Commit graph

36331 commits

Author SHA1 Message Date
Qihang Gao
fa461abf8a MdePkg/UefiDevicePathLib: Fix the potential memory leak issue
The function DevPathToTextUsbWWID() allocates NewStr when the input
SerialNumber lacks a null terminator. However, this allocated memory
is never freed after use, resulting in a memory leak.

This patch adds the missing FreePool() for NewStr before the function
returns, ensuring that the allocated buffer is properly freed and
eliminating the potential leak.

Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
2026-07-17 09:45:38 +00:00
Phil Noh
c70637de12 MdeModulePkg/PciBusDxe: Honor SpecificFlag for PMem64 in UpdatePciInfo
When UpdatePciInfo() downgrades a PciBarTypePMem64 BAR to a 32-bit type
via EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL, it unconditionally
assigns PciBarTypePMem32 regardless of SpecificFlag, placing the BAR in
the prefetchable bridge window even when the platform intended the
non-prefetchable window.

The ACPI resource descriptor's SpecificFlag field encodes the intended
prefetchability of the constrained resource, using the bit:
EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE.

Fix this by checking the bit in SpecificFlag to select PciBarTypePMem32 or
PciBarTypeMem32, consistent with DumpPpbPaddingResource() in
PciEnumeratorSupport.c that uses the bit as the sole discriminator
between the two 32-bit BAR types.

Signed-off-by: Phil Noh <Phil.Noh@amd.com>
2026-07-17 09:03:00 +00:00
Tuan Phan
3613891d77 SecurityPkg/RngDxe: Support RISCV64
Add RISCV64 to the list of valid architectures.

Signed-off-by: Tuan Phan <tuan.phan@oss.qualcomm.com>
2026-07-17 05:23:45 +00:00
Tuan Phan
fb42b39a7d SecurityPkg/RngDxe: Replace Intel-specific with arch-neutral comments
The RngDxe driver and its non-AArch64 support files still contained
comments and descriptions referring to Intel Secure Key technology,
RDRAND/RDSEED instructions, and the Intel DRNG implementation guide.

These references are no longer accurate because the driver obtains
random data through the platform-provided RngLib abstraction rather
than relying on Intel-specific CPU features. Update the comments and
descriptions to use architecture-neutral language that better reflects
the current implementation.

Signed-off-by: Tuan Phan <tuan.phan@oss.qualcomm.com>
2026-07-17 05:23:45 +00:00
Joey Vagedes
3fec625408 SecurityPkg: Add Google Test MockSecureBootVariableLib
Add Google Test Mock library header and implementation for
SecureBootVariableLib to allow simple mocking for host based unit tests
that utilize the Google Test framework.

Signed-off-by: Joey Vagedes <joey.vagedes@gmail.com>
2026-07-16 17:50:01 +00:00
Dongyan Qian
3a4556803d DynamicTablesPkg: Enable LoongArch64 table generation
Add LOONGARCH64 support to DynamicTablesPkg by adding it to the existing
common component build list, adding the LoongArch64 DynamicTableManagerDxe
source, and enabling the SMBIOS generators used by current LoongArch
platforms.

Keep DynamicTableFactoryDxe generator registration architecture-specific.
The LoongArch64 factory instance links selected NULL generator libraries so
their constructors register the generators at runtime.

LoongArch64-specific tables can use AcpiRawLib initially and move to
dedicated LoongArch64 generators in follow-up patches.

Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
2026-07-16 07:10:30 +00:00
Dongyan Qian
8046280304 DynamicTablesPkg: Move SMBIOS generators to common components
The SMBIOS generators are architecture-neutral standalone components. They
are currently listed only for AARCH64. Move them to the existing common
component section so every supported architecture receives the same package
build coverage.

Keep the DynamicTableFactoryDxe registration architecture-specific.
Its NULL library list determines the generators registered at runtime.

Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
2026-07-16 07:10:30 +00:00
Dongyan Qian
f5254b5c23 DynamicTablesPkg/Smbios: Fix X64 build warnings
Moving the standalone SMBIOS generators to the common component section
adds them to the X64 build. VS2022 reports narrowing warnings for native-
width, wide, or enum values converted to fixed-width SMBIOS fields. These
warnings are treated as errors under /WX.

Use UINTN for the Type 7 table-list count and index. Add bounds checks for
the Type 4 processor counts and Type 7 cache level where CM-derived values
could exceed the corresponding SMBIOS fields, and make the remaining
intended conversions explicit in the Type 4, Type 7, Type 16, Type 17,
Type 19, and Type 44 generators.

This rejects out-of-range processor counts and cache levels instead of
silently truncating them, while preserving the existing behavior for valid
configuration data.

Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
2026-07-16 07:10:30 +00:00
Dongyan Qian
9e83101fdf DynamicTablesPkg/Smbios: Use EFIAPI for extended callbacks
The SMBIOS_TABLE_GENERATOR_BUILD_TABLEEX and
SMBIOS_TABLE_GENERATOR_FREE_TABLEEX callback types do not specify EFIAPI.
The Type 37 implementations specify it, while the other extended callback
implementations follow the omission in the shared types.

For X64 GCC builds, BaseTools/Conf/tools_def.template adds
-DEFIAPI=__attribute__((ms_abi)). Therefore, callbacks marked with EFIAPI
use the Microsoft x64 ABI, while unannotated callback types use the
compiler default ABI. If the two sides differ, the caller and callee use
different argument registers, and GCC rejects the function pointer
assignment.

This mismatch remained hidden while the standalone Type 37 generator was
built only for AARCH64. Moving the SMBIOS generators to the common
component section adds X64 build coverage and exposes it.

Add EFIAPI to the extended callback types and all matching implementations.
This follows the ACPI generator callback convention and provides the ABI
prerequisite for expanding the SMBIOS standalone build coverage.

Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
2026-07-16 07:10:30 +00:00
Alexander Gryanko
1dc6b5e3dd SecurityPkg: added image verification tests for signed images
Previous changes introduced tests for unsigned
images verified by hash entries in DB/DBX. This commit adds
tests covering verification of signed images, including
certificate chain validation as well as cases where image
hashes are checked against entries in DB/DBX.

Signed-off-by: Alexander Gryanko <xpahos@gmail.com>
2026-07-16 02:33:17 +00:00
Alexander Gryanko
7668d8854f SecurityPkg: added image verification test using DB hash
The part of DxeImageVerificationHandler responsible for
verifying the image location source has already been
implemented. This commit implements tests for verifying
images in cases where the image has no signature, but
there is a hash record for this file in DB/DBX.

Signed-off-by: Alexander Gryanko <xpahos@gmail.com>
2026-07-16 02:33:17 +00:00
Alexander Gryanko
ef2996c667 MdePkg: added mock for InstallConfigurationTable
InstallConfigurationTable is used in the AddImageExeInfo
call and is necessary for outputting information about
the binary file in case of an error. Mock has been added
for the DxeImageVerificationHandler subroutine.

Signed-off-by: Alexander Gryanko <xpahos@gmail.com>
2026-07-16 02:33:17 +00:00
Michael D Kinney
ae023dbe99 BaseTools/Tests: Update TC6 for backward-compatible rebase behavior
Update the test decision matrix and TC6 expected result to reflect
the backward-compatible ForceRebase logic: when ForceRebase=TRUE and
no files have the ,XIP suffix (XipFileCount==0), all files are
rebased using the legacy behavior rather than skipping all files.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2026-07-15 21:37:05 +00:00
Michael D Kinney
0347d3b711 BaseTools/GenFv: Preserve legacy rebase behavior when Xip is unused
Add XipFileCount to FV_INFO to track how many files have the ,XIP
suffix. Update FfsRebase() to only apply selective XIP rebase when
XipFileCount > 0. When no files have the ,XIP suffix (XipFileCount
== 0), preserve the legacy ForceRebase=TRUE behavior of rebasing all
files. This maintains backward compatibility for existing platforms
that use FvForceRebase=TRUE without any Xip rules.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2026-07-15 21:37:05 +00:00
Kun Qin
fe89a63da4 OvmfPkg: MmControlPei: Fix QEMU does not send MMI to all cores
Because there was no negotiation, the SMM controller from QEMU will not
broadcast the SMI to all cores, causing only the BSP getting interrupted
into MMI.

This change fixed the issue by invoking the negotiation routine and
program the register to enable broadcasting.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2026-07-15 20:29:12 +00:00
abuthahirm
7442655403 NetworkPkg/UefiPxeBcDxe: Fix CopyMem destination in PxeBcDhcp6CallBack
When caching the DHCPv6 discover packet to Mode->DhcpDiscover in
PxeBcDhcp6CallBack, the destination was incorrectly specified as
Mode->DhcpDiscover.Dhcpv4 (the DHCPv4 union member). Change it to
Mode->DhcpDiscover to correctly reference the union and avoid
type confusion when copying a DHCPv6 packet.

Signed-off-by: Abuthahir M <abuthahirm@ami.com>
2026-07-14 18:10:05 +00:00
abuthahirm
a589f6fe03 NetworkPkg/Ip6Dxe: Add NULL check for InterfaceId before dereference
In Ip6ProcessRouterAdvertise, IpSb->InterfaceId is dereferenced in
CopyMem to form a stateless address. Add a guard to ensure
IpSb->InterfaceId is not NULL before entering the block, preventing
a potential NULL pointer dereference.

Signed-off-by: Abuthahir M <abuthahirm@ami.com>
2026-07-14 18:10:05 +00:00
abuthahirm
d21677e0bc NetworkPkg/Ip6Dxe: Move neighbor table cleanup before MNP teardown
In Ip6CleanService, Ip6FreeNeighborEntry may attempt to send packets via
MNP. Defensively move the neighbor table cleanup to occur before MNP
teardown so that the MNP child handle and its resources remain valid
during neighbor entry cleanup.

Signed-off-by: Abuthahir M <abuthahirm@ami.com>
2026-07-14 18:10:05 +00:00
abuthahirm
bc15a87b74 NetworkPkg/Dhcp6Dxe: Defensively check for NULL Config in Dhcp6UpdateIaInfo
Replace the ASSERT (Instance->Config != NULL) in Dhcp6UpdateIaInfo with
an explicit NULL check that returns EFI_DEVICE_ERROR. Also add a
complementary guard in Dhcp6GenerateIaCb alongside the existing check
for Instance->IaCb.Ia. These are defensive changes to prevent potential
NULL pointer dereferences.

Signed-off-by: Abuthahir M <abuthahirm@ami.com>
2026-07-14 18:10:05 +00:00
Michael G.A. Holland
0f07c187d0 CryptoPkg/BaseCryptLib: Add ML-DSA Support
Created ML-DSA API functions to configure public and private keys for
ML-DSA algorithm.  This will allow users to sign and verify with ML-DSA.
Unit tests were add to confirm operation of the API.

Signed-off-by: Michael G.A. Holland <michael.holland@intel.com>
2026-07-14 03:26:52 +00:00
Mingjie Shen
96c9f8f372 UefiPayloadPkg: Fix incorrect EfiPciWidth* enum literals
In arguments of EFI_PCI_IO_PROTOCOL member functions, replace the
EfiPciWidth* enum literals from
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH with the matching
EfiPciIoWidth* values from EFI_PCI_IO_PROTOCOL_WIDTH.

This keeps the call sites aligned with the protocol they actually use.
The old values were copied from EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL code,
so they obscured the intent of the calls and relied on an explicit
cast.

This mimics commit 8ba64a9a94 ("UefiPayloadPkg: Fix build failure with
CLANGPDB").

Generated by coccinelle script.

``` smpl
@initialize:python@
@@

def to_pci_io_width(name):
    return name.replace("EfiPciWidth", "EfiPciIoWidth", 1)

@normalize@
typedef EFI_PCI_IO_PROTOCOL;
typedef EDKII_PCI_DEVICE_PPI;
type T =~ "^EFI_PCI_IO_PROTOCOL_WIDTH$";
EFI_PCI_IO_PROTOCOL *x;
EDKII_PCI_DEVICE_PPI *y;
identifier bad =~ "EfiPciWidth(Uint|FifoUint|FillUint)(8|16|32|64)";
identifier top_op =~ "^(PollMem|PollIo|CopyMem)$";
identifier space =~ "^(Mem|Io|Pci)$";
identifier rw =~ "^(Read|Write)$";
fresh identifier good = script:python(bad) { to_pci_io_width(bad) };
expression first;
expression list rest;
@@
(
  x->top_op
|
  y->PciIo.top_op
|
  x->space.rw
|
  y->PciIo.space.rw
) (
  first,
- (T)bad
+ good
  ,
  rest
  )
```

Verified with:
- `build -p UefiPayloadPkg/UefiPayloadPkg.dsc -a IA32 -a X64 -b DEBUG -t GCC -D BOOTLOADER=SBL`
- temporary IA32 PEIM harness that compiled X86_BuildFdtLib.c

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2026-07-14 00:06:22 +00:00
Mingjie Shen
049dc848c4 MdeModulePkg: Fix incorrect EfiPciWidth* enum literals
In arguments of EFI_PCI_IO_PROTOCOL member functions, replace the
EfiPciWidth* enum literals from
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH with the matching
EfiPciIoWidth* values from EFI_PCI_IO_PROTOCOL_WIDTH.

This keeps the call sites aligned with the protocol they actually use.
The old values were copied from EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL code,
so they obscured the intent of the calls and relied on an explicit
cast.

This mimics commit 8ba64a9a94 ("UefiPayloadPkg: Fix build failure with
CLANGPDB").

Generated by coccinelle script.

``` smpl
@initialize:python@
@@

def to_pci_io_width(name):
    return name.replace("EfiPciWidth", "EfiPciIoWidth", 1)

@normalize@
typedef EFI_PCI_IO_PROTOCOL;
typedef EDKII_PCI_DEVICE_PPI;
type T =~ "^EFI_PCI_IO_PROTOCOL_WIDTH$";
EFI_PCI_IO_PROTOCOL *x;
EDKII_PCI_DEVICE_PPI *y;
identifier bad =~ "EfiPciWidth(Uint|FifoUint|FillUint)(8|16|32|64)";
identifier top_op =~ "^(PollMem|PollIo|CopyMem)$";
identifier space =~ "^(Mem|Io|Pci)$";
identifier rw =~ "^(Read|Write)$";
fresh identifier good = script:python(bad) { to_pci_io_width(bad) };
expression first;
expression list rest;
@@
(
  x->top_op
|
  y->PciIo.top_op
|
  x->space.rw
|
  y->PciIo.space.rw
) (
  first,
- (T)bad
+ good
  ,
  rest
  )
```

Verified with:
- `build -p MdeModulePkg/MdeModulePkg.dsc -m MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf -a IA32 -b DEBUG -t GCC`
- `build -p MdeModulePkg/MdeModulePkg.dsc -m MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf -a X64 -b DEBUG -t GCC`

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2026-07-14 00:06:22 +00:00
Benjamin Doron
50418424a0 UefiPayloadPkg: Fix AARCH64's ResetSystemLib class definition
This library class is called ResetSystemLib, not EfiResetSystemLib.
Fix this, making resets generated by UEFI and through the runtime service
work as expected.

Signed-off-by: Benjamin Doron <benjamin.doron@9elements.com>
2026-07-13 20:18:37 +00:00
Benjamin Doron
11ba2716ba UefiCpuPkg/BaseArchSupportLib: Include what you use
This fixes compiler errors on AARCH64.

Signed-off-by: Benjamin Doron <benjamin.doron@9elements.com>
2026-07-13 20:18:37 +00:00
Nickle Wang
6a6ec8a228 RedfishPkg/RedfishHttpDxe: report Redfish communication time
Add the support of reporting Redfish communication time between BIOS
and BMC. This helps to debug the issue of long boot time. This debug
function is default disabled, so it won't add extra time during
Redfish communication on regular boot.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
2026-07-12 06:19:39 +00:00
Mingjie Shen
927c7b1d81 BaseTools/Plugin/CodeQL: Add CodeQL version update script
Add a maintenance script that updates the CodeQL CLI dependency
YAML files and CodeQlQueries.qls together.

The script refreshes the CLI version, release digests, and cpp query
pack pin from the GitHub release metadata and the corresponding
qlpack.yml in the CodeQL CLI release branch.

Add comments to the CodeQL CLI dependency YAML files that direct
maintainers to use the script for future version updates.

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2026-07-11 01:26:20 +00:00
Mingjie Shen
f9e3f92819 BaseTools/Plugin/CodeQL: Update CodeQL CLI to v2.25.3
Update CodeQL external dependency definitions to v2.25.3 for generic,
Linux, and Windows archives, including refreshed SHA256 hashes from the
release metadata.

Pin the codeql/cpp-queries query pack to version 1.6.1, as specified in
the qlpack.yml at:
https://github.com/github/codeql/blob/codeql-cli/v2.25.3/cpp/ql/src/qlpack.yml

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2026-07-11 01:26:20 +00:00
Pierre Gondois
dce4c57471 DynamicTablesPkg: Add AmlUpdateRdDWord() and AmlUpdateRdWord()
Add the following functions to the AmlResourceDataApi:
- AmlUpdateRdDWord()
- AmlUpdateRdWord()

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-07-10 23:45:20 +00:00
Pierre Gondois
d3a7acfff9 DynamicTablesPkg: Check Rd Address Space field combination
Some combination of fields of Rd Address Space descriptors
are not valid. Check them when updating a Rd Address Space
descriptor.

Cf. ACPI 6.4 Table 6.44:
"Valid Combination of Address Space Descriptor Fields"

Also check that the input length is not 0 to avoid
potential integer underflow.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-07-10 23:45:20 +00:00
Pierre Gondois
10aef94c8b DynamicTablesPkg: Move CheckAddressSpaceFields() to AmlUtility.c
Move the CheckAddressSpaceFields() function to AmlUtility.c
to allow other files to re-use it.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-07-10 23:45:20 +00:00
Michael Kubacki
17ea1f3599 CONTRIBUTING.md: Add breaking change process link
Adds a reference to the Breaking Change and Release Process for EDK II
in CONTRIBUTING.md, so that contributors are aware of the process when
introducing breaking changes.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-07-10 22:02:44 +00:00
Michael Kubacki
0b68bfa540 .github: Add RFC 0003 Breaking Change and Release Process files
Adds the GitHub issue template files for the EDK II Breaking Change
and Release Process, as well as a link to the process in the pull
request template.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-07-10 22:02:44 +00:00
Michael Kubacki
550171fac5 BREAKING-CHANGES.md: Add initial file
RFC 0003 - "Breaking Change and Release Process for EDK II" defined a
new process for how breaking changes are tracked and documented in
EDK II. This commit adds an empty BREAKING-CHANGES.md file to the root
of the EDK II repository with sections for the current and next two
stable tags so the file can be updated in accordance with the RFC.

I add myself as a reviewer of the file to monitor the initial set of
updates against the RFC process.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-07-10 22:02:44 +00:00
Mike Beaton
a7d88f37ec Maintainers: Remove myself as reviewer for now
Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
2026-07-10 18:40:18 +00:00
zhuyunfei
f49f209c4f OvmfPkg/LoongArchVirt: Add TPM platform PEI support
Implement SetupTPMResources() in PlatformPei to:
- Parse QEMU FDT for 'tcg,tpm-tis-mmio' node
- Translate MMIO address via platform-bus ranges
- Create MMIO resource HOB and set PcdTpmBaseAddress
- Install gOvmfTpmDiscoveredPpi to trigger Tcg2ConfigPei

Also add SecurityPkg.dec dependency and required PPI/PCD references,
and add LOONGARCH64 depex for Tcg2ConfigPei.

Signed-off-by: zhuyunfei <zhuyunfei@loongson.cn>
Signed-off-by: gaoqihang <gaoqihang@loongson.cn>
Reviewed-by: qiandongyan <qiandongyan@loongson.cn>
Reviewed-by: lichao <lichao@loongson.cn>
2026-07-09 16:07:34 +00:00
zhuyunfei
49cbe1d438 OvmfPkg/LoongArchVirt: Add TPM support in platform description files
Add library mappings, PCDs, and component entries for Tcg2Pei,
Tcg2ConfigPei, Tcg2PlatformPei, Tcg2Dxe, and Tcg2ConfigDxe
when TPM2_ENABLE is TRUE. Also include the corresponding
firmware volume sections.

Signed-off-by: zhuyunfei <zhuyunfei@loongson.cn>
Signed-off-by: gaoqihang <gaoqihang@loongson.cn>
Reviewed-by: qiandongyan <qiandongyan@loongson.cn>
Reviewed-by: lichao <lichao@loongson.cn>
2026-07-09 16:07:34 +00:00
Yeoreum Yun
d7d5ddef07 DynamicTablesPkg: add SMBIOS type 44 for risc-v
Add Smbios Type 44 generator for the risc-v processor specific block
support.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2026-07-09 14:13:22 +00:00
Yeoreum Yun
be3aeb7c33 DynamicTablesPkg: add SMBIOS type 44 for x86(x64)
Add Smbios Type 44 generator for the x86(x64) processor specific block
support.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2026-07-09 14:13:22 +00:00
Yeoreum Yun
455b806260 DynamicTablesPkg: add SMBIOS type 44 generator
Add Smbios Type 44 generator with the arm processor specific block
support.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2026-07-09 14:13:22 +00:00
Yeoreum Yun
caac96b38c DynamicTablesPkg: add arm data structure for SMBIOS type 44 record
Add SMBIOS type 44 relevant information for arm to generate
SMBIOS type 44 record.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2026-07-09 14:13:22 +00:00
Yeoreum Yun
8a501b5d36 DynamicTablesPkg: add arch common data structure for SMBIOS type 44 record
Add SMBIOS type 44 relevant information for common to
generate SMBIOS type 44 record.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2026-07-09 14:13:22 +00:00
Yeoreum Yun
2d7734c7a8 DynamicTablesPkg: add Type4 record in to SmbiosHandleMap
This is preparatory patch for SMBIOS Type 44 record.
SMBIOS Type 44 record have a reference handle of SMBIOS Type 4 record.

Therefore, register SMBIOS Type 4 record into SmbiosHandleMap
with the Socket Processor Hieararchy token.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2026-07-09 14:13:22 +00:00
Yeoreum Yun
143e4441ed MdePkg: SMBIOS: add RiscV processor specific block structure
Add definitions for RiscV processor specific block structure.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2026-07-09 14:13:22 +00:00
Yeoreum Yun
071b0778d9 MdePkg: SMBIOS: add x86(x64) processor specific block structure
Add definitions for x86 processor specific block structure.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2026-07-09 14:13:22 +00:00
Yeoreum Yun
b35d53d589 MdePkg: SMBIOS: add Arm processor specific block structures
Add definitions for Arm processor specific block structure and
related sub data structure.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2026-07-09 14:13:22 +00:00
Oliver Smith-Denny
c38340a0c1 MdeModulePkg: Dxe Core: Correct gMemoryTypeInformation Definition
Commit 43e306806e added support
to DXE Core for EfiUnacceptedMemoryType. However, it incorrectly
added EFI_GCD_MEMORY_TYPE_UNACCEPTED to gMemoryTypeInformation,
which is the GCD memory type that is associated with
EfiUnacceptedMemoryType. All other changes from that PR
appear correct.

This is corrected to the EFI memory type.

The Memory Bin Google Test copied this incorrect definition,
so it is updated as well.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2026-07-09 12:46:51 +00:00
Christopher Zurcher
a62292ba94 BaseTools/GenFds: Print INF name on Depex eval failure
Signed-off-by: Christopher Zurcher <christopher.zurcher@microsoft.com>
2026-07-09 09:58:04 +00:00
Mingjie Shen
2cfd432ac9 ArmPkg/Driver: Remove the stale mPartId and duplicate ArmFfaLibRxRelease
ArmFfaLibGetPartitionInfo() helper replaces the manual partition info
lookup sequence used by FF-A clients:

* ArmFfaLibPartitionIdGet()
* ArmFfaLibGetRxTxBuffers()
* ArmFfaLibPartitionInfoGet(..., FFA_PART_INFO_FLAG_TYPE_DESC, ...)
* copy EFI_FFA_PART_INFO_DESC from the RX buffer
* ArmFfaLibRxRelease()

The collateral evolutions in b80000847a and 96ad9bd397 use the
helper as the owner of that sequence. Their callers only consume the
copied partition descriptor and do not keep a local partition ID solely for
RX buffer release.

Commit 8955d8db32 converted MmCommunication to call
ArmFfaLibGetPartitionInfo(), but kept caller-side partition ID state
and, in PEI, still released the RX buffer after the helper returned.
That made the ArmPkg conversion inconsistent with b80000847a and
96ad9bd397, and inconsistent with the helper ownership model. In the
ArmFfaLibPartitionInfoGetRegs path, there is no RX buffer to release,
while in the RX/TX buffer path, the buffer is already released inside
ArmFfaLibGetPartitionInfo().

This patch removes the stale local mPartId state and the remaining
caller-side ArmFfaLibRxRelease() from the DXE and PEI MM communication
drivers. The callers now match the helper contract: get the descriptor,
validate DIRECT_MSG_REQ support, and store the StandaloneMM partition
ID.

The current version was generated by running the following Coccinelle
script on 8955d8db32^, then rebasing the resulting fixup to master.

``` smpl
@replace_old_sequence@
typedef EFI_STATUS;
identifier Fn;
identifier Info, Count, TxBuffer, TxBufferSize, RxBuffer, RxBufferSize;
identifier PartId, Status, Size;
expression Guid;
position p;
statement S1, S2;
type SizeArgT;
@@
EFI_STATUS Fn@p (...) {
...
- EFI_FFA_PART_INFO_DESC *Info;
+ EFI_FFA_PART_INFO_DESC Info;
...
- Status = ArmFfaLibPartitionIdGet (&PartId);
- if (EFI_ERROR (Status)) S1
...
- Status = ArmFfaLibGetRxTxBuffers (
-            &TxBuffer,
-            &TxBufferSize,
-            &RxBuffer,
-            &RxBufferSize
-            );
- if (EFI_ERROR (Status)) S2
...
- Status = ArmFfaLibPartitionInfoGet (
-            Guid,
-            FFA_PART_INFO_FLAG_TYPE_DESC,
-            &Count,
-            (SizeArgT)&Size
-            );
+ Status = ArmFfaLibGetPartitionInfo (Guid, &Info);
...
(
- if ((Count != 1) || (Size < sizeof (EFI_FFA_PART_INFO_DESC))) {
-   ...
- } else {
-   Info = (EFI_FFA_PART_INFO_DESC *)RxBuffer;
    ...
- }
|
- if ((Count != 1) || (Size < sizeof (EFI_FFA_PART_INFO_DESC))) {
-   ...
- }
  ...
- Info = (EFI_FFA_PART_INFO_DESC *)RxBuffer;
)
  ...
- ArmFfaLibRxRelease (PartId);
  ...
}

@part_info_members depends on replace_old_sequence@
identifier replace_old_sequence.Info;
identifier Field =~ "^(PartitionId|PartitionProps)$";
@@
- Info->Field
+ Info.Field

@remove_old_variables depends on replace_old_sequence@
identifier replace_old_sequence.Count, replace_old_sequence.TxBuffer;
identifier replace_old_sequence.TxBufferSize, replace_old_sequence.RxBuffer, replace_old_sequence.RxBufferSize;
identifier replace_old_sequence.PartId;
identifier replace_old_sequence.Size;
type T;
@@
(
- T *TxBuffer;
|
- UINT64 TxBufferSize;
|
- T *RxBuffer;
|
- UINT64 RxBufferSize;
|
- UINT32 Count;
|
- UINT32 Size;
|
- UINT16 PartId;
|
- static UINT16 PartId;
)
```

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2026-07-08 09:17:17 +00:00
Mingjie Shen
b38d9eb7c6 MdeModulePkg/ArmFfaLib: Use EFI_PAGES_TO_SIZE
Replace manual page-size multiplication with EFI_PAGES_TO_SIZE
in the ArmFfaLib sources.

This commit mimics 3457388 and is generated by the following coccinelle
scipt:

```smpl
@pages_to_size@
expression PAGE_COUNT;
@@
- PcdGet64 (PAGE_COUNT) * EFI_PAGE_SIZE
+ EFI_PAGES_TO_SIZE (PcdGet64 (PAGE_COUNT))
```

Tested:
- stuart_ci_build -c .pytool/CISettings.py -p MdeModulePkg -a AARCH64 -t DEBUG TOOL_CHAIN_TAG=GCC
- stuart_ci_build -c .pytool/CISettings.py -p MdeModulePkg -a AARCH64 -t RELEASE,NO-TARGET TOOL_CHAIN_TAG=GCC

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2026-07-08 05:02:11 +00:00
Dāvis Mosāns
855e63ee5c SecurityPkg/Tpm2ServiceFfa.h: fix typo
Replace `TPM_CRB_FFA_FEAT_NOTIFICATION_TYPE_SHIFT` with `TPM2_FFA_FEAT_NOTIFICATION_TYPE_SHIFT`

Fixes #12768

Signed-off-by: Dāvis Mosāns <davispuh@gmail.com>
2026-07-07 19:57:18 +00:00