Commit Graph

34722 Commits

Author SHA1 Message Date
Zachary Clark-Williams
0cb71c18c5 NetworkPkg/WifiConnectionManager: net list scan ui
Commit 7c204d7 changed the behavior of the WiFi
Connection Manager. It no longer scans for available
networks when the driver loads, because scanning
during that time disrupts connections for other
features. To avoid blocking other processes, the
driver should initiate a scan only when appropriate.
This update introduces a one-time scan that occurs
when the user opens the network settings page in
the UI, enables WiFi, and then opens the network
list page to view available networks.

Signed-off-by: Zachary Clark-Williams <zachary.clark-williams@intel.com>
2025-06-25 11:49:21 +00:00
Yang Gang
579c12d7bc UefiPayloadPkg: Add missing VirtNorFlashDeviceLib instance
Signed-off-by: Yang Gang <yanggang@byosoft.com.cn>
2025-06-25 09:25:18 +00:00
Ryan Wong
5ac1dfc093 MdeModulePkg/UfsPassThruDxe: Correct size in UfsHc->FreeBuffer call
UfsHc->FreeBuffer accepts page numbers rather than bytes as its
size argument. Fix two positions where wrong size were passed.

Signed-off-by: Ryan Wong <colorfulshark@gmail.com>
2025-06-25 14:48:08 +08:00
Jean-Philippe Brucker
7d4b9f5cb1 BaseTools: Declare $(DEBUG_DIR)/<module>.efi output
$(DEBUG_DIR)/<M>.efi is generated by the recipe of
$(OUTPUT_DIR)/<M>.efi: the .efi file is generated and then copied into
$(DEBUG_DIR). At the moment the generate GNUmakefile does not declare
the dependency between these two files, which can be a problem because
$(FFS_OUTPUT_DIR)/<M>.offset depends on $(DEBUG_DIR)/<M>.efi.

Normally $(DEBUG_DIR)/<M>.efi is generated first and there is no
problem, but when an external tool builds edk2 from a Makefile, like
OP-TEE build does for instance, the parallel '-j' flag passed to Make is
inherited by the edk2 GNUmakefile from the environment. As a result Make
might try to build the $(FFS_OUTPUT_DIR)/<M>.offset target in parallel
and fail to find the .efi file:

make[1]: *** No rule to make target 'Build/ArmVirtQemu-AARCH64/DEBUG_GCC5/AARCH64/NetworkPkg/VlanConfigDxe/VlanConfigDxe/DEBUG/VlanConfigDxe.efi', needed by 'Build/ArmVirtQemu-AARCH64/DEBUG_GCC5/FV/Ffs/E4F61863-FE2C-4b56-A8F4-08519BC439DFVlanConfigDxe/VlanConfigDxe.offset'.  Stop.

If we declare the $(DEBUG_DIR) file as output of this rule, then the
generated GNUmakefile will contain the right dependency declaration:

	$(DEBUG_DIR)/VlanConfigDxe.efi: $(OUTPUT_DIR)/VlanConfigDxe.efi

and the parallel build will succeed.

Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
2025-06-25 14:37:58 +08:00
Tuan Phan
5925977a4e OvmfPkg/RiscVVirt: Add support for Capsule Firmware Upgrade
This patch introduces support for firmware upgrades using the
FMP capsule update mechanism.

Signed-off-by: Tuan Phan <tphan@ventanamicro.com>
2025-06-25 04:23:40 +00:00
Tuan Phan
26c80e55ed ArmVirtPkg: Link all targets to the new VirtNorFlashDeviceLib
Since VirtNorFlashDxe now depends on the new VirtNorFlashDeviceLib,
all related targets should be linked against this library.

Signed-off-by: Tuan Phan <tphan@ventanamicro.com>
2025-06-25 04:23:40 +00:00
Tuan Phan
6fff3da225 OvmfPkg/VirtNorFlash: Move low level NOR flash functions into library
This patch refactors low level NOR flash functions into a dedicated library
to enable reuse, particularly for supporting the firmware upgrade feature.

Signed-off-by: Tuan Phan <tphan@ventanamicro.com>
2025-06-25 04:23:40 +00:00
Tuan Phan
e64983d53d OvmfPkg/VirtNorFlash: Refactor TPL handling outside NOR flash functions
To facilitate moving the NOR flash functions into a separate library,
TPL handling is now delegated to the caller.

Signed-off-by: Tuan Phan <tphan@ventanamicro.com>
2025-06-25 04:23:40 +00:00
Zachary Clark-Williams
d82e9b7bbb WifiConnectionManagerDxe: clear timers not events
Replace timer eventclose with scan timerset in WifiConnectionManagerDxe.
This change ensures that the driver sets and manages scan timers
correctly without requiring a reload when the user enables WiFi and
initiates a scan for available networks.

By using scan timerset directly, the driver maintains consistent
behavior across WiFi sessions and avoids redundant event handling.

Signed-off-by: Zachary Clark-Williams <zachary.clark-williams@intel.com>
2025-06-25 01:21:51 +00:00
Zachary Clark-Williams
da7b74161b WifiConnectionManagerDxe: HII missing EAP TLS case
Add missing EAP-TLS option to HII configuration

Implemented support for EAP-TLS authentication in
the WifiConnectionManagerDxe HII interface. This
change ensures that the EAP-TLS option is available
for selection in the UI, addressing cases where it
was previously missing.

Signed-off-by: Zachary Clark-Williams <Zachary.Clark-Williams@intel.com>
2025-06-25 00:28:42 +00:00
Michael D Kinney
36a71d088b NetworkPkg: Use Library/GoogleTestLib.h
Update unit tests to use GoogleTestLib.h instead
of gtest.h so the edk2 extensions for google tests
are always available.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-06-24 19:32:41 +00:00
Michael D Kinney
953b9d0e57 MdePkg: Use Library/GoogleTestLib.h
Update unit tests to use GoogleTestLib.h instead
of gtest.h so the edk2 extensions for google tests
are always available.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-06-24 19:32:41 +00:00
Michael D Kinney
ecdab102c8 DynamicTablesPkg: Use Library/GoogleTestLib.h
Update unit tests to use GoogleTestLib.h instead
of gtest.h so the edk2 extensions for google tests
are always available.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-06-24 19:32:41 +00:00
Michael D Kinney
50dc5f2f31 BaseTools/GetFw: Skip R_X86_64_NONE relocations
Building .aslc files in a module for host-based unit
testing in Linux/GCC X64 environments may introduce
relocations for a symbol in a shared library from
lcov or asan.

Update logic to not generate an error message and exit
if the symbol is unknown but the relocation type is
R_X86_64_NONE.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-06-24 19:32:41 +00:00
Michael D Kinney
3f278768fa BaseTools/HostBasedUnitTestRunner: lcov ignore mismatch errors
Ignore mismatch errors for lcov 2.x in all locations that lcov
is run. When building more complex unit tests, these mismatch
errors are showing up in different phases of the code coverage
collection.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-06-24 19:32:41 +00:00
Michael D Kinney
272c1b2b5f UnitTestFrameworkPkg: Add -pie to ASLCC_FLAGS for unit tests
For Linux/GCC host-based unit tests, -fno-pei is added
to CC_FLAGS and this causes builds of .aslc/.act files for
ACPI tables used in host-based unit tests to fail. Add
-fpie to ASLCC_FLAGS in UnitTestFrameworkPkgHost.dsc.inc
to override this CC_FLAGS setting and resolve the build issue.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-06-24 19:32:41 +00:00
Michael D Kinney
b4e5860fd5 UnitTestFrameworkPkg/GoogleTestLib: Enhance unit test NULL checks
gtest.h uses standard includes that define NULL to __null. This
is different that the C++ standard that uses nullptr. Redefine
NULL in GoogleTestLib.h to use C++ form of nullptr. This allows
NULL to be used in checks and mocks without explicit typecasts.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-06-24 19:32:41 +00:00
Leif Lindholm
f93e6a0743 Revert "UefiCpuPkg/PiSmmCpuDxeSmm: Add sync barrier before BSP invokes ..."
PR #11210 introduced Commit bbee92c9af,
("UefiCpuPkg/PiSmmCpuDxeSmm: Add sync barrier before BSP invokes SmmCoreEntry")
which causes a boot failure in OVMF_X64_MMDEBUG targets, breaking upstream CI.
Revert it.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-06-24 16:11:00 +00:00
Wei6 Xu
bbee92c9af UefiCpuPkg/PiSmmCpuDxeSmm: Add sync barrier before BSP invokes SmmCoreEntry
This patch introduces a synchronization point between the BSP and APs to
ensure all APs have entered their SMM wait-loop (while (TRUE) in APHandler
()) before the BSP calls into the SMI handler logic via gSmmCpuPrivate
->SmmCoreEntry().

Previously, the BSP would invoke ReleaseAllAPs() and immediately proceed
to SmmCoreEntry() without confirming whether APs had reached the stable
waiting state. If SmmStartupThisAp() was called inside the SMI handler
shortly after ReleaseAllAPs(), it might lead to a race condition:
APs are issued two consecutive wait signals (SmmCpuSyncWaitForBsp()).
BSP sends two consecutive releases (ReleaseAllAPs() + SmmStartupThisAp())
If an AP has not yet responded to the first release, the second release may
overwrite the semaphore state, and the AP might miss the notification,
causing it to hang or behave unpredictably.

To address this:
A SmmCpuSyncWaitForAPs() is added in BSP after
mmCpuPlatformHookBeforeMmiHandler() and before entering SmmCoreEntry().
A matching SmmCpuSyncReleaseBsp() is added in AP immediately after its own
SmmCpuPlatformHookBeforeMmiHandler()

This ensures that BSP does not enter SMI handler logic or dispatch any
AP-related requests before all APs are confirmed to be idle and ready.
Debug sync point markers (e.g., /// #6, #7) are updated accordingly.
This change eliminates a subtle but critical race condition in
multi-processor/multi-socket systems during SMM entry and improves overall
synchronization safety.

Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
2025-06-20 11:03:11 +00:00
Ceping Sun
92c714f8b7 OvmfPkg/TdxDxe: Support 5-level paging for ResetVector
Since OVMF already supports 5-level paging, the ResetVector
needs to handle the case.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2025-06-20 10:23:42 +08:00
Ceping Sun
406f42cb74 OvmfPkg: Add the ResetVector in TDX MailBox
Base on ACPI 6.6 Multiprocessor Wakeup Structure, TDVF needs to provide
a physical address of the ResetVector to OS. And it should allow the
Multiprocessor Wakeup Mailbox to be reset in order to be used once again
with a given AP.

Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
Reviewed-by: Min Xu <min.m.xu@intel.com>
Tested-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
2025-06-20 10:23:42 +08:00
Ceping Sun
41aaecbf59 OvmfPkg: Add the Test command in TDX MailBox
Base on  ACPI 6.6 MultiProcessor Wakeup Mailbox Structure,
the new "Test" command is added.

Also the "Sleep" command is not used in TDX Mailbox, it should be removed.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2025-06-20 10:23:42 +08:00
Ceping Sun
8d22d1c288 OvmfPkg/WorkArea.h: Add MAILBOX_GDT
Add the GDT table to swicth paging mode when the OS jumps
to the ResetVector in Mailbox.

Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
Reviewed-by: Min Xu <min.m.xu@intel.com>
Tested-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
2025-06-20 10:23:42 +08:00
Ceping Sun
510a5c2039 MdePkg/Acpi66.h: Add ACPI 6.6 header
Create Acpi66.h, which is copied from Acpi65.h, and make the following
changes:

1. Replace all occurences of "6.5/6_5" with "6.6/6_6".
2. Add "ResetVector" in Multiprocessor Wakeup Structure.
3. Add "Test" command for Multiprocessor Wakeup Mailbox.
4. Make Acpi66.h the latest ACPI definitions that Acpi.h contains.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2025-06-20 10:23:42 +08:00
Abdul Lateef Attar
f93da07277 DynamicTablesPkg: Enhance SPCR support for interrupt and terminal types
Introduce optional configuration objects to specify interrupt and terminal types.
When the platform supplies this information,
the SPCR table is updated to reflect the provided values.

If the interrupt type is 8259,
the corresponding IRQ number is set in the SPCR table.

Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-06-19 17:43:41 +00:00
Kun Qin
e4e29690f1 OvmfPkg: README: Add documentation for Standalone MM on OVMF
This update introduces a new section in the README file, detailing the
design considerations of the recently onboarded Standalone MM platform in
OVMF.

The section is intended for future reference and should be revised
accordingly if updates to the Standalone MM framework render these
limitations obsolete.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-19 06:17:18 +00:00
Kun Qin
b25c1aa090 OvmfPkg: PlatformCI: Ovmf x64 platform with Standalone MM
This change expands the CI pipeline build to a new platform type with
Standalone MM support to ensure the incoming change works with Standalone
MM environment on x64 platforms.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-19 06:17:18 +00:00
Kun Qin
e8fe2e83f1 OvmfPkg: OvmfPkgX64: Platform changes for Standalone MM support
This change adds a build flag in the platform DSC file to support
standalone MM build on OVMF platform.

The new standalone MM platform will not support S3 boot and thus no SMM
lock box related components are included.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-19 06:17:18 +00:00
Kun Qin
00ee4b57f8 OvmfPkg: MmPlatformHobProducerLibOvmf: Ovmf specific HOB creators for Stmm
This change introduces a platform specific HOB producor library to meet
the expectation of Standalone MM core.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-19 06:17:18 +00:00
Kun Qin
187761e05d OvmfPkg: MemEncryptSevLib: Add Null instance
This change introduces a Null instance of MemEncryptSevLib to enable
platforms that do not have confidential compute support.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-19 06:17:18 +00:00
Kun Qin
4ea31ba020 OvmfPkg: QemuFlashFvbServices: Introduce Standalone MM instance
This update introduces the implementation of QemuFlashFvbServices to
support operation with Standalone MM backed platforms.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-19 06:17:18 +00:00
Kun Qin
aedcb46e6f OvmfPkg: QemuFlashFvbServicesRuntimeDxe: Abstract out SMM/DXE functions
This update refactors QemuFlashFvbServicesRuntimeDxe to abstract out
direct calls to SMM and DXE specific functions.

Specifically, dynamic PCD usage and gBS references have been moved to SMM
specific files.

The constructor functionality has been relocated to a common
implementation and is invoked from their respective entry points.

These changes lay the groundwork for supporting a Standalone MM-based
solution in the future.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-19 06:17:18 +00:00
Kun Qin
cf4534c9da OvmfPkg: SmmControl2Dxe: Avoid double initialization
This change adds a build time PCD to prevent the SmmControl2Dxe driver
from re-initialization the MM related registers.

This register is to be used when MmControlPei is already executed in PEI
phase and completed setting up the MM control registers.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-19 06:17:18 +00:00
Kun Qin
8ac270e812 OvmfPkg: MmControlPei: Introduce MM control PPI to OVMF
This change adds a PEIM that produces gEfiPeiMmControlPpiGuid to be used
in PEI phase, i.e. boot strap MM foundation.

This flow is largely in assemblence of MM control DXE driver and used the
`SmiFeatures.*` files from the DXE drivers as the common resources.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-19 06:17:18 +00:00
Kun Qin
84f140bf86 OvmfPkg: StandaloneMmCpuFeaturesLib: Introduce SmmCpuFeaturesLib for Ovmf
This change adds the implementation of SmmCpuFeaturesLib for Ovmf to
operate with Standalone MM supported platforms.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-19 06:17:18 +00:00
Kun Qin
ad46860061 OvmfPkg: SmmCpuFeaturesLib: Abstract out SMM specific implementations
This update refactors the existing SmmCpuFeaturesLib to eliminate direct
calls to SMM-specific functions.

In particular, the constructor has been relocated to traditional MM-
specific C files, utilizing a common entry point.

Furthermore, several implementation-specific functions have been
modularized into its respective C files.

These changes lay the groundwork for supporting a Standalone MM-based
solution in the future.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-19 06:17:18 +00:00
Kun Qin
d03c535745 OvmfPkg: PlatformSecureLib: Support Standalone MM core and drivers
This change extends the library to support MM_CORE_STANDALONE and
MM_STANDALONE for usage in MM standalone environment.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-19 06:17:18 +00:00
Kun Qin
a60b026a10 OvmfPkg: PlatformDebugLibIoPort: Support Standalone MM core and drivers
This change extends the library to support MM_CORE_STANDALONE and
MM_STANDALONE for usage in MM standalone environment.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-19 06:17:18 +00:00
Kun Qin
423b987253 OvmfPkg: DxeAcpiTimerLib: Support Standalone MM core and drivers
This change extends the library to support MM_CORE_STANDALONE and
MM_STANDALONE for usage in MM standalone environment.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-19 06:17:18 +00:00
Kun Qin
aba8a76a64 OvmfPkg: MemDebugLogLibNull: Support Standalone MM core and drivers
This change extends the supported types to Standalone MM and Standalone
MM Core module types to support potential MM usage.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-19 06:17:18 +00:00
Kun Qin
73b0b5edae StandaloneMmPkg: StandaloneMmIplPei: Use MM access to open the regions
Current MM IPL in PEI phase does not open the MMRAM regions through MM
access PPI. This is causing some platforms like OVMF reading all `0xFF`s
when trying to relocate the Standalone MM core.

This change opens all the MMRAM regions provided by MM access PPI and
closes + locks the regions after initial MM foundation setup, when MM
Access PPI is available.

Platforms that require MM access PPI can inject depex through libraries.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-19 06:17:18 +00:00
Kun Qin
c72d638434 StandaloneMmPkg: StandaloneMmIplPei: Prevent Freeing Zero Pages
There could be scenarios where the HOB producer does not create any HOBs.
In such cases, the buffer intended to be freed will have zero pages.

This update addresses the issue that could cause assertions during
runtime by ensuring that buffers with zero pages are not freed.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-19 06:17:18 +00:00
Rebecca Cran
c255456765 OvmfPkg: Update README with new 'TLS Auth Configuration'
'Tls Auth Configuration' is now 'TLS Auth Configuration'. Update
README to match.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2025-06-16 23:03:46 +00:00
Rebecca Cran
0dde8cd314 NetworkPkg: Change 'Tls' to 'TLS'
Sicne it's a user-visible string, change 'Tls' to 'TLS', which is
more correct.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2025-06-16 23:03:46 +00:00
Rebecca Cran
897edd165c MdeModulePkg: Add help for Reset menu item, and fix French strings
Fix the help string for the Reset menu item, and add it to the UI
instead of just repeating the main text. Fix the French translations.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2025-06-16 23:03:46 +00:00
Kevin Tsai
45010d2812 UefiPayloadPkg: fix SPI prefetch and cache disable setting
fix SPI prefetch and cache disable value and define SRC bitfield position
correct register setting in SaveAndDisableSpiPrefetchCache

Signed-off-by: Kevin Tsai <kevin.tsai@intel.com>
2025-06-16 17:31:26 +00:00
Damien
8810c3b270 edksetup.sh: Update "inux" to "Unix-like"
This commit replaces the outdated and
less common term "inux" with "Unix-like."
While "inux" historically served as an abbreviation for Unix-like systems,
the term "Unix-like" is now the widely accepted
and more precise descriptor in the industry,
as detailed by sources like Wikipedia's "Unix-like" entry.

This change enhances readability and
ensures consistency with current technical vocabulary,
making the text clearer for a broader audience.

Signed-off-by: Damien Chen <inkfan130924783@gmail.com>
2025-06-16 13:58:53 +00:00
abdattar
92bf30908f DynamicTablesPkg: Add SLIT table generator library
Introduce a common architecture SLIT table generator library
that retrieves locality domain distance information from
the configuration manager and generates the table accordingly.

Signed-off-by: abdattar <AbdulLateef.Attar@amd.com>
2025-06-16 09:31:00 +02:00
Aaron Young
b188715202 OvmfPkg: Add OVMF Memory Debug Logging to Ia32X64 and X64 OVMF builds
Add the OVMF Memory Debug Logging feature (MemDebugLogLib library
and MemDebugLogPei PEIM) to the Ia32X64 and X64 OVMF builds.

This includes reserving the "early" memory debug log buffer
in the .fdf files.

The OVMF Memory Debug Logging feature is enabled
via the -D DEBUG_TO_MEM build flag.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Aaron Young <aaron.young@oracle.com>
2025-06-13 22:19:39 +00:00
Aaron Young
44831e815c OvmfPkg: Add OVMF Mem Debug Log buffer to PEI mem cap/reserve early buffer
Add the memory debug log buffer size (pages) to
TotalPages in PlatformPei:GetPeiMemoryCap() help
ensure we don't run out of memory.

Also Reserve the "early" memory debug log buffer.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Aaron Young <aaron.young@oracle.com>
2025-06-13 22:19:39 +00:00