Commit Graph

34016 Commits

Author SHA1 Message Date
786ae76884 IntelFsp2WrapperPkg: Bootloader need to recover fs and gs
When enter FSP, bootloader need to save fs and gs, when back
to bootloader, bootloader need to restore fs and gs, so it
could avoid bootloader access wrong data segment when usging
fs and gs.

Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Duggapu Chinni B <chinni.b.duggapu@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ted Kuo <ted.kuo@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
2025-03-05 18:21:49 +00:00
b509393160 MdeModulePkg/DxeCapsuleLibFmp: Check for NULL in IsValidCapsuleHeader
Signed-off-by: Christopher Zurcher <christopher.zurcher@microsoft.com>
2025-03-03 23:00:33 +00:00
d03e9e701b CryptoPkg: Add sleep function to BaseCryptLibMbedTls Timerwrapper
Add sleep() function to BaseCryptLibMbedTls library in
Timerwrapper.c

Encountering an unresolved external symbol error for sleep while
using the BaseCryptLibMbedTls library in RuntimeDxe

Signed-off-by: Hema Anmisha <hema.anmisha.kalavakolanu@intel.com>
2025-03-03 11:34:34 +00:00
55a887297c SecurityPkg: fix possible out of bond array access in debug traces
This patch fixes
https://github.com/tianocore/edk2/issues/10533
Bugzilla #4834

Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
2025-03-03 03:14:15 +00:00
9224a2b917 MdeModulePkg/TerminalDxe: Support multiple modes for SetMode function
When the terminal driver is active, currently terminals available through
SetMode function are limited to mode 0 (80x25) despite multiple modes are
configured as MaxMode value (e.g. 3 modes in mTerminalConsoleModeData
list). Improve the function to support multiple modes based on the value.
Additionally add more modes that match with the GraphicsConsoleDxe driver.
This update is expected to help the symptom that the Setup or Shell screen
becomes smaller due to the text mode.

Signed-off-by: Phil Noh <Phil.Noh@amd.com>
2025-03-03 01:45:48 +00:00
a1b2eeb6ff CI: Install a fresh python virtual env every time (Linux)
Install a fresh python virtual environment every time to ensure
correct permissions and compatibility of the packages.
This is more robust than relying on being able to upgrade
an existing one.

Signed-off-by: Oliver Steffen <osteffen@redhat.com>
2025-02-28 18:34:59 +00:00
29f02d0161 MdeModulePkg/HiiDatabaseDxe: Prevent linker error
Prevent an issue where `memcpy()` instrinsic is being used after
recent MSVC linker update in windows-2022 VM image from 14.31.31103
to 14.32.31326.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-02-28 16:14:37 +00:00
c46bc0ea98 MdePkg/BaseMemoryLib: Prevent potential VS2022 linker failure
After updating between various VS2022 versions such as 17.4 to
17.5, , linker failures began to appear in several modules because
`memset` is an unresolved symbol.

The following functions in BaseMemoryLib/MemLibGeneric.c have their
loop pattern replaced with the `memset` intrinsic function:

- `InternalMemSetMem16()`
- `InternalMemSetMem32()`
- `InternalMemSetMem64()`

An example of an error related to `InternalMemSetMem64()` in
VariableSmmRuntimeDxe is shown below:

```
INFO - BaseMemoryLib.lib(MemLibGeneric.obj) : error LNK2001:
         unresolved external symbol memset
INFO - <...>\VariableSmmRuntimeDxe.dll : fatal error LNK1120:
         1 unresolved externals
```

This was reproduced in several environments including:

- Public VM image:
  https://github.com/actions/runner-images/blob/win22/20230226.1/images/win/Windows2022-Readme.md

- Locally when updating from 17.4.4 to 17.5.1

> Note: This image (with 17.4) does not have this issue
  https://github.com/actions/runner-images/blob/win22/20230219.1/images/win/Windows2022-Readme.md

This change updates the type cast for the destination buffer to be
a pointer to `volatile` data to prevent this optimization with a
relatively minimum delta to prior implementation.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-02-28 16:14:37 +00:00
f79218f4dd ArmVirtPkg: Add support for fw_cfg for EFI Shell
Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
2025-02-28 14:07:34 +00:00
7862dcb802 OvmfPkg: Make PlatformBootManagerLibLight use PlatformBootManagerCommonLib
Delete functions that are available in the PlatformBootManagerCommonLib
and add this Lib to dependencies in .inf file.

This is to reduce code duplication, because many functions have the same
implementation in PlatformBootManagerLib and PlatformBootManagerLibLight.

Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
2025-02-28 14:07:34 +00:00
716f150a8b OvmfPkg: Make PlatformBootManagerLib use PlatformBootManagerCommonLib
Delete functions that are available in the PlatformBootManagerCommonLib
and add this Lib to dependencies in .inf file.

This is to reduce code duplication, because many functions have the same
implementation in PlatformBootManagerLib and PlatformBootManagerLibLight.

Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
2025-02-28 14:07:34 +00:00
f3d0fd96d1 OvmfPkg: add PlatformBootManagerCommonLib to dependencies
Add PlatformBootManagerCommonLib to all target that use
PlatformBootManagerLib.

This is part of the effort to remove code present in both
PlatformBootManagerLib and PlatformBootManagerLibLight.

Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
2025-02-28 14:07:34 +00:00
05330c09d0 ArmVirtPkg: add PlatformBootManagerCommonLib to dependencies
Add PlatformBootManagerCommonLib to ArmVirtQemu and ArmVirtQemuKernel in
ArmVirtPkg.

This is part of the effort to remove code present in both
PlatformBootManagerLib and PlatformBootManagerLibLight.

Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
2025-02-28 14:07:34 +00:00
a255b52fbc OvmfPkg: Introduce PlatformBootManagerCommonLib
Many function present in PlatformBootManagerLib and
PlatformBootManagerLibLight have the same implementation. The idea of
this new Library is to collect them to enable code reuse.

Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
2025-02-28 14:07:34 +00:00
566aece5b8 ArmVirtPkg: move USB drivers to UsbComponents.dsc.inc
Use `UsbComponents.dsc.inc` for the USB driver configuration to simplify
changes across all DSC files. This also allows selective enabling or
disabling of `UsbMassStorage` through `fw_cfg`.

Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
2025-02-28 12:56:36 +00:00
de1e14856d ArmVirtPkg: move network configuration to NetworkComponents.dsc.inc
Use `NetworkComponents.dsc.inc` for the network driver configuration to
simplify changes across all DSC files. This also allows selective
enabling or disabling the support for IPv4, IPv6, VirtioNet and ISCSI
through `fw_cfg`.

Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
2025-02-28 12:56:36 +00:00
7fa3814887 RedfishPkg: Correct %g arguments in DEBUG calls
In formatted strings, %g expects a Guid*, not a Guid.  These are found
in DEBUG_MANAGEABILITY, so this was only an issue when
DEBUG_MANAGEABILITY logs were enabled.

Signed-off-by: Jake Garver <jake@nvidia.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
2025-02-28 03:10:10 +00:00
473a22d233 IntelFsp2Pkg : Set FSP-I upd data pointer to NULL as default
FSP-I upd data pointer should be set NULL as default, it could
avoid other code to use it before it was set with correct pointer.

Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Duggapu Chinni B <chinni.b.duggapu@intel.com>
Cc: Ted Kuo <ted.kuo@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
2025-02-27 16:34:33 +00:00
67fe6b41b2 MdeModulePkg/UefiBootManagerLib: Apply var policy to HDDP
Applies variable policy to the "HDDP" UEFI variable in the
mBmHardDriveBootVariableGuid vendor namespace to ensure a minimum
allowed size and expected attributes are present.

A protocol notify is used to handle different platform scenarios
where this instance of UefiBootManagerLib may be linked.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-02-27 15:41:04 +00:00
f75e6952ca ArmPkg: ArmFfaSvc: Adding missing FF-A definitions
This change added missing FF-A definitions for certain FF-A function IDs.

The `ARM_FFA_NOTIFICATION_*` and `ARM_FFA_FEATURE_*` definitions are
based on FF-A spec v1.3 ALP1.

The `ARM_FFA_MEM_PERM_RESERVED_MASK` definition is based on FF-A memory
protocol spec v1.3 ALP1.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-02-26 11:04:29 +00:00
49ae82a08e DynamicTablesPkg: AcpiMadtLibArm: Correct value of GICC.GICRBaseAddress
From the ACPI 6.5 specification
(https://uefi.org/specs/ACPI/6.5/05_ACPI_Software_Programming_Model.html#gic-cpu-interface-gicc-structure) :

"If all of the GIC Redistributors are in the always-on power domain, GICR
structures should be used to describe the Redistributors instead, and this
field must be set to 0."

To comply with this statement, zero GICC.GICRBaseAddress when GICR
structures are present in the MADT.

Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-02-26 09:28:01 +00:00
3b93347ee3 CryptoPkg: Update generated files based on openssl 3.4.1
FIX: https://github.com/tianocore/edk2/issues/10664

Signed-off-by: Li Yi <yi1.li@intel.com>
2025-02-26 06:39:16 +00:00
a59d7fa14e CryptoPkg: Update openssl submodule to 3.4.1
FIX: https://github.com/tianocore/edk2/issues/10664

CVE-2024-13176 affects ECDSA Sign of NIST P-521 implementation of
EDK2. Fix it by updating openssl to 3.4.1.

Signed-off-by: Yi Li <yi1.li@intel.com>
2025-02-26 06:39:16 +00:00
de29ae677a StandaloneMmPkg/MmIpl : Add EFI_HOB_HANDOFF_INFO_TABLE to MM HOB list
GetBootModeHob function need to add EFI_HOB_HANDOFF_INFO_TABLE
in MM hob data base.

Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Wei6 Xu <wei6.xu@intel.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
2025-02-26 13:16:12 +08:00
1428b94fc0 MdeModulePkg/Variable: Init var policy after SMM variable is ready
On a MM system, the main UEFI variable logic resides in MMRAM. In
that case, the variable policy logic in `VarCheckPolicyLib`, such as
`VarCheckPolicyLibStandaloneMm` is linked against the MM driver also
in that case `VariableStandaloneMm`.

The MM variable driver indicates its presence to the RT DXE driver
via `gEfiSmmVariableProtocolGuid` to indicate variable read support
is available from MM. This triggers installation of the variable
architectural protocol in DXE.

Today, variable policy is initialized by calling
`VariablePolicySmmDxeMain()` in `VariableSmmRuntimeInitialize()`. In
turn, this installs `gEdkiiVariablePolicyProtocolGuid`. Functions in
`gEdkiiVariablePolicyProtocolGuid` may trigger MMIs. However, it is
possible that the MM variable driver which is linked against the code
with the variable policy MMI handlers (i.e. `VarCheckPolicyLib`) is
not loaded yet.

Therefore, this change moves invocation of
`VariablePolicySmmDxeMain()` to `SmmVariableReady()` which is called
on installation of `gEfiSmmVariableProtocolGuid` indicating variable
MM services are ready. `gEdkiiVariablePolicyProtocolGuid` is still
installed prior to the variable architectural protocol being
installed.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-02-25 19:12:17 +00:00
0f136602fd DynamicTablesPkg: Add _STA method to CPU object
Implement the _STA method for the CPU object based on
the value provided by the configuration manager.

Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-02-25 10:52:23 +01:00
eb1beb6e95 MdePkg/IndustryStandard: Add _STA bit definitions
Adds _STA device status bit definitions.
Reference: ACPI 6.5 specification, section 6.3.7

Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-02-25 10:52:23 +01:00
565a458adc DynamicTablesPkg: Add _PSD and _CPC support for X64
Introduce _PSD and _CPC ACPI objects for X64 platforms.

Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-02-25 10:52:23 +01:00
70f53a1b32 DynamicTablesPkg: Add _CST, _CSD, _PCT, and _PSS objects
This patch adds several ACPI objects to the X64 CPU SSDT table
 to enhance power and performance management.

The new objects include:
- _CST: Defines CPU idle states for power saving.
- _CSD: Specifies dependencies between CPU idle states.
- _PCT: Provides an interface for controlling CPU performance states.
- _PSS: Lists supported CPU performance states.
- _PPC: Indicates current CPU performance capabilities.

These additions help improve power efficiency and thermal management in X64 systems.

Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-02-25 10:52:23 +01:00
704eaf5cda DynamicTablesPkg: Adds C-state and P-state namespace objects
This update adds new configuration manager objects for C-State and P-State.
The C-State objects manage processor idle states,
while the P-State objects handle processor performance states.
This enhancement improves power management and performance
tuning within the DynamicTablesPkg.

Changes include:
- Added C-State and P-State namespace objects in ArchCommonNameSpaceObjects.h.
- Updated ConfigurationManagerObjectParser.c to support the new objects.
- Revised Readme.md to document these changes.

Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-02-25 10:52:23 +01:00
ef4ea08e8f DynamicTablesPkg/AmlLib: Implement C-State and P-State ACPI object
This commit introduces a set of functions designed to facilitate the creation
and management of C-State (_CST, _CSD) and P-State (_PCT, _PSS) ACPI objects.

Detailed Summary:
1) AmlCreateCstNode(): This function is responsible for creating a _CST
   (C-State) node, which is essential for defining processor idle states.
2) AmlAddCstState(): This function adds a C-State package to an existing
   CST node, allowing for the specification of individual C-State entries.
3) AmlCreateCsdNode(): This function creates a _CSD (C-State Dependency) node,
   which is used to describe dependencies between different C-States.
4) AmlCreatePctNode(): This function generates a _PCT (Performance Control) node,
   complete with PCT packages, to manage performance state transitions.
5) AmlCreatePssNode(): This function creates a _PSS (Performance Supported States) node,
   which lists the supported performance states for a processor.

Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-02-25 10:52:23 +01:00
86af841a20 MdePkg/IndustryStandard: Add _CSD version definition
Add _CSD version and number of entries definition.
These were introduced in the ACPI 3.0 specification.
Reference: ACPI 6.5 specification, section 8.4.1.2,
Table 8.3: C-State Dependency Package Values.

Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-02-25 10:52:23 +01:00
6d1bdc2b55 StandaloneMmPkg: Produce StandaloneMM Entry/Exit Notify Protocol.
Produce StandaloneMM Entry/Exit Notify Protocol for PlatformHook.
This replaces the SMM core platform hook implementation in the
traditional SMM (Edk2\MdeModulePkg\Include\Library\SmmCorePlatformHookLib.h).
Unlike traditional SMM, Standalone MM prefers a more generic method to
perform platform-specific tasks before and after the SMI handler. Therefore,
it introduces the gMmEntryNotifyProtocolGuid and gMmExitNotifyProtocolGuid
protocols to notify the SMM entry and exit. This approach is more flexible
for the platform, eliminating the need to place all tasks in
PlatformHookBeforeSmmDispatch() and PlatformHookAfterSmmDispatch(), thus
platform code can depend on the protocol notification to perform
platform-specific tasks.

Signed-off-by: Diat Siah Yap <diat.siah.yap@intel.com>
2025-02-25 08:15:45 +00:00
8d0a57d65a IntelFsp2Pkg/FspSecCore: Update FSP global data in FSP-S/I entry
Today when FspSiliconInit/FspSmmInit is called, the corresponding
FSP-S/I UPD pointer is saved in FSP_GLOBAL_DATA by gen-specific
code. Such code might be duplicated between different gens of
FSP implementation.

The change is to update FspSecCore module to set the UPD pointer
in FSP_GLOBAL_DATA for all API calls:
* FspMemoryInit
* FspSiliconInit
* FspSmmInit

This can eliminate the gen-specific code.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Duggapu Chinni B <chinni.b.duggapu@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ted Kuo <ted.kuo@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
2025-02-25 04:19:37 +00:00
af2a04699d MdeModulePkg: Add the EFI_RESOURCE_ATTRIBUTE_SPECIAL_PURPOSE attribute
Add the EFI_RESOURCE_ATTRIBUTE_SPECIAL_PURPOSE resource attribute as
per the PI 1.8 spec. This flag is used to indicate that the memory
should be treated as special purpose memory (SPM).

Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-02-25 01:23:14 +00:00
2625e91963 ArmPkg/ArmStandaloneMmCoreEntryPoint: Fix cast on clang
Compilation error:

```
ArmStandaloneMmCoreEntryPoint.c:1041:48: error: cast to smaller
  integer type 'unsigned long' from 'void *'
  [-Werror,-Wvoid-pointer-to-int-cast]

  1041 |   DEBUG ((DEBUG_INFO, "Start Dump Hob: %lx\n",
             (unsigned long)HobStart));
```

The `%p` specifer is now used to print the pointers.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-02-24 16:30:19 +00:00
3e7e3e2467 MdePkg/AArch64: fix AsmMacroLib signed value handling for MOV32/MOV64
MOV32 and MOV64, defined in AsmMacrolib.h, use a combination of movz and
movk instructions to fill a register with an immediate value. With each
instruction supplying 16 of the bits.

CLANGPDB builds have been reported to fail on the current implementation
when provided with negative values with:
  error: immediate must be an integer in range [0, 65535].

To resolve this, add a mask for the line filling the top 16 bits, like
the other lines already had.

Reported-by: Michael Kubacki <mikuback@linux.microsoft.com>
Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-02-24 16:30:19 +00:00
81803b9eba OvmfPkg: Add SmmCommunicationDxe
Adds the driver when SMM_REQUIRE is set to publish the
gEdkiiPiSmmCommunicationRegionTableGuid config table. Some code
now uses this table to find common communication buffers.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-02-24 14:08:32 +00:00
0058f7486f .azurepipelines: Introduce Build.Archlist for Azure GCC5 pipeline
Azure Ubuntu GCC5 pipeline builds packages with all architectures.
However, UefiPayloadPkg supports multiple architectures, including
IA32, X64 and AARCH64. In this case, Azure pipeline builds modules
for IA32, X64 and AARCH64 architectures, generates FD with same
FDF file. It leads build system failed to locate which module should
be integrated into Flash image.

Add Build.Archlist to specify architectures to be build with, and
separate TARGET_UEFIPAYLOAD to TARGET_UEFIPAYLOAD_IA32_X64 and
TARGET_UEFIPAYLOAD_AARCH64 to cover all supported architectures for
UefiPayloadPkg package.

Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
2025-02-24 12:31:47 +00:00
f0a2015373 UefiPayloadPkg: Add AARCH64 support
Add basic support for FIT image on the AARCH64 architecture, reuse
exsitting DSC and FDF files for IA32, X64 and AARCH64 architectures.

Introduce new PCD: PcdUseUniversalPayloadSerialPort to indicate
which serial port module is used due to some serial port parameters
are fixed for ARM SoC and Platform.

Please use following command to build AARCH64 UPL FIT image:
"
 export GCC5_AARCH64_PREFIX=aarch64-linux-gnu-
 python UefiPayloadPkg/UniversalPayloadBuild.py -a AARCH64
        -t GCC5 -b DEBUG --Fit
"

Signed-off-by: Amos Bu <amos.bu@newfw.com>
Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
2025-02-24 12:31:47 +00:00
9757ffaa38 UefiPayloadPkg: Update logic of fetching Processor Physical Address size
UefiPayloadEntry utilizes CPUID 0x80000008 leaf to retrieve the Processor's
Physical Address size for X86 architecture. To enable support for multiple
architectures, replace the direct implementation with an architecture-level
function provided by the UefiCpuPkg library, abstracting the underlying details.

Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
2025-02-24 12:31:47 +00:00
9fe0980a77 UefiCpuPkg: Add common architecture level library support
Introduce fundamental architecture-level functionalities which should
be implemented cross different architectures.

Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
2025-02-24 12:31:47 +00:00
8f57cf0829 EmulatorPkg/Unix/Host: Skip symbol unloading for stripped images
Skip symbol unloading for the PE/COFF images which dont have pdb area
when it built in RELEASE MODE.

Signed-off-by: Anandh krishna U <anandhkrishnau@ami.com>
2025-02-24 04:59:43 +00:00
e2bb5b530b StandaloneMmPkg/Core: dump HOB list in MMRAM
This commit is to dump finaled HOB list in MMRAM.

In previous commit, we verify the HOB list and initialize a
new HOB list in MMRAM before we call the library constructor.
Since we might migrate some memory allocation HOB into MMRAM,
it's cleared to dump information in finaled HOB list.

Signed-off-by: Dun Tan <dun.tan@intel.com>
2025-02-24 03:24:08 +00:00
1b71ddea42 StandaloneMmPkg/Core: pass HOB list in MMRAM to library constructor
The commit changes the code to initializes new HOB list in MMRAM
before the ProcessLibraryConstructorList() and pass the MMRAM HOB
list to lib constructor.

Previously, the HOB list in non-MMRAM range is passed to the lib
constructor. Then code in the library constructor would consume
unverified HOB list in non-MMRAM buffer. With this commit, the
HOB validation and memory allocation HOB migration are doned before
the library constructor.

Since the HOB list initialization needs to allocate memory in MMRAM,
we also need to call the MmInitializeMemoryServices() before the HOB
list initialization. Then the duplicated code in the StandaloneMmCore
MemoryAllocationLib can also be removed.

Signed-off-by: Dun Tan <dun.tan@intel.com>
2025-02-24 03:24:08 +00:00
8e92e8761c IntelFsp2Pkg/FspSecCore: initialize FspMode in FSP_GLOBAL_DATA
FspSecCore only runs in API mode.
When it allocates memory in stack for FSP_GLOBAL_DATA, it does not
initialize the FspMode to FSP_IN_API_MODE.

The patch enhances the code to initialize the FspMode as well.

This change does not have functionality impact as there should
be some code elsewhere which sets the FspMode.
This change allows to remove the extra code logic that sets
FspMode in API mode.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Duggapu Chinni B <chinni.b.duggapu@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ted Kuo <ted.kuo@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
2025-02-24 02:36:58 +00:00
83a86f465c UefiPayloadPkg: Allow boot timeout to be configured
This patch moves `PcdPlatformBootTimeOut` from `[PcdsDynamicExDefault]`
to `[PcdsDynamicHii]`, allowing the boot timeout to be configured through
HII, rather than being a compile-time setting.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2025-02-23 21:32:17 +00:00
063e19bab2 IntelFsp2Pkg: Fixing TemporaryRamSize Configurability option.
Issue : Configuring TemporaryRamSize using FSP-T arch UPD
(added as part of Spec 2.5) is not working as expected.

Root cause : Code is reading the ImageAttribute from the wrong
address which confirms the TemporaryRamSize Configurability,
hence the TemporaryRamSize UPD is ignored. This is because
the code expects the FspInfoheader Offset to be in ESI/RSI
(from which ImageAttribute read) is not guaranteed as per the
current implementation.

Fix : Modified code to make sure that ESI/RSI contains the
FspInfoheader offset by time the code reads the ImageAttribute.

Tests : Verified the fix on Both 32 Bit and 64 Bit FSP Binaries
by configuring the TemporaryRamSize using the FSPT Arch UPD.

Signed-off-by: Aravind P R <aravind.p.r@intel.com>
2025-02-21 17:57:46 +00:00
fbe0805b20 MdeModulePkg/HiiDatabaseDxe: Remove buffer error for string default.
Remove efivarstore IFR buffer error when string load default.
In the case of varstore type IFR, it will be NULL,
just break into next opcode process.

Resolve issue from commit cbe8a09dba
varstore type IFR string might return status error
while execute ExtractConfig function.

Signed-off-by: Longhao Lee <longhaox.lee@intel.com>
edk2-stable202502
2025-02-21 08:50:36 +08:00
0192f2d7cb MdeModulePkg/UsbBusPei: Improve PEI USB enumeration
Unlike DXE USB enumeration that enumerates all changed ports on timer
interrupt, PEI USB Enumeration runs once at the driver entry point.
USB3.x devices initially appear in USB2.0 ports. When the USB2.0 port is
reset, the USB3.x device disappears from the USB2.0 port and appears on the
USB3.0 port. The USB3.x device won't be enumerated if the USB2.0 port
number is greater than the USB3.0 port number. Re-enumerate USB to make
sure USB3.x devices in this case.

Signed-off-by: Phil Noh <Phil.Noh@amd.com>
2025-02-19 10:21:00 +08:00