Commit Graph

35018 Commits

Author SHA1 Message Date
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
1780373897 MdeModulePkg/DxeMain: Add debug code for Event Group notify functions
There are a lot of notify callback events for Event Groups. Usually they
are not reported unless there is a debug code in the callback itself.
The debug message helps to check which/when the callback is registered and
executed in POST. Also helps to notice the callback sequence. It depends
on DEBUG_EVENT flag enabled by PcdFixedDebugPrintErrorLevel PCD token.

Signed-off-by: Phil Noh <Phil.Noh@amd.com>
2025-09-16 09:09:24 +08:00
282a324bf4 MdeModulePkg/ArmFfaLib: Add MemoryAllocationLib
ArmFfaRxTxMap.c is built by both ArmFfaPeiLib and ArmFfaDxeLib.

ArmFfaSecRxTxMap.c is built by ArmFfaSecLib.

ArmFfaStandaloneMmRxTxMap.c is built by ArmFfaStandaloneMm*Lib.

The files depend on `MemoryAllocationLib` APIs such as
`AllocateAlignedPages()`. This change adds `MemoryAllocationLib` to
those library INF files.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-09-12 07:31:53 +00:00
2558af552d MdeModulePkg/ArmFfaLib: Add HobLib to StMm instances
ArmFfaCommon.c is built by both ArmFfaStandaloneMmCoreLib and
ArmFfaStandaloneMmLib. It links against HobLiib APIs such as
`GetFirstHob()`. Right now, the symbols fail to link:

```
lld-link: error: undefined symbol: GetFirstHob
          ArmFfaStandaloneMmCoreLib.lib(ArmFfaCommon.obj)
```

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-09-12 07:31:53 +00:00
615e5ca40a EmbeddedPkg/PrePiLib: minor cleanup in FfsProcessSection ()
Drop an else wrapper in FfsProcessSection () on the other side of
an if-statemenmt that is an error return.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-09-11 21:05:29 +00:00
24fd71dcaa EmbeddedPkg/PrePiLib: eliminate unneeded variable in FfsProcessSection ()
The "Found" variable provided only a deferred form of success handling, so
eliminate it to improve readability.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-09-11 21:05:29 +00:00
6b19b447c5 EmbeddedPkg/PrePiLib: refactor FfsProcessSection ()
Create some helper functions to make FfsProcessSection at least halfway
readable by both humans and compilers.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-09-11 21:05:29 +00:00
4a1dca59f6 OvmfPkg/ResetVector: reorganize #vc exit handler setup.
Move setup + teardown of the #vc exception handler to separate
functions.  Setup as early as possible (right after entering 32-bit
mode).  Teardown as late as possible (right before entering 64-bit
mode).

This makes the cpuid instruction work in all 32-bit code, no matter
what mode (native/TDX/SEV) the code is running in.  Specifically
the TDX probe code works properly in SEV mode because the #vc handler
emulates the instruction properly.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2025-09-11 19:32:07 +00:00
6d90162e28 OvmfPkg/ResetVector: move ReloadFlat32 call
Move the call from IntelTdx.asm to Main.asm.  This is needed when using
the Main32 entry point.  Right now is used in TDX mode only, but this
can potentially used by other modes (native, SEV) too.  So prepare for
that.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2025-09-11 19:32:07 +00:00
ea5a8582e7 OvmfPkg/MemFd: switch Microvm build to include
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2025-09-11 17:47:40 +00:00
f8953fd9bd OvmfPkg/MemFd: switch OvmfPkgIa32X64 build to include
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2025-09-11 17:47:40 +00:00
4b1711d431 OvmfPkg/MemFd: add AmdSev changes, switch AmdSev build to include
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2025-09-11 17:47:40 +00:00
9d282ec2d9 OvmfPkg/MemFd: move MEMFD config from OvmfPkgX64 to include file
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2025-09-11 17:47:40 +00:00
502f0dfda4 OvmfPkg: Add NETWORK_ISCSI_DEFAULT_ENABLE build flag
REF: https://github.com/tianocore/edk2/issues/11483

Introduce a new build flag NETWORK_ISCSI_DEFAULT_ENABLE to control
whether iSCSI support is enabled by default without setting fwcfg. This
allows developers to decide at build time if the IScsiDxe driver should be
included and enabled by default.

If NETWORK_ISCSI_DEFAULT_ENABLE is set to FALSE, IScsiDxe will still be
built when NETWORK_ISCSI_ENABLE is TRUE, but the default PCD value
(gUefiOvmfPkgTokenSpaceGuid.PcdEntryPointOverrideDefaultValue) will be
set to "no". This ensures iSCSI remains disabled at runtime unless enabled
explicitly by fwcfg.

This change provides more flexibility for both build-time and runtime
configuration of iSCSI support.

Signed-off-by: Richard Lyu <richard.lyu@suse.com>
2025-09-11 08:19:20 +00:00
10b310f9b2 StandaloneMmPkg/Ipl: Do not check return status of MmCore's entry point
Per PI spec the entry point of standalone MM core returns "VOID".
So it's not right to check the return status of MM core's entry point.
In rare case, it might hit assertion as the MM core's entry point has
no responsibility to reset RAX to 0 (in x64 arch).

Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Dun Tan <dun.tan@intel.com>
Cc: Eduardo Cuevas Farfan <eduardo.cuevas.farfan@intel.com>
2025-09-10 11:36:10 +00:00
9b931ae81f FmpDevicePkg/Library: Correct comment description
Correct comment description.
Signed-off-by: Damien Chen <inkfan130924783@gmail.com>
2025-09-10 01:36:29 +00:00
b471ed2969 ArmVirtPkg: Drop ARM Virtual Platforms
Per the additional suggestion in RFC
https://edk2.groups.io/g/devel/topic/rfc_remove_ovmf_ia32_and/114152215,
this drops ARM 32 bit virtual platforms. The full rationale
is included in the RFC.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-09-09 18:49:32 +00:00
1fb88ffe28 OvmfPkg: Remove OVMF IA32
This commit removes OVMF IA32 from edk2 per RFC
https://edk2.groups.io/g/devel/topic/rfc_remove_ovmf_ia32_and/114152215.

OVMF IA32 is a 32 bit only platform that no longer represents the vast
majority of physical platforms. The RFC details more reasoning in
much more depth.

OVMF IA32 will be kept in a branch off the edk2-stable202508 tag for
any long term consumers; it will receive build break updates only
(e.g. if an upstream submodule changes location).

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-09-09 18:49:32 +00:00
20f24c0f67 OvmfPkg/MemEncryptSevLib: Check if SEV-SNP coherency mitigitation is needed
CPUID bit Fn8000001F_EBX[31] defines the COHERNECY_SFW_NO CPUID bit that,
when set, indicates that the software mitigation for this vulnerability is
not needed.

Add support to check for this CPUID bit and avoid the mitigation if set.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
2025-09-09 17:43:31 +00:00
f41f938b35 OvmfPkg/ResetVector: Make ReceivedVc a flag in SEV-ES workarea
In preparation for adding another indicator flag, change the ReceivedVc
field into a flags field. Since the code is used by both assembler and
C files, use bitmasks for field definitions. The VC flag is bit 0.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
2025-09-09 17:43:31 +00:00
07ba06fdf7 MdePkg: Add the COHERENCY_SFW_NO CPUID bit field
Update the CPUID 0x8000001F EBX definition to add the COHERENCY_SFW_NO
bit field. The COHERENCY_SFW_NO bit is used to indicate that the SEV-SNP
cache coherency mitigation is not needed.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
2025-09-09 17:43:31 +00:00
3b0d834db2 OvmfPkg/MemEncryptSevLib: Evict cache lines during SNP memory validation
An SNP cache coherency vulnerability may require a mitigation to evict
cache lines after memory has been validated. Perform this mitigation
after having validated memory.

CVE-2024-36331

Signed-off-by: Michael Roth <michael.roth@amd.com>
Co-developed-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
2025-09-09 17:43:31 +00:00
406aeb5a97 ShellPkg/SmbiosView: Add decode for DSP0134 SMBIOS Spec v3.9.0
Add decode for Type17 Memory based on SMBIOS Spec v3.9.0

Signed-off-by: Giri Mudusuru <girimudusuru@microsoft.com>
2025-09-09 10:39:33 +00:00
9e1c211b6c MdePkg/IndustryStandard: Define enums for DSP0134 SMBIOS Spec v3.9.0
Add new enums for Type3 Chassis & Type17 Memory

Signed-off-by: Giri Mudusuru <girimudusuru@microsoft.com>
2025-09-09 10:39:33 +00:00
5739530817 MdePkg: Add MockSpiNorFlashProtocol
Add MockSpiNorFlashProtocol for google test components to use.

Signed-off-by: PaddyDeng <paddydeng@ami.com>
2025-09-09 16:15:39 +08:00
f5d3291379 Maintainers.txt: Add vishalo as reviewer for AARCH64 support
Add vishalo as reviewer for ArmPkg, and ARM/AARCH64 support code in MdePkg.

Signed-off-by: Vishal Oliyil Kunnil <vishalo@qti.qualcomm.com>
2025-09-08 19:59:25 +00:00
d7832b4800 MdeModulePkg: consider UNSUPPORTED return as valid in ArmFfaStandaloneMmLib
commit b534cabbda ("ArmFfaLib: Add Rx/Tx support for Stmm secure partition")
makes ArmFfaStandlaoneMm(Core)Lib map Rx/Tx buffer in its constructor.

This makes a failure of loading StandaloneMm in legacy platform
which doesn't implements Rx/Tx buffer related API since it doesn't need to.

StandaloneMm could be only service provider not cosumer in some platform
where doesn't need to map RxTx buffer.
Therefore, Considier EFI_UNSUPPORTED return in ArmFfaStandaloneMmLib's
constructor.

Fixes: b534cabbda ("ArmFfaLib: Add Rx/Tx support for Stmm secure partition")
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2025-09-09 01:09:48 +10:00
d8e875e625 Global: fix ArmFfaLibRun() caller couldn't get ret-args
When ArmFfaLibDirectMsgReq(2) is preempted, caller of these functions
should resume it works via ArmFfaLibRun() and the secure partition
will be return with FFA_DIRECT_MSG_RESP(2) with return arguments.

However, since ArmFfaLibRun() gets its return in its stack variable,
So caller of ArmFfaLibRun() doesn't get the return arguments from
secure partition.

To resolve this, add output parameter to ArmFfaLibRun() to
receive return arguments.

Continuous-integration-options: PatchCheck.ignore-multi-package
Fixes: 5d1b38dd07 ("ArmPkg: Add ArmFfaLib used in Dxe driver")
Reported-by: Mariam Elshakfy <Mariam.Elshakfy@arm.com>
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2025-09-08 13:14:00 +00:00
57230fff6b ArmPlatformPkg,EmbeddedPkg,MdeModulePkg: Move RealTimeClockLib header
RealTimeClockLib is an architectural implementation that is not
restricted to the embedded segment or any platform in particular.

So the header has been moved to MdeModulePkg.
And the package has been added to the relevant INF files.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Sachin Ganesh <sachinganesh@ami.com>
2025-09-08 16:54:42 +08:00
438045682b MdePkg/Inclde: Deprecate EFI_UNICODE_COLLATION_PROTOCOL_GUID
EFI_UNICODE_COLLATION_PROTOCOL_GUID is deprecated in the
previous commit. Hence, removing related guid definition.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-09-05 13:50:50 +00:00
cf5f907cd5 ShellPkg: Deprecate EFI_UNICODE_COLLATION_PROTOCOL_GUID
As EFI_UNICODE_COLLATION_PROTOCOL_GUID is being deprecated.
Remove the instances used in ShellPkg.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-09-05 13:50:50 +00:00
a46697f735 MdeModulePkg: Deprecate EFI_UNICODE_COLLATION_PROTOCOL_GUID
Adding to the previous commit deprecating
EFI_UNICODE_COLLATION_PROTOCOL_GUID in MdeModulePkg.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-09-05 13:50:50 +00:00
9898567e2b FatPkg/EnhanceFatDxe:Deprecate EFI_UNICODE_COLLATION_PROTOCOL_GUID
EFI_UNICODE_COLLATION_PROTOCOL_GUID was deprecated in favor of
a newer version EFI_UNICODE_COLLATION_PROTOCOL2_GUID which
provides improved language support and better extensibility.

It was officially removed from UEFI specifications
2.10A and 2.11 and should no longer be used in
current implementations.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-09-05 13:50:50 +00:00
8bd3787e4b MdePkg/Include: Deprecate EFI_DEVICE_IO_PROTOCOL
EFI_DEVICE_IO_PROTOCOL is deprecated in the previous commit.
Hence, removing related header file and guid definition.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-09-05 13:50:50 +00:00
e27779e2c1 ShellPkg/Library: Deprecate EFI_DEVICE_IO_PROTOCOL
gEfiDeviceIoProtocolGuid identifies EFI_DEVICE_IO_PROTOCOL,
which provided low-level I/O and MMIO access for UEFI drivers.

It was removed in UEFI 2.10A and 2.11 due to overlapping
functionality with modern protocols like EFI_PCI_IO_PROTOCOL
and EFI_CPU_IO2_PROTOCOL. These newer protocols offer improved
modularity, abstraction, and safety, making EFI_DEVICE_IO_PROTOCOL
obsolete.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-09-05 13:50:50 +00:00
80fddcaeb8 MdePkg/Include: Deprecate UNICODE_COLLATION_INTERFACE
Remove UNICODE_COLLATION_INTERFACE typedef
since unused and removed from UEFI 2.10A
and 2.11 specifications.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-09-05 13:50:50 +00:00
b1e018c0ad MdePkg/Include: Deprecate EFI_NVDIMM_LABEL_FLAGS_UPDATING
The EFI_NVDIMM_LABEL_FLAGS_UPDATING flag is used in UEFI
to indicate that an update was in progress across multiple
Label Storage Areas (LSAs) on NVDIMM devices.

Its purpose was to help ensure atomicity in the event of
interruptions like power loss or system crashes.

It is deprecated in UEFI 2.10 and 2.11, as label index blocks
and checksums now provide better atomicity and consistency
without requiring this flag.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-09-05 13:50:50 +00:00
a860818324 MdePkg/Include: Deprecate EFI_NVDIMM_LABEL_FLAGS_RESERVED
EFI_NVDIMM_LABEL_FLAGS_RESERVED is a reserved bit in
the NVDIMM label flags field, intended for future use.
It was removed in UEFI 2.10A and 2.11 as it had no
defined function and was unused in implementations.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-09-05 13:50:50 +00:00
ff668af879 MdePkg/Include: Deprecate EFI_IP4_CONFIG_PROTOCOL
EFI_IP4_CONFIG_PROTOCOL is deprecated in the previous commit.
Hence, removing related header file and guid definition.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-09-05 13:50:50 +00:00
c3cab06d2b ShellPkg/Library: Deprecate EFI_IP4_CONFIG_PROTOCOL
EFI_IP4_CONFIG_PROTOCOL is superseded by
EFI_IP4_CONFIG2_PROTOCOL, which provides better
support for modern network stack requirements.

It was officially removed from UEFI specifications
2.10A and 2.11 and should no longer be used in
current implementations.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-09-05 13:50:50 +00:00
85770fd453 MdePkg: Add support for PCIe Extended IDs
Add PTM (001F) structure in MdePkg.

Signed-off-by: Nanjinmoorthy <nanjinmoorthyj@ami.com>
2025-09-05 12:04:06 +00:00
c992bffaef ShellPkg: Add support for PCIe Extended IDs
Add a support to print PTM (001F) structure.

Signed-off-by: Nanjinmoorthy <nanjinmoorthyj@ami.com>
2025-09-05 12:04:06 +00:00
338f5079f7 MdePkg: Enable CompilerIntrinsicsLib for LoongArch
When arrays are lager enough, LoongArch compilers(such as GCC or Clang)
will replace some libc functions to improve performace, which may cause
building failures. Enabling this library can link edk2's own libc
functions and fix this problem.

Signed-off-by: Chao Li <lichao@loongson.cn>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
2025-09-05 09:39:13 +00:00
6093cfcdd1 BaseTools: PatchCheck.py: Allow MultiPkg Commits For Subject Check
Subject Check was added to PatchCheck.py to enforce that if a package
was touched in a commit that it be referenced in the subject line.

However, this is impractical for multipackage commits with many
packages, e.g. when stack cookies were added, every package was
touched, but in a rote way, and it is not reasonable to put every
package in a subject line.

This updates PatchCheck.py to check if ignore_multi_package is set
and if so only require that package names be included in the subject
if there are fewer than 3 packages touched. Otherwise, PatchCheck will
require the message to start with `Global:` to indicate it touches
more than 3 packages.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-09-05 06:32:06 +00:00
d250191042 BaseTools/PatchCheck.py: Check CI Options Before Parsing
PatchCheck.py currently parses the CI options as the last
step it does before reporting results. This means that the
other checking logic cannot use any of the CI options that
are passed in.

This updates the order of operations to process CI options
before running other checks so that they can be used in
performing checks.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-09-05 06:32:06 +00:00
65485e195f UefiCpuPkg/MpInitLib: Ensure AP wake up on WakeUpByInitSipiSipi mode
If AP loop mode is not Halt loop, it is found that the AP in ApInitDone
state exits the loop mode immediately when WAKEUP_AP_SIGNAL is signaled
at the first step of AP wake up. When WakeUpByInitSipiSipi is enabled,
it is possible that the AP could clear StartupApSignal buffer before the
BSP sends Init-Startup IPI to the AP. In the case, it causes that the BSP
frees AP reset vector buffer even though AP wake up is in process. This
results in an exception error. To ensure AP wake up, it is expected that
the AP is in the known non-executable state before the AP wakeup signal.

The issue happens when the AP is disabled through the MP service of
gEfiMpServiceProtocolGuid->EnableDisableAP(FALSE) and enabled later
through gEfiMpServiceProtocolGuid->EnableDisableAP(TRUE). In the flow,
the AP that in MINOTOR-MWAIT-Loop or Run-Loop can respond to the
WAKEUP_AP_SIGNAL before the BSP sends the INIT-SIPI-SIPI.

Signed-off-by: Phil Noh <Phil.Noh@amd.com>
2025-09-04 14:31:57 +00:00
1dacf4c408 CryptoPkg: Add SNI support
Add Server Name Indication support.

Signed-off-by: Kanagavel S <Kanagavels@ami.com>
2025-09-04 08:32:34 +00:00