Commit graph

36512 commits

Author SHA1 Message Date
Pierre Gondois
f260ae0375 ShellPkg/EfiCompress: Extract OpenFileHelper() and CompressFile()
Extract file opening and compression code into helpers.

Upon calling:
- gEfiShellProtocol->GetFileSize()
- gEfiShellProtocol->ReadFile()
the returned Status is now checked.

Upon calling AllocateZeroPool, the failed status is now set to
EFI_OUT_OF_RESOURCES.

Other than that, no functional change.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04 10:35:35 +03:00
Pierre Gondois
c089090278 ShellPkg/Pci: Extract ParsePciBdf()
Extract BDF argument parsing into a helper.

No functional change.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04 10:35:35 +03:00
Pierre Gondois
ba2f216986 ShellPkg/Pci: Extract PciEnumerateAll()
Extract the default PCI enumeration path into a helper.

No functional change.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04 10:35:35 +03:00
Pierre Gondois
42f1d004c0 ShellPkg/UefiShellDebug1: Lower indentation level in MainCmdXXX() (4/4)
This patch aims to help breaking down the long functions present in
the ShellPkg and reduce complexity/nested code and conditions.

Lower the indentation level in the newly created MainCmdXXX()
functions.

To avoid having one large commit updating all the UefiShellDebug1
commands, only update these files:
- SerMode.c
- SetSize.c
- SetVar.c
- SmbiosView/SmbiosView.c

No functional change should be induced by this patch.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04 10:35:35 +03:00
Pierre Gondois
642954d295 ShellPkg/UefiShellDebug1: Lower indentation level in MainCmdXXX() (3/4)
This patch aims to help breaking down the long functions present in
the ShellPkg and reduce complexity/nested code and conditions.

Lower the indentation level in the newly created MainCmdXXX()
functions.

To avoid having one large commit updating all the UefiShellDebug1
commands, only update these files:
- MemMap.c
- Mm.c
- Mode.c
- Pci.c

No functional change should be induced by this patch.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04 10:35:35 +03:00
Pierre Gondois
d395696428 ShellPkg/UefiShellDebug1: Lower indentation level in MainCmdXXX() (2/4)
This patch aims to help breaking down the long functions present in
the ShellPkg and reduce complexity/nested code and conditions.

Lower the indentation level in the newly created MainCmdXXX()
functions.

To avoid having one large commit updating all the UefiShellDebug1
commands, only update these files:
- Edit/Edit.c
- EfiCompress.c
- EfiDecompress.c
- LoadPciRom.c

No functional change should be induced by this patch.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04 10:35:35 +03:00
Pierre Gondois
cad93da7e5 ShellPkg/UefiShellDebug1: Lower indentation level in MainCmdXXX() (1/4)
This patch aims to help breaking down the long functions present in
the ShellPkg and reduce complexity/nested code and conditions.

Lower the indentation level in the newly created MainCmdXXX()
functions.

To avoid having one large commit updating all the UefiShellDebug1
commands, only update these files:
- Comp.c
- Cxl.c
- Dblk.c
- Dmem.c
- DmpStore.c

No functional change should be induced by this patch.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04 10:35:35 +03:00
Pierre Gondois
cebf8bc4ae ShellPkg/UefiShellDebug1: Extract MainCmdXXX() function (4/4)
This patch aims to help breaking down the long functions present in
the ShellPkg and reduce complexity/nested code and conditions.

Extract a MainCmdXXX() function for each shell command.
This command contains the possible operations the command aims
to operate. The ShellCommandRunXXX() function from which it
is extracted is only responsible of:
- initializing the shell/command environment
- parsing the command parameter and creating a Package
- freeing the Package

For the MemMap and SetVar commands, ShellCommandLineFreeVarList()
calls are removed as the Package is now freed in the caller
function: ShellCommandRunXXX().

To avoid having one large commit updating all the UefiShellDebug1
commands, only update these files:
- SerMode.c
- SetSize.c
- SetVar.c
- SmbiosView/SmbiosView.c

No functional change should be induced by this patch.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04 10:35:35 +03:00
Pierre Gondois
0b6156b43a ShellPkg/UefiShellDebug1: Extract MainCmdXXX() function (3/4)
This patch aims to help breaking down the long functions present in
the ShellPkg and reduce complexity/nested code and conditions.

Extract a MainCmdXXX() function for each shell command.
This command contains the possible operations the command aims
to operate. The ShellCommandRunXXX() function from which it
is extracted is only responsible of:
- initializing the shell/command environment
- parsing the command parameter and creating a Package
- freeing the Package

For the MemMap and SetVar commands, ShellCommandLineFreeVarList()
calls are removed as the Package is now freed in the caller
function: ShellCommandRunXXX().

To avoid having one large commit updating all the UefiShellDebug1
commands, only update these files:
- MemMap.c
- Mm.c
- Mode.c
- Pci.c

No functional change should be induced by this patch.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04 10:35:35 +03:00
Pierre Gondois
5bdbf4462b ShellPkg/UefiShellDebug1: Extract MainCmdXXX() function (2/4)
This patch aims to help breaking down the long functions present in
the ShellPkg and reduce complexity/nested code and conditions.

Extract a MainCmdXXX() function for each shell command.
This command contains the possible operations the command aims
to operate. The ShellCommandRunXXX() function from which it
is extracted is only responsible of:
- initializing the shell/command environment
- parsing the command parameter and creating a Package
- freeing the Package

For the MemMap and SetVar commands, ShellCommandLineFreeVarList()
calls are removed as the Package is now freed in the caller
function: ShellCommandRunXXX().

To avoid having one large commit updating all the UefiShellDebug1
commands, only update these files:
- Edit/Edit.c
- EfiCompress.c
- EfiDecompress.c
- HexEdit/HexEdit.c
- LoadPciRom.c

No functional change should be induced by this patch.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04 10:35:35 +03:00
Pierre Gondois
6d0ef532c6 ShellPkg/UefiShellDebug1: Extract MainCmdXXX() function (1/4)
This patch aims to help breaking down the long functions present in
the ShellPkg and reduce complexity/nested code and conditions.

Extract a MainCmdXXX() function for each shell command.
This command contains the possible operations the command aims
to operate. The ShellCommandRunXXX() function from which it
is extracted is only responsible of:
- initializing the shell/command environment
- parsing the command parameter and creating a Package
- freeing the Package

For the MemMap and SetVar commands, ShellCommandLineFreeVarList()
calls are removed as the Package is now freed in the caller
function: ShellCommandRunXXX().

To avoid having one large commit updating all the UefiShellDebug1
commands, only update these files:
- Comp.c
- Cxl.c
- Dblk.c
- Dmem.c
- DmpStore.c

No functional change should be induced by this patch.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04 10:35:35 +03:00
Pierre Gondois
cb7f7262d5 ShellPkg/Mm: Remove unnecessary goto
If ShellCommandLineParse() fails, there is no need to free:
- InputStr
- Package
Remove the goto statement.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04 10:35:35 +03:00
Pierre Gondois
adad73339d ShellPkg/ShellDebug1: Rationalize Package init/free
Package is sometimes initialized to NULL and only
freed if not NULL. Remove these as:
- Package is initialized in ShellCommandLineParse().
- If ShellCommandLineFreeVarList() is reached,
  Package cannot be NULL.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04 10:35:35 +03:00
Pierre Gondois
c827978910 ShellPkg/LoadPciRom: Fix memory leak
Package is never freed.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04 10:35:35 +03:00
Pierre Gondois
6dea226953 ShellPkg/UefiShellDebug1: Return if ShellCommandLineParse() failed (4/4)
This patch aims to help breaking down the long functions present in
the ShellPkg and reduce complexity/nested code and conditions.

Return directly if ShellCommandLineParse() returned an error Status.
In such case, the "Package" that should be allocated by
ShellCommandLineParse() is already freed in:
ShellCommandLineParse()
\-ShellCommandLineParseEx()
\-InternalCommandLineParse()
so there is no need to free it with ShellCommandLineFreeVarList().

To avoid having one large commit updating all the UefiShellDebug1
commands, only update these files:
- SerMode.c
- SetSize.c
- SetVar.c
- SmbiosView/SmbiosView.c

No functional change should be induced by this patch.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04 10:35:35 +03:00
Pierre Gondois
da181122b1 ShellPkg/UefiShellDebug1: Return if ShellCommandLineParse() failed (3/4)
This patch aims to help breaking down the long functions present in
the ShellPkg and reduce complexity/nested code and conditions.

Return directly if ShellCommandLineParse() returned an error Status.
In such case, the "Package" that should be allocated by
ShellCommandLineParse() is already freed in:
ShellCommandLineParse()
\-ShellCommandLineParseEx()
\-InternalCommandLineParse()
so there is no need to free it with ShellCommandLineFreeVarList().

To avoid having one large commit updating all the UefiShellDebug1
commands, only update these files:
- MemMap.c
- Mm.c
- Mode.c
- Pci.c

No functional change should be induced by this patch.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04 10:35:35 +03:00
Pierre Gondois
d23559e847 ShellPkg/UefiShellDebug1: Return if ShellCommandLineParse() failed (2/4)
This patch aims to help breaking down the long functions present in
the ShellPkg and reduce complexity/nested code and conditions.

Return directly if ShellCommandLineParse() returned an error Status.
In such case, the "Package" that should be allocated by
ShellCommandLineParse() is already freed in:
ShellCommandLineParse()
\-ShellCommandLineParseEx()
\-InternalCommandLineParse()
so there is no need to free it with ShellCommandLineFreeVarList().

To avoid having one large commit updating all the UefiShellDebug1
commands, only update these files:
- Edit/Edit.c
- EfiCompress.c
- EfiDecompress.c
- HexEdit/HexEdit.c
- LoadPciRom.c

No functional change should be induced by this patch.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04 10:35:35 +03:00
Pierre Gondois
7ee84dc437 ShellPkg/UefiShellDebug1: Return if ShellCommandLineParse() failed (1/4)
This patch aims to help breaking down the long functions present in
the ShellPkg and reduce complexity/nested code and conditions.

Return directly if ShellCommandLineParse() returned an error Status.
In such case, the "Package" that should be allocated by
ShellCommandLineParse() is already freed in:
ShellCommandLineParse()
\-ShellCommandLineParseEx()
\-InternalCommandLineParse()
so there is no need to free it with ShellCommandLineFreeVarList().

To avoid having one large commit updating all the UefiShellDebug1
commands, only update these files:
- Comp.c
- Cxl.c
- Dblk.c
- Dmem.c
- DmpStore.c

No functional change should be induced by this patch.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04 10:35:35 +03:00
Pierre Gondois
4e1e739338 ShellPkg/Ls: Remove double-free calls
Package is always freed in ShellCommandRunLs().
Remove calls to ShellCommandLineFreeVarList() in MainCmdLs().

This double-free was introduced in:
commit 531b0aa002 ("ShellPkg/UefiShellLevel2:
Extract MainCmdXXX() function")

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04 10:35:35 +03:00
Pierre Gondois
a3da9cde61 ShellPkg/Edit: Remove unused code snippet
The commented out code snippet seems to try to create a new file
with the user input filename. FileBufferRead() seems to have replaced
this code snippet in a better wrapper:
- if the file exists, open it
- otherwise, create the file

Remove the commented-out code snippet.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04 10:35:35 +03:00
rdiaz
f7052e2d02 SecurityPkg: Remove global use pre-memory
Updated Tpm2DeviceLibFfa to no longer use globals. Updated the
SEC version of Tpm2DeviceLibFfaBase to no longer use globals
when including TPM libraries in the SEC phase. Includes various
cleanup regarding the updated files.

Signed-off-by: Raymond Diaz <raymonddiaz@microsoft.com>
2026-08-03 20:16:00 +00:00
Qihang Gao
ae8814ff6b OvmfPkg/LoongArchVirt: Add Hash2DxeCrypto to satisfy TcpDxe dependency
The TcpDxe driver requires the Hash2 protocol to be available for its
dispatch. On the LoongArchVirt QEMU platform, this protocol was not
previously included, leading to failures when the network stack attempted
to initialize.

Add SecurityPkg/Hash2DxeCrypto to both the DSC and FDF files, ensuring
that the Hash2 protocol is installed and can be consumed by TcpDxe.

Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
2026-08-03 11:07:16 +00:00
Herve ELTER
0af5cb9cd0 SecurityPkg/Tcg: Use TPM names in setup strings
Use TPM 1.2 and TPM 2.0 in setup titles instead of the
implementation-facing TCG and TCG2 names.

Signed-off-by: Herve ELTER <rvnvv74@gmail.com>
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2026-08-03 03:56:36 +00:00
Mikey Strauss
4bd628ce98 SecurityPkg/DeviceSecurity: Update libspdm submodule to 3.8.2
The libspdm submodule was pinned at 3.7.0 (2025-04-03), three releases behind
upstream 3.8.2 (2026-04-03). libspdm processes untrusted responder (device)
data in the SPDM device attestation path, so tracking upstream keeps that
parsing current with fixes and hardening.

Two responder-side advisories were resolved between 3.7.0 and 3.8.2:
  - GHSA-j54w-759w-xj3m: out-of-bounds write in GET_CSR handling.
  - GHSA-m4wc-xmvg-369f: integer overflow / out-of-bounds read in
    GET_MEASUREMENT_EXTENSION_LOG handling.
Both are responder-side. edk2 links SpdmRequesterLib (it acts as the SPDM
Requester that verifies an untrusted device Responder), so these responder
handlers are not built into edk2 images; this update is defense-in-depth
rather than a fix for a path reachable in edk2 today.

The libspdm sources referenced by the SpdmLib INFs are unchanged in 3.8.2
(the only additions are the optional ENDPOINT_INFO capability sources, which
edk2 does not enable), so no INF change is required.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Chris Fernald <chfernal@microsoft.com>

Signed-off-by: Mikey Strauss <mdstrauss91@gmail.com>
2026-08-03 01:40:40 +00:00
Phil Noh
d45f882a1b BaseTools: Fix Clang -Wtautological-overlap-compare in PcdValueInit.c
For each structured-PCD field copied via memcpy, DscBuildData.py
emits the clamp expression, '(FieldSize > 0 && FieldSize < ValueSize) ?
FieldSize : ValueSize'. When ValueSize == 1 and FieldSize is unsigned,
it reduces to (FieldSize > 0 && FieldSize < 1) - always-false comparison.

Clang flags it under -Wtautological-overlap-compare, and because
PcdValueInit builds with -Werror, autogen fails and the build aborts with
'PcdValueInit.c: error: overlapping comparisons always evaluate to false
[-Werror,-Wtautological-overlap-compare]'. This is specific to Clang host.

To fix it, this update changes '<' to '<=' at all five generator sites in
DscBuildData.py (GenerateDefaultValueAssignFunction,
GenerateInitValueFunction, GenerateCommandLineValue,
GenerateModuleScopeValue, GenerateFdfValue). Behavior is unchanged:
both branches copy the same byte count when FieldSize == ValueSize.
GCC and MSVC builds are unaffected.

Signed-off-by: Phil Noh <Phil.Noh@amd.com>
2026-08-01 16:17:54 +00:00
Gerd Hoffmann
6c4a9a7659 OvmfPkg/EmuVariableFvbRuntimeDxe: fix ValidateFvHeader in tdx mode
In TDX mode MmioRead* functions can not access memory, so avoid that.
See added source code comments for details.

Fixes: 0917ddad25 ("OvmfPkg/EmuVariableFvbRuntimeDxe: avoid accessing varstore header with cmp")
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2026-08-01 14:22:23 +00:00
Nick Owens
46591c981f OvmfPkg/RiscVVirt: Add Hash2DxeCrypto for TcpDxe
TcpDxe depends on gEfiHash2ServiceBindingProtocolGuid, which nothing on
the platform produces, so it is built into the FV but never dispatched.
Add Hash2DxeCrypto, as ArmVirtQemu does. The rest of NetworkPkg depends
on gEfiRngProtocolGuid, produced by VirtioRngDxe when the VM is given a
virtio-rng device.

Signed-off-by: Nick Owens <mischief@offblast.org>
2026-08-01 13:04:49 +00:00
Michael D Kinney
3120fb4b69 UefiCpuPkg/CpuDxeRiscV64: Read hardware state in GetInterruptState
Fix CpuGetInterruptState() to read the actual hardware interrupt flag
(sstatus.SIE) via BaseLib's GetInterruptState() instead of returning a cached
boolean variable. The cached variable becomes stale in interrupt context
where hardware disables interrupts without going through the protocol's
DisableInterrupt() call.

This is a PI Spec conformance fix: EFI_CPU_ARCH_PROTOCOL.GetInterruptState()
is specified to return the current processor interrupt state.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2026-08-01 09:48:12 +00:00
Michael D Kinney
d91dff7cbe UefiCpuPkg/CpuDxe: Read hardware interrupt state in GetInterruptState
Fix CpuGetInterruptState() to read the actual hardware interrupt flag
(RFLAGS.IF) via BaseLib's GetInterruptState() instead of returning a cached
boolean variable. The cached variable becomes stale in interrupt context
where hardware disables interrupts without going through the protocol's
DisableInterrupt() call.

This is a PI Spec conformance fix: EFI_CPU_ARCH_PROTOCOL.GetInterruptState()
is specified to return the current processor interrupt state.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2026-08-01 09:18:09 +00:00
Gerd Hoffmann
3f97b8bc7f MdeModulePkg/SmbiosDxe: fix table length check
In case EntryPointStructure does not exist yet use a length of zero instead of
skipping the check altogether.  Fixes a heap overflow in the following code
flow in case the first smbios table installed is larger than
SMBIOS_TABLE_MAX_LENGTH.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2026-08-01 04:35:21 +00:00
Theo
bc71cc972d MdeModulePkg/NvmExpressHci.c: Save time when BIOS reset with NVMes
Dispatch Shutdown Notification to every NVMe first, then polling
every NVMe t omaake sure all NVMe's shutdown processing is
completed.This will help to save a lot time when BIOS trigger
reset for Servers whose have many NVMes. Tested on a platform
with AMD EPYC cpu with 26 NVMes, this method reduce reset time
from 3 minutes to 10 seconds.

Signed-off-by: Theo <theo.tao@foxmail.com>
2026-08-01 03:58:29 +00:00
Pierre Gondois
21063e6b23 DynamicTablesPkg: Remove ACPI_AML_STA_PROC_SUPPORTED
Remove the ACPI_AML_STA_PROC_SUPPORTED macro to make use
of the new MdePkg macro: ACPI_AML_STA_BASE_SUPPORTED.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-07-31 17:24:16 +00:00
Pierre Gondois
475ed476ac DynamicTablesPkg: Add support for _STA in SSDT topology tables
Make use of the previously introduced StaToken field to
generate a _STA method describing the status of a processor
or processor container.
staSupp

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-07-31 17:24:16 +00:00
Pierre Gondois
d2936e9efa DynamicTablesPkg: Add StaToken to ProcHierarch CmObj
Add a new StaToken field to CM_ARCH_COMMON_PROC_HIERARCHY_INFO
CmObj, allowing to describe the ASL "_STA" value the processor
or processor container should return.

CM_X64_LOCAL_APIC_X2APIC_INFO.StaToken already allows to reference
a StaToken from a X2APIC CmObj. If ProcHierarchy objects are used,
the SSDT CPU topology table will be generated using the X2APIC
objects, so the new field should not collide with the new one.
Add a note to CM_X64_LOCAL_APIC_X2APIC_INFO.StaToken
to handle this case.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-07-31 17:24:16 +00:00
Pierre Gondois
0d9c10b3a2 MdePkg: Update AML _STA macros
Add a ACPI_AML_STA_DEVICE_STATUS_PRESENT macro without typo,
the previous one should be removed ultimately.

Introduce macros for _STA supported bits:
- STA_BASE_SUPPORTED
- STA_SUPPORTED

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-07-31 17:24:16 +00:00
Jeff Brasen
ca8de19382 MdeModulePkg: MemoryBins: make GoogleTest page-granularity aware
MemoryBinGoogleTest.PopulatesFromValidHob asserted fixed page counts for
each memory type.  PopulateMemoryTypeInformation, however, rounds the
runtime memory types (EfiReservedMemoryType, EfiACPIMemoryNVS,
EfiRuntimeServicesCode, EfiRuntimeServicesData) up to
RUNTIME_PAGE_ALLOCATION_GRANULARITY.  That granularity equals EFI_PAGE_SIZE
on IA32/X64, so the hard-coded values happened to match, but it is 64 KiB
on AArch64, where the same inputs round up to different page counts and the
test failed.

Compute the expected page counts with the same granularity rounding the
production code uses, so the test passes on all host architectures instead
of only x86.

Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
2026-07-31 15:16:47 +00:00
Jeff Brasen
6a4e543b09 SecurityPkg/Test: add AARCH64 to host test DSC
Add AARCH64 to SUPPORTED_ARCHITECTURES so the SecurityPkg
host-based unit tests build and run on an AARCH64 host.  Depends
on the AARCH64 host-test framework enablement
(UnitTestFrameworkPkg/MdePkg).

Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
2026-07-31 15:16:47 +00:00
Jeff Brasen
10732648fb SecurityPkg/Test: use BaseRngLibNull for AARCH64 host tests
BaseRngLib's AARCH64 backend uses an RNDR instruction path that does not
link in the host environment.  Map RngLib to BaseRngLibNull for AARCH64
host builds (IA32/X64 keep BaseRngLib) and hoist the common RngLib mapping
so the per-component override can be dropped.

Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
2026-07-31 15:16:47 +00:00
Jeff Brasen
158c70987b CryptoPkg/BaseCryptLib: add AARCH64 host unit test Rand source
The host-based BaseCryptLib instance (UnitTestHostBaseCryptLib.inf) built
Rand/CryptRandTsc.c only for IA32/X64.  Add Rand/CryptRand.c for AARCH64 so
the openssl-backed RandomSeed() is available when linking AARCH64 host
tests, and advertise AARCH64 in VALID_ARCHITECTURES.

Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
2026-07-31 15:16:47 +00:00
Kun Qin
2da91c23b9 PrmPkg: Host Test: Adding AArch64 target
This change adds the AArch64 target for host based unit tests.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2026-07-31 15:16:47 +00:00
Kun Qin
2c74b5ecc9 DynamicTablesPkg: Host Test: Adding AArch64 target
This change adds the AArch64 target for host based unit tests.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2026-07-31 15:16:47 +00:00
Kun Qin
4eba9cd69c DynamicTablesPkg: AcpiDbg2Lib: Adding host based instance
The current instance does not support host based test on AArch64 host
system due to its dependency on hardware UART library.

This change created a new instance that does not initialize the serial
port for host based test applications.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2026-07-31 15:16:47 +00:00
Kun Qin
a57c5b6da4 FmpDevicePkg: Host Test: Adding AArch64 target
This change adds the AArch64 target for host based unit tests.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2026-07-31 15:16:47 +00:00
Kun Qin
47c48984c5 MdeModulePkg: Host Test: Adding AArch64 target
This change adds the AArch64 target for host based unit tests.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2026-07-31 15:16:47 +00:00
Kun Qin
6c1505be64 MdePkg: Host Test: Adding AArch64 target
This change adds the AArch64 target for host based unit tests.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2026-07-31 15:16:47 +00:00
Kun Qin
8cdd6f77b7 UnitTestFrameworkPkg: Test: Adding AArch64 target
This change adds the AArch64 target for host based unit tests.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2026-07-31 15:16:47 +00:00
Kun Qin
56e1e04202 UnitTestFrameworkPkg: FunctionMockLib: Do not support AArch64
Current FunctionMockLib is relying on the subhoob module to support the
backend operation by bitbanging the binary post-disassembly.

However subhook module is a x64 centric module and does not support
AArch64 usage.

This change removes the mock function support for AArch64. The
functionality will need other solutions to be properly supported.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2026-07-31 15:16:47 +00:00
Kun Qin
26800658df UnitTestFrameworkPkg: UnitTestDebugAssertLib: GCC support for AArch64
This change adds the GCC compiler flag for AArch64 targets.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2026-07-31 15:16:47 +00:00
Kun Qin
476c89e564 UnitTestFrameworkPkg: CmockaLib: Support float operations
This change adds the support of float operations for AArch64 host based
unit tests by overriding the compiler flags.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2026-07-31 15:16:47 +00:00
Kun Qin
4d024b0cde UnitTestFrameworkPkg: SampleUnitTestGenerateException: Fix for AArch64
AArch64 does not generate divide-by-zero exceptions like x86. Yet the
current generate exception test is using this operation to attempt
triggering exceptions.

This change abstracted the exception generation logic into per-arch
files and use undefined instruction to trigger AArch64 exceptions.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2026-07-31 15:16:47 +00:00