Commit Graph

34143 Commits

Author SHA1 Message Date
Kun Qin
9dec81092b MdeModulePkg: PiSmmCore: Added parser of new MM communicate header
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3398
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3430

MM communicate protocols are expanded with EFI_MM_COMMUNICATE_HEADER_V3
structure that cooperates with updated field types and flexible array.
The PiSmmCore implementation is updated to detect and process incoming
data accordingly.

Two checks are also performed to prevent legacy communicate data or
unsupported data is fed into MM core under agreed header guid.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>

Signed-off-by: Kun Qin <kuqin12@gmail.com>
2025-04-07 07:42:13 +00:00
Kun Qin
3da340ccdd MdePkg: MmCommunication: Introduce EFI_PEI_MM_COMMUNICATION3_PPI to MdePkg
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3398
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3430

This change introduces a new definition for MM communicate PPI v3.

This PPI will be installed under a new GUID in contrast to exisiting
EFI_PEI_MM_COMMUNICATION_PPI.

Data communicated to MM through EFI_PEI_MM_COMMUNICATION3_PPI should
always start with EFI_MM_COMMUNICATE_HEADER_V3 with its HeaderGuid,
Signature and Version fields properly populated.

Signed-off-by: Kun Qin <kuqin12@gmail.com>
2025-04-07 07:42:13 +00:00
Kun Qin
11cc0d639e MdePkg: MmCommunication: Introduce EFI_MM_COMMUNICATION3_PROTOCOL to MdePkg
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3398
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3430

This change introduces a new definition for MM communicate protocol v3.

This protocol will be installed under a new GUID in contrast to exisiting
EFI_MM_COMMUNICATION_PROTOCOL.

Data communicated to MM through EFI_MM_COMMUNICATION3_PROTOCOL should
always start with EFI_MM_COMMUNICATE_HEADER_V3 with its HeaderGuid,
Signature and Version fields properly populated.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>

Signed-off-by: Kun Qin <kuqin12@gmail.com>
2025-04-07 07:42:13 +00:00
Kun Qin
7d1b9d3c3c MdePkg: MmCommunication: Introduce EFI_MM_COMMUNICATE_HEADER_V3 to MdePkg
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3398
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3430

This change introduces a new definition for MM communicate header
structure, intending to provide better portability between different
architectures (IA32 & X64) and adapt to flexible array supported by
modern compilers.

The original MessageLength field of EFI_MM_COMMUNICATE_HEADER, as a
generic definition, was used for both PEI and DXE MM communication. On a
system that supports PEI MM launch, but operates PEI in 32bit mode and MM
foundation in 64bit, the current EFI_MM_COMMUNICATE_HEADER definition
will cause structure parse error due to UINTN used. This introduction
removes the architecture dependent field by defining this field as
UINT64.

The new signature could help identifying whether the data received is
compiliant with this new data structure, which will help for binary
release modules to identify usage of legacy data structure.

BufferSize field is also added to indicate the full range of communicate
region available to the SMI handler.

The data field of MM communicate message is replaced with flexible array
to allow users not having to consume extra data during communicate and
author code more intrinsically.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>

Signed-off-by: Kun Qin <kuqin12@gmail.com>
2025-04-07 07:42:13 +00:00
edhay
59805c7697 ShellPkg/SmbiosView: Decode for InterfaceTypeSpecificData of SMBIOS type42
ShellPkg/SmbiosView tool changes for InterfaceTypeSpecificData decode and print
Previously, the InterfaceTypeSpecificData of SMBIOS type42 table was dumped
as hex in the SmbiosView tool output
This commit adds decode, interpretation and print as per SMBIOS spec version 3.8.0

Signed-off-by: G Edhaya Chandran <edhaya.chandran@arm.com>
2025-04-02 22:21:39 +00:00
edhay
7e8cd32353 MdePkg/IndustryStandard: Define enums of MCTPHostInterface from DSP0239
Enums for MCTPHostInterface are defined from Management Component Transport Protocol (MCTP) IDs and Codes specification (DSP0239)
These are referenced for the decode of InterfaceTypeSpecificData of SMBIOS table 42 by ShellPkg/SmbiosView

Signed-off-by: G Edhaya Chandran <edhaya.chandran@arm.com>
2025-04-02 22:21:39 +00:00
Nhi Pham
cf5a955774 MdePkg/IndustryStandard: Fix typos in IoRemappingTable.h
This corrects the value of the type `Named Component` and `Root Complex`
in the structure comments, according to the DEN0049E_IO_Remapping_Table
specification [1], table 2.

[1] https://developer.arm.com/documentation/den0049/latest

Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
2025-04-02 20:49:22 +00:00
Gao Qihang
e0b2187754 MdeModulePkg/CustomizedDisplayLib:Fix wrong ColumnIndexWidth special case.
If the column width of screen cannot be divisible by three, one or two
rows will be superfluous in the 3rd column. so, Optimize calculation method
of 3rd cloumn to fill entire row.

Signed-off-by: Gao Qihang <gaoqihang@loongson.cn>
2025-04-02 19:10:04 +00:00
kuqin12
8baa1c5120 ArmPkg: ArmStandaloneMmCoreEntryPoint: Support 18 register DIRECT_REQ2
This change added the support for using 18 registers when FF-A
DIRECT_REQ2 is used to communicate with MM core.

This change was tested on QEMU SBSA and booted to Windows.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-02 16:25:45 +00:00
Kun Qin
8d03c42d38 ArmPkg: ArmFfaLib: Update FF-A direct message to support 18 registers
This change expands the support of FF-A direct message 2 call to use the
full 18 registers.

It also adds a check in the contructors to ensure the SMCCC meets the
minimal requirement of v1.2 to support FF-A v1.2 usage.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-02 16:25:45 +00:00
Kun Qin
47b793f38c ArmPkg: ArmSvcLib: Support all 18 registers
This extends ARM_SVC_ARGS to support all x0-x17 registers use case for
FF-A.

The ArmCallSvc function is also updated to support 18-register usage.

Co-authored-by: Olivier Deprez <Olivier.Deprez@arm.com>
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-02 16:25:45 +00:00
Kun Qin
c0ecd11e62 ArmPkg: ArmSmcLib: Support all 18 registers
This extends ARM_SMC_ARGS to support all x0-x17 registers use case for
FF-A.

The ArmCallSmc function is also updated to support 18-register usage.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-02 16:25:45 +00:00
Thejaswani Putta
213973e9e5 EmulatorPkg: Add stub to read redfish host interface serial number
Signed-off-by: Thejaswani Putta <tputta@nvidia.com>
2025-04-02 03:32:19 +00:00
Thejaswani Putta
4a055eb486 RedfishPkg: Populate serial number in SMBIOS type 42 record
Add a stub function to read host interface USB serial number,
append serial number to SMBIOS type 42 record if valid data
is returned.

Signed-off-by: Thejaswani Putta <tputta@nvidia.com>
2025-04-02 03:32:19 +00:00
Guillermo Antonio Palomino Sosa
76c282b075 Maintainers.txt: Add new maintainer to BaseTools section
- Updated Maintainers.txt to include Guillermo Antonio Palomino Sosa
  as a maintainer for the BaseTools section.
- Added his contact information: email and GitHub username.

Signed-off-by: Guillermo Antonio Palomino Sosa <guillermo.a.palomino.sosa@intel.com>
2025-04-01 16:24:25 +00:00
Yang Gang
069dfae3e5 MdePkg: Fix typo in I2cMaster.h, SetBusFrequench -> SetBusFrequency
Signed-off-by: Yang Gang <yanggang@byosoft.com.cn>
2025-04-01 02:54:39 +00:00
Michael Kubacki
30f3fa0af7 StandaloneMmCorePerformanceLib.inf: Add gEfiEventExitBootServicesGuid
Adds `gEfiEventExitBootServicesGuid` to the `[Guids]` section and
removes `gEdkiiSmmExitBootServicesProtocolGuid` from the
`[Protocols]` section for the current implementation.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-03-31 17:03:01 +00:00
Michael D Kinney
09faa4a1ce BaseTools/build: Reduce special FV full to warning
If an FV_SPARE_SPACE_THRESHOLD is enabled and an FV
is 100% full with 0 bytes free, then this is likely
a special FV that may have alignment requirements
for the FFS file for both the start address and the
length and the FFS file consumes all the available
FV space.

Reduce FV_SPARE_SPACE_THRESHOLD from an error to a
warning if this FV 0 bytes free condition is
detected.

PR #10828 introduced the generation of these error
conditions for an FV with large alignment requirements.
The pad region before the aligned FFS file used to
be counted as free space even though it could never
be used due to the alignment requirements. There was
actually no free space available. PR #10828 fixed the
free space calculation to properly show it as 0 bytes
free, and this change then caused build error when
FV_SPARE_SPACE_THRESHOLD feature was enabled. The
reduction to a warning for this condition allows the
build to complete with errors and also provides a
build log warning message for review.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-03-31 16:04:37 +00:00
Leif Lindholm
a088d9ceb0 ArmPlatformPkg/PeilessSec: drop _SetSVCMode sequence for Arm
_SetSVCMode sits shortly after _ModuleEntryPoint, to switch into SVC mode
and mask FIQ and IRQ exceptions (making it badly named to boot).

But this should always be the state we start executing in, so most
likely this is another remnant of a time when the edk2 image also
contained Secure Monitor code, which has not been supported for some
time now.

Delete the whole stanza and see if anything breaks.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-03-31 14:36:54 +00:00
Leif Lindholm
ad6639cf3e ArmPlatformPkg/PeilessSec: drop _SetSVCMode symbol from AArch64
AArch64 has no SVC mode, this was clearly copied from the AArch32
version, so drop it.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-03-31 14:36:54 +00:00
INDIA\sachinganesh
5d3314d0bf MdeModulePkg/Core: Add Hot Pluggable type to Attribute Conversion Table
Hot Pluggable resource attribute was introduced in UEFI 2.11 and PI 1.9
specifications.
This type should have an entry in the Attribute Conversion Table.

Signed-off-by: Sachin Ganesh <sachinganesh@ami.com>
2025-03-31 07:49:33 +00:00
Abner Chang
3907f8a0ba RedfishPkg/RedfishHttpDxe : Fix the incorrect length of the Basic Auth
Use AsciiStrLen function instead of AsciiStrSize to determine
the length of Basic Auth string.

Signed-off-by: Abner Chang <abner.chang@amd.com>
2025-03-27 07:46:29 -05:00
Abdul Lateef Attar
9006a9b5e4 PrmPkg: Correct the flags for X64 GCC compiler
Correct the GCC GenFw and ld flag to build PRM run time modules.
These changes are made for X64 GCC compiler, current present for AARCH64 only.
Adds addition _X64_OBJCOPY_STRIPFLAG for X64 to retain required symbol
during objcopy.

Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-03-27 04:54:29 +00:00
Jiaxin Wu
14b730cde8 MdeModulePkg/Universal: Remove dynamic PcdStatusCodeUseSerial usage in MM
This patch is to replace dynamic PcdStatusCodeUseSerial by the
gMmStatusCodeUseSerialHobGuid.

Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
2025-03-27 02:28:30 +00:00
Jiaxin Wu
5c6fea49ee StandaloneMmPkg: Produce gMmStatusCodeUseSerialHobGuid HOB
Produce gMmStatusCodeUseSerialHobGuid as MM Foundation HOB to
describe the status code use serial port or not.

Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
2025-03-27 02:28:30 +00:00
Jiaxin Wu
b7ef717177 StandaloneMmPkg: Add gMmStatusCodeUseSerialHobGuid HOB definition
PcdStatusCodeUseSerial can be the dynamic PCD, which can't be used
in MM drivers. So, defines gMmStatusCodeUseSerialHobGuid HOB to
indicate StatusCode is reported via serial port or not. The value
shall match with the PcdStatusCodeUseSerial.

Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
2025-03-27 02:28:30 +00:00
Jason1 Lin
a7ab45ace2 BaseTools/FMMT: Fix GUID Tool Not Found the Shell Script Issue
- FMMT tool would use the "PATH" environment variable for locating
  the required GUID tool.

- On Windows-like system, batch file not found in the "PATH" environment
  variable when "shell=False".

- This issue required commands to include program extensions or
  absolute paths.

- This patch sets "shell=True" to extend the support for batch files,
  including scripts in BinWrappers under BaseTools.

- Converted input commands from lists to strings to ensure proper
  argument interpretation in POSIX-like shell scripts.

Signed-off-by: Jason1 Lin <jason1.lin@intel.com>
2025-03-26 05:37:32 +00:00
Wei6 Xu
95bf74fac1 MdeModulePkg/DxeCorePerformanceLib: Fix incorrect size calculation
The values of BootRecordDataPayloadSize and CommSize are incorrect.
BootRecordDataPayloadSize should equal to
  SmmBootRecordDataSize - SmmBootRecordDataRetrieved
CommSize should equal to
  OFFSET_OF (EFI_MM_COMMUNICATE_HEADER,Data) \
  + (UINTN)MmCommBufferHeader->MessageLength
SmmCommData->BootRecordSize should be set to BootRecordDataPayloadSize,
instead of the total size of entire Smm boot record data.

Signed-off-by: Wei6 Xu <wei6.xu@intel.com>
2025-03-26 09:59:01 +08:00
Zhiguang Liu
e01f4180b3 BaseTools: Fix missing module PCD in compile information of build report
Module PCD in compile information is missed in module_report.json

Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2025-03-25 10:10:20 +00:00
Phil Noh
b279ac9f36 BaseTools/GenFv: Ensure the minimum pad file size for the FV with VTF
In case of the FV with VTF, the left size should be enough to add the
minimum pad file size (EFI_FFS_FILE_HEADER, 0x18). It prevents the build
error, "GenFv: ERROR 0006: invalid FFS file header checksum" caused by the
pad file overwriting some header data in VTF. This includes these updates
for CalculateFvSize() function.

1. If NumBlocks is not defined, ensure the minimum pad file size for the
left size (if the pad file is required as VTF is not bottom aligned at end
of block, insert EFI_FFS_FILE_HEADER to ensure the pad file size)
2. If NumBlocks is defined, report more clear error message (the required
fv image size = 0x%x. the set fv image size = 0x%x. Free space left is not
enough to add a pad file (0x18))
3. Remove MaxPadFileSize, which is reported when the taken size is same as
the total size. It can not be the actual left size to add an FFS file. It
causes confusion when referring to the build log (FV Space Information)

Signed-off-by: Phil Noh <Phil.Noh@amd.com>
2025-03-22 01:58:40 +00:00
Michael Kubacki
1c51a268b7 MdeModulePkg: Add Standalone MM perf library support
Adds a new library instance to support logging performance data in
Standalone MM.

- Add StandaloneMmPerformanceLib instance
- Move common MM logic to a new file `SmmPerformanceLibInternal.c`
- Since the library largely defers most logic to the performance
  measurement protocol a large degree of code can be shared between
  Standalone MM and Traditional MM.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-03-21 15:23:11 +00:00
Michael Kubacki
11b44c5cd1 MdeModulePkg: Add Standalone MM Core performance support
Adds a new library instance to support MM core functionality for
performance in Standalone MM.

- Add StandaloneMmCorePerformanceLib instance
- Move common MM logic to a new file `MmCorePerformanceLib.c`
- Define interfaces with implementation specific to MM environment
  type in `SmmCorePerformanceLibInternal.h` and implement those
  functions in the Standalone MM and Traditional MM specific C files

Note: StandaloneMmCorePerformanceLib supports both
      `MM_CORE_STANDALONE` and `MM_STANDALONE` as some Standalone MM
	  environments have privilege separation and need to link this
	  functionality in a ring 3 Standalone MM driver that is outside
	  the ring 0 Standalone MM core driver.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-03-21 15:23:11 +00:00
Michael Kubacki
874c24baae MdeModulePkg/DxeCorePerformanceLib: Use EFI_MM_COMMUNICATE_HEADER
Refactor the file to use the new type name EFI_MM_COMMUNICATE_HEADER.

This is the same type but follows the new name and is more clear
with upcoming Standalone MM support being added.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-03-21 15:23:11 +00:00
Star Zeng
cd387d2c77 UefiCpuPkg MpInformation2.h: Include PiMultiPhase.h
There will be build failure because of EFI_AP_PROCEDURE definition
not found if MpInformation2.h is included by base type library.

MpInformation2.h depends on MpService.h because of
EFI_PROCESSOR_INFORMATION definition, and then MpService.h
depends on PiMultiPhase.h because of EFI_AP_PROCEDURE definition.

This patch updates MpInformation2.h to include PiMultiPhase.h instead
of PiPei.h and also removes SecPlatformInformation.h including.
It also does minor refinement to file header description.

Signed-off-by: Star Zeng <star.zeng@intel.com>
2025-03-21 06:23:31 +00:00
Sarah Walker
2a3926dadc MdePkg: IndustryStandard: Rename ACPI SPCR revision 4 structure
The structure for the SPCR revision 4 table was originally named
EFI_ACPI_4_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE. This prefix suggests it
is an ACPI 4.0 structure, which it is not. This could cause confusion with
genuine ACPI 4.0 structures and defines (eg
EFI_ACPI_4_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE, which is
unrelated to SPCR revision 4).

Rename the structure to EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_4.

Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-03-20 20:07:16 +00:00
Khor Swee Aun
589be8d301 Maintainers.txt: Update StandaloneMmPkg reviewer
Add SweeAun as StandaloneMmPkg reviewer.

Signed-off-by: Khor Swee Aun <swee.aun.khor@intel.com>
2025-03-20 18:34:52 +00:00
Ceping Sun
2eac71a1ee OvmfPkg/IntelTdx: Cache and measure FwCfg
Since OVMF would initialize the platform info with FwCfg,
TDVF needs to cache and measure the FwCfg at first.

Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2025-03-20 02:37:31 +00:00
Ceping Sun
81c2c92074 OvmfPkg/PlatformPei: Cache and measure FwCfg items
Since OVMF would initialize the platform info with FwCfg,
TDVF needs to cache and measure the FwCfg at first.

Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2025-03-20 02:37:31 +00:00
Ceping Sun
4d2af7b91a OvmfPkg: Refactor QEMU_FW_CFG_CACHE_WORK_AREA
Move QemuFwCfgSupported and QemuFwCfgDmaSupported to the struct
since they will be used as global variables in the DXE phase
along with QEMU_FW_CFG_CACHE_WORK_AREA.

Additionally, change its name to QEMU_FW_CFG_WORK_AREA.

Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2025-03-20 02:37:31 +00:00
Ceping Sun
fb56dc78ef OvmfPkg/QemuFwCfgLib: Support Cache FwCfg with optional measurement
OVMF uses FW_CFG_SELECTOR(0x510) and FW_CFG_IO_DATA(0x511) to
get configuration information from QEMU. From the security perspective
these information shall be measured before they're consumed.

This patch reads the FwCfg items and caches them in a GuidHob. In the
meanwhile these FwCfg items are measured as well. This is to avoid
changing the order when reading the FwCfg process, which depends on
multiple factors(depex, order in the Firmware volume).

Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2025-03-20 02:37:31 +00:00
Ceping Sun
be529ef3c9 OvmfPkg/QemuFwCfgLib: Add FwCfg cache interface
Since TDVF needs to cache and measure FwCfg, it is required to
add an API to support cache with optional measurement and add some
internal interfaces to support cache in QemuFwCfgLib.
The new API is listed below:
  QemuFwCfgInitCache()

The new Internal interfaces are listed below:
  InternalQemuFwCfgCacheReadBytes()
  InternalQemuFwCfgCacheSelectItem()
  InternalQemuFwCfgCacheGetWorkArea()
  InternalQemuFwCfgCacheResetWorkArea()
  InternalQemuFwCfgItemCached()
  InternalQemuFwCfgCacheReading()
  InternalQemuFwCfgInitCache()
  InternalQemuFwCfgCheckOvmfWorkArea()

Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2025-03-20 02:37:31 +00:00
Ceping Sun
63408b2895 OvmfPkg/PeilessStartupLib: Build PlatformInfoHob before InitializePlatform
Since the QEMU_FW_CFG_WORK_AREA is saved in EFI_HOB_PLATFORM_INFO
and InitializePlatform would read by QemuFwCfg, TDVF should build
the PlatformInfoHob before InitializePlatform.

Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2025-03-20 02:37:31 +00:00
Ceping Sun
f66078a713 OvmfPkg/PlatformInitLib.h: Add QEMU_FW_CFG_CACHE_WORK_AREA
Add QEMU_FW_CFG_CACHE_WORK_AREA in EFI_HOB_PLATFORM_INFO
to support reading from cache in QemuFwCfgLib.

Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2025-03-20 02:37:31 +00:00
Ceping Sun
151326e542 OvmfPkg.dec: Add gOvmfFwCfgInfoHobGuid
Since TDVF has to measure FwCfg data from QEMU,
it is required to cache the data with measurement
in early phase. This can avoid changing the measurement
order when reading the FwCfg process, which depends
on multiple factors(depex, order in the firmware volume).

Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2025-03-20 02:37:31 +00:00
Ceping Sun
ebba67b754 SecurityPkg: Add TpmMeasurementLib for SEC phase
Add the SecTpmMeasurementLib to support
TpmMeasurementAndLogData in Sec phase.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2025-03-20 02:37:31 +00:00
Shuo Liu
425d97caef Maintainers.txt: Add Shuo Liu as UefiPayloadPkg Reviewer
UefiPayloadPkg is used by non-UEFI bootloaders, e.g. coreboot.
Shuo works on Xeon-SP coreboot and will contribute to the
reviewing activity for UefiPayloadPkg.

Signed-off-by: Shuo Liu <shuo.liu@intel.com>
2025-03-19 16:23:49 +00:00
Leif Lindholm
22919e560b MdeModulePkg/VarCheckHiiLib: clean up VarCheckHiiLibReceiveHiiBinHandler
Building VarCheckHiiLib fails on my clang 19.1.6 setup with the error
 variable 'Status' is used uninitialized whenever 'if' condition is false
due to the DispatchHandle != NULL test.

Calling this function with a NULL handle makes no sense, so move the test
to the function entry and return failure if appropriate.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-03-19 14:18:12 +00:00
Leif Lindholm
f6aba88ac8 MdeModulePkg/VarCheckHiiLib: don't return success for invalid input
The doxygen comment for VarCheckHiiLibReceiveHiiBinHandler says that
EFI_INVALID_PARAMETER should be returned if either of CommBuffer or
CommBufferSize is NULL, but the test results in an early return of
EFI_SUCCESS.

Update the code to match the documentation.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-03-19 14:18:12 +00:00
Crystal Lee
1c6ce560f0 ArmPkg: Add a protocol notification for gEfiDxeMmReadyToLockProtocolGuid
Add and install a protocol notification handler for
gEfiDxeMmReadyToLockProtocolGuid, in order to to trigger MMI
handler to install gEfiMmReadyToLockProtocolGuid protocol in Mm.

Signed-off-by: Crystal Lee <CrystalLee@ami.com>
2025-03-19 10:51:13 +00:00
Jack Pham
f1a2bd2333 MdeModulePkg/XhciDxe: Adjust out-of-range bInterval values
When a USB device is enumerated it will report one or more endpoint
descriptors which contains a bInterval field which specifies the
interval a host should periodically poll for that particular endpoint
when scheduling transfers.  But the units this value is expressed in
(in whole ms, a power of 2 x 1ms, or a power of 2 x 125us) may differ
depending on the speed of the device and whether the endpoint is
isochronous or interrupt.

Some high/super-speed devices, which are supposed to report isoc/int
bInterval as a power of 2 x 125us, incorrectly report full-speed
bInterval values (that is, in whole units of ms) in their interrupt
endpoint descriptors which results in an assertion error due to being
out of range of the spec-expected values.  Rather than asserting, try
to adjust those assuming they were expressed in units of ms with an
upper limit of 128ms.

Signed-off-by: Jack Pham <jackp@qti.qualcomm.com>
2025-03-18 20:29:20 +00:00