Add a Configuration Manager object and parser for SMBIOS Type 26
Voltage Probe information.
Add a Type 26 SMBIOS generator that creates one Voltage Probe
structure for each Voltage Probe CM object. The generator validates
the probe location and status fields, publishes the optional
description string, and registers the generated table with the
SMBIOS table factory.
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Add the missing SMBIOS Type 28 Temperature Probe location decode values
to smbiosview.
The Type 28 Location field defines values 0x0C through 0x0F for Front
Panel Board, Back Panel Board, Power System Board, and Drive Back Plane,
but smbiosview only decoded values up to 0x0B.
Signed-off-by: VarshitPandya <varshit.pandya@arm.com>
The smbiosview Type 26 Voltage Probe decoder uses the low 5 bits of
LocationAndStatus as the probe location and the high 3 bits as the probe
status.
However, the Type 26 lookup tables were swapped: VPLocationTable contained
status strings and VPStatusTable contained location strings. This caused
valid records to be displayed as, for example:
Voltage Probe - Location: OK
Voltage Probe - Status: Processor
Swap the table contents so Type 26 output matches the SMBIOS
LocationAndStatus bit layout.
Signed-off-by: VarshitPandya <varshit.pandya@arm.com>
In AllocateMemory(), several pointers are used without prior null
checks. This may lead to unexpected behavior or system crashes if any
of these pointers are NULL.
Add explicit null checks for these pointers to ensure safe access and
prevent potential null pointer dereferences.
Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
Originally, edk2 sought to have mergify use rebases to update PR
branches. However, mergify is deprecating pull requests from forks
with update_method=rebase and update_bot_account impersonation:
Deprecation notice: This pull request comes from a fork and was
queued with update_method=rebase and update_bot_account
impersonation. This capability will be removed on July 1, 2026.
After this date, the merge queue will no longer be able to rebase
fork pull requests with this configuration. To avoid disruption,
switch to update_method=merge in configuration. To avoid disruption,
switch to update_method=merge in your queue rule.
This change explicitly sets the update_method to merge per the
deprecation guidance.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Implemented signature and verification functions for ED448;
Updated documentation and unit tests to cover new verification functions
Signed-off-by: Michael G.A. Holland <michael.holland@intel.com>
Removes Visual Studio 2017 support from BaseTools. Newer toolchains
(VS2019, VS2022, and VS2026) are supported in its place.
This removes the VS2017 toolchain definitions from tools_def.template,
the VS2017 environment setup logic in toolsetup.bat,
set_vsprefix_envs.bat, and get_vsvars.bat, and the VS2017
configuration in the WindowsVsToolChain build plugin.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
VS2017 support is being removed from edk2. The static analysis
(/analyze) build option that suppressed C6305 was scoped to the VS2017
toolchain. This change retargets it to VS2019, which is the oldest
Visual Studio toolchain that remains supported.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
VS2017 support is being removed from edk2. This Visual Studio solution
built the EmulatorPkg host with the VS2017 toolchain (`-t VS2017`),
which will no longer exist in tools_def.template. The EmulatorPkg
documentation and CI build with VS2022, so the VS2017 solution is
removed.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
The VS2017 toolchain is being removed from edk2. In preparation, this
change removes the toolchain as an option in edksetup.bat.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Visual Studio 2015 is out of service and support was recently removed
from the repo. To prevent confusion about toolchain support, this
commit updates the RedfishPkg Readme to replace the `VS2015x86`
reference with `VS2026` (the latest supported VS version).
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
The Ia32 and X64 ProcessorBind.h files had comments about VS2015, but
the warning is still relevant for newer VS versions, so update the
comments to be more general since VS2015 support was removed from the
repo recently.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
REF: https://github.com/tianocore/edk2/issues/12490
Removes Visual Studio 2015 support from BaseTools since mainstream
support ended on October 13, 2020 and extended support ended on
October 14, 2025.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
The VS2015 toolchain is being removed from edk2. In preparation, this
change removes the toolchain as an option in edksetup.bat.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
This file has:
- Not been updated in 10 years.
- Was used to build Nt32Pkg which no longer exists.
- Is not needed to currenly build EmulatorPkg.
- Was last updated to support Visual Studio 2015, which is no longer
supported by Microsoft.
It is removed as part of the Visual Studio 2015 removal.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
This file:
- Has not had a code change in 8 years.
- Is not used by any other file in the repository.
- Was last updated to support VS2015 which is no longer supported by
Microsoft.
As part of VS2015 support removal, this file is deleted.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Use the TemperatureProbeToken in the Cooling Device CM object to resolve
the SMBIOS handle of the corresponding Type 28 Temperature Probe record.
Set the Type 27 TemperatureProbeHandle field to 0xFFFF when no
temperature probe token is provided. Return an error if a non-null token
does not resolve to a generated Type 28 record.
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Introduce a CM_ARCH_COMMON_TEMPERATURE_PROBE_INFO object to describe
temperature probes provided by the platform. The generator creates one
SMBIOS Type 28 record for each temperature probe object and populates
the description, location/status, probe limits, resolution, tolerance,
accuracy, OEM-defined data, and nominal value.
Add the CM object parser entry and wire the generator into the
DynamicTablesPkg build.
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Introduce a CM_ARCH_COMMON_COOLING_DEVICE_INFO object to describe
cooling devices provided by the platform. The generator creates one
SMBIOS Type 27 record for each cooling device object and populates the
device type/status, cooling unit group, OEM-defined data, nominal speed,
and optional description string.
The temperature probe handle is set to 0xFFFF for now because SMBIOS
Type 28 Temperature Probe generation is not currently available. Reject
non-null temperature probe tokens until Type 28 handle resolution can be
added.
Add the CM object parser entry and wire the generator into the
DynamicTablesPkg build.
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Add myself as a maintainer of DXE and PEI Core modules.
As I am taking on a larger maintenance set, drop my EmulatorPkg
maintainership to focus on the new one.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
During SnpUndi32Initialize(), CurrentAddress is unconditionally
overwritten with PermanentAddress before UNDI initialization. This
causes MAC address passthrough (MacPassthru) to fail, as the NIC's
actual current address, which may differ from its permanent address,
is lost.
After UNDI initialization completes, call PxeGetStnAddr() to read
the NIC's station address via the UNDI interface and update
CurrentAddress, PermanentAddress, and BroadcastAddress in the mode
structure with the values reported by the hardware.
The call is added to both initialization paths: the cable-detect
success path and the fallback no-cable-detect path.
Signed-off-by: Jared Pan <jared.pan@dell.com>
IScsiBuildKeyValueList parses the data segment of a received iSCSI
login, text or CHAP response into key=value pairs. After locating '='
within the remaining length, it sets KeyValuePair->Value and calls
AsciiStrLen(Value) to measure the value before subtracting it from the
remaining length. AsciiStrLen has no length cap, and the data segment
copied from the received PDU (AllocatePool(Len) + NetbufQueCopy of the
data-segment length) is not guaranteed to be NUL-terminated.
A malicious or redirecting target can send a data segment whose final
value lacks a trailing NUL (e.g. the 3 bytes "X=Y"), so AsciiStrLen
reads past the end of the segment allocation, an attacker-controlled
out-of-bounds read. The SafeUint32Sub bound check only runs after the
over-read.
Replace AsciiStrLen(Value) with AsciiStrnLenS(Value, Len), capping the
scan to the bytes remaining from Value onward. An unterminated value
then returns Len and the existing SafeUint32Sub rejects the segment.
The single change covers all three callers (login redirect, operational
parameter negotiation and CHAP).
Signed-off-by: Syed Mohammed Nayyar <jmestwa@gmail.com>
Certain devices require immediate follow-up commands
after reading the LANGID string to fetch Manufacturer,
Product, or SerialNumber strings.
[Suggested Solution]
These strings are now cached after initial retrieval
to allow UsbIoGetStringDescriptor() to return them
directly, improving efficiency and stability.
Signed-off-by: Marlboro Chuang <marlboro.chuang@dell.com>
Signed-off-by: Jared Pan <jared.pan@dell.com>
The patch enhances the USB enumeration process in EDK2 to improve compatibility with non-standards-compliant devices that may fail during standard enumeration sequences.
The suggested solution is based on USB specifications and references implementations from both Linux and Windows environments.
[Suggested solution]
- Integrated a retry mechanism to sequentially execute enumeration scripts, inspired by the enumeration flows of Windows, Linux, and EDK2. This improves robustness when handling corner-case devices.
- Do sanity check while the device report the device descriptor.
- AMD XHCI might need to wait for more time while sending the CLEAR_FEATURE reuqest.
Signed-off-by: Marlboro Chuang <marlboro.chuang@dell.com>
Signed-off-by: Jared Pan <jared.pan@dell.com>
Use a Temperature Probe specific HII string when displaying the Type 28
Location field in smbiosview.
The Type 28 decoder was using the Voltage Probe location label, causing
temperature probe records to be displayed with the wrong field name.
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Decode the Type 26 Voltage Probe Location and Status fields according
to the SMBIOS 3.9.0 specification, section 7.27, "Voltage Probe
(Type 26)".
Table 95, "Voltage Probe: Location and Status fields", defines bits
4:0 as the Location field and bits 7:5 as the Status field. smbiosview
was decoding these fields in the opposite order, causing the displayed
voltage probe location and status to be swapped.
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Libraries that may be consumed by UEFI_DRIVER should not have depex
section for UEFI_DRIVER. The INF specification said: If the Module is
a Library, then a [Depex] section is optional. Regarding HiiUtilityLib,
RedfishDebugLib and RedfishHttpLib, they don't have additional dependence,
so the Depex sections should be removed to ensure no adverse impact on
the UEFI_DRIVER.
Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
CmArmDmc620PmuRegInfoParser only parses the interrupt field
without parsing the interrupt flags. Fix it.
Also make CmArmCmn600InfoParser use the common interrupt
parser instead of separately printing the interrupt number
and flag.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Dmc620 have been added at an incorrect index in the
ArmNamespaceObjectParser array. Fix the order.
Also, rename:
- CmArmObjDmc620PmuSocketInfoParser
to:
- CmArmDmc620PmuSocketInfoParser
to follow the other conventional names.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
The following objects are missing some fields in the
CmObjParser:
- CM_ARCH_COMMON_PROC_HIERARCHY_INFO
- CM_ARCH_COMMON_CACHE_INFO
Add them.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Always set the ProcessorArm64SocId bit for arm64 build
and conditionally set the Processor64BitCapable bits for
64-bits architectures.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
BuildSmbiosTable() and BuildSmbiosTableEx() callback are called
with uninitialized pointers which might contain garbage data. If
one of these function fails, the exit handler uses these
uninitialized fields.
Set these uninitialized pointers in the caller function.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
IsPciDeviceRejected() masks BAR value with 0xFFFFFFF0 before testing
the type bits (2:1) that mark a 64-bit memory BAR, essentially clears
them, making the 64-bit BAR code path unreachable and treated as if
it were 32-bit.
The function rejects a device when BAR looks unprogrammed by comparing
if its size mask equals its value. When a 64-bit BAR is mistaken for a
32-bit one, only its lower part is compared, possibly leading a valid
BAR being falsely rejected. For example, a 2G BAR with size mask
0x80000000 at 0x180000000 matches and the device is dropped.
This code runs during light enumeration (PciEnumeratorLight), used when
PCI resources are already assigned by the platform (e.g. Xen HVM, where
hvmloader programs the BARs). The rejected device never receives a
PciIo handle, so no driver can bind to it. For example, a virtio-vga
with a 64-bit BAR vanishes under OVMF on Xen, leaving the guest with
no graphics output.
Fix by testing the type bits on the raw BAR value before masking.
Signed-off-by: Jiaqing Zhao <Zhao.Jiaqing@amd.com>
Adds a new ECC check, `IncludeFileCheckPragmaOnce` (error code 6006),
that flags header files using a traditional `#ifndef`/`#define`
include guard and recommends `#pragma once` instead.
A guard is detected when a '#ifndef NAME' is immediately followed by a
valueless '#define NAME' using the same macro name. Feature macros
such as '#define FOO 1' and files already using '#pragma once' are not
flagged.
The check reports against the parsed preprocessor directive rows in
the identifier tables rather than the File table. Those rows carry the
actual source line number, whereas File-level findings resolve to
"line 1" in the report. This gives an accurate line number, to the
EccCheck CI plugin, so it can reconcile findings with the changed line
ranges of a commit.
It uses the binary extension list and the exception list, consistent
with the other include file checks.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
The HashInstanceLibSha256 library does not call into Tpm2CommandLib.
Removing it from the [LibraryClasses] section reduces unnecessary
dependencies and avoids potential build issues in non-TPM builds.
Also remove the unnecessary include of Tpm2CommandLib.h
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Enable CryptSha256 hash in SecCryptLib as this
is required by Arm CCA.
The hash algorithm used by the Arm CCA Realm
Extensible Measurement (REM) registers is
either SHA256 or SHA512.
To enable measurements in the early boot phase
enable SHA256 hash algorithm in SecCryptLib.
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
CxlDxe is currently compiled as part of the MdeModulePkg
IA32 CI. When running CI with VS2022 version 14.44.35228.0,
the CI build fails with:
CxlDxe.lib(CxlDxe.obj) : unresolved external symbol __allmul
CxlDxe(CxlDxe.obj) : unresolved external symbol __allshl
CxlDxe is not intended to run on IA32 DXE systems, as such
systems are legacy, but until edk2 drops build support for
IA32 DXE (or at least CI for it), the build needs to work.
This fixes the 64 bit multiplication/shifting that occurs
in CxlDxe to use the BaseLib functions that avoid the
compiler intrinsics.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
The PCI specification normally requires function 0 to be present
before functions 1 through 7 are used. PciBusDxe therefore stops
scanning a slot when probing function 0 fails.
Some virtualized PCI topologies may expose selected non-zero functions
to a guest while function 0 is hidden. Add an opt-in Feature PCD so a
platform can continue collecting device information for functions 1
through 7 when function 0 is absent.
The default remains FALSE, so existing platform behavior is unchanged
unless the platform explicitly enables the PCD.
Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
Fix vulnerabilities and a memory leak in the IPMI Blob Transfer driver:
- Prevent integer underflow and OOB read by validating response size before
accessing CompletionCode, OEN, and CRC.
- Prevent buffer overflow by ensuring BMC response size does not exceed the
caller's buffer capacity, avoiding potential memory overwriting.
- Fix memory leak by freeing IpmiResponseData and IpmiSendData.
Additionally, fix unit test failures caused by the changes and pre-existing bugs:
- Allocate a safe fixed size (70 bytes) for IpmiResponseData in
IpmiBlobTransferSendIpmi to prevent heap overflow if the BMC returns
more data than expected. Add validation to check if returned size
exceeds this allocation.
- Modify IpmiBlobTransferStat and IpmiBlobTransferSessionStat to only
copy MetaDataLen bytes of metadata instead of always copying the max
size (64 bytes), preventing buffer overflow when caller allocates
a smaller buffer.
- Add missing ASSERT(FALSE) in IpmiBlobTransferStat parameter validation.
- Fix IpmiBlobTransferWriteMeta parameter validation to allow 0-length
writes (Data can be NULL when WriteLength is 0), which was causing
test failure.
- Fix syntax errors in unit tests where arrays were assigned values
after declaration using brace-enclosed lists.
- Fix sizeof misuse on macros representing size values in unit tests,
which caused too small allocations and buffer overflows in mock setups.
- Fix queue order in OpenValidResponse test to match the actual call
order (GetCount, Enumerate, Open) and free all mock buffers.
- Remove unnecessary MockIpmiSubmitCommand calls from invalid buffer
tests to prevent mock queue leaks to subsequent tests.
- Fix memory leaks of ExpectedMetadata in unit tests by changing them
to static arrays.
Signed-off-by: Phineas Su <pohaosu@google.com>
EfiPxeBcStart() in PxeBcImpl.c has conditional code branches for
IPV4 and IPV6.
- IPV4 branch should use EFI_IP4_COMPLETION_TOKEN which is
Private->IcmpToken.
- IPV6 branch should use EFI_IP6_COMPLETION_TOKEN which is
Private->Icmp6Token.
Right now, the IPv4 branch incorrectly initializes
Private->Icmp6Token to EFI_NOT_READY. That is changed to
Private->IcmpToken.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
The EccCheck plugin currently reports incorrect paths that are
confusing to a user, such as:
```
*file: C:\src\edk2\Build\.pytool\Plugin\EccCheck\MdePkg\Include\
Protocol\AuthenticationInfo.h
```
This is because the EccCheck plugin does not scan the package in
place. Before running ECC, it copies the package into
`Build/.pytool/Plugin/EccCheck/` and points the ECC tool at that
temporary location. As a result, the paths ECC records in its report
refer to the temporary copy rather than the file in the actual source
tree.
This affected two fields that are printed:
- The "file:" line is taken from ECC's File column (`row[3]`), which
holds the absolute path of the scanned file. It always pointed
into the temporary scan directory.
- The descriptive message (`row[5]`) paths were prefixed with
`Build/.pytool/Plugin/EccCheck/`.
The temporary path is an internal build detail and prevents resolution
against the actual source file.
This change translates the reported paths back to the package-relative
path before printing.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Ensure that either File or FileBuffer is provided before proceeding with
security verification. If both are NULL, return EFI_INVALID_PARAMETER.
This prevents verification from running without a valid input buffer and
aligns with the intended design, where File is optional and FileBuffer
alone is sufficient.
Signed-off-by: Vignesh G <vigneshg@ami.com>