Commit Graph

35018 Commits

Author SHA1 Message Date
e27cfda33b OvmfPkg/IoMmuDxe: Fix 1M and 2M buffer handling
The IoMmu keeps a pool of pre-allocated shared buffers in various sizes
to serve requests. Usage is tracked in a bitmap.

The bitmap masks for the 1M and 2M buffer pools are incorrect, causing
the same buffers getting handed out repeatedly, causing corrupted device
accesses.

The masks needs to be kept in sync with mReservedMemRanges below.
This sets the correct values for:

 - RESERVED_MEM_BITMAP_1M_MASK = (1 << 14) = 0x4000
 - RESERVED_MEM_BITMAP_2M_MASK = (1 << 15) | (1 << 16) = 0x18000

Signed-off-by: Oliver Steffen <osteffen@redhat.com>
2025-10-16 06:21:35 +00:00
2522020ee1 UnitTestFrameworkPkg: Use 8MB stack for MSFT and CLANGPDB
Linux/GCC host-based unit test application builds use a
default stack size of 8MB. Windows/VS20xx and Windows/CLANGPDB
host-based unit test application builds use a default stack size
of 1MB. This can allow Linux unit tests to pass and Windows unit
tests to fail with stack overflow if large local variables are
used. ASAN increases stack usage, so this condition can occur
more frequently when ASAN enabled.

Update MSFT and CLANGPDB for host-based unit tests to use a
default stack size of 8MB so all tool chains use the same
default stack size for host-based unit tests.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-10-15 16:21:17 +00:00
597d061e09 MdeModulePkg/DxeCapsuleLibFmp:Added PCD for EmbeddedDriver Support
Currently, there is no mechanism for platforms to enable or disable
support for EmbeddedDrivers in capsule updates. This patch introduces
a new PCD, PcdEmbeddedDriverSupport, allowing platforms to explicitly
control whether capsules containing EmbeddedDrivers are supported.
This ensures capsules with embedded drivers are rejected on platforms
that do not support them.

This is a breaking change.By default, PcdEmbeddedDriverSupport
is set to FALSE which disables embedded driver support in capsule updates
across all platforms unless explicitly enabled.

Platforms must opt-in by setting the PcdEmbeddedDriverSupport to TRUE
in order to enable support for capsules containing embedded drivers.

Signed-off-by: Pavithra Gurulingappa <gpavithr@qti.qualcomm.com>
2025-10-14 17:45:19 +00:00
9c06ac56fb SecurityPkg: Tcg2StandaloneMmArm: Enable TPM FFA Instance to Register PPI
Previously, the implementation restricted usage to TPM instances with the
DTPM ID, which worked only if the system supported TPM over FFA but still
set the instance ID to DTPM. However, Tpm2InstanceLibFfa requires the
`PcdTpmInstanceGuid` to be set to `gTpm2ServiceFfaGuid`.

This update expands support by allowing the `PcdTpmInstanceGuid` to
include the TPM-over-FFA instance GUID, enabling proper registration of
the PPI.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-10-14 17:58:23 +02:00
4883960e5e SecurityPkg: Tcg2AcpiFfa: Correct TPM Instance Validation
The current implementation checks `PcdTpmInstanceGuid` and enforces the
use of the DTPM instance GUID. However, for FFA-specific modules, the
correct value should be `gTpm2ServiceFfaGuid`.

This update fixes the validation logic to support routing through
Tpm2DeviceLibRouter* with the appropriate instance library, which
requires the instance ID to be set to `gTpm2ServiceFfaGuid`.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-10-14 17:58:23 +02:00
ff96eb4c2c MdePkg: Restore ARM processor macro in CPER header
Commit 84c0261 removed support for ARM32 and inadvertently removed the
EFI_GENERIC_ERROR_PROC_TYPE_ARM macro which remains valid for AARCH64.
The macro refers to the ARM CPU architecture, not specifically the ARM32
instruction set.

Restore the macro to maintain compatibility with downstream modules that
rely on Cper.h for AARCH64 platforms.

Signed-off-by: Vishal Oliyil Kunnil <vishalo@qti.qualcomm.com>
2025-10-14 08:42:51 +00:00
faeee00490 MdeModulePkg/FvSimpleFileSystemDxe: Remove Iso639Language
PR #11380 that removed the Unicode Collation Protocol
introduced a logic bug in the use of GetBestLanguage().
Iso639Language would always be computed to TRUE when it
should always be passed to GetBestLanguage() as FALSE
once Unicode Collation Protocol is removed.

Update InitializeUnicodeCollationSupportWorker() to
remove the local variable Iso639Language and always
call GetBestLanguage() with the Iso639Language parameter
set to FALSE.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-10-14 01:45:12 +00:00
56989e2d24 FatPkg/EnhancedFatDxe: Remove Iso639Language
PR #11380 that removed the Unicode Collation Protocol
introduced a logic bug in the use of GetBestLanguage().
Iso639Language would always be computed to TRUE when it
should always be passed to GetBestLanguage() as FALSE
once Unicode Collation Protocol is removed.

Update InitializeUnicodeCollationSupportWorker() to
remove the local variable Iso639Language and always
call GetBestLanguage() with the Iso639Language parameter
set to FALSE.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-10-14 01:45:12 +00:00
aace3eebd2 DynamicTablesPkg: Use abstract tokens in token generator
Using abstract tokens ensures no collisions with non-generated tokens.

Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-10-13 10:45:45 +00:00
f09ea5f672 ArmVirtPkg/KvmtoolCfgMgrDxe: Update DynamicPlatRepoLib usage
Update for the new token parameter in DynPlatRepoAddObject() and
HW_INFO_ADD_OBJECT.

Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-10-13 10:45:45 +00:00
954ee29013 DynamicTablesPkg/FdtHwInfoParserLib: Add Arm IORT parser
Add a parser for IORT. Currently generates PCI Root Complex and SMMUv3
nodes.

Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-10-13 10:45:45 +00:00
ba69c6d514 DynamicTablesPkg: FdtHwInfoParserLib: Generate GIC ITS group objects
Add generation of GIC ITS identifier array and group CmObjs.

Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-10-13 10:45:45 +00:00
b0aac86c0d DynamicTablesPkg: Add helper to add array as a CmObj
Implement a helper to add an array as a CmObj.

Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-10-13 10:45:45 +00:00
12690ffbb8 DynamicTablesPkg: Add helper to add CmObj with given token
Implement function to add a CmObj with a token provided by the caller. This
is intended to be used with abstract tokens, the value of which is generated
by the caller.

Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-10-13 10:45:45 +00:00
2ad74b956b DynamicTablesPkg/FdtHwInfoParserLib: Support 1 PMU IRQ per core
The current Arm GICC parser only supports one PMU IRQ shared between all
cores. Newer systems use a unique PMU IRQ per core.

Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-10-13 10:45:45 +00:00
549b473b23 MdePkg/BaseFdtLib: Add FdtGetPhandle wrapper
Add wrapper for fdt_get_phandle().

Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-10-13 10:45:45 +00:00
80eaa563ec MdeModulePkg/HiiDatabaseDxe: Avoid unexpected memory free
TempBuffer variable is only dynamically allocated when the opcode is
EFI_IFR_STRING_OP and the string value is not 0, so it should be freed
under the same condition. Otherwise, the variable may be unexpected
freed.

Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
2025-10-10 08:44:42 +00:00
aff203c3ce Maintainers.txt: Remove myself as BaseTools maintainer
Remove myself as a BaseTools maintainer.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2025-10-10 07:36:22 +00:00
3b83fe3958 BaseTools: Disable GCC relax on LoongArch
It might appear some odd problems if enable GCC relax. Disabling it can
avoid these problems.

Signed-off-by: Chao Li <lichao@loongson.cn>
Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Guillermo Antonio Palomino Sosa <guillermo.a.palomino.sosa@intel.com>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Poncho Figueroa <poncho.figueroa.esqueda@intel.com>
2025-10-10 05:57:28 +00:00
0070fd1aec CryptoPkg: Fix build of MbedTlsLib
Fixes build failures caused by __USE_MINGW_ANSI_STDIO not being defined when
building with CLANG.

Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2025-10-10 02:58:38 +00:00
4bb6dd8296 CryptoPkg: Simplify MSFT FLINK_FLAGS
Remove /FILEALIGN, /SUBSYSTEM, /EXPORT and /BASE options
that are not required for UEFI Shell applications.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-10-09 23:36:39 +00:00
0f0b472ae5 OvmfPkg/PlatformInitLib: add sanity checks to igvm code
With SEV or SEV-ES being active uninitialized memory is random cipher
text instead of being zero-initialized.  So checking against zero to
figure whenever igvm parameters are present or not is not sufficient.
Apply more strict sanity checks.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2025-10-09 22:04:43 +00:00
ab04d09555 EmbeddedPkg: Clear keyboard queue buffer after reading
There is a possibility to retrieve user input keystroke data stored in the
queue buffer via the EFI_SIMPLE_TEXT_INPUT_PROTOCOL pointer. To prevent
exposure of the password string, clear the queue buffer by filling it
with zeros after reading.

Signed-off-by: Nick Wang <nick.wang@insyde.com>
2025-10-09 08:02:51 +00:00
0cad130cb4 MdeModulePkg : Clear keyboard queue buffer after reading
There is a possibility to retrieve user input keystroke data stored in the
queue buffer via the EFI_SIMPLE_TEXT_INPUT_PROTOCOL pointer. To prevent
exposure of the password string, clear the queue buffer by filling it
with zeros after reading.

Signed-off-by: Nick Wang <nick.wang@insyde.com>
2025-10-09 08:02:51 +00:00
f98662c5e3 MdePkg/MockFdtLib: add FdtLib mock functions
Add FdtDelNode() and FdtGetPath() mock functions.

Signed-off-by: Bob Morgan <bobm@nvidia.com>
2025-10-06 18:08:45 +00:00
5cf1be671b ShellPkg/pci.c: Fix typo in source code.
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
2025-10-03 17:14:30 +00:00
5550d8f0b7 ShellPkg: Add PCIe boundary check and enhance DVSEC size calculation
1. Safe wrapper function for DumpHex that validates PCI configuration
   space boundaries. This function ensures that hex dumps do not exceed
   the standard 4KB PCIe configuration space boundary. If the requested
   dump would exceed this boundary, it prints an error message and
   truncates the dump size to remain within valid bounds.

2. Enhance DVSEC capability structure size calculation method. Size is
   now obtained from the DesignatedVendorSpecificHeader1.Bits.DvsecLength
   register.

Issue: https://github.com/tianocore/edk2/issues/11554

Signed-off-by: Pranav V V <pranav.v.v@intel.com>
2025-10-03 17:14:30 +00:00
da44b3b24a PrmPkg: Set DXE_RUNTIME_DRIVER section alignment
Since PRM modules are DXE_RUNTIME_DRIVER images, this change sets
the linker flags to the expected section alignment values for
runtime code images. This serves as an example for platforms but
also results in PRM sample modules in the package having correct
section alignment.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-10-03 00:22:27 +00:00
baf0ae3b1d SecurityPkg: rename PeilessSecMeasureNullLib
By edk2 convention, a NULL library should be called *LibNull.
This library did not follow this convention, so rename i.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-10-02 15:42:07 +01:00
d95e578b25 ArmPlatformPkg: rename LcdHwLibNull and LcdPlatformLibNull
By edk2 convention, a NULL library should be called *LibNull.
These libraries did not follow this convention, so rename them.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-10-02 15:42:07 +01:00
d52fa6da67 ArmPkg: rename ArmMtlNullLib
By edk2 convention, a NULL library should be called *LibNull.
ArmMtlNullLib did not follow this convention, so rename it
ArmMtlLibNull.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-10-02 15:42:07 +01:00
01b9f27dbb ArmPlatformPkg/PlatformPei: generate TPM event log hobs
When measured boot is enabled, TF-A passes
the early measurement event log to the BL33 firmware (i.e., UEFI)
through a transfer list entry with
the tag ID TRANSFER_ENTRY_TAG_ID_TPM_EVENT_LOG.

Therefore, generate TPM event log HOBs from
the early measurement event log so they can be
unified with the Tcg2Dxe event logs.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2025-10-02 08:24:05 +00:00
f1f672b898 ArmPkg/SemihostFs: fix crash when file open fails
Since the FileFcb’s list entry is not initialized at allocation,
SemihostFs reports the following crash when freeing FileFcb
after failing to obtain the file size in FileOpen():

  ASSERT [SemihostFs] LinkedList.c(75): List->ForwardLink != ((void *) 0)

To fix this, properly initialize the list entry at FCB allocation
and move RemoveListEntry() to FileClose(),
since the FCB entry will only be on the list
when VolumeOpen() or FileOpen() succeeds.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2025-10-02 07:29:06 +00:00
edb5331f78 .github/workflows: Add PR formatting validator
This workflow runs when GitHub PRs are modified (edited, opened,
reopened, and synchronized) to perform basic validation of the PR
title and description.

Right now, this includes:

- Checking that the PR title is not empty
- Checking that the PR body is not empty
- Checking that the PR body meets the minimum text length.
  Where the minimum text length is defined to be the number of
  characters in the PR template with empty sections
- Checking that PR template placeholder do not remain in the PR
  description

If a check fails, a GitHub comment will be left on the PR and a PR
status check failure will be present on the PR until the issue is
resolved. Upon future runs of the workflow, existing PR validation
message contents are hashed and compared to a new message that may
potentially be posted. If the same comment is already posted in the
PR, it is not posted again.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-10-01 23:46:51 +00:00
bfbd5d70e8 .github/GitHub.py: Add output and env helpers
Adds GitHub helper functions so other Python code can more cleanly
set output and environment variables.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-10-01 23:46:51 +00:00
d3a64baf4b NetworkPkg/UefiPxeBcDxe: Add buffer check before reporting status code
When PxeBcLoadBootFile() fails, it reports a status code to notify
listeners (such as telemetry/SEL logging drivers) about the error.
However, the current implementation reports the status code for all
error conditions, including benign cases, such as where the caller passes
Buffer == NULL with EFI_BUFFER_TOO_SMALL to query the required size.

This causes false positive error reports in telemetry systems, as
EFI_BUFFER_TOO_SMALL with Buffer == NULL is an expected and normal
operation for size queries, not an actual error condition.

The PXE-E05 error message is already correctly guarded with the
condition "(Status == EFI_BUFFER_TOO_SMALL) && (Buffer != NULL)",
but the status code reporting was unconditional.

Add a buffer null check before REPORT_STATUS_CODE_WITH_EXTENDED_DATA
to ensure status codes are only reported for actual errors:
- Report when Status != EFI_BUFFER_TOO_SMALL (all other errors)
- Report when Status == EFI_BUFFER_TOO_SMALL AND Buffer != NULL (PXE-E05)
- Skip when Status == EFI_BUFFER_TOO_SMALL AND Buffer == NULL (size query)

This prevents spurious error logs while maintaining proper error
reporting for genuine failures including PXE-E05, PXE-E07, PXE-E09,
PXE-E99, and all other error conditions.

Signed-off-by: Marc Chen <marc.chen@microsoft.com>
2025-10-01 16:46:03 +00:00
90771630bf UefiCpuPkg/ArmMmuLib: Add support for LPA2
Add support for LPA2 (52-bit physical addressing).

Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-10-01 11:14:56 +00:00
5ec21149a7 ArmPkg/CpuDxe: Add support for LPA2 page table entry format
Add support for decoding the output address format in page table entries
when LPA2 is in use.

Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-10-01 11:14:56 +00:00
6e01bfcca2 ArmPkg/CpuDxe: Add support for signed page table levels
When 52-bit virtual addressing and 4k pages are in use, the top page table
level is level -1.

Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-10-01 11:14:56 +00:00
3916260189 ArmPkg/ArmLib: Add 52-bit VA support helper (LPA2)
Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-10-01 11:14:56 +00:00
c5e4e7e78a MdePkg/ArmLib: Add prototype for 52-bit VA support helper
Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-10-01 11:14:56 +00:00
8c50ce60c4 MdePkg/AArch64: Add LPA2 related constants
Add constants required for LPA2 (52-bit virtual addressing) support.

Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
[ardb: touchup for uncrustify]
2025-10-01 11:14:56 +00:00
fe22ac2932 OvmfPkg/igvm: add IgvmSecureBootDxe
Enroll the secure boot variables passed in via IGVM data HOBs.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2025-10-01 09:00:49 +00:00
5a6a9f7955 OvmfPkg/X86QemuLoadImageLib: do not use the legacy linux loader in CVMs.
Do not use the insecure legacy linux loader (which does not
enforce secure boot checks) when running in a confidential VM.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2025-10-01 09:00:49 +00:00
8b22c532b3 ShellPkg/Library: rework Shell...CommandsLib Load.c
CodeQL incorrectly flags that LoadedDriverImage might be derferenced
while NULL, but the actual code paths make that impossible.

Strip several levels of success handling to improve readability for
humans and static analyzers both.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-10-01 10:02:57 +02:00
aa29d51637 ShellPkg: Use the newly introduced ShellPrintDefaultEx() alias
Make use the newly introduced ShellPrintDefaultEx() alias and
replace wherever it is possible:
- "ShellPrintEx (-1, -1,"
with:
- "ShellPrintDefaultEx ("

No functional change is introduced.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01 10:02:57 +02:00
9ff74659a8 OvmfPkg: Use the newly introduced ShellPrintHiiDefaultEx() alias
Make use the newly introduced ShellPrintHiiDefaultEx() alias and
replace wherever it is possible:
- "ShellPrintHiiEx (-1, -1, NULL,"
with:
- "ShellPrintHiiDefaultEx ("

No functional change is introduced.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01 10:02:57 +02:00
c71d0e7153 PrmPkg: Use the newly introduced ShellPrintHiiDefaultEx() alias
Make use the newly introduced ShellPrintHiiDefaultEx() alias and
replace wherever it is possible:
- "ShellPrintHiiEx (-1, -1, NULL,"
with:
- "ShellPrintHiiDefaultEx ("

No functional change is introduced.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01 10:02:57 +02:00
c4a8b001f3 ShellPkg: Use the newly introduced ShellPrintHiiDefaultEx() alias
Make use the newly introduced ShellPrintHiiDefaultEx() alias and
replace wherever it is possible:
- "ShellPrintHiiEx (-1, -1, NULL,"
with:
- "ShellPrintHiiDefaultEx ("

No functional change is introduced.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01 10:02:57 +02:00
432feb6b56 NetworkPkg: Use the newly introduced ShellPrintHiiDefaultEx() alias
Make use the newly introduced ShellPrintHiiDefaultEx() alias and
replace wherever it is possible:
- "ShellPrintHiiEx (-1, -1, NULL,"
with:
- "ShellPrintHiiDefaultEx ("

No functional change is introduced.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01 10:02:57 +02:00