From the IPMI v2.0 (April 21, 2015 E7 Markup) specification,
Table 22-12, Get System Interface Capabilities Command:
"Input message size in bytes. (1 based.)"
...
"A BMC that supports multi-part Start and End would return
a value from 33 to 64. A BMC that supports multi-part with Middle
transactions would return a value from 65 to 255."
Yet the comment in the existing code describes this as being a
counter of the number of middle packets, with Start and End packets
counting outside of that. This seems very incorrect to me.
Address this, and simplify the code, by using the already existing
global variable mMaxRequestSize. Update the debug error message
text to reflect the functional change.
Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
For some reason this module was created "backwards", with .inf files
in subdirectories, as well as identical apart from failes to keep in
sync source files for Dxe and Pei drivers.
Flip the thing the right way around and delete the duplicated files.
Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
While reviewing PR #12035, I found this function a bit overcomplicated,
with a bunch of live-coded integers, so I reworked it for improved
human and compiler readability.
Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
Fixing all markdown lint errors found by running markdownlint-cli.
Verified that rendering still shows valid information.
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
Today's implementation used a hardcoded value for the I/O Port
Base Address. This creates a problem for platform configurability.
If a platform needs to use a different I/O port address, then
it requires modification of a source file.
Create gPcAtChipsetPkgTokenSpaceGuid.PcdUartIoPortBaseAddress
as a FixedAtBuild pcd scoped to PcAtChipsetPkg, with default
value for 0x3f8 to match existing value, and update
code to use PCD.
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
In some VS22 versions, these code patterns (assiging the scalar in
a loop) have been found to be converted into calls to the `memcpy`
intrinsic. This change updates them to use CopyMem to avoid the
potential error.
Previous:
- MSVC version: 14.31.31103
New:
- MSVC version: 14.32.31326
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
https://codeql.github.com/codeql-query-help/cpp/cpp-comparison-with-wider-type
If the narrow type (smaller range) is compared against a wide type
(larger range), the narrow value may overflow before reaching the wide
value. This can cause unexpected behavior, such as:
Infinite loops (loop condition never becomes false).
Incorrect logic (comparison results are misleading).
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
This adds the ability to pass PATH_TO_OS to the
PlatformBuild.py scripts in the PlatformCI folder.
This allows easy booting to an OS (or generically adding a
drive) while using the standard PlatformBuild.py for OvmfPkg.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
This adds the ability to pass PATH_TO_OS to the
PlatformBuild.py scripts in the PlatformCI folder.
This allows easy booting to an OS (or generically adding a
drive) while using the standard PlatformBuild.py for ArmVirtPkg.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
The misc MM communicate buffer now stores the FF-A direct message
registers in an ARM_FFA_ARGS layout that preserves the native register
indices. The TCG physical presence callback must therefore locate the
TCG_NVS payload at the correct register offset instead of the start of
the communication buffer.
Point LocalTcgNvs at CommBuffer + OFFSET_OF (ARM_FFA_ARGS, Arg4) and
validate the buffer size against sizeof (ARM_FFA_ARGS). Add a
STATIC_ASSERT to guarantee TCG_NVS fits within the register space
available for the direct message payload, and include ArmFfaLib.h for
the ARM_FFA_ARGS definition.
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
The MISC_MM_COMMUNICATE_BUFFER stored the FF-A direct message
registers in a DIRECT_MSG_ARGS structure. Populating and reading it
required manually re-indexing every register (EventSvcArgs->Arg4..Arg17
into DirectMsgArgs.Arg0..Arg13). This shifted the register positions and
left the buffer layout inconsistent with the raw FF-A argument register
file, making it error prone to correlate a slot with its architectural
register.
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
`TlsNew()` explicitly sets the default security level to 3. The current
default in OpenSSL is security level 2 which is inherited by Linux
distributions like Ubuntu 26.04. This is also the security level that
was announced in https://edk2.groups.io/g/devel/topic/115039926.
Signed-off-by: Jean-Tiare Le Bigot <jt@yadutaf.fr>
This plugin runs markdownlint against all markdown files in a given
package to report linter errors.
See the following readme for me details:
.pytool/Plugin/MarkdownLintCheck/Readme.md
Co-authored-by: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
In preparation for the MarkdownLintCheck plugin being added to the
repo, this change defaults the plugin to `AuditOnly` mode in each
package. This allows package maintainers to enable the plugin as they
see fit.
Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
1. To provide greater clarity and consistency, the file instructions
are updated to indicate that entries should be added after existing
entries within a given section so that they are in chronological
merge order within the section.
2. Existing entries are sorted accordingly.
3. Existing entries are updated to have consistent style and some
section header levels are adjusted to properly reflect the level
of the section.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Add EFI_MEMORY_XP to all MapMmioMemory() calls in ProcessPciHost() for:
- ECAM space
- Translated I/O window
- 32-bit MMIO window
- 64-bit MMIO window
These regions are data/MMIO only and should not be executable. Marking them
with EFI_MEMORY_XP improves memory protection hardening without changing
intended runtime behavior.
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
PlatformPeiLib consumes QemuFwCfgSimpleParserLib, but ArmVirtXen.dsc
provided no resolution for it or its dependency QemuFwCfgLib, causing:
error 4000: Instance of library class [QemuFwCfgSimpleParserLib]
is not found for module [ArmVirtPrePiUniCoreRelocatable.inf],
consumed by PlatformPeiLib.inf
Wire up QemuFwCfgLibNull and QemuFwCfgSimpleParserLib in the common
ArmVirt.dsc.inc so all platforms without fw_cfg fail gracefully.
ArmVirtCloudHv.dsc already carried the same null pair; both per-DSC
copies are removed now that the common default covers them.
ArmVirtQemu and ArmVirtQemuKernel continue to override with their
real MMIO implementations.
Fixes: f4bbef1dd7 ("ArmVirtPkg: introduce compile and runtime control of serial debug log level")
Reported-by: Pierre Gondois <pierre.gondois@arm.com>
Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
This updates all GitHub Actions using VS2022 to
VS2026.
Note, windows-2025 is the VM image that contains
VS2026. 2025 refers to the Windows Server version,
not the VS version. GitHub runners have updated the
windows-2025 VM version to include VS2026, so no
additional migration is required.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
This upgrades the Azure Pipelines CI to use
VS2026 instead of VS2022.
The Windows VM image is updated to windows-2025-vs2026 which
has been updated to use VS2026. Note, 2025 references
the Windows Server release, not the VS version. Azure pipelines
has not migrated its windows-2025 VM image to use VS2026 yet,
it will do so after that feature is GA'd, at which point edk2
will have time to update to that VM image.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
edk2 is moving to VS2026 for the MSVC toolchain.
Update the building instructions and DSC conditionals.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
edk2 is moving to VS2026 for the MSVC toolchain,
as such, upgrade the Windows BaseTools build default
from VS2022 -> VS2026.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
Updated the ACPI code to fix an issue where the template was
outdated and the revision was reporting V5 but the template was still
using the V4 version of the Start Method specific parameters.
Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Raymond Diaz <raymonddiaz@microsoft.com>
Update SmbiosSmcLib to use ArmSmcccSocIdLib for retrieving the JEP106
identification code and SoC revision.
Remove the duplicated SMCCC feature detection and SoC ID calls while
retaining the SMBIOS-specific formatting of the Type 4 Processor ID.
Signed-off-by: Varshit Pandya <Varshit.Pandya@arm.com>
Add ArmSmcccSocIdLib to provide a shared interface for checking support
for the SMCCC Architecture SoC ID service and retrieving the JEP106
identification code and SoC revision.
Move the existing SMCCC SoC ID handling out of ProcessorSubClassDxe and
update the driver to use the new library. Continue to use the MIDR value
for the SMBIOS Processor ID when the SMCCC SoC ID service is unavailable.
This allows other SMBIOS implementations to reuse the SMCCC handling
without duplicating it or depending on the legacy ProcessorSubClassDxe
driver.
Signed-off-by: Varshit Pandya <Varshit.Pandya@arm.com>
Fixing all markdown lint errors found by running markdownlint-cli.
Verified that rendering still shows valid information.
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
In MmiHandlerRegister(), the MmiHandler structure is currently
allocated before looking up the target MmiEntry. If the lookup
fails, the function returns an error but the allocated MmiHandler
is never freed, causing a memory leak.
This patch moves the allocation of MmiHandler and its initialization
to after the MmiEntry lookup and validation. This ensures that memory
is only allocated when the operation can succeed, eliminating the need
for a FreePool() on the error path and simplifying the error handling
logic.
Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
Suggested-by: Ray Ni <ray.ni@intel.com>
Adds an optional flag that copies the GNU build-id note from the input
ELF file into the output PE/COFF firmware image as a dedicated ".bldid"
section. The build ID is emitted by the linker as a unique fingerprint
of the binary and allows custom post-build and debugging tools to
reliably match a firmware image against its corresponding unstripped
ELF and debug symbols, without relying on file names, timestamps, or
build paths.
This notable opts to use a non-standard section name ".bldid" to store
the build ID. This approach was chosen to keep genfw and the parsers simple
since the full "build-id" name would require redirecting the section name.
While this breaks from standard conventions, this is not impactful since
GenFW is already creating a non-standard artifact for the PE image with
the associated ELF symbol file.
Signed-off-by: Chris Fernald <chfernal@microsoft.com>
Add a DynamicTables SMBIOS generator for the Additional Information
(Type 40) structure.
SMBIOS Type 40 provides additional information for fields in other
SMBIOS structures. Each Type 40 entry references an existing SMBIOS
record by handle and offset, provides an optional entry string, and
carries a supplemental field value.
The generator consumes one or more top-level CM objects, each referencing
a list of Additional Information entries. Each entry provides:
- the CM object token of the referenced SMBIOS structure,
- the referenced table generator ID,
- the offset of the referenced field,
- an optional entry string,
- a token to a typed Additional Information Value object.
Example platform CM object layout:
CM_ARCH_COMMON_ADDITIONAL_INFORMATION AdditionalInformation[] = {
{
REFERENCE_TOKEN (AdditionalInformation[0]),
REFERENCE_TOKEN (AdditionalInformationEntry[0])
}
};
CM_ARCH_COMMON_ADDITIONAL_INFORMATION_ENTRY
AdditionalInformationEntry[] = {
{
REFERENCE_TOKEN (MemoryDeviceInfo[0]),
CREATE_STD_SMBIOS_TABLE_GEN_ID (EStdSmbiosTableIdType17),
OFFSET_OF (SMBIOS_TABLE_TYPE17, MemoryType),
"DIMM0 memory type",
REFERENCE_TOKEN (AdditionalInformationValue[0])
}
};
CM_ARCH_COMMON_ADDITIONAL_INFORMATION_VALUE
AdditionalInformationValue[] = {
{
sizeof (UINT8),
{
MemoryTypeDram
}
}
};
The generator resolves referenced SMBIOS handles using CM object tokens
and table generator IDs. It validates the typed value objects, individual
entry lengths, and aggregate formatted record size. The maximum accepted
value length is controlled by PcdMaxAdditionalInformationValue.
Build the variable-length Type 40 formatted area and append the entry
strings to the SMBIOS string area.
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Add the Configuration Manager objects required to describe SMBIOS
Additional Information (Type 40) structures.
The top-level object references a list of Additional Information entries.
Each entry identifies a field in an existing SMBIOS structure and
references a typed value object containing the additional data.
Define the maximum value buffer size from the SMBIOS Type 40 formatted
length limit and add parsers for the new CM objects.
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
OVMF already supports MemDebugLogLib for capturing firmware debug
output in a runtime memory buffer. Align the TDX peiless boot path
with OVMF by integrating the same library, so that TDX guests can
use memory-based debug logging.
In PeilessStartupLib, allocate a runtime buffer for the debug log
during PeilessStartup() and copy any early SEC-phase logs from
the pre-allocated FDF region into it.
Register the early debug log memory region in the TDX metadata as
TEMP_MEM so the TDX module accepts it during guest initialization.
Move PlatformDxe/Platform.inf from NCCFV to DXEFV because it
exposes the memory debug log HOB to the guest.
Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
The Null instance of MemDebugLogLib only provides MemDebugLogWrite(),
MemDebugLogPages(), and MemDebugLogEnabled(). Any module that
references MemDebugLogInit() or MemDebugLogCopy() cannot link against
the Null instance, forcing the feature to be gated at the build-system
level rather than at runtime.
Add no-op stubs for MemDebugLogInit() and MemDebugLogCopy().
This will be used by the following commit to add memory debug log
support in TDX.
Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
Some SuperSpeed-capable devices may fall back to High-Speed
mode and cause subsequent commands to fail.
[Suggested Solution]
Check the BOS descriptor to verify SuperSpeed support and
trigger a port reset if needed to re-enumerate the device
properly.
Signed-off-by: Marlboro Chuang <marlboro.chuang@dell.com>
Signed-off-by: Jared Pan <jared.pan@dell.com>
[Suggested Solution]
Add the BOS descriptor structure and definition.
Signed-off-by: Marlboro Chuang <marlboro.chuang@dell.com>
Signed-off-by: Jared Pan <jared.pan@dell.com>
Move SMBIOS_MAX_STRING_SIZE and CFMWS_MAX_INTERLEAVE_WAYS to the
common definitions near the top of ArchCommonNameSpaceObjects.h.
Document that SMBIOS_MAX_STRING_SIZE is an implementation-defined
Configuration Manager storage limit, including the terminating NULL,
rather than an SMBIOS specification limit. Also distinguish it from
the legacy SMBIOS_STRING_MAX_LENGTH definition used for SMBIOS 2.6
MIF compatibility.
Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
Link VirtioMmioProbeLib to VirtioFdtDxe so that the Virtio MMIO
probe constructor maps the virtio-mmio ranges before the transport
driver accesses the device MMIO regions.
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Introduce a Virtio MMIO probe library that discovers virtio-mmio
nodes from the FDT and maps their MMIO ranges before the virtio
transport driver creates virtio devices and accesses the device
MMIO regions.
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>