Date   

[PATCH V1 1/1] MinPlatformPkg: Add PCDs to update FADT entries from board package

Chiu, Chasel
 

From: Ankit Sinha <ankit.sinha@...>

Adds new PCDs to allow entries in FADT to be customized during platform
integration. Board packages will can update these PCDs during boot.

Cc: Chasel Chiu <chasel.chiu@...>
Cc: Nate DeSimone <nathaniel.l.desimone@...>
Cc: Liming Gao <gaoliming@...>
Cc: Eric Dong <eric.dong@...>

Signed-off-by: Ankit Sinha <ankit.sinha@...>
---
Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 85 ++++++=
++++++--------
Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.inf | 24 ++++++
Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec | 36 ++++++=
+--
3 files changed, 105 insertions(+), 40 deletions(-)

diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c b=
/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
index 05fc7799fb13..b3d067def3fa 100644
--- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
+++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
@@ -1165,6 +1165,11 @@ PlatformUpdateTables (
// Update the creator revision=0D
//=0D
TableHeader->CreatorRevision =3D PcdGet32(PcdAcpiDefaultCreatorRevis=
ion);=0D
+=0D
+ //=0D
+ // Update the oem revision=0D
+ //=0D
+ TableHeader->OemRevision =3D PcdGet32(PcdAcpiDefaultOemRevision);=0D
}=0D
}=0D
=0D
@@ -1187,44 +1192,54 @@ PlatformUpdateTables (
case EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE:=0D
FadtHeader =3D (EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE *) Table;=0D
=0D
- FadtHeader->PreferredPmProfile =3D PcdGet8 (PcdFadtPreferredPmProfile)=
;=0D
- FadtHeader->IaPcBootArch =3D PcdGet16 (PcdFadtIaPcBootArch);=0D
- FadtHeader->Flags =3D PcdGet32 (PcdFadtFlags);=0D
+ FadtHeader->PreferredPmProfile =3D PcdGet8 (PcdFadtPref=
erredPmProfile);=0D
+ FadtHeader->IaPcBootArch =3D PcdGet16 (PcdFadtIaP=
cBootArch);=0D
+ FadtHeader->Flags =3D PcdGet32 (PcdFadtFla=
gs);=0D
+ FadtHeader->AcpiEnable =3D PcdGet8 (PcdAcpiEnab=
leSwSmi);=0D
+ FadtHeader->AcpiDisable =3D PcdGet8 (PcdAcpiDisa=
bleSwSmi);=0D
+ FadtHeader->Pm1aEvtBlk =3D PcdGet16 (PcdAcpiPm1=
AEventBlockAddress);=0D
+ FadtHeader->Pm1bEvtBlk =3D PcdGet16 (PcdAcpiPm1=
BEventBlockAddress);=0D
+ FadtHeader->Pm1aCntBlk =3D PcdGet16 (PcdAcpiPm1=
AControlBlockAddress);=0D
+ FadtHeader->Pm1bCntBlk =3D PcdGet16 (PcdAcpiPm1=
BControlBlockAddress);=0D
+ FadtHeader->Pm2CntBlk =3D PcdGet16 (PcdAcpiPm2=
ControlBlockAddress);=0D
+ FadtHeader->PmTmrBlk =3D PcdGet16 (PcdAcpiPmT=
imerBlockAddress);=0D
+ FadtHeader->Gpe0Blk =3D PcdGet16 (PcdAcpiGpe=
0BlockAddress);=0D
+ FadtHeader->Gpe0BlkLen =3D PcdGet8 (PcdAcpiGpe0=
BlockLength);=0D
+ FadtHeader->Gpe1Blk =3D PcdGet16 (PcdAcpiGpe=
1BlockAddress);=0D
+ FadtHeader->Gpe1Base =3D PcdGet8 (PcdAcpiGpe1=
Base);=0D
+ FadtHeader->DutyWidth =3D PcdGet8 (PcdAcpiDuty=
Width);=0D
=0D
- FadtHeader->AcpiEnable =3D PcdGet8 (PcdAcpiEnableSwSmi);=0D
- FadtHeader->AcpiDisable =3D PcdGet8 (PcdAcpiDisableSwSmi);=0D
+ FadtHeader->XPm1aEvtBlk.Address =3D PcdGet16 (PcdAcpiPm1=
AEventBlockAddress);=0D
+ FadtHeader->XPm1aCntBlk.Address =3D PcdGet16 (PcdAcpiPm1=
AControlBlockAddress);=0D
+ FadtHeader->XPm1bCntBlk.Address =3D PcdGet16 (PcdAcpiPm1=
BControlBlockAddress);=0D
+ FadtHeader->XPm2CntBlk.Address =3D PcdGet16 (PcdAcpiPm2=
ControlBlockAddress);=0D
+ FadtHeader->XPmTmrBlk.Address =3D PcdGet16 (PcdAcpiPmT=
imerBlockAddress);=0D
+ FadtHeader->XGpe0Blk.Address =3D PcdGet16 (PcdAcpiGpe=
0BlockAddress);=0D
+ FadtHeader->XGpe1Blk.Address =3D PcdGet16 (PcdAcpiGpe=
1BlockAddress);=0D
=0D
- FadtHeader->Pm1aEvtBlk =3D PcdGet16 (PcdAcpiPm1AEventBlockAddress);=0D
- FadtHeader->Pm1bEvtBlk =3D PcdGet16 (PcdAcpiPm1BEventBlockAddress);=0D
- FadtHeader->Pm1aCntBlk =3D PcdGet16 (PcdAcpiPm1AControlBlockAddress);=
=0D
- FadtHeader->Pm1bCntBlk =3D PcdGet16 (PcdAcpiPm1BControlBlockAddress);=
=0D
- FadtHeader->Pm2CntBlk =3D PcdGet16 (PcdAcpiPm2ControlBlockAddress);=0D
- FadtHeader->PmTmrBlk =3D PcdGet16 (PcdAcpiPmTimerBlockAddress);=0D
- FadtHeader->Gpe0Blk =3D PcdGet16 (PcdAcpiGpe0BlockAddress);=0D
- FadtHeader->Gpe0BlkLen =3D 0x20;=0D
- FadtHeader->Gpe1Blk =3D PcdGet16 (PcdAcpiGpe1BlockAddress);=0D
+ FadtHeader->ResetReg.AccessSize =3D PcdGet8 (PcdAcpiRese=
tRegAccessSize);=0D
+ FadtHeader->XPm1aEvtBlk.AccessSize =3D PcdGet8 (PcdAcpiXPm1=
aEvtBlkAccessSize);=0D
+ FadtHeader->XPm1bEvtBlk.AccessSize =3D PcdGet8 (PcdAcpiXPm1=
bEvtBlkAccessSize);=0D
+ FadtHeader->XPm1aCntBlk.AccessSize =3D PcdGet8 (PcdAcpiXPm1=
aCntBlkAccessSize);=0D
+ FadtHeader->XPm1bCntBlk.AccessSize =3D PcdGet8 (PcdAcpiXPm1=
bCntBlkAccessSize);=0D
+ FadtHeader->XPm2CntBlk.AccessSize =3D PcdGet8 (PcdAcpiXPm2=
CntBlkAccessSize);=0D
+ FadtHeader->XPmTmrBlk.AccessSize =3D PcdGet8 (PcdAcpiXPmT=
mrBlkAccessSize);=0D
+ FadtHeader->XGpe0Blk.AccessSize =3D PcdGet8 (PcdAcpiXGpe=
0BlkAccessSize);=0D
+ FadtHeader->XGpe1Blk.AccessSize =3D PcdGet8 (PcdAcpiXGpe=
1BlkAccessSize);=0D
=0D
- FadtHeader->XPm1aEvtBlk.Address =3D PcdGet16 (PcdAcpiPm1AEventBlockAdd=
ress);=0D
- FadtHeader->XPm1bEvtBlk.Address =3D PcdGet16 (PcdAcpiPm1BEventBlockAdd=
ress);=0D
- if (FadtHeader->XPm1bEvtBlk.Address =3D=3D 0) {=0D
- FadtHeader->XPm1bEvtBlk.AccessSize =3D 0;=0D
- }=0D
- FadtHeader->XPm1aCntBlk.Address =3D PcdGet16 (PcdAcpiPm1AControlBlockA=
ddress);=0D
- FadtHeader->XPm1bCntBlk.Address =3D PcdGet16 (PcdAcpiPm1BControlBlockA=
ddress);=0D
- if (FadtHeader->XPm1bCntBlk.Address =3D=3D 0) {=0D
- FadtHeader->XPm1bCntBlk.AccessSize =3D 0;=0D
- }=0D
- FadtHeader->XPm2CntBlk.Address =3D PcdGet16 (PcdAcpiPm2ControlBlockAd=
dress);=0D
- //if (FadtHeader->XPm2CntBlk.Address =3D=3D 0) {=0D
- FadtHeader->XPm2CntBlk.AccessSize =3D 0;=0D
- //}=0D
- FadtHeader->XPmTmrBlk.Address =3D PcdGet16 (PcdAcpiPmTimerBlockAddre=
ss);=0D
- FadtHeader->XGpe0Blk.Address =3D PcdGet16 (PcdAcpiGpe0BlockAddress)=
;=0D
- FadtHeader->XGpe1Blk.Address =3D PcdGet16 (PcdAcpiGpe1BlockAddress)=
;=0D
- if (FadtHeader->XGpe1Blk.Address =3D=3D 0) {=0D
- FadtHeader->XGpe1Blk.AddressSpaceId =3D 0;=0D
- FadtHeader->XGpe1Blk.AccessSize =3D 0;=0D
- }=0D
+ FadtHeader->SleepControlReg.AddressSpaceId =3D PcdGet8 (PcdAcpiSlee=
pControlRegAddressSpaceId);=0D
+ FadtHeader->SleepControlReg.RegisterBitOffset =3D PcdGet8 (PcdAcpiSlee=
pControlRegRegisterBitOffset);=0D
+ FadtHeader->SleepControlReg.AccessSize =3D PcdGet8 (PcdAcpiSlee=
pControlRegAccessSize);=0D
+ FadtHeader->SleepControlReg.Address =3D PcdGet64 (PcdAcpiSle=
epControlRegAddress);=0D
+ FadtHeader->SleepStatusReg.AddressSpaceId =3D PcdGet8 (PcdAcpiSlee=
pStatusRegAddressSpaceId);=0D
+ FadtHeader->SleepStatusReg.RegisterBitWidth =3D PcdGet8 (PcdAcpiSlee=
pStatusRegRegisterBitWidth);=0D
+ FadtHeader->SleepStatusReg.RegisterBitOffset =3D PcdGet8 (PcdAcpiSlee=
pStatusRegRegisterBitOffset);=0D
+ FadtHeader->SleepStatusReg.AccessSize =3D PcdGet8 (PcdAcpiSlee=
pStatusRegAccessSize);=0D
+ FadtHeader->SleepStatusReg.Address =3D PcdGet64 (PcdAcpiSle=
epStatusRegAddress);=0D
+=0D
+ FadtHeader->S4BiosReq =3D PcdGet8 (PcdAcpiS4Bi=
osReq);=0D
+ FadtHeader->XPm1aEvtBlk.Address =3D PcdGet16 (PcdAcpiPm1=
AEventBlockAddress);=0D
+ FadtHeader->XPm1bEvtBlk.Address =3D PcdGet16 (PcdAcpiPm1=
BEventBlockAddress);=0D
=0D
DEBUG ((DEBUG_INFO, "ACPI FADT table @ address 0x%x\n", Table));=0D
DEBUG ((DEBUG_INFO, " IaPcBootArch 0x%x\n", FadtHeader->IaPcBootArch)=
);=0D
diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.inf=
b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.inf
index 99adf9c381c9..9d91e418d4ca 100644
--- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.inf
+++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.inf
@@ -62,6 +62,8 @@
gMinPlatformPkgTokenSpaceGuid.PcdMaxCpuSocketCount=0D
=0D
gMinPlatformPkgTokenSpaceGuid.PcdFadtPreferredPmProfile=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiGpe1Base=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiDutyWidth=0D
gMinPlatformPkgTokenSpaceGuid.PcdFadtIaPcBootArch=0D
gMinPlatformPkgTokenSpaceGuid.PcdFadtFlags=0D
=0D
@@ -77,7 +79,29 @@
gMinPlatformPkgTokenSpaceGuid.PcdAcpiPm2ControlBlockAddress=0D
gMinPlatformPkgTokenSpaceGuid.PcdAcpiPmTimerBlockAddress=0D
gMinPlatformPkgTokenSpaceGuid.PcdAcpiGpe0BlockAddress=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiGpe0BlockLength=0D
gMinPlatformPkgTokenSpaceGuid.PcdAcpiGpe1BlockAddress=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiResetRegAccessSize=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiXPm1aEvtBlkAccessSize=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiXPm1bEvtBlkAccessSize=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiXPm1aCntBlkAccessSize=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiXPm1bCntBlkAccessSize=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiXPm2CntBlkAccessSize=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiXPmTmrBlkAccessSize=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiXGpe0BlkAccessSize=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiXGpe1BlkAccessSize=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiSleepControlRegAddressSpaceId=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiSleepControlRegRegisterBitWidth=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiSleepControlRegRegisterBitOffset=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiSleepControlRegAccessSize=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiSleepControlRegAddress=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiSleepStatusRegAddressSpaceId=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiSleepStatusRegRegisterBitWidth=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiSleepStatusRegRegisterBitOffset=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiSleepStatusRegAccessSize=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiSleepStatusRegAddress=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiS4BiosReq=0D
+=0D
=0D
gMinPlatformPkgTokenSpaceGuid.PcdLocalApicAddress=0D
gMinPlatformPkgTokenSpaceGuid.PcdIoApicAddress=0D
diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec b/Platform/In=
tel/MinPlatformPkg/MinPlatformPkg.dec
index e38617ce20fd..bfc50565144f 100644
--- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
+++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
@@ -112,10 +112,6 @@
gMinPlatformPkgTokenSpaceGuid.PcdMaxCpuCoreCount|8|UINT32|0x90000022=0D
gMinPlatformPkgTokenSpaceGuid.PcdMaxCpuSocketCount|4|UINT32|0x90000023=0D
=0D
- gMinPlatformPkgTokenSpaceGuid.PcdFadtPreferredPmProfile|0x02|UINT8|0x900=
00025=0D
- gMinPlatformPkgTokenSpaceGuid.PcdFadtIaPcBootArch|0x0001|UINT16|0x900000=
26=0D
- gMinPlatformPkgTokenSpaceGuid.PcdFadtFlags|0x000086A5|UINT32|0x90000027=
=0D
-=0D
gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiAcpiReclaimMemorySize|0x65|U=
INT32|0x20000500=0D
gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiAcpiNvsMemorySize|0x30|UINT3=
2|0x20000501=0D
gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiReservedMemorySize|0x402|UIN=
T32|0x20000502=0D
@@ -245,6 +241,10 @@
gMinPlatformPkgTokenSpaceGuid.PcdPciSegmentCount |0x1 |UI=
NT8|0x4001004E=0D
gMinPlatformPkgTokenSpaceGuid.PcdRandomizePlatformHierarchy |TRUE |BOOL=
EAN|0x4001004F=0D
=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdFadtPreferredPmProfile|0x02|UINT8|0x900=
00025=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdFadtIaPcBootArch|0x0001|UINT16|0x900000=
26=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdFadtFlags|0x000086A5|UINT32|0x90000027=
=0D
+=0D
gMinPlatformPkgTokenSpaceGuid.PcdAcpiPm1AEventBlockAddress|0x1800|UINT16=
|0x00010035=0D
gMinPlatformPkgTokenSpaceGuid.PcdAcpiPm1BEventBlockAddress|0x0000|UINT16=
|0x00010036=0D
gMinPlatformPkgTokenSpaceGuid.PcdAcpiPm1AControlBlockAddress|0x1804|UINT=
16|0x0001037=0D
@@ -252,7 +252,33 @@
gMinPlatformPkgTokenSpaceGuid.PcdAcpiPm2ControlBlockAddress|0x1850|UINT1=
6|0x00010039=0D
gMinPlatformPkgTokenSpaceGuid.PcdAcpiPmTimerBlockAddress|0x1808|UINT16|0=
x0001003A=0D
gMinPlatformPkgTokenSpaceGuid.PcdAcpiGpe0BlockAddress|0x1880|UINT16|0x00=
01003B=0D
- gMinPlatformPkgTokenSpaceGuid.PcdAcpiGpe1BlockAddress|0x0000|UINT16|0x00=
01003C=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiGpe0BlockLength|0x00|UINT8|0x000100=
3C=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiGpe1BlockAddress|0x0000|UINT16|0x00=
01003D=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiGpe1Base|0x00|UINT8|0x00010040=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiDutyWidth|0x00|UINT8|0x00010041=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiResetRegAccessSize|0x00|UINT8|0x000=
10042=0D
+=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiXPm1aEvtBlkAccessSize|0x00|UINT8|0x=
00010043=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiXPm1bEvtBlkAccessSize|0x00|UINT8|0x=
00010044=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiXPm1aCntBlkAccessSize|0x00|UINT8|0x=
00010045=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiXPm1bCntBlkAccessSize|0x00|UINT8|0x=
00010046=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiXPm2CntBlkAccessSize|0x00|UINT8|0x0=
0010047=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiXPmTmrBlkAccessSize|0x00|UINT8|0x00=
010048=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiXGpe0BlkAccessSize|0x00|UINT8|0x000=
10049=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiXGpe1BlkAccessSize|0x00|UINT8|0x000=
1004A=0D
+=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiSleepControlRegAddressSpaceId|0x00|=
UINT8|0x0001004B=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiSleepControlRegRegisterBitWidth|0x0=
0|UINT8|0x0001004C=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiSleepControlRegRegisterBitOffset|0x=
00|UINT8|0x0001004D=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiSleepControlRegAccessSize|0x00|UINT=
8|0x0001004E=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiSleepControlRegAddress|0x0000000000=
000000|UINT64|0x0001004F=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiSleepStatusRegAddressSpaceId|0x00|U=
INT8|0x00010050=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiSleepStatusRegRegisterBitWidth|0x00=
|UINT8|0x00010051=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiSleepStatusRegRegisterBitOffset|0x0=
0|UINT8|0x00010052=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiSleepStatusRegAccessSize|0x00|UINT8=
|0x00010053=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiSleepStatusRegAddress|0x00000000000=
00000|UINT64|0x00010054=0D
+ gMinPlatformPkgTokenSpaceGuid.PcdAcpiS4BiosReq|0x0000|UINT8|0x00010055=0D
+=0D
=0D
gMinPlatformPkgTokenSpaceGuid.PcdPciExpressRegionLength|0x10000000|UINT3=
2|0x0010004=0D
gMinPlatformPkgTokenSpaceGuid.PcdFspCpuPeiApWakeupBufferAddr|0x9f000|UIN=
T32|0x30000008=0D
--=20
2.33.0.windows.1


Re: [Patch v2 00/28] UEFI variable protection

Michael Kubacki
 

Hi Judah,

Do you have reference information for the following?

1. Overall boot time impact for a sample variable store?

- In particular:
- Initial HMAC calculation/verification time.
- Non-volatile write impact time to caluclate new store HMAC value and update MetaDataHmacVar.
- Variable reclaim before and after time.

2. Overall non-volatile store size overhead impact with AES-CBC encrypted variables?

I understand these will vary based on system properties like SPI flash parameters, cryptographic processor details, etc. I'm trying to get an idea of the impact from sample data or averages on a particular system configuration. Also to learn whether the native encryption instruction (AES-NI) was used and if that could provide any benefit given the potential number of encryption/decryption operations introduced.

For the code design, I feel the ProtectedVariableLib interface is a bit too coupled against internal implementation details of the variable driver. I generally understand why the code is split out to wrap operations around the new functionality and it follows the AuthVarLib pattern but changing the library or driver will continue to require large changes across both like this due to the coupling.

Small things I noticed:
1. VariableKeyLib.inf should not be "BASE", it directly depends on PEI services
2. Typo "varabile" in some files
3. Does ProtectedVariableLibNull actually need to depend on BaseMemoryLib?

Thanks,
Michael

On 4/29/2022 2:04 PM, Judah Vang wrote:
For a more detail description of the UEFI variable protected feature you can
view the Readme.md located at the following location:
https://github.com/judahvang/edk2/tree/rpmc-update
Judah Vang (28):
MdeModulePkg: Add new GUID for Variable Store Info
SecurityPkg: Add new GUIDs for
MdeModulePkg: Update AUTH_VARIABLE_INFO struct
MdeModulePkg: Add reference to new Ppi Guid
MdeModulePkg: Add new ProtectedVariable GUIDs
MdeModulePkg: Add new include files
MdeModulePkg: Add Null ProtectedVariable Library
MdeModulePkg: Add new Variable functionality
MdeModulePkg: Add support for Protected Variables
SecurityPkg: Add new KeyService types and defines
SecurityPkg: Update RPMC APIs with index
SecurityPkg: Add new variable types and functions
SecurityPkg: Fix GetVariableKey API
SecurityPkg: Add null encryption variable libs
SecurityPkg: Add VariableKey library function
SecurityPkg: Add EncryptionVariable lib with AES
SecurityPkg: Add Protected Variable Services
MdeModulePkg: Reference Null ProtectedVariableLib
SecurityPkg: Add references to new *.inf files
ArmVirtPkg: Add reference to ProtectedVariableNull
UefiPayloadPkg: Add ProtectedVariable reference
EmulatorPkg: Add ProtectedVariable reference
OvmfPkg: Add ProtectedVariable reference
OvmfPkg: Add ProtectedVariableLib reference
OvmfPkg: Add ProtectedVariableLib reference
OvmfPkg: Add ProtectedVariableLib reference
OvmfPkg: Add ProtectedVariable reference
CryptoPkg: Enable cypto HMAC KDF library
MdeModulePkg/MdeModulePkg.dec | 13 +-
SecurityPkg/SecurityPkg.dec | 43 +-
ArmVirtPkg/ArmVirtQemu.dsc | 3 +-
EmulatorPkg/EmulatorPkg.dsc | 3 +-
MdeModulePkg/MdeModulePkg.dsc | 4 +-
OvmfPkg/AmdSev/AmdSevX64.dsc | 3 +-
OvmfPkg/Bhyve/BhyveX64.dsc | 3 +-
OvmfPkg/CloudHv/CloudHvX64.dsc | 1 +
OvmfPkg/Microvm/MicrovmX64.dsc | 3 +-
OvmfPkg/OvmfPkgIa32.dsc | 1 +
OvmfPkg/OvmfPkgIa32X64.dsc | 1 +
OvmfPkg/OvmfPkgX64.dsc | 1 +
OvmfPkg/OvmfXen.dsc | 3 +-
SecurityPkg/SecurityPkg.dsc | 13 +-
UefiPayloadPkg/UefiPayloadPkg.dsc | 2 +
CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf | 2 +-
MdeModulePkg/Library/ProtectedVariableLibNull/ProtectedVariableLibNull.inf | 34 +
MdeModulePkg/Universal/Variable/Pei/VariablePei.inf | 10 +-
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf | 3 +-
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf | 3 +-
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf | 4 +-
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf | 3 +-
SecurityPkg/Library/EncryptionVariableLib/EncryptionVariableLib.inf | 43 +
SecurityPkg/Library/EncryptionVariableLibNull/EncryptionVariableLibNull.inf | 38 +
SecurityPkg/Library/ProtectedVariableLib/DxeProtectedVariableLib.inf | 64 +
SecurityPkg/Library/ProtectedVariableLib/PeiProtectedVariableLib.inf | 68 +
SecurityPkg/Library/ProtectedVariableLib/SmmProtectedVariableLib.inf | 67 +
SecurityPkg/Library/ProtectedVariableLib/SmmRuntimeProtectedVariableLib.inf | 62 +
SecurityPkg/Library/VariableKeyLib/VariableKeyLib.inf | 36 +
MdeModulePkg/Include/Guid/ProtectedVariable.h | 22 +
MdeModulePkg/Include/Library/AuthVariableLib.h | 4 +-
MdeModulePkg/Include/Library/EncryptionVariableLib.h | 165 ++
MdeModulePkg/Include/Library/ProtectedVariableLib.h | 700 +++++++
MdeModulePkg/Universal/Variable/Pei/Variable.h | 80 +-
MdeModulePkg/Universal/Variable/Pei/VariableParsing.h | 309 +++
MdeModulePkg/Universal/Variable/Pei/VariableStore.h | 116 ++
MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h | 126 +-
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h | 91 +-
MdePkg/Include/Ppi/ReadOnlyVariable2.h | 4 +-
SecurityPkg/Include/Library/RpmcLib.h | 15 +-
SecurityPkg/Include/Library/VariableKeyLib.h | 37 +-
SecurityPkg/Include/Ppi/KeyServicePpi.h | 57 +
SecurityPkg/Library/EncryptionVariableLib/EncryptionVariable.h | 49 +
SecurityPkg/Library/ProtectedVariableLib/ProtectedVariableInternal.h | 611 ++++++
MdeModulePkg/Library/ProtectedVariableLibNull/ProtectedVariable.c | 449 ++++
MdeModulePkg/Universal/Variable/Pei/Variable.c | 886 ++------
MdeModulePkg/Universal/Variable/Pei/VariableParsing.c | 941 +++++++++
MdeModulePkg/Universal/Variable/Pei/VariableStore.c | 305 +++
MdeModulePkg/Universal/Variable/RuntimeDxe/Reclaim.c | 349 +++-
MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 2139 +++++++++++---------
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c | 26 +-
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableExLib.c | 167 +-
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.c | 194 +-
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c | 320 ++-
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeCache.c | 2 +-
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c | 39 +-
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c | 41 +-
SecurityPkg/Library/EncryptionVariableLib/EncryptionVariable.c | 728 +++++++
SecurityPkg/Library/EncryptionVariableLibNull/EncryptionVariable.c | 107 +
SecurityPkg/Library/ProtectedVariableLib/ProtectedVariableCommon.c | 2095 +++++++++++++++++++
SecurityPkg/Library/ProtectedVariableLib/ProtectedVariableDxe.c | 163 ++
SecurityPkg/Library/ProtectedVariableLib/ProtectedVariablePei.c | 1331 ++++++++++++
SecurityPkg/Library/ProtectedVariableLib/ProtectedVariableSmm.c | 209 ++
SecurityPkg/Library/ProtectedVariableLib/ProtectedVariableSmmDxeCommon.c | 975 +++++++++
SecurityPkg/Library/ProtectedVariableLib/ProtectedVariableSmmRuntime.c | 233 +++
SecurityPkg/Library/RpmcLibNull/RpmcLibNull.c | 8 +-
SecurityPkg/Library/VariableKeyLib/VariableKeyLib.c | 59 +
SecurityPkg/Library/VariableKeyLibNull/VariableKeyLibNull.c | 6 +-
SecurityPkg/Library/EncryptionVariableLibNull/EncryptionVariableLibNull.uni | 16 +
69 files changed, 12845 insertions(+), 1863 deletions(-)
create mode 100644 MdeModulePkg/Library/ProtectedVariableLibNull/ProtectedVariableLibNull.inf
create mode 100644 SecurityPkg/Library/EncryptionVariableLib/EncryptionVariableLib.inf
create mode 100644 SecurityPkg/Library/EncryptionVariableLibNull/EncryptionVariableLibNull.inf
create mode 100644 SecurityPkg/Library/ProtectedVariableLib/DxeProtectedVariableLib.inf
create mode 100644 SecurityPkg/Library/ProtectedVariableLib/PeiProtectedVariableLib.inf
create mode 100644 SecurityPkg/Library/ProtectedVariableLib/SmmProtectedVariableLib.inf
create mode 100644 SecurityPkg/Library/ProtectedVariableLib/SmmRuntimeProtectedVariableLib.inf
create mode 100644 SecurityPkg/Library/VariableKeyLib/VariableKeyLib.inf
create mode 100644 MdeModulePkg/Include/Guid/ProtectedVariable.h
create mode 100644 MdeModulePkg/Include/Library/EncryptionVariableLib.h
create mode 100644 MdeModulePkg/Include/Library/ProtectedVariableLib.h
create mode 100644 MdeModulePkg/Universal/Variable/Pei/VariableParsing.h
create mode 100644 MdeModulePkg/Universal/Variable/Pei/VariableStore.h
create mode 100644 SecurityPkg/Include/Ppi/KeyServicePpi.h
create mode 100644 SecurityPkg/Library/EncryptionVariableLib/EncryptionVariable.h
create mode 100644 SecurityPkg/Library/ProtectedVariableLib/ProtectedVariableInternal.h
create mode 100644 MdeModulePkg/Library/ProtectedVariableLibNull/ProtectedVariable.c
create mode 100644 MdeModulePkg/Universal/Variable/Pei/VariableParsing.c
create mode 100644 MdeModulePkg/Universal/Variable/Pei/VariableStore.c
create mode 100644 SecurityPkg/Library/EncryptionVariableLib/EncryptionVariable.c
create mode 100644 SecurityPkg/Library/EncryptionVariableLibNull/EncryptionVariable.c
create mode 100644 SecurityPkg/Library/ProtectedVariableLib/ProtectedVariableCommon.c
create mode 100644 SecurityPkg/Library/ProtectedVariableLib/ProtectedVariableDxe.c
create mode 100644 SecurityPkg/Library/ProtectedVariableLib/ProtectedVariablePei.c
create mode 100644 SecurityPkg/Library/ProtectedVariableLib/ProtectedVariableSmm.c
create mode 100644 SecurityPkg/Library/ProtectedVariableLib/ProtectedVariableSmmDxeCommon.c
create mode 100644 SecurityPkg/Library/ProtectedVariableLib/ProtectedVariableSmmRuntime.c
create mode 100644 SecurityPkg/Library/VariableKeyLib/VariableKeyLib.c
create mode 100644 SecurityPkg/Library/EncryptionVariableLibNull/EncryptionVariableLibNull.uni


[edk2-staging][PATCH] edk2-staging/RedfishClientPkg: Introduce Redfish event library

Nickle Wang
 

Add RedfishEventLib to Redfish client package. This library provides
interface for Redfish feature drivers to listen to Redfish event
such as the event before provisioning and the event after
provisioning. Feature driver can perform additional operation before
and after Redfish provisioning.

Signed-off-by: Nickle Wang <nickle.wang@...>
Cc: Abner Chang <abner.chang@...>
---
.../Include/Guid/RedfishClientEventGroup.h | 27 ++++
.../Include/Library/RedfishEventLib.h | 77 ++++++++++
.../Library/RedfishEventLib/RedfishEventLib.c | 139 ++++++++++++++++++
.../RedfishEventLib/RedfishEventLib.inf | 38 +++++
RedfishClientPkg/RedfishClientLibs.dsc.inc | 2 +-
RedfishClientPkg/RedfishClientPkg.dec | 7 +-
6 files changed, 288 insertions(+), 2 deletions(-)
create mode 100644 RedfishClientPkg/Include/Guid/RedfishClientEventGroup.h
create mode 100644 RedfishClientPkg/Include/Library/RedfishEventLib.h
create mode 100644 RedfishClientPkg/Library/RedfishEventLib/RedfishEventLi=
b.c
create mode 100644 RedfishClientPkg/Library/RedfishEventLib/RedfishEventLi=
b.inf

diff --git a/RedfishClientPkg/Include/Guid/RedfishClientEventGroup.h b/Redf=
ishClientPkg/Include/Guid/RedfishClientEventGroup.h
new file mode 100644
index 0000000000..0d88dd4726
--- /dev/null
+++ b/RedfishClientPkg/Include/Guid/RedfishClientEventGroup.h
@@ -0,0 +1,27 @@
+/** @file=0D
+ GUID for Redfish Client Event Group GUID=0D
+=0D
+ (C) Copyright 2022 Hewlett Packard Enterprise Development LP<BR>=0D
+=0D
+ SPDX-License-Identifier: BSD-2-Clause-Patent=0D
+=0D
+**/=0D
+=0D
+#ifndef REDFISH_CLIENT_EVENT_GROUP_GUID_H_=0D
+#define REDFISH_CLIENT_EVENT_GROUP_GUID_H_=0D
+=0D
+#define REDFISH_CLIENT_FEATURE_READY_TO_PROVISIONING_GUID \=0D
+ { \=0D
+ 0x77E4FC1C, 0x2428, 0x47EE, { 0x9E, 0xEC, 0x8B, 0x77, 0xEF, 0x9D, 0x4E=
, 0xF0 } \=0D
+ }=0D
+=0D
+extern EFI_GUID gEfiRedfishClientFeatureReadyToProvisioningGuid;=0D
+=0D
+#define REDFISH_CLIENT_FEATURE_AFTER_PROVISIONING_GUID \=0D
+ { \=0D
+ 0xE547CB6F, 0x306F, 0x4226, { 0xAB, 0x70, 0xA0, 0x6E, 0x26, 0xF1, 0x2E=
, 0xD0 } \=0D
+ }=0D
+=0D
+extern EFI_GUID gEfiRedfishClientFeatureAfterProvisioningGuid;=0D
+=0D
+#endif=0D
diff --git a/RedfishClientPkg/Include/Library/RedfishEventLib.h b/RedfishCl=
ientPkg/Include/Library/RedfishEventLib.h
new file mode 100644
index 0000000000..1f3d0acf19
--- /dev/null
+++ b/RedfishClientPkg/Include/Library/RedfishEventLib.h
@@ -0,0 +1,77 @@
+/** @file=0D
+ This file defines the Redfish event library interface.=0D
+=0D
+ (C) Copyright 2022 Hewlett Packard Enterprise Development LP<BR>=0D
+=0D
+ SPDX-License-Identifier: BSD-2-Clause-Patent=0D
+=0D
+**/=0D
+=0D
+#ifndef REDFISH_EVENT_LIB_H_=0D
+#define REDFISH_EVENT_LIB_H_=0D
+=0D
+#include <Uefi.h>=0D
+=0D
+/**=0D
+ Create an EFI event before Redfish provisioning start.=0D
+=0D
+ @param NotifyFunction The notification function to call when=
the event is signaled.=0D
+ @param NotifyContext The content to pass to NotifyFunction =
when the event is signaled.=0D
+ @param ReadyToProvisioningEvent Returns the EFI event returned from gB=
S->CreateEvent(Ex).=0D
+=0D
+ @retval EFI_SUCCESS Event was created.=0D
+ @retval Other Event was not created.=0D
+=0D
+**/=0D
+EFI_STATUS=0D
+EFIAPI=0D
+CreateReadyToProvisioningEvent (=0D
+ IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL=0D
+ IN VOID *NotifyContext, OPTIONAL=0D
+ OUT EFI_EVENT *ReadyToProvisioningEvent=0D
+ );=0D
+=0D
+/**=0D
+ Create an EFI event after Redfish provisioning finished.=0D
+=0D
+ @param NotifyFunction The notification function to call when=
the event is signaled.=0D
+ @param NotifyContext The content to pass to NotifyFunction =
when the event is signaled.=0D
+ @param ReadyToProvisioningEvent Returns the EFI event returned from gB=
S->CreateEvent(Ex).=0D
+=0D
+ @retval EFI_SUCCESS Event was created.=0D
+ @retval Other Event was not created.=0D
+=0D
+**/=0D
+EFI_STATUS=0D
+EFIAPI=0D
+CreateAfterProvisioningEvent (=0D
+ IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL=0D
+ IN VOID *NotifyContext, OPTIONAL=0D
+ OUT EFI_EVENT *ReadyToProvisioningEvent=0D
+ );=0D
+=0D
+/**=0D
+ Signal ready to provisioning event.=0D
+=0D
+ @retval EFI_SUCCESS Event was created.=0D
+ @retval Other Event was not created.=0D
+=0D
+**/=0D
+EFI_STATUS=0D
+SignalReadyToProvisioningEvent (=0D
+ IN VOID=0D
+ );=0D
+=0D
+/**=0D
+ Signal after provisioning event.=0D
+=0D
+ @retval EFI_SUCCESS Event was created.=0D
+ @retval Other Event was not created.=0D
+=0D
+**/=0D
+EFI_STATUS=0D
+SignalAfterProvisioningEvent (=0D
+ IN VOID=0D
+ );=0D
+=0D
+#endif=0D
diff --git a/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.c b/R=
edfishClientPkg/Library/RedfishEventLib/RedfishEventLib.c
new file mode 100644
index 0000000000..1c8cfe53c7
--- /dev/null
+++ b/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.c
@@ -0,0 +1,139 @@
+/** @file=0D
+ Redfish event library implementation.=0D
+=0D
+ (C) Copyright 2022 Hewlett Packard Enterprise Development LP<BR>=0D
+=0D
+ SPDX-License-Identifier: BSD-2-Clause-Patent=0D
+=0D
+**/=0D
+=0D
+#include <Uefi.h>=0D
+=0D
+#include <Guid/RedfishClientEventGroup.h>=0D
+=0D
+#include <Library/UefiLib.h>=0D
+#include <Library/BaseLib.h>=0D
+#include <Library/DebugLib.h>=0D
+#include <Library/UefiBootServicesTableLib.h>=0D
+#include <Library/RedfishEventLib.h>=0D
+=0D
+/**=0D
+ Create an EFI event before Redfish provisioning start.=0D
+=0D
+ @param NotifyFunction The notification function to call when=
the event is signaled.=0D
+ @param NotifyContext The content to pass to NotifyFunction =
when the event is signaled.=0D
+ @param ReadyToProvisioningEvent Returns the EFI event returned from gB=
S->CreateEvent(Ex).=0D
+=0D
+ @retval EFI_SUCCESS Event was created.=0D
+ @retval Other Event was not created.=0D
+=0D
+**/=0D
+EFI_STATUS=0D
+EFIAPI=0D
+CreateReadyToProvisioningEvent (=0D
+ IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL=0D
+ IN VOID *NotifyContext, OPTIONAL=0D
+ OUT EFI_EVENT *ReadyToProvisioningEvent=0D
+ )=0D
+{=0D
+ EFI_STATUS Status;=0D
+=0D
+ Status =3D gBS->CreateEventEx (=0D
+ EVT_NOTIFY_SIGNAL,=0D
+ TPL_CALLBACK,=0D
+ (NotifyFunction =3D=3D NULL ? EfiEventEmptyFunction : No=
tifyFunction),=0D
+ NotifyContext,=0D
+ &gEfiRedfishClientFeatureReadyToProvisioningGuid,=0D
+ ReadyToProvisioningEvent=0D
+ );=0D
+=0D
+ return Status;=0D
+}=0D
+=0D
+/**=0D
+ Create an EFI event after Redfish provisioning finished.=0D
+=0D
+ @param NotifyFunction The notification function to call when=
the event is signaled.=0D
+ @param NotifyContext The content to pass to NotifyFunction =
when the event is signaled.=0D
+ @param ReadyToProvisioningEvent Returns the EFI event returned from gB=
S->CreateEvent(Ex).=0D
+=0D
+ @retval EFI_SUCCESS Event was created.=0D
+ @retval Other Event was not created.=0D
+=0D
+**/=0D
+EFI_STATUS=0D
+EFIAPI=0D
+CreateAfterProvisioningEvent (=0D
+ IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL=0D
+ IN VOID *NotifyContext, OPTIONAL=0D
+ OUT EFI_EVENT *ReadyToProvisioningEvent=0D
+ )=0D
+{=0D
+ EFI_STATUS Status;=0D
+=0D
+ Status =3D gBS->CreateEventEx (=0D
+ EVT_NOTIFY_SIGNAL,=0D
+ TPL_CALLBACK,=0D
+ (NotifyFunction =3D=3D NULL ? EfiEventEmptyFunction : No=
tifyFunction),=0D
+ NotifyContext,=0D
+ &gEfiRedfishClientFeatureAfterProvisioningGuid,=0D
+ ReadyToProvisioningEvent=0D
+ );=0D
+=0D
+ return Status;=0D
+}=0D
+=0D
+/**=0D
+ Signal ready to provisioning event.=0D
+=0D
+ @retval EFI_SUCCESS Event was created.=0D
+ @retval Other Event was not created.=0D
+=0D
+**/=0D
+EFI_STATUS=0D
+SignalReadyToProvisioningEvent (=0D
+ IN VOID=0D
+ )=0D
+{=0D
+ EFI_STATUS Status;=0D
+ EFI_EVENT Event;=0D
+=0D
+ Status =3D CreateReadyToProvisioningEvent (NULL, NULL, &Event);=0D
+ if (EFI_ERROR (Status)) {=0D
+ DEBUG ((DEBUG_ERROR, "%a, failed to create after provisioning event\n"=
, __FUNCTION__));=0D
+ return Status;=0D
+ }=0D
+=0D
+ gBS->SignalEvent (Event);=0D
+ gBS->CloseEvent (Event);=0D
+=0D
+ return EFI_SUCCESS;=0D
+}=0D
+=0D
+/**=0D
+ Signal after provisioning event.=0D
+=0D
+ @retval EFI_SUCCESS Event was created.=0D
+ @retval Other Event was not created.=0D
+=0D
+**/=0D
+EFI_STATUS=0D
+SignalAfterProvisioningEvent (=0D
+ IN VOID=0D
+ )=0D
+{=0D
+ EFI_STATUS Status;=0D
+ EFI_EVENT Event;=0D
+=0D
+ Status =3D CreateAfterProvisioningEvent (NULL, NULL, &Event);=0D
+ if (EFI_ERROR (Status)) {=0D
+ DEBUG ((DEBUG_ERROR, "%a, failed to create after provisioning event\n"=
, __FUNCTION__));=0D
+ return Status;=0D
+ }=0D
+=0D
+ gBS->SignalEvent (Event);=0D
+ gBS->CloseEvent (Event);=0D
+=0D
+ return EFI_SUCCESS;=0D
+}=0D
+=0D
diff --git a/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.inf b=
/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.inf
new file mode 100644
index 0000000000..edafca0c65
--- /dev/null
+++ b/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.inf
@@ -0,0 +1,38 @@
+## @file=0D
+#=0D
+# (C) Copyright 2022 Hewlett Packard Enterprise Development LP<BR>=0D
+#=0D
+# SPDX-License-Identifier: BSD-2-Clause-Patent=0D
+#=0D
+##=0D
+=0D
+[Defines]=0D
+ INF_VERSION =3D 0x00010006=0D
+ BASE_NAME =3D RedfishEventLib=0D
+ FILE_GUID =3D C4F7E27D-2338-43EA-9D1F-D10960E36521=
=0D
+ MODULE_TYPE =3D DXE_DRIVER=0D
+ VERSION_STRING =3D 1.0=0D
+ LIBRARY_CLASS =3D RedfishEventLib| DXE_DRIVER UEFI_DRIV=
ER=0D
+=0D
+#=0D
+# VALID_ARCHITECTURES =3D IA32 X64 EBC=0D
+#=0D
+=0D
+[Sources]=0D
+ RedfishEventLib.c=0D
+=0D
+[Packages]=0D
+ MdePkg/MdePkg.dec=0D
+ MdeModulePkg/MdeModulePkg.dec=0D
+ RedfishPkg/RedfishPkg.dec=0D
+ RedfishClientPkg/RedfishClientPkg.dec=0D
+=0D
+[LibraryClasses]=0D
+ BaseLib=0D
+ DebugLib=0D
+ UefiBootServicesTableLib=0D
+ UefiLib=0D
+=0D
+[Guids]=0D
+ gEfiRedfishClientFeatureReadyToProvisioningGuid=0D
+ gEfiRedfishClientFeatureAfterProvisioningGuid=0D
diff --git a/RedfishClientPkg/RedfishClientLibs.dsc.inc b/RedfishClientPkg/=
RedfishClientLibs.dsc.inc
index 5467acedd0..91e5de4296 100644
--- a/RedfishClientPkg/RedfishClientLibs.dsc.inc
+++ b/RedfishClientPkg/RedfishClientLibs.dsc.inc
@@ -27,4 +27,4 @@
RedfishPlatformConfigLib|RedfishPkg/Library/RedfishPlatformConfigLib/Red=
fishPlatformConfigLib.inf=0D
RedfishContentCodingLib|RedfishPkg/Library/RedfishContentCodingLibNull/R=
edfishContentCodingLibNull.inf=0D
ConverterCommonLib|RedfishClientPkg/ConverterLib/edk2library/ConverterCo=
mmonLib/ConverterCommonLib.inf=0D
-=0D
+ RedfishEventLib|RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib=
.inf=0D
diff --git a/RedfishClientPkg/RedfishClientPkg.dec b/RedfishClientPkg/Redfi=
shClientPkg.dec
index 09df062dd3..56e542f03c 100644
--- a/RedfishClientPkg/RedfishClientPkg.dec
+++ b/RedfishClientPkg/RedfishClientPkg.dec
@@ -1,7 +1,7 @@
## @file=0D
# Redfish Client Package=0D
#=0D
-# (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>=0D
+# (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP<BR>=0D
#=0D
# SPDX-License-Identifier: BSD-2-Clause-Patent=0D
##=0D
@@ -21,6 +21,7 @@
=0D
[LibraryClasses]=0D
RedfishFeatureUtilityLib|Include/Library/RedfishFeatureUtilityLib.h=0D
+ RedfishEventLib|Include/Library/RedfishEventLib.h=0D
=0D
[LibraryClasses.Common.Private]=0D
## @libraryclass Redfish Helper Library=0D
@@ -39,6 +40,10 @@
## Include/Guid/RedfishClientPkgTokenSpace.h=0D
gEfiRedfishClientPkgTokenSpaceGuid =3D { 0x8c444dae, 0x728b, 0x48ee, =
{ 0x9e, 0x19, 0x8f, 0x0a, 0x3d, 0x4e, 0x9c, 0xc8 } }=0D
=0D
+ ## Include/Guid/RedfishClientEventGroup.h=0D
+ gEfiRedfishClientFeatureReadyToProvisioningGuid =3D { 0x77E4FC1C, 0x2428=
, 0x47EE, { 0x9E, 0xEC, 0x8B, 0x77, 0xEF, 0x9D, 0x4E, 0xF0 } }=0D
+ gEfiRedfishClientFeatureAfterProvisioningGuid =3D { 0xE547CB6F, 0x306F=
, 0x4226, { 0xAB, 0x70, 0xA0, 0x6E, 0x26, 0xF1, 0x2E, 0xD0 } }=0D
+=0D
[PcdsFixedAtBuild]=0D
gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize|32|UINT=
32|0x10000001=0D
gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaVersionSize|8|UINT=
32|0x10000002=0D
--=20
2.32.0.windows.2


Cancelled Event: TianoCore Bug Triage - APAC / NAMO - Tuesday, May 17, 2022 #cal-cancelled

Group Notification <noreply@...>
 

Cancelled: TianoCore Bug Triage - APAC / NAMO

This event has been cancelled.

When:
Tuesday, May 17, 2022
6:30pm to 7:30pm
(UTC-07:00) America/Los Angeles

Where:
https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTk1YzJhN2UtOGQwNi00NjY4LWEwMTktY2JiODRlYTY1NmY0%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-1242-431b-9a51-92cd01a5df3c%22%7d

Organizer: Liming Gao gaoliming@...

Description:

TianoCore Bug Triage - APAC / NAMO

Hosted by Liming Gao

 

________________________________________________________________________________

Microsoft Teams meeting

Join on your computer or mobile app

Click here to join the meeting

Join with a video conferencing device

teams@...

Video Conference ID: 116 062 094 0

Alternate VTC dialing instructions

Or call in (audio only)

+1 916-245-6934,,77463821#   United States, Sacramento

Phone Conference ID: 774 638 21#

Find a local number | Reset PIN

Learn More | Meeting options


Event: TianoCore Bug Triage - APAC / NAMO - 05/17/2022 #cal-reminder

Group Notification <noreply@...>
 

Reminder: TianoCore Bug Triage - APAC / NAMO

When:
05/17/2022
6:30pm to 7:30pm
(UTC-07:00) America/Los Angeles

Where:
https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTk1YzJhN2UtOGQwNi00NjY4LWEwMTktY2JiODRlYTY1NmY0%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-1242-431b-9a51-92cd01a5df3c%22%7d

Organizer: Liming Gao gaoliming@...

View Event

Description:

TianoCore Bug Triage - APAC / NAMO

Hosted by Liming Gao

 

________________________________________________________________________________

Microsoft Teams meeting

Join on your computer or mobile app

Click here to join the meeting

Join with a video conferencing device

teams@...

Video Conference ID: 116 062 094 0

Alternate VTC dialing instructions

Or call in (audio only)

+1 916-245-6934,,77463821#   United States, Sacramento

Phone Conference ID: 774 638 21#

Find a local number | Reset PIN

Learn More | Meeting options


Re: [PATCH V2 5/6] MdePkg: Probe Cc guest in BaseIoLibIntrinsicSev

Min Xu
 

On May 17, 2022 6:22 AM, dann frazier wrote:
I ran through our tests on stable-202205-rc1, and I'm finding that all of the
tests using 2M FD_SIZE & SMM_REQUIRE=TRUE are failing with QEMU
hanging w/o output. Equivalent tests w/ 4M FD_SIZE are working fine. I
bisected it down to this commit, and also confirmed that reverting this
commit on top of 202205-rc1 also avoids the problem.

I might have a chance to debug more tomorrow, but for now I just wanted to
flag it.
This patch calls CcProbe () to get the Confidential Computing guest type. There are 2 versions of CcProbeLib, one is to get the Cc guest type from PcdOvmfWorkArea, the other is a null instance and it always return CcGuestTypeNonEncrypted (which means it is a legacy vm guest). Only OvmfPkgX64.dsc and IntelTdxX64.dsc include the first one (which probe the PcdOvmfWorkArea).

If this patch is reverted, it means it is to check the guest type by calling CPUID, not reading the PcdOvmfWorkArea.

Can you share your build command and qemu command so that I can try it in my side?

Thanks
Min


Re: [PATCH v3] IntelFsp2Pkg: FSP_TEMP_RAM_INIT call must follow X64 Calling Convention

Chiu, Chasel
 

Thanks for clarification!
In this case, please use "mov rsp, rcx" to support 64bit addressing.

Thanks,
Chasel

-----Original Message-----
From: Duggapu, Chinni B <chinni.b.duggapu@...>
Sent: Tuesday, May 17, 2022 12:33 AM
To: Chiu, Chasel <chasel.chiu@...>; devel@edk2.groups.io
Cc: Desimone, Nathaniel L <nathaniel.l.desimone@...>; Zeng, Star
<star.zeng@...>; S, Ashraf Ali <ashraf.ali.s@...>
Subject: RE: [PATCH v3] IntelFsp2Pkg: FSP_TEMP_RAM_INIT call must
follow X64 Calling Convention

HI Chasel,
Yes, we don't need to modify esp for LoadMicrocodeDefault. However, this
function does couple of MSR Accesses in b/w that would lead to modify RCX
anyway.
So, if not RSP, we need to use different register to save RCX and consume in
the whole function.

That's why I have not changed the usage of RSP to hold the input parameter.



Thanks,
Chinni.

-----Original Message-----
From: Chiu, Chasel <chasel.chiu@...>
Sent: Monday, May 16, 2022 5:38 PM
To: Duggapu, Chinni B <chinni.b.duggapu@...>;
devel@edk2.groups.io
Cc: Desimone, Nathaniel L <nathaniel.l.desimone@...>; Zeng, Star
<star.zeng@...>; S, Ashraf Ali <ashraf.ali.s@...>
Subject: RE: [PATCH v3] IntelFsp2Pkg: FSP_TEMP_RAM_INIT call must
follow X64 Calling Convention


Thanks for correcting format and updating patch per feedbacks!
Just one more comment below inline and please also help to include patch
of
IntelFsp2WrapperPkg\Library\SecFspWrapperPlatformSecLibSample\X64\S
ecEntry.nasm for passing API parameter by RCX.
You might want to create a patch series:
[1/2] IntelFsp2Pkg patch
[2/2] IntelFsp2WrapperPkg patch

Thanks,
Chasel

-----Original Message-----
From: Duggapu, Chinni B <chinni.b.duggapu@...>
Sent: Monday, May 16, 2022 6:54 PM
To: devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@...>; Desimone, Nathaniel L
<nathaniel.l.desimone@...>; Zeng, Star <star.zeng@...>; S,
Ashraf Ali <ashraf.ali.s@...>
Subject: [PATCH v3] IntelFsp2Pkg: FSP_TEMP_RAM_INIT call must follow
X64 Calling Convention

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3926
This API accept one parameter using RCX and this is consumed in
mutiple sub functions.

Cc: Chasel Chiu <chasel.chiu@...>
Cc: Nate DeSimone <nathaniel.l.desimone@...>
Cc: Star Zeng <star.zeng@...>
Cc: Ashraf Ali S <ashraf.ali.s@...>
Signed-off-by: cbduggap <chinni.b.duggapu@...>
---
IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm | 26 ++++++++---------
.../Include/SaveRestoreSseAvxNasm.inc | 28
+++++++++++++++++++
2 files changed, 41 insertions(+), 13 deletions(-)

diff --git a/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm
b/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm
index a9f5f28ed7..9504c96b81 100644
--- a/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm
+++ b/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm
@@ -114,7 +114,7 @@ endstruc
global ASM_PFX(LoadMicrocodeDefault)
ASM_PFX(LoadMicrocodeDefault): ; Inputs:- ; rsp ->
LoadMicrocodeParams pointer+ ; rcx -> LoadMicrocodeParams
pointer ;
Register Usage: ; rsp Preserved ; All others destroyed@@ -130,10
+130,9 @@ ASM_PFX(LoadMicrocodeDefault):
cmp rsp, 0 jz ParamError- mov eax, dword [rsp + 8] ;
Parameter pointer- cmp eax, 0+ cmp ecx, 0 jz ParamError- mov
esp, eax+ mov esp, ecx


I think we do not need to modify esp because now esp/rsp only containing
return address initialized by caller.



; skip loading Microcode if the
MicrocodeCodeSize is zero ; and report error if size is less than 2k@@ -
321,8 +320,7 @@ ASM_PFX(EstablishStackFsp):
; ; Save parameter pointer in rdx ;- mov rdx, qword [rsp + 8]-+
mov
rdx, rcx ; ; Enable FSP STACK ;@@ -420,7 +418,10 @@
ASM_PFX(TempRamInitApi):
; ENABLE_SSE ENABLE_AVX-+ ;+ ; Save Input Parameter in
YMM10+ ;+
SAVE_RCX ; ; Save RBP, RBX, RSI, RDI and RSP in YMM7, YMM8 and
YMM6 ;@@ -442,9 +443,8 @@ ASM_PFX(TempRamInitApi):
; ; Check Parameter ;- mov rax, qword [rsp + 8]- cmp rax, 0-
mov rax, 08000000000000002h+ cmp rcx, 0+ mov rcx,
08000000000000002h jz TempRamInitExit ;@@ -455,18 +455,18
@@ ASM_PFX(TempRamInitApi):
jnz TempRamInitExit ; Load microcode- LOAD_RSP+ LOAD_RCX
CALL_YMM ASM_PFX(LoadMicrocodeDefault) SAVE_UCODE_STATUS
rax ; Save microcode return status in SLOT 0 in YMM9 (upper
128bits). ; @note If return value rax is not 0, microcode did not load, but
continue and attempt to boot. ; Call Sec CAR Init- LOAD_RSP+
LOAD_RCX
CALL_YMM ASM_PFX(SecCarInit) cmp rax, 0 jnz
TempRamInitExit
- LOAD_RSP+ LOAD_RCX CALL_YMM ASM_PFX(EstablishStackFsp)
cmp
rax, 0 jnz TempRamInitExitdiff --git
a/IntelFsp2Pkg/Include/SaveRestoreSseAvxNasm.inc
b/IntelFsp2Pkg/Include/SaveRestoreSseAvxNasm.inc
index e8bd91669d..38c807a311 100644
--- a/IntelFsp2Pkg/Include/SaveRestoreSseAvxNasm.inc
+++ b/IntelFsp2Pkg/Include/SaveRestoreSseAvxNasm.inc
@@ -177,6 +177,30 @@
LXMMN xmm5, %1, 1 %endmacro +;+; Upper half of
YMM10 to save/restore RCX+;+;+; Save RCX to YMM10[128:191]+;
Modified: XMM5 and YMM10+;++%macro SAVE_RCX 0+ LYMMN
ymm10, xmm5, 1+ SXMMN xmm5, 0, rcx+ SYMMN
ymm10,
1, xmm5+ %endmacro++;+; Restore RCX from YMM10[128:191]+;
Modified: XMM5 and RCX+;++%macro LOAD_RCX 0+ LYMMN
ymm10, xmm5, 1+ movq rcx, xmm5+ %endmacro+ ; ;
YMM7[128:191] for calling stack ; arg 1:Entry@@ -231,6 +255,7 @@
NextAddress:
; Use CpuId instruction (CPUID.01H:EDX.SSE[bit 25] = 1) to
test ; whether the processor supports SSE instruction. ;+
mov r10, rcx mov rax, 1 cpuid bt rdx, 25@@ -
241,6 +266,7 @@ NextAddress:
; bt ecx, 19 jnc SseError+ mov rcx,
r10 ; ; Set OSFXSR bit (bit #9) & OSXMMEXCPT bit (bit
#10)@@ -258,6 +284,7 @@ NextAddress:
%endmacro %macro ENABLE_AVX 0+ mov r10, rcx
mov eax, 1 cpuid and ecx, 10000000h@@ -280,5
+307,6
@@ EnableAvx:
xgetbv ; result in edx:eax or eax, 00000006h ;
Set
XCR0 bit #1 and bit #2 to enable SSE state and AVX state xsetbv+
mov rcx, r10 %endmacro --
2.36.0.windows.1


Re: System S3 via UEFI shell

Steven Shi
 

As far as I know, there is no general(safe) way to do S3 in Uefi shell. There is no AML interpreter driver in UEFI shell to run the platform ASL code.

 

The warm reset is different from the S3 resume.

 

 

Thanks

 

Steven Shi

 

 

From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Rafael Machado
Sent: Tuesday, May 17, 2022 3:11 AM
To: devel@edk2.groups.io
Subject: [edk2-devel] System S3 via UEFI shell

 

Hi everyone

 

I have a question.

Is there a way to put a system to sleep (S3) via UEFI shell?

 

Checking the UEFIshell spec, there is the reset command, that can be triggered with parameter -w, that would cause a warm boot. But I am not sure if warm boot and a S3 resume are the same.

 

Any comments?

 

Thanks

Rafael

 


Now: Tools, CI, Code base construction meeting series - 05/16/2022 #cal-notice

Group Notification <noreply@...>
 

Tools, CI, Code base construction meeting series

When:
05/16/2022
4:30pm to 5:30pm
(UTC-07:00) America/Los Angeles

Where:
https://github.com/tianocore/edk2/discussions/2614

View Event

Description:

TianoCore community,

Microsoft and Intel will be hosting a series of open meetings to discuss build, CI, tools, and other related topics. If you are interested, have ideas/opinions please join us. These meetings will be Monday 4:30pm Pacific Time on Microsoft Teams.

MS Teams Link in following discussion: * https://github.com/tianocore/edk2/discussions/2614

Anyone is welcome to join.

MS Teams Browser Clients * https://docs.microsoft.com/en-us/microsoftteams/get-clients?tabs=Windows#browser-client


[PATCH] MdeModulePkg/UefiBootManagerLib: Configurable New Boot Options

Ashish Singhal
 

Add a new PCD to be able to configure whether newly detected boot options
are to be added at the beginning of the current boot options list or at
the end.

Signed-off-by: Ashish Singhal <ashishsingha@...>
---
MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 6 +++++-
.../Library/UefiBootManagerLib/UefiBootManagerLib.inf | 1 +
MdeModulePkg/MdeModulePkg.dec | 5 +++++
MdeModulePkg/MdeModulePkg.uni | 4 ++++
4 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index 962892d38f..8a46100c2a 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -2435,7 +2435,11 @@ EfiBootManagerRefreshAllBootOption (
//
for (Index = 0; Index < BootOptionCount; Index++) {
if (EfiBootManagerFindLoadOption (&BootOptions[Index], NvBootOptions, NvBootOptionCount) == -1) {
- EfiBootManagerAddLoadOptionVariable (&BootOptions[Index], (UINTN)-1);
+ if (PcdGetBool (PcdNewBootOptionAtStart)) {
+ EfiBootManagerAddLoadOptionVariable (&BootOptions[Index], 0);
+ } else {
+ EfiBootManagerAddLoadOptionVariable (&BootOptions[Index], (UINTN)-1);
+ }
//
// Try best to add the boot options so continue upon failure.
//
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
index fe05d5f1cc..46f41a7c63 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
+++ b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
@@ -119,3 +119,4 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdDriverHealthConfigureForm ## SOMETIMES_CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxRepairCount ## CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdNewBootOptionAtStart ## CONSUMES
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index cf79292ec8..9d696f117b 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -2146,6 +2146,11 @@
# @Prompt GHCB Pool Size
gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbSize|0|UINT64|0x00030008

+ ## This dynamic PCD holds the flag to tell UEFI boot manager whether to add newly detected devices at
+ # the end, or at the start of the boot option.
+ # @Prompt Add new devices in boot options at start
+ gEfiMdeModulePkgTokenSpaceGuid.PcdNewBootOptionAtStart|FALSE|BOOLEAN|0x00030009
+
[PcdsDynamicEx]
## This dynamic PCD enables the default variable setting.
# Its value is the default store ID value. The default value is zero as Standard default.
diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni
index b070f15ff2..8e68db1c25 100644
--- a/MdeModulePkg/MdeModulePkg.uni
+++ b/MdeModulePkg/MdeModulePkg.uni
@@ -1325,6 +1325,10 @@

#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdGhcbBase_HELP #language en-US "Used with SEV-ES support to identify an address range that is not to be encrypted."

+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdNewBootOptionAtStart_PROMPT #language en-US "Add new devices in boot options at start"
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdNewBootOptionAtStart_HELP #language en-US "Used by UEFI boot manager to decide whether to place newly detcted devices at start of the list or end."
+
#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdGhcbSize_PROMPT #language en-US "Guest-Hypervisor Communication Block (GHCB) Pool Base Size"

#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdGhcbSize_HELP #language en-US "Used with SEV-ES support to identify the size of the address range that is not to be encrypted."
--
2.17.1


Re: [PATCH V2 5/6] MdePkg: Probe Cc guest in BaseIoLibIntrinsicSev

dann frazier
 

On Fri, Apr 15, 2022 at 08:07:08AM +0800, Min Xu wrote:
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3902

Bad IO performance in SEC phase is observed after TDX features was
introduced. (after commit b6b2de884864 - "MdePkg: Support mmio for
Tdx guest in BaseIoLibIntrinsic").

This is because IsTdxGuest() will be called in each MMIO operation.
It is trying to cache the result of the probe in the efi data segment.
However, that doesn't work in SEC, because the data segment is read only
(so the write seems to succeed but a read will always return the
original value), leading to us calling TdIsEnabled() check for every
mmio we do, which is causing the slowdown because it's very expensive.

This patch is to call CcProbe instead of TdIsEnabled in IsTdxGuest.
Null instance of CcProbe always returns CCGuestTypeNonEncrypted. Its
OvmfPkg version returns the guest type in Ovmf work area.
Hi!

I ran through our tests on stable-202205-rc1, and I'm finding that all
of the tests using 2M FD_SIZE & SMM_REQUIRE=TRUE are failing with
QEMU hanging w/o output. Equivalent tests w/ 4M FD_SIZE are working
fine. I bisected it down to this commit, and also confirmed that
reverting this commit on top of 202205-rc1 also avoids the problem.

I might have a chance to debug more tomorrow, but for now I just
wanted to flag it.

-dann

Cc: Michael D Kinney <michael.d.kinney@...>
Cc: Liming Gao <gaoliming@...>
Cc: Zhiguang Liu <zhiguang.liu@...>
Cc: James Bottomley <jejb@...>
Cc: James Bottomley <James.Bottomley@...>
Cc: Jiewen Yao <jiewen.yao@...>
Cc: Gerd Hoffmann <kraxel@...>
Signed-off-by: Min Xu <min.m.xu@...>
---
.../BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf | 1 +
.../Library/BaseIoLibIntrinsic/IoLibInternalTdx.c | 13 ++-----------
2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf b/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf
index 7fe1c60f046e..e1b8298ac451 100644
--- a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf
+++ b/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf
@@ -55,6 +55,7 @@
DebugLib
BaseLib
RegisterFilterLib
+ CcProbeLib

[LibraryClasses.X64]
TdxLib
diff --git a/MdePkg/Library/BaseIoLibIntrinsic/IoLibInternalTdx.c b/MdePkg/Library/BaseIoLibIntrinsic/IoLibInternalTdx.c
index 1e539dbfbbad..8af6fc35c591 100644
--- a/MdePkg/Library/BaseIoLibIntrinsic/IoLibInternalTdx.c
+++ b/MdePkg/Library/BaseIoLibIntrinsic/IoLibInternalTdx.c
@@ -10,6 +10,7 @@
#include <Include/IndustryStandard/Tdx.h>
#include <Library/TdxLib.h>
#include <Register/Intel/Cpuid.h>
+#include <Library/CcProbeLib.h>
#include "IoLibTdx.h"

// Size of TDVMCALL Access, including IO and MMIO
@@ -22,9 +23,6 @@
#define TDVMCALL_ACCESS_READ 0
#define TDVMCALL_ACCESS_WRITE 1

-BOOLEAN mTdxEnabled = FALSE;
-BOOLEAN mTdxProbed = FALSE;
-
/**
Check if it is Tdx guest.

@@ -38,14 +36,7 @@ IsTdxGuest (
VOID
)
{
- if (mTdxProbed) {
- return mTdxEnabled;
- }
-
- mTdxEnabled = TdIsEnabled ();
- mTdxProbed = TRUE;
-
- return mTdxEnabled;
+ return CcProbe () == CCGuestTypeIntelTdx;
}

/**


How to prevent a DXE driver from loading automatically

King Sumo
 

Hi All,

I'm including EFI drivers for an Intel Network card, but this adds a huge delay in the system startup when the ports are being initialized (the server has several slots). The network cards will be used only for PXE boot during the staging/setup process, so I'm thinking of adding a configurable option to enable/disable the PXE boot. So only if enabled the drivers will be loaded, and after the staging the PXE can be disabled via BMC or something else.

Do we have any way to prevent a driver from being loaded automatically? Such as using some conditions or dependencies? For instance, if some driver is not loaded or some protocol isn't available?

One option will be setting the EFI files as RAW or FREEFORM so they will not be recognized as a DRIVER during the DXE phase. But it will be required to implement the driver loading, I'm not sure how difficult it will be (maybe using GetSectionFromAnyFv to load the contents to a buffer, but how to load it?). 

Kind Regards,
Sumo


[PATCH] OvmfPkg: Make an Ia32/X64 hybrid build work with SEV

Lendacky, Thomas
 

The BaseMemEncryptSevLib functionality was updated to rely on the use of
the OVMF/SEV workarea to check for SEV guests. However, this area is only
updated when running the X64 OVMF build, not the hybrid Ia32/X64 build.
Base SEV support is allowed under the Ia32/X64 build, but it now fails
to boot as a result of the change.

Update the ResetVector code to check for SEV features when built for
32-bit mode, not just 64-bit mode (requiring updates to both the Ia32
and Ia32X64 fdf files).

Fixes: f1d1c337e7c0575da7fd248b2dd9cffc755940df
Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jordan Justen <jordan.l.justen@...>
Cc: Gerd Hoffmann <kraxel@...>
Cc: Erdem Aktas <erdemaktas@...>
Cc: James Bottomley <jejb@...>
Cc: Michael Roth <michael.roth@...>
Cc: Min Xu <min.m.xu@...>
Signed-off-by: Tom Lendacky <thomas.lendacky@...>
---
OvmfPkg/OvmfPkgIa32.fdf | 11 +++
OvmfPkg/OvmfPkgIa32X64.fdf | 8 +++
OvmfPkg/OvmfPkgX64.fdf | 3 +-
OvmfPkg/ResetVector/Ia32/AmdSev.asm | 4 ++
OvmfPkg/ResetVector/Main.asm | 6 ++
OvmfPkg/ResetVector/ResetVector.nasmb | 72 ++++++++++----------
6 files changed, 67 insertions(+), 37 deletions(-)

diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
index 3ab1755749d4..57d13b7130bc 100644
--- a/OvmfPkg/OvmfPkgIa32.fdf
+++ b/OvmfPkg/OvmfPkgIa32.fdf
@@ -76,6 +76,9 @@ [FD.MEMFD]
0x007000|0x001000
gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|gUefiOvmfPkgTokenSpaceGuid.PcdGuidedExtractHandlerTableSize

+0x008000|0x001000
+gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaSize
+
0x010000|0x010000
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize

@@ -87,6 +90,14 @@ [FD.MEMFD]
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize
FV = DXEFV

+##########################################################################################
+# Set the SEV-ES specific work area PCDs (used for all forms of SEV since the
+# the SEV STATUS MSR is now saved in the work area)
+#
+SET gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase = $(MEMFD_BASE_ADDRESS) + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader
+SET gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaSize = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaSize - gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader
+##########################################################################################
+
################################################################################

[FV.SECFV]
diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf
index e1638fa6ea38..ccde366887a9 100644
--- a/OvmfPkg/OvmfPkgIa32X64.fdf
+++ b/OvmfPkg/OvmfPkgIa32X64.fdf
@@ -90,6 +90,14 @@ [FD.MEMFD]
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize
FV = DXEFV

+##########################################################################################
+# Set the SEV-ES specific work area PCDs (used for all forms of SEV since the
+# the SEV STATUS MSR is now saved in the work area)
+#
+SET gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase = $(MEMFD_BASE_ADDRESS) + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader
+SET gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaSize = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaSize - gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader
+##########################################################################################
+
################################################################################

[FV.SECFV]
diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
index aa9a83032d9b..438806fba8f1 100644
--- a/OvmfPkg/OvmfPkgX64.fdf
+++ b/OvmfPkg/OvmfPkgX64.fdf
@@ -106,7 +106,8 @@ [FD.MEMFD]
FV = DXEFV

##########################################################################################
-# Set the SEV-ES specific work area PCDs
+# Set the SEV-ES specific work area PCDs (used for all forms of SEV since the
+# the SEV STATUS MSR is now saved in the work area)
#
SET gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase = $(MEMFD_BASE_ADDRESS) + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader
SET gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaSize = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaSize - gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader
diff --git a/OvmfPkg/ResetVector/Ia32/AmdSev.asm b/OvmfPkg/ResetVector/Ia32/AmdSev.asm
index 864d68385342..9350b0406833 100644
--- a/OvmfPkg/ResetVector/Ia32/AmdSev.asm
+++ b/OvmfPkg/ResetVector/Ia32/AmdSev.asm
@@ -150,6 +150,8 @@ BITS 32
SevEsUnexpectedRespTerminate:
TerminateVmgExit TERM_UNEXPECTED_RESP_CODE

+%ifdef ARCH_X64
+
; If SEV-ES is enabled then initialize and make the GHCB page shared
SevClearPageEncMaskForGhcbPage:
; Check if SEV is enabled
@@ -209,6 +211,8 @@ GetSevCBitMaskAbove31:
GetSevCBitMaskAbove31Exit:
OneTimeCallRet GetSevCBitMaskAbove31

+%endif
+
; Check if Secure Encrypted Virtualization (SEV) features are enabled.
;
; Register usage is tight in this routine, so multiple calls for the
diff --git a/OvmfPkg/ResetVector/Main.asm b/OvmfPkg/ResetVector/Main.asm
index 5cfc0b5c72b1..46cfa87c4c0a 100644
--- a/OvmfPkg/ResetVector/Main.asm
+++ b/OvmfPkg/ResetVector/Main.asm
@@ -75,6 +75,12 @@ SearchBfv:

%ifdef ARCH_IA32

+ ;
+ ; SEV support can be built and run using the Ia32/X64 split environment.
+ ; Set the OVMF/SEV work area as appropriate.
+ ;
+ OneTimeCall CheckSevFeatures
+
;
; Restore initial EAX value into the EAX register
;
diff --git a/OvmfPkg/ResetVector/ResetVector.nasmb b/OvmfPkg/ResetVector/ResetVector.nasmb
index 9421f4818907..94fbb0a87b37 100644
--- a/OvmfPkg/ResetVector/ResetVector.nasmb
+++ b/OvmfPkg/ResetVector/ResetVector.nasmb
@@ -47,7 +47,36 @@
%include "Ia32/SearchForBfvBase.asm"
%include "Ia32/SearchForSecEntry.asm"

-%define WORK_AREA_GUEST_TYPE (FixedPcdGet32 (PcdOvmfWorkAreaBase))
+%define WORK_AREA_GUEST_TYPE (FixedPcdGet32 (PcdOvmfWorkAreaBase))
+%define PT_ADDR(Offset) (FixedPcdGet32 (PcdOvmfSecPageTablesBase) + (Offset))
+
+%define GHCB_PT_ADDR (FixedPcdGet32 (PcdOvmfSecGhcbPageTableBase))
+%define GHCB_BASE (FixedPcdGet32 (PcdOvmfSecGhcbBase))
+%define GHCB_SIZE (FixedPcdGet32 (PcdOvmfSecGhcbSize))
+%define SEV_ES_WORK_AREA (FixedPcdGet32 (PcdSevEsWorkAreaBase))
+%define SEV_ES_WORK_AREA_SIZE 25
+%define SEV_ES_WORK_AREA_STATUS_MSR (FixedPcdGet32 (PcdSevEsWorkAreaBase))
+%define SEV_ES_WORK_AREA_RDRAND (FixedPcdGet32 (PcdSevEsWorkAreaBase) + 8)
+%define SEV_ES_WORK_AREA_ENC_MASK (FixedPcdGet32 (PcdSevEsWorkAreaBase) + 16)
+%define SEV_ES_WORK_AREA_RECEIVED_VC (FixedPcdGet32 (PcdSevEsWorkAreaBase) + 24)
+%define SEV_ES_VC_TOP_OF_STACK (FixedPcdGet32 (PcdOvmfSecPeiTempRamBase) + FixedPcdGet32 (PcdOvmfSecPeiTempRamSize))
+%define SEV_SNP_SECRETS_BASE (FixedPcdGet32 (PcdOvmfSnpSecretsBase))
+%define SEV_SNP_SECRETS_SIZE (FixedPcdGet32 (PcdOvmfSnpSecretsSize))
+%define CPUID_BASE (FixedPcdGet32 (PcdOvmfCpuidBase))
+%define CPUID_SIZE (FixedPcdGet32 (PcdOvmfCpuidSize))
+%define SNP_SEC_MEM_BASE_DESC_1 (FixedPcdGet32 (PcdOvmfSecPageTablesBase))
+%define SNP_SEC_MEM_SIZE_DESC_1 (FixedPcdGet32 (PcdOvmfSecGhcbBase) - SNP_SEC_MEM_BASE_DESC_1)
+;
+; The PcdOvmfSecGhcbBase reserves two GHCB pages. The first page is used
+; as GHCB shared page and second is used for bookkeeping to support the
+; nested GHCB in SEC phase. The bookkeeping page is mapped private. The VMM
+; does not need to validate the shared page but it need to validate the
+; bookkeeping page.
+;
+%define SNP_SEC_MEM_BASE_DESC_2 (GHCB_BASE + 0x1000)
+%define SNP_SEC_MEM_SIZE_DESC_2 (SEV_SNP_SECRETS_BASE - SNP_SEC_MEM_BASE_DESC_2)
+%define SNP_SEC_MEM_BASE_DESC_3 (CPUID_BASE + CPUID_SIZE)
+%define SNP_SEC_MEM_SIZE_DESC_3 (FixedPcdGet32 (PcdOvmfPeiMemFvBase) - SNP_SEC_MEM_BASE_DESC_3)

%ifdef ARCH_X64
#include <AutoGen.h>
@@ -94,43 +123,14 @@
%define TDX_WORK_AREA_PGTBL_READY (FixedPcdGet32 (PcdOvmfWorkAreaBase) + 4)
%define TDX_WORK_AREA_GPAW (FixedPcdGet32 (PcdOvmfWorkAreaBase) + 8)

- %define PT_ADDR(Offset) (FixedPcdGet32 (PcdOvmfSecPageTablesBase) + (Offset))
+ %include "X64/IntelTdxMetadata.asm"
+ %include "Ia32/Flat32ToFlat64.asm"
+ %include "Ia32/PageTables64.asm"
+ %include "Ia32/IntelTdx.asm"
+ %include "X64/OvmfSevMetadata.asm"
+%endif

- %define GHCB_PT_ADDR (FixedPcdGet32 (PcdOvmfSecGhcbPageTableBase))
- %define GHCB_BASE (FixedPcdGet32 (PcdOvmfSecGhcbBase))
- %define GHCB_SIZE (FixedPcdGet32 (PcdOvmfSecGhcbSize))
- %define SEV_ES_WORK_AREA (FixedPcdGet32 (PcdSevEsWorkAreaBase))
- %define SEV_ES_WORK_AREA_SIZE 25
- %define SEV_ES_WORK_AREA_STATUS_MSR (FixedPcdGet32 (PcdSevEsWorkAreaBase))
- %define SEV_ES_WORK_AREA_RDRAND (FixedPcdGet32 (PcdSevEsWorkAreaBase) + 8)
- %define SEV_ES_WORK_AREA_ENC_MASK (FixedPcdGet32 (PcdSevEsWorkAreaBase) + 16)
- %define SEV_ES_WORK_AREA_RECEIVED_VC (FixedPcdGet32 (PcdSevEsWorkAreaBase) + 24)
- %define SEV_ES_VC_TOP_OF_STACK (FixedPcdGet32 (PcdOvmfSecPeiTempRamBase) + FixedPcdGet32 (PcdOvmfSecPeiTempRamSize))
- %define SEV_SNP_SECRETS_BASE (FixedPcdGet32 (PcdOvmfSnpSecretsBase))
- %define SEV_SNP_SECRETS_SIZE (FixedPcdGet32 (PcdOvmfSnpSecretsSize))
- %define CPUID_BASE (FixedPcdGet32 (PcdOvmfCpuidBase))
- %define CPUID_SIZE (FixedPcdGet32 (PcdOvmfCpuidSize))
- %define SNP_SEC_MEM_BASE_DESC_1 (FixedPcdGet32 (PcdOvmfSecPageTablesBase))
- %define SNP_SEC_MEM_SIZE_DESC_1 (FixedPcdGet32 (PcdOvmfSecGhcbBase) - SNP_SEC_MEM_BASE_DESC_1)
- ;
- ; The PcdOvmfSecGhcbBase reserves two GHCB pages. The first page is used
- ; as GHCB shared page and second is used for bookkeeping to support the
- ; nested GHCB in SEC phase. The bookkeeping page is mapped private. The VMM
- ; does not need to validate the shared page but it need to validate the
- ; bookkeeping page.
- ;
- %define SNP_SEC_MEM_BASE_DESC_2 (GHCB_BASE + 0x1000)
- %define SNP_SEC_MEM_SIZE_DESC_2 (SEV_SNP_SECRETS_BASE - SNP_SEC_MEM_BASE_DESC_2)
- %define SNP_SEC_MEM_BASE_DESC_3 (CPUID_BASE + CPUID_SIZE)
- %define SNP_SEC_MEM_SIZE_DESC_3 (FixedPcdGet32 (PcdOvmfPeiMemFvBase) - SNP_SEC_MEM_BASE_DESC_3)
-
-%include "X64/IntelTdxMetadata.asm"
-%include "Ia32/Flat32ToFlat64.asm"
%include "Ia32/AmdSev.asm"
-%include "Ia32/PageTables64.asm"
-%include "Ia32/IntelTdx.asm"
-%include "X64/OvmfSevMetadata.asm"
-%endif

%include "Ia16/Real16ToFlat32.asm"
%include "Ia16/Init16.asm"
--
2.34.1


System S3 via UEFI shell

Rafael Machado
 

Hi everyone

I have a question.
Is there a way to put a system to sleep (S3) via UEFI shell?

Checking the UEFIshell spec, there is the reset command, that can be triggered with parameter -w, that would cause a warm boot. But I am not sure if warm boot and a S3 resume are the same.

Any comments?

Thanks
Rafael


Re: 回复: 回复: [edk2-devel] [PATCH v5 0/8] Add Variable Flash Info HOB

Ard Biesheuvel
 

On Mon, 16 May 2022 at 17:27, Michael Kubacki
<mikuback@...> wrote:

Yes, it has been reviewed by all maintainers. An announcement of the
change was sent to edk2 on April 29th:
https://edk2.groups.io/g/announce/message/291

The series for edk2-platforms has also been out since April 25th:
https://edk2.groups.io/g/devel/message/89308

Thanks,
Michael
I am fine with merging this as is, but please merge the edk2-platforms
changes as soon as the edk2 changes are in, so platforms there are not
left in a broken state.


Re: [PATCH v3] IntelFsp2Pkg: FSP_TEMP_RAM_INIT call must follow X64 Calling Convention

cbduggap
 

HI Chasel,
Yes, we don't need to modify esp for LoadMicrocodeDefault. However, this function does couple of MSR Accesses in b/w that would lead to modify RCX anyway.
So, if not RSP, we need to use different register to save RCX and consume in the whole function.

That's why I have not changed the usage of RSP to hold the input parameter.



Thanks,
Chinni.

-----Original Message-----
From: Chiu, Chasel <chasel.chiu@...>
Sent: Monday, May 16, 2022 5:38 PM
To: Duggapu, Chinni B <chinni.b.duggapu@...>; devel@edk2.groups.io
Cc: Desimone, Nathaniel L <nathaniel.l.desimone@...>; Zeng, Star <star.zeng@...>; S, Ashraf Ali <ashraf.ali.s@...>
Subject: RE: [PATCH v3] IntelFsp2Pkg: FSP_TEMP_RAM_INIT call must follow X64 Calling Convention


Thanks for correcting format and updating patch per feedbacks!
Just one more comment below inline and please also help to include patch of IntelFsp2WrapperPkg\Library\SecFspWrapperPlatformSecLibSample\X64\SecEntry.nasm for passing API parameter by RCX.
You might want to create a patch series:
[1/2] IntelFsp2Pkg patch
[2/2] IntelFsp2WrapperPkg patch

Thanks,
Chasel

-----Original Message-----
From: Duggapu, Chinni B <chinni.b.duggapu@...>
Sent: Monday, May 16, 2022 6:54 PM
To: devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@...>; Desimone, Nathaniel L
<nathaniel.l.desimone@...>; Zeng, Star <star.zeng@...>; S,
Ashraf Ali <ashraf.ali.s@...>
Subject: [PATCH v3] IntelFsp2Pkg: FSP_TEMP_RAM_INIT call must follow
X64 Calling Convention

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3926
This API accept one parameter using RCX and this is consumed in
mutiple sub functions.

Cc: Chasel Chiu <chasel.chiu@...>
Cc: Nate DeSimone <nathaniel.l.desimone@...>
Cc: Star Zeng <star.zeng@...>
Cc: Ashraf Ali S <ashraf.ali.s@...>
Signed-off-by: cbduggap <chinni.b.duggapu@...>
---
IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm | 26 ++++++++---------
.../Include/SaveRestoreSseAvxNasm.inc | 28 +++++++++++++++++++
2 files changed, 41 insertions(+), 13 deletions(-)

diff --git a/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm
b/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm
index a9f5f28ed7..9504c96b81 100644
--- a/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm
+++ b/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm
@@ -114,7 +114,7 @@ endstruc
global ASM_PFX(LoadMicrocodeDefault)
ASM_PFX(LoadMicrocodeDefault): ; Inputs:- ; rsp ->
LoadMicrocodeParams pointer+ ; rcx -> LoadMicrocodeParams pointer ;
Register Usage: ; rsp Preserved ; All others destroyed@@ -130,10
+130,9 @@ ASM_PFX(LoadMicrocodeDefault):
cmp rsp, 0 jz ParamError- mov eax, dword [rsp + 8] ;
Parameter pointer- cmp eax, 0+ cmp ecx, 0 jz ParamError- mov
esp, eax+ mov esp, ecx


I think we do not need to modify esp because now esp/rsp only containing return address initialized by caller.



; skip loading Microcode if the
MicrocodeCodeSize is zero ; and report error if size is less than 2k@@ -
321,8 +320,7 @@ ASM_PFX(EstablishStackFsp):
; ; Save parameter pointer in rdx ;- mov rdx, qword [rsp + 8]-+ mov
rdx, rcx ; ; Enable FSP STACK ;@@ -420,7 +418,10 @@
ASM_PFX(TempRamInitApi):
; ENABLE_SSE ENABLE_AVX-+ ;+ ; Save Input Parameter in YMM10+ ;+
SAVE_RCX ; ; Save RBP, RBX, RSI, RDI and RSP in YMM7, YMM8 and
YMM6 ;@@ -442,9 +443,8 @@ ASM_PFX(TempRamInitApi):
; ; Check Parameter ;- mov rax, qword [rsp + 8]- cmp rax, 0-
mov rax, 08000000000000002h+ cmp rcx, 0+ mov rcx,
08000000000000002h jz TempRamInitExit ;@@ -455,18 +455,18
@@ ASM_PFX(TempRamInitApi):
jnz TempRamInitExit ; Load microcode- LOAD_RSP+ LOAD_RCX
CALL_YMM ASM_PFX(LoadMicrocodeDefault) SAVE_UCODE_STATUS
rax ; Save microcode return status in SLOT 0 in YMM9 (upper
128bits). ; @note If return value rax is not 0, microcode did not load, but
continue and attempt to boot. ; Call Sec CAR Init- LOAD_RSP+ LOAD_RCX
CALL_YMM ASM_PFX(SecCarInit) cmp rax, 0 jnz TempRamInitExit
- LOAD_RSP+ LOAD_RCX CALL_YMM ASM_PFX(EstablishStackFsp) cmp
rax, 0 jnz TempRamInitExitdiff --git
a/IntelFsp2Pkg/Include/SaveRestoreSseAvxNasm.inc
b/IntelFsp2Pkg/Include/SaveRestoreSseAvxNasm.inc
index e8bd91669d..38c807a311 100644
--- a/IntelFsp2Pkg/Include/SaveRestoreSseAvxNasm.inc
+++ b/IntelFsp2Pkg/Include/SaveRestoreSseAvxNasm.inc
@@ -177,6 +177,30 @@
LXMMN xmm5, %1, 1 %endmacro +;+; Upper half of
YMM10 to save/restore RCX+;+;+; Save RCX to YMM10[128:191]+;
Modified: XMM5 and YMM10+;++%macro SAVE_RCX 0+ LYMMN
ymm10, xmm5, 1+ SXMMN xmm5, 0, rcx+ SYMMN ymm10,
1, xmm5+ %endmacro++;+; Restore RCX from YMM10[128:191]+;
Modified: XMM5 and RCX+;++%macro LOAD_RCX 0+ LYMMN
ymm10, xmm5, 1+ movq rcx, xmm5+ %endmacro+ ; ;
YMM7[128:191] for calling stack ; arg 1:Entry@@ -231,6 +255,7 @@
NextAddress:
; Use CpuId instruction (CPUID.01H:EDX.SSE[bit 25] = 1) to
test ; whether the processor supports SSE instruction. ;+
mov r10, rcx mov rax, 1 cpuid bt rdx, 25@@ -
241,6 +266,7 @@ NextAddress:
; bt ecx, 19 jnc SseError+ mov rcx,
r10 ; ; Set OSFXSR bit (bit #9) & OSXMMEXCPT bit (bit
#10)@@ -258,6 +284,7 @@ NextAddress:
%endmacro %macro ENABLE_AVX 0+ mov r10, rcx
mov eax, 1 cpuid and ecx, 10000000h@@ -280,5 +307,6
@@ EnableAvx:
xgetbv ; result in edx:eax or eax, 00000006h ; Set
XCR0 bit #1 and bit #2 to enable SSE state and AVX state xsetbv+
mov rcx, r10 %endmacro --
2.36.0.windows.1


Re: [PATCH V4 7/9] MdePkg: Define CC Measure EventLog ACPI Table

Sami Mujawar
 

Hi Min,

This patch looks good to me.

Reviewed-by: Sami Mujawar <sami.mujawar@...>

Regards,

Sami Mujawar


Re: [PATCH V4 3/9] SecurityPkg: Add definition of EFI_CC_EVENT_HOB_GUID

Sami Mujawar
 

Hi Min,

Thank you for this patch.

Reviewed-by: Sami Mujawar <sami.mujawar@...>

Regards,

Sami Mujawar


Re: [PATCH v2 1/1] ArmPlatformPkg: Remove overly verbose DEBUG lines in LcdGraphicsBlt

Sami Mujawar
 

Hi Rebecca,

Thank you for this patch.
These changes look good to me.

Reviewed-by: Sami Mujawar <sami.mujawar@...>

Regards,

Sami Mujawar


Re: [PATCH v2 1/1] ArmPlatformPkg: Remove overly verbose DEBUG lines in LcdGraphicsBlt

Rebecca Cran
 

Could I have some reviews of this v2 patch please?


Thanks.

Rebecca Cran

On 5/3/22 14:07, Rebecca Cran wrote:
The DEBUG output in LcdGraphicsBlt is overly verbose, and makes using
the console difficult, for example when using the UiApp.

Since the extra output should no longer be needed, delete the DEBUG
lines.

Signed-off-by: Rebecca Cran <rebecca@...>
---
ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputBlt.c | 12 ------------
1 file changed, 12 deletions(-)

diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputBlt.c b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputBlt.c
index 01ec6f68bd93..013506976f91 100644
--- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputBlt.c
+++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputBlt.c
@@ -815,18 +815,6 @@ LcdGraphicsBlt (
HorizontalResolution = This->Mode->Info->HorizontalResolution;
VerticalResolution = This->Mode->Info->VerticalResolution;
- DEBUG ((
- DEBUG_INFO,
- "LcdGraphicsBlt (BltOperation:%d,DestX:%d,DestY:%d,Width:%d,Height:%d) res(%d,%d)\n",
- BltOperation,
- DestinationX,
- DestinationY,
- Width,
- Height,
- HorizontalResolution,
- VerticalResolution
- ));
-
// Check we have reasonable parameters
if ((Width == 0) || (Height == 0)) {
DEBUG ((DEBUG_ERROR, "LcdGraphicsBlt: ERROR - Invalid dimension: Zero size area.\n"));

4901 - 4920 of 94602