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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Introduce fundamental architecture-level functionalities which should
be implemented cross different architectures.
Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
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>
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>
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>
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>
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>
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>
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>
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>