Commit Graph

35064 Commits

Author SHA1 Message Date
7cf721dd4d StandaloneMmPkg: Drop ARM32 Support
edk2 is dropping support for the ARM32 architecture. This commit
removes ARM32 code from StandaloneMmPkg. It also removes irrelevant
VALID_ARCHITECTURES comments from infs that are not arch
specific.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-09-25 22:04:10 +00:00
3d50e76f03 UefiPayloadPkg: Drop ARM32 Support
edk2 is dropping support for the ARM32 architecture. This commit
removes ARM32 support from UefiPayloadPkg. It removes irrelevant
VALID_ARCHITECTURES comments from infs that are not arch
specific.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-09-25 22:04:10 +00:00
08c27faeed UefiCpuPkg: Drop ARM32 Support
edk2 is dropping support for the ARM32 architecture. This commit
removes ARM32 code from UefiCpuPkg. It drops irrelevant
VALID_ARCHITECTURES fields from infs that are not arch
specific.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-09-25 22:04:10 +00:00
215e45bdb3 .azurepipelines,.github,.pytool: Disable ARM32 at Top Level/Pipelines
edk2 is dropping support for the ARM32 architecture. As such,
this commit drops ARM32 from running in CI and removes the
references to it in the readme and Maintainers.txt.

Continuous-integration-options: PatchCheck.ignore-multi-package

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-09-25 22:04:10 +00:00
f451d187c3 ShellPkg: AcpiView: Fix CodeQL Error
When removing ARM32 code from edk2, a CodeQL
error in AcpiView (pointer used without null
check) was flagged in GH.

This updates the code to eliminate the duplicate code in that
function and instead call EfiGetSystemConfigurationTable.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-09-25 22:04:10 +00:00
12797dd337 BaseTools: Align Pre-Processor Macros for CLANGPDB and CLANGDWARF
Update the CLANGPDB toolchain to define the __GNUC__, __GNUC_MINOR__,
__GNUC_PATCHLEVEL__, and __MINGW32__ macros with values that match the
pre-defined values seen when using the x86_64-unknown-windows-gnu target
triple. This minimizes the differences in pre-processor macros between the
CLANGPDB and CLANGDWARF targets.

Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2025-09-25 18:17:09 +00:00
21eff866e7 SecurityPkg/Tpm2DeviceLibDTpm: Remove global variable for command code
As a BASE type library, currently the TCG PEI driver, Tcg2Pei.inf links
the library. On edk2-stable202508 version, it is found that the driver
includes and updates the global variable of mLastCommandSent in debug
build. Also found that the previous commit (460f270) for the library adds
and uses the global variable. Updating the global variable in PEI drivers
could affect the following issues. To address these issues, remove the
global variable usage.

PEI ROM Boot : Global variable is not updated
PEI RAM Boot : PEI FV integration/security check is failed

Signed-off-by: Phil Noh <Phil.Noh@amd.com>
2025-09-25 10:24:54 +00:00
b15f98e68f OvmfPkg/IntelTdx: Fix TDVF boot failure with odd-sized memory below 2816M
TDVF boot in QEMU fails when the VMM is configured with
odd memory sizes (in MB) below 2816M (e.g., 2815M, 2813M).
This is due to the RAM split defined in pc_q35.c:
when RAM exceeds 2816M, low memory is truncated to 2048M
and the remainder is placed above the 4G boundary.
This split causes failures only with odd sizes below 2816M.

TDVF uses a default page size of 2M (hugepage),
which leads to a corner case where the last 1M may not be accepted.
To resolve this, on BSP, always accept any remaining memory using a 4K page size.

Signed-off-by: Stanislaw Grams <stanislaw.grams@intel.com>
2025-09-25 08:59:57 +00:00
17691a2641 FmpDevicePkg/FmpDxe: Improve handling of XDR certs
The current implementation for XDR certificate handling assumes the
PublicKeyDataXdr buffer is 4-byte aligned. This is not always the case.
For example, if PublicKeyDataXdr=0x02, and the length is 0x05, the
correct offset should be 0x2 + align_up(0x5, 4) -> 0x2 + 0x8 = 0xA. The
current logic produces align_up(0x2 + 0x5, 4) -> align_up(0x7, 4) = 0x8.

Signed-off-by: Antaeus Kleinert-Strand <antklein@microsoft.com>
2025-09-24 00:02:41 +00:00
18d053d682 IntelFsp2Pkg/FspSecCore: Reserve 32B when calling C function in 64bit
After bootloader calls FSP API mode, I found the RDI register is
changed in some cases.
Below is the first line of function FspApiCallingCheck in assembly dump
  mov qword ptr [rsp+0x8],rbx
We can see compiler will use rsp+0x8 for some purpose, while rsp+0x8
is used to save RDI by FSP in code before.

According to the x86-64 calling convention, caller is responsible for
allocating 32 bytes of "shadow space" on the stack right before calling
the function (regardless of the actual number of parameters used).
However FSP code doesn't reserve 32 bytes before calling
FspApiCallingCheck C function in 64bit.

The patch fixes it by reserving the 32 bytes before calling C routine.
Also, make sure the stack is 16-byte alignment, sub 0x28 to RSP.

Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2025-09-23 03:54:45 +00:00
fb43f0c085 CryptoPkg: Add support to set TLS security level.
Add Edkiicrypto protocol API to set TLS set security level.

Signed-off-by: Kanagavel S <kanagavels@ami.com>
2025-09-23 03:08:14 +00:00
ba41bd096a MdeModulePkg/TerminalDxe: Improve the implementation of AnsiTestString
Adjust AnsiTestString to be compatible with wide/narrow string in
TerminalDxe driver. If WIDE_CHAR or NARROW_CHAR is hit, the string
is still valid since OutputString function will correctly handle it.

Signed-off-by: Gao Qihang <gaoqihang@loongson.cn>
2025-09-23 09:02:47 +08:00
0053bbf833 MdeModulePkg/TerminalDxe: Add missing types for TestString function
Add four newly added terminal types in TerminalConOutTestString, although
this function is rarely used. This patch is a supplement to previous patch
8a53ea9d9f.

Signed-off-by: Gao Qihang <gaoqihang@loongson.cn>
2025-09-23 09:02:47 +08:00
8a07311710 MdeModulePkg: Add PcdDelayedDispatchMaxEntries
The current fixed value of 8 for `DELAYED_DISPATCH_MAX_ENTRIES` is
not large enough to accommodate platform usage. This change replaces
the macro with a PCD that can be configured by platforms.

In the case the default PCD value is too small, an error message
explaining that the PCD should be updated will be printed followed
by an assert.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-09-23 09:02:04 +08:00
32711df057 DynamicTablesPkg: Drop IA32 support
All DynamicTablesPkg libraries and drivers execute in the DXE phase,
where both AMD and Intel platforms operate in X64 (64-bit) mode.
Therefore, IA32 (32-bit) support is no longer required for DynamicTablesPkg.

Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-09-22 18:24:48 +00:00
81f9f6d7b3 CryptoPkg/BaseCryptLibMbedTls: Fix wrong return in X509GetIssuerName
Signed-off-by: Ágatha Freitas <htafreit@gmail.com>
2025-09-22 13:36:09 +00:00
bd9cb33424 CryptoPkg/BaseCryptLibMbedTls: Fix DateTime conversion from char to int
Signed-off-by: Ágatha Freitas <htafreit@gmail.com>
2025-09-22 13:36:09 +00:00
238a6175fb BaseTools/Conf: Add support for C++ compiler flags
Update build rules to split C file rules from C++ file
rules and introduce CXX_FLAGS to provide compiler options
that are only used to compile C++ files.

This is required because the compiler options to specify
the C++ standard generate errors when used to compile
C files.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-22 09:18:28 +00:00
5dadbbac0b BaseTools/Conf: Remove -nostdlib -nostdlibinc for CLANG
Remove -nostdlib and -nostdlibinc from CC_FLAGS for CLANG
builds to support using CLANGPDB and CLANGDWARF for modules
of type HOST_APPLICATION that require use of standard C libs.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-22 09:18:28 +00:00
6e992efa8d BaseTools/Conf: Remove -imacros from GCC_ASM_FLAGS
All ASM files are processed using PP_FLAGS that includes
AutoGen.h. Remove redundant -imacros AutoGen.h option from
GCC_ASM_FLAGS. This also removes warnings generated in
CLANG builds when an ASM file is processed and an
AutoGen.h file is not present.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-22 09:18:28 +00:00
95c5f119bd BaseTools/Conf: Make ASLCC_FLAGS independent of CC_FLAGS
Update ASLCC_FLAGS in tools_def.template too provide all
the options required to compile ACPI Table source files
without any dependencies on CC_FLAGS. This allows CC_FLAGS
to only be used to compile C source files and for
ASLCC_FLAGS to only be used to compile ACPI Tables source
files.

No changes are required for the MSFT or XCODE tool chain
families. Only the GCC tool chain family requires updates
to the ASLCC_FLAGS in tools_def.template along with updates
to build_rule.template to not use CC_FLAGS for ACPI Table
rules.

This change is required to avoid use of ASAN and code
coverage flags when building ACPI Table source files that
break CLANGDWARF builds of ACPI Table source files.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-22 09:18:28 +00:00
23dd3eafb8 BaseTools/Conf: USER_DEFINED/HOST_APPLICATION CLANG support
* Add CLANGDWARF support to USER_DEFINED module type rules.
* Add CLANGDWARF support to HOST_APPLICATION module type rules.
* Add missing -c option to CLANGPDB HOST_APPLICATION module
  type rules

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-22 09:18:28 +00:00
a63bbb35d9 EmulatorPkg/Unix/Host: Add CLANGDWARF support and reduce warnings
Use GCC family and remove references to specific tool chain tags.
This allows all GCC families to be supported including CLANGDWARF.

Add -z noexecstack to reduce warnings.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-22 07:12:48 +00:00
a9cf21e835 BaseTools/Conf: Fix build_rule.template for CLANGDWARF
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-22 07:12:48 +00:00
24803543ea EmulatorPkg/Win/Host: Remove set but not used variables
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-22 07:12:48 +00:00
7f557cd133 EmulatorPkg/Unix/Host: Fix set but unused variables
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-22 07:12:48 +00:00
0bc550f466 UnitTestFrameworkPkg/SampleGoogleTest: Add missing override keyword
Add missing override keyword to c++ classes. Found by the clang++
compiler.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-19 13:45:44 +00:00
62861fed5d Maintainers.txt: Replace Swee Aun with Star as reviewer for StandaloneMmPkg
Swee Aun has left Intel,
replace Swee Aun with Star as reviewer for StandaloneMmPkg.

Signed-off-by: Star Zeng <star.zeng@intel.com>
2025-09-19 12:32:42 +00:00
82a03a8248 RedfishPkg/JsonLib: Define NO_MSABI_VA_FUNCS for GCC X64
For GCC family X64 builds, add -DNO_MSABI_VA_FUNCS to force
use of the compiler default vararg macros. This define is
required in libraries that use a standard C source submodule
and there are one or more vararg functions. The calling
convention of the vararg function must match the calling
convention of the vararg macros used within the vararg
function.

In the JsonLib case, jsonp_error_set() is a vararg function
and generates the following error for CLANGDWARF X64 builds.

RedfishPkg/Library/JsonLib/jansson/src/error.c:37:5:
error: '__builtin_ms_va_start' used in System V ABI function
37 |     va_start(ap, msg);
   |     ^

This change matches CryptoPkg openssl and mbedtls library
INF files that also define NO_MSABI_VA_FUNCS.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-19 10:54:10 +00:00
ff39a5d2dd CryptoPkg/BaseCryptLib: Fix MODULE_TYPE for unit tests
Update INF for BaseCryptLib used with host based unit
tests to use a MODULE_TYPE of HOST_APPLICATION to make
sure the correct compiler/linker flags are used.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-19 10:03:52 +00:00
ae95326c2c CryptoPkg/BaseCryptLib: Remove tolower() for unit tests
tolower() is always provided by the standard C library.
Remove the implementation of tolower() from
UnitTestHostCrtWrapper.c that is only used when building
host based unit tests.

PR https://github.com/tianocore/edk2/pull/11217 attempted to
resolve this issue by renaming tolower() to avoid duplicate
symbols. This change removes this workaround as well.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-19 10:03:52 +00:00
1e5aeff417 UefiCpuPkg/MtrrLib: Update unit tests for CLANGPDB
Update [BuildOptions] so CLANGPDB matches MSFT to support
Windows/clang builds of MtrrLib host-based unit tests.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-19 08:02:01 +00:00
d87583e720 MdePkg/Library/BaseLib: Remove __chkstk() from BaseLib
Remove workaround for GCC compilers that is no longer
required. Keeping this implementation of __chkstk() generates
duplicate symbol build failures with Windows/CLANGPDB builds
host-based unit test builds.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-19 07:14:26 +00:00
2636488e7b MdePkg/Test/MockSmmServicesTableLib: Fix struct init
CLANGDWARF generates errors for missing braces in
initialization of complex structures. Expand the
initialization of EFI_SMM_CPU_IO2_PROTOCOL in
LocalSmst to set each function pointer to NULL.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-19 05:32:01 +00:00
f57fab9b1d MdeModulePkg/Test/Include: Fix SecurityManagement include guard
Fix mimatched macro name of include guard in
MockSecurityManagementLib.h. This was found with unit test
build using CLANGDWARF.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-19 04:41:29 +00:00
c4ca5ee091 MdeModulePkg/Universal/DisplayEngineDxe: Fix GCCNOLTO error
Fix potentially uninitialized local variable Index.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-19 02:50:26 +00:00
9ac6e450e4 NetworkPkg/UefiPceBcDxe/GoogleTest: Add missing EFIAPI
CLANGDWARF generates a build error for calling convention
mismatch in UdpRead(), UdpWrite(), and Configure() mock
functions.  Add EFIAPI so mock function matches function
prototype of function being mocked.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-18 17:25:38 +00:00
b05c8d7b80 NetworkPkg/Dhcp6Dxe/GoogleTest: Fix init of complex struct
CLANGDWARF generates build error for missing braces when
initializing a complex structure. Change initialization of
EFI_DHCP6_IA local variable to a call to ZeroMem() instead.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-18 17:25:38 +00:00
0d26d944d9 MdeModulePkg/Universal/DriverSampleDxe: Fix VFR warnings
Remove default from checkbox statement that is not part
of the checkbox statement syntax to remove VFR compiler
warning.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-18 16:08:59 +00:00
2a8d98d0a5 OvmfPkg/IntelTdx: Update TDVF README.md
TDVF cannot be mapped as a pflash device.
The script referenced in README.md must use the -bios option instead.
TDX support in QEMU and KVM has been upstreamed,
so the URLs should be updated to point to upstream repositories.

Signed-off-by: Stanislaw Grams <stanislaw.grams@intel.com>
2025-09-18 12:42:23 +00:00
b4e6443f89 SecurityPkg: Tpm2DeviceLibFfa: Recognize CRB Interface Version 2
This change adds the recognition of TPM devices that supports CRB
interface v2.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-09-18 17:30:28 +08:00
b24663ee58 SecurityPkg: Tpm2DeviceLibDTpm: Recognize CRB Interface Version 2
This change adds the recognition of TPM devices that supports CRB
interface v2.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-09-18 17:30:28 +08:00
3a5563593a MdePkg: TpmPtp: Add CRB Interface Version 2 Definition
Introduces support for CRB Interface Version 2 as defined in the TCG PC
Client Platform TPM Profile (PTP) Specification v1.06.

This enables firmware to identify TPMs that support the CRB buffer
interface.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-09-18 17:30:28 +08:00
11ecff34f3 ArmVirtPkg/ArmVirtQemu,ArmVirtQemuKernel: Allow users to enable SNP
Modern ARM server platforms support SNP for PXE boot.
I tested PXE boot with ArmVirtQemu and needed to enable SNP.

Signed-off-by: Dimitri Daskalakis <dimitri.daskalakis1@gmail.com>
2025-09-17 18:06:49 +00:00
6690201491 .pytool: Update Uncrustify to 73.0.11
Uncrustify release

https://github.com/tianocore/uncrustify/releases/tag/73.0.11

The only functional change in this release from 73.0.10 is to
reduce file parsing messages during execution:

```
uncrustify prints each file it is parsing at system error level,
which is by default printed. For MdeModulePkg along, this creates
1,000 lines of logs, just saying which file is being parsed.

This is noise in the log, so this commit downgrades the print to
user information, which is not printed by default.
```

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-09-17 16:01:29 +00:00
d347a7e8bc BaseTools/VfrCompile: Fix compiler warning C++17 does not allow register
The register keyword was deprecated in C++11 and removed in C++17,
which causes multiple compiler warnings when building VfrCompile:

"ISO C++17 does not allow ‘register’ storage class specifier".

Resolve the warnings by removing instances of register keyword.

Signed-off-by: Vishal Oliyil Kunnil <vishalo@qti.qualcomm.com>
2025-09-17 02:11:01 +00:00
dfbb7de3c6 ArmPkg: ArmPsciMpServicesDxe: Fix MPIDR usage from CoreInfo
The `GET_MPIDR_AFFINITY_BITS` macro masks MT_BIT in ArmReadMpidr (), but
`CoreInfo[Index].Mpidr` wasn't masked by the same macro which causes a
mismatch even if it is the same MPIDR value.

This change uses the same `GET_MPIDR_AFFINITY_BITS` macro for
`CoreInfo[Index].Mpidr` to fix the core index searching logic.

Signed-off-by: Kun Qin <kuqin@microsoft.com>
2025-09-16 20:20:28 +00:00
1fc19a0d52 ArmPkg: ArmPsciMpServicesDxe: Fix core disable/enable if the timer expires
When an AP is waken up to perform some operation with a time out period
specified, the expired timer will put the core into `CpuStateFinished`
state. This will make the subsequent enable/disable AP core fail to
proceed, which is unexpected and inconsistent with the rest of the
handling in this module (`CpuStateIdle` and `CpuStateFinished` are
generally treated the same).

This change extends the accepted state of CPU to `CpuStateFinished` for
AP enable/disable interface to fix calls on timer expired APs.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-09-16 20:20:28 +00:00
c502e2c58e MdeModulePkg/UnicodeCollation: Fix uninitialized variable usage
Build failed with the below error:
error: variable 'Status' is used uninitialized when
PcdUnicodeCollation2Support is FALSE.

Fixing this issue by initializing Status unconditionally.

This is a regression issue caused by below Edk2 commit
a46697f735

Signed-off-by: HemaAnmisha <hema.anmisha.kalavakolanu@intel.com>
2025-09-16 14:46:12 +00:00
3a53c57967 StandaloneMmPkg: Optimize MM core image size alignment
It is incorrect for MM core image size alignment, it just add
alignment parameter for alignment. It will increase size if the
image size is already aligned. After optimize, it will ignore this
case.

Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Dun Tan <dun.tan@intel.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
2025-09-16 07:44:35 +00:00