Re: [edk2-devel] [PATCH V8 13/47] UefiCpuPkg: Enable Tdx support in MpInitLib

2022-03-16 Thread Min Xu
On March 15, 2022 3:58 PM, Ni Ray wrote:
> 
> Min,
> I don't quite understand.
> 
> Of all MP services, the TDX version only supports:
> * GetNumberOfProcessors
> * GetProcessorInfo
> 
> And even when TDX MP returns 3 or 4 threads from GetNumberOfProcessors(),
> StartupAllAPs() is an NOP.
> Will that cause any issue?
> 
> Can you avoid running MP driver when TDX is enabled?
MP Driver cannot be skipped in td guest. Because there are other drivers depend 
on the protocol (gEfiMpServiceProtocolGuid) which is produced by MP driver.

MP service of Td guest is different from the current MP service in EDK2. Td 
guest implement the MP service by the mechanism of mailbox. Please see [TDVF] 
4.3 TDVF AP Handling & [GHCI] 4.1 ACPI MADT Multiprocessor Wakeup Table.
[TDVF] 
https://www.intel.com/content/dam/develop/external/us/en/documents/tdx-virtual-firmware-design-guide-rev-1.01.pdf
[GHCI] 
https://www.intel.com/content/dam/develop/external/us/en/documents/intel-tdx-guest-hypervisor-communication-interface-1.0-344426-002.pdf

So here is my suggestion to this problem.
In MpInitLib if it is Td guest, then GetNumberOfProcessors just return 
(NumberOfProcessors=1, NumberOfEnabledProcessors=1). Because only the BSP is 
workable at this moment.
GetProcessorInfo returns EFI_UNSUPPORTED. Because in current stage Td guest 
doesn't have the MP Service requirement.

What's your thought?

Thanks
Min


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87625): https://edk2.groups.io/g/devel/message/87625
Mute This Topic: https://groups.io/mt/89725404/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH V8 13/47] UefiCpuPkg: Enable Tdx support in MpInitLib

2022-03-16 Thread Ni, Ray
GetProcessorInfo() can return the information for index#0 CPU.
Other suggestions look good to me.

-Original Message-
From: Xu, Min M  
Sent: Wednesday, March 16, 2022 4:32 PM
To: Ni, Ray ; devel@edk2.groups.io
Cc: Brijesh Singh ; Aktas, Erdem 
; James Bottomley ; Yao, Jiewen 
; Tom Lendacky ; Dong, Eric 
; Kumar, Rahul1 ; Gerd Hoffmann 

Subject: RE: [PATCH V8 13/47] UefiCpuPkg: Enable Tdx support in MpInitLib

On March 15, 2022 3:58 PM, Ni Ray wrote:
> 
> Min,
> I don't quite understand.
> 
> Of all MP services, the TDX version only supports:
> * GetNumberOfProcessors
> * GetProcessorInfo
> 
> And even when TDX MP returns 3 or 4 threads from GetNumberOfProcessors(),
> StartupAllAPs() is an NOP.
> Will that cause any issue?
> 
> Can you avoid running MP driver when TDX is enabled?
MP Driver cannot be skipped in td guest. Because there are other drivers depend 
on the protocol (gEfiMpServiceProtocolGuid) which is produced by MP driver.

MP service of Td guest is different from the current MP service in EDK2. Td 
guest implement the MP service by the mechanism of mailbox. Please see [TDVF] 
4.3 TDVF AP Handling & [GHCI] 4.1 ACPI MADT Multiprocessor Wakeup Table.
[TDVF] 
https://www.intel.com/content/dam/develop/external/us/en/documents/tdx-virtual-firmware-design-guide-rev-1.01.pdf
[GHCI] 
https://www.intel.com/content/dam/develop/external/us/en/documents/intel-tdx-guest-hypervisor-communication-interface-1.0-344426-002.pdf

So here is my suggestion to this problem.
In MpInitLib if it is Td guest, then GetNumberOfProcessors just return 
(NumberOfProcessors=1, NumberOfEnabledProcessors=1). Because only the BSP is 
workable at this moment.
GetProcessorInfo returns EFI_UNSUPPORTED. Because in current stage Td guest 
doesn't have the MP Service requirement.

What's your thought?

Thanks
Min


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87626): https://edk2.groups.io/g/devel/message/87626
Mute This Topic: https://groups.io/mt/89725404/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH] EmulatorPkg/RedfishPlatformCredentialLib: Don't stop Redfish service

2022-03-16 Thread Abner Chang
https://bugzilla.tianocore.org/show_bug.cgi?id=3859

Platform Redfish credential library shouldn't top the service at either 
EndOfDXE or ExitBootService notification. RedfishConfiguHandler UEFI driver is 
responsible to stop the Redfish service when EndOfDXE or ExitBootService event 
is triggered.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Andrew Fish 
Cc: Ray Ni 
---
 .../RedfishPlatformCredentialLib/RedfishPlatformCredentialLib.c | 2 --
 1 file changed, 2 deletions(-)

diff --git 
a/EmulatorPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCredentialLib.c
 
b/EmulatorPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCredentialLib.c
index a0233a984d..614eaebb0d 100644
--- 
a/EmulatorPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCredentialLib.c
+++ 
b/EmulatorPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCredentialLib.c
@@ -223,7 +223,6 @@ LibCredentialExitBootServicesNotify (
   IN  EDKII_REDFISH_CREDENTIAL_PROTOCOL  *This
   )
 {
-  LibStopRedfishService (This, ServiceStopTypeExitBootService);
 }
 
 /**
@@ -237,5 +236,4 @@ LibCredentialEndOfDxeNotify (
   IN  EDKII_REDFISH_CREDENTIAL_PROTOCOL  *This
   )
 {
-  LibStopRedfishService (This, ServiceStopTypeSecureBootDisabled);
 }
-- 
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87627): https://edk2.groups.io/g/devel/message/87627
Mute This Topic: https://groups.io/mt/89817622/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 0/3] [RFC] consolidate compiler intrinsics

2022-03-16 Thread Gerd Hoffmann
On Tue, Mar 15, 2022 at 03:27:58PM +, Michael D Kinney wrote:
> Hi Gerd,
> 
> Thanks for working on this.  I raised this topic in the new TianoCore build 
> and CI 
> meeting yesterday because the intrinsic libs are closely tied to the 
> toolchains
> supported by TianoCore.
> 
> I agree with the concept of moving the compiler intrinsics to a library in 
> the MdePkg.
> 
> + Sean Brogan
> 
> Sean mentioned that he has some addition work on intrinsic libs for Visual 
> Studio
> toolchains.  It would be good to see if this set of changes is aligned with 
> those
> efforts.

Having a single place where all compiler intrinsics are located should
simplify this kind of changes.

> I see a few items that might be good to clean up at some point
> * fltused should go into its own file.  Not related to the strcmp() API
> * I see size_t defined in multiple places using different mappings.  Would be 
> good to 
>   define that in a single location.

Yes, sure.  Both are valid points.

I see this series as first step, consolidating the existing code in a
singe place with (almost) no actual code changes.  There surely will be
incremental improvements and cleanups later on.  I will need a few more
intrinsic functions when moving edk2 to openssl 3.0 for example.

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87628): https://edk2.groups.io/g/devel/message/87628
Mute This Topic: https://groups.io/mt/89471210/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 0/3] [RFC] consolidate compiler intrinsics

2022-03-16 Thread Gerd Hoffmann
On Tue, Mar 15, 2022 at 05:08:55PM +, Pedro Falcato wrote:
> Gerd,
> 
> Have you considered just pulling in LLVM's compiler-rt builtins? It
> implements essentially everything we'll ever need for a GNU-like toolchain,
> for all the architectures we support, and also has unit tests (
> https://github.com/llvm/llvm-project/tree/main/compiler-rt/test/builtins/Unit
> ).
> 
> I think it would be a good idea considering it's guaranteed to be correct
> and always implements whatever clang requires (and AFAIK clang always
> requires what gcc requires).

This is beyond the scope of this patch series, I want have a single
intrinsics lib for everybody as first step.

Using llvm's intrinsics certainly is an option for future improvements,
assuming it is ok license-wise (edk2 is bsd, llvm compiler-rt is apache,
as far I know they are compatible).

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87629): https://edk2.groups.io/g/devel/message/87629
Mute This Topic: https://groups.io/mt/89471210/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] EmulatorPkg/RedfishPlatformCredentialLib: Don't stop Redfish service

2022-03-16 Thread Nickle Wang

Some typos.

Platform Redfish credential library shouldn't stop the service at either 
EndOfDXE or ExitBootService notification. RedfishConfigureHandler UEFI driver 
is responsible to stop the Redfish service when EndOfDXE or ExitBootService 
event is triggered.

Reviewed-by: Nickle Wang 

Thanks,
Nickle


From: Chang, Abner (HPS SW/FW Technologist) 
Sent: Wednesday, March 16, 2022 16:04
To: devel@edk2.groups.io 
Cc: Wang, Nickle (Server BIOS) ; Andrew Fish 
; Ray Ni 
Subject: [PATCH] EmulatorPkg/RedfishPlatformCredentialLib: Don't stop Redfish 
service

https://bugzilla.tianocore.org/show_bug.cgi?id=3859

Platform Redfish credential library shouldn't top the service at either 
EndOfDXE or ExitBootService notification. RedfishConfiguHandler UEFI driver is 
responsible to stop the Redfish service when EndOfDXE or ExitBootService event 
is triggered.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Andrew Fish 
Cc: Ray Ni 
---
 .../RedfishPlatformCredentialLib/RedfishPlatformCredentialLib.c | 2 --
 1 file changed, 2 deletions(-)

diff --git 
a/EmulatorPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCredentialLib.c
 
b/EmulatorPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCredentialLib.c
index a0233a984d..614eaebb0d 100644
--- 
a/EmulatorPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCredentialLib.c
+++ 
b/EmulatorPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCredentialLib.c
@@ -223,7 +223,6 @@ LibCredentialExitBootServicesNotify (
   IN  EDKII_REDFISH_CREDENTIAL_PROTOCOL  *This
   )
 {
-  LibStopRedfishService (This, ServiceStopTypeExitBootService);
 }

 /**
@@ -237,5 +236,4 @@ LibCredentialEndOfDxeNotify (
   IN  EDKII_REDFISH_CREDENTIAL_PROTOCOL  *This
   )
 {
-  LibStopRedfishService (This, ServiceStopTypeSecureBootDisabled);
 }
--
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87630): https://edk2.groups.io/g/devel/message/87630
Mute This Topic: https://groups.io/mt/89817622/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v3 0/5] Http Fixes

2022-03-16 Thread Gerd Hoffmann
On Tue, Mar 15, 2022 at 02:42:24PM +0100, Oliver Steffen wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2720
> 
> This set of patches fixes booting from HTTP/1.0 servers.
> It also improves the interaction with HTTP/1.1 servers by recognizing
> the 'Connection: close' header field, which fixes a problem with
> servers that close the connection after a 404-error is encountered.
> 
> It also prevents triggering the TCP issue described in
> https://bugzilla.tianocore.org/show_bug.cgi?id=3735
> when booting from HTTP/1.0 servers.
> 
> PR: https://github.com/tianocore/edk2/pull/2564

Reviewed-by: Gerd Hoffmann 

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87631): https://edk2.groups.io/g/devel/message/87631
Mute This Topic: https://groups.io/mt/89797768/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH V8 13/47] UefiCpuPkg: Enable Tdx support in MpInitLib

2022-03-16 Thread Min Xu
On March 16, 2022 4:37 PM, Ni Ray wrote:
> 
> GetProcessorInfo() can return the information for index#0 CPU.
> Other suggestions look good to me.
> 
Agree. It will be updated in the next version.

Thanks
Min


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87632): https://edk2.groups.io/g/devel/message/87632
Mute This Topic: https://groups.io/mt/89725404/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH edk2-platforms 1/3] Platform/ARM/JunoPkg: Convert AcpiSsdtRootPci.asl from tabs to spaces

2022-03-16 Thread Sami Mujawar

Hi Rebecca,

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

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar

On 05/03/2022 04:19 AM, Rebecca Cran wrote:

Other .asl files in Platform/ARM/JunoPkg/AcpiTables use spaces, while
AcpiSsdtRootPci.asl uses tabs. To be consistent, convert it to spaces.

Signed-off-by: Rebecca Cran 
---
  Platform/ARM/JunoPkg/AcpiTables/AcpiSsdtRootPci.asl | 288 ++--
  1 file changed, 144 insertions(+), 144 deletions(-)

diff --git a/Platform/ARM/JunoPkg/AcpiTables/AcpiSsdtRootPci.asl 
b/Platform/ARM/JunoPkg/AcpiTables/AcpiSsdtRootPci.asl
index ba41a9586555..317b621e013e 100644
--- a/Platform/ARM/JunoPkg/AcpiTables/AcpiSsdtRootPci.asl
+++ b/Platform/ARM/JunoPkg/AcpiTables/AcpiSsdtRootPci.asl
@@ -28,24 +28,24 @@
interrupt type as PCI defaults (Level Triggered, Active Low) are not
compatible with GICv2.
  */
-#define LNK_DEVICE(Unique_Id, Link_Name, irq)  
  \
- Device(Link_Name) {   
  \
- Name(_HID, EISAID("PNP0C0F")) 
  \
- Name(_UID, Unique_Id) 
  \
- Name(_PRS, ResourceTemplate() {   
  \
- Interrupt(ResourceProducer, Level, ActiveHigh, Exclusive) { irq } 
  \
- })
  \
- Method (_CRS, 0) { Return (_PRS) }
  \
- Method (_SRS, 1) { }  
  \
- Method (_DIS) { } 
  \
- }
+#define LNK_DEVICE(Unique_Id, Link_Name, irq)  
\
+  Device(Link_Name) {  
\
+  Name(_HID, EISAID("PNP0C0F"))
\
+  Name(_UID, Unique_Id)
\
+  Name(_PRS, ResourceTemplate() {  
\
+  Interrupt(ResourceProducer, Level, ActiveHigh, Exclusive) { irq }
\
+  })   
\
+  Method (_CRS, 0) { Return (_PRS) }   
\
+  Method (_SRS, 1) { } 
\
+  Method (_DIS) { }
\
+  }

-#define PRT_ENTRY(Address, Pin, Link)  
\
+#define PRT_ENTRY(Address, Pin, Link)  
   \
  Package (4) { 
\
  Address,/* uses the same format as _ADR */
\
  Pin,/* The PCI pin number of the device (0-INTA, 1-INTB, 
2-INTC, 3-INTD). */  \
-Link,   /* Interrupt allocated via Link device. */ 
\
-Zero/* global system interrupt number (no used) */ 
\
+Link,   /* Interrupt allocated via Link device. */ 
   \
+Zero/* global system interrupt number (no used) */ 
   \
}

  /*
@@ -59,155 +59,155 @@

  DefinitionBlock("SsdtPci.aml", "SSDT", 1, "ARMLTD", "ARM-JUNO", 
EFI_ACPI_ARM_OEM_REVISION) {
Scope(_SB) {
- //
- // PCI Root Complex
- //
- LNK_DEVICE(1, LNKA, 168)
- LNK_DEVICE(2, LNKB, 169)
- LNK_DEVICE(3, LNKC, 170)
- LNK_DEVICE(4, LNKD, 171)
+//
+// PCI Root Complex
+//
+LNK_DEVICE(1, LNKA, 168)
+LNK_DEVICE(2, LNKB, 169)
+LNK_DEVICE(3, LNKC, 170)
+LNK_DEVICE(4, LNKD, 171)

- Device(PCI0)
+Device(PCI0)
  {
- Name(_HID, EISAID("PNP0A08")) // PCI Express Root Bridge
- Name(_CID, EISAID("PNP0A03")) // Compatible PCI Root Bridge
- Name(_SEG, Zero) // PCI Segment Group number
- Name(_BBN, Zero) // PCI Base Bus Number
- Name(_CCA, 1)// Initially mark the PCI coherent (for JunoR1)
+  Name(_HID, EISAID("PNP0A08")) // PCI Express Root Bridge
+  Name(_CID, EISAID("PNP0A03")) // Compatible PCI Root Bridge
+  Name(_SEG, Zero) // PCI Segment Group number
+  Name(_BBN, Zero) // PCI Base Bus Number
+  Name(_CCA, 1)// Initially mark the PCI coherent (for JunoR1)

-// Root Complex 0
-Device (RP0) {
-Name(_ADR, 0xF000)// Dev 0, Func 0
-}
+  // Root Complex 0
+  Device (RP0) {
+Name(_ADR, 0xF00

Re: [edk2-devel][edk2-platforms][PATCH V1 1/1] WhitleyOpenBoardPkg/JunctionCity: Build ACPI content

2022-03-16 Thread Oram, Isaac W
Thanks for the confirmation.  I didn't have any trouble applying the patch on 
the same commit.  Best idea is that maybe something went wrong extracting the 
patch from the email.

Regards,
Isaac

From: Manickavasakam Karpagavinayagam 
Sent: Tuesday, March 15, 2022 12:22 PM
To: Oram, Isaac W ; devel@edk2.groups.io; Ponnusamy, 
Suresh 
Cc: Desimone, Nathaniel L ; Chiu, Chasel 
; DOPPALAPUDI, HARIKRISHNA 
Subject: RE: [EXTERNAL] [edk2-devel][edk2-platforms][PATCH V1 1/1] 
WhitleyOpenBoardPkg/JunctionCity: Build ACPI content

Isaac/Nate :

Using the patch reference, we manually updated the source. Below are the 
commits used in our testing source.

- edk2 - b24306f15daa2ff8510b06702114724b33895d3c (edk2-stable202202)
- edk2-non-osi - 0320db977fb27e63424b0953a3020bb81c89e8f0
- edk2-platforms - 7cd51aa3c1ee601e0bf56d34dcf054c38997 + the PATCH
- FSP - 478a80a7e7b170873c9fa7f55fecfd0e0bdaf63e

We are able to boot to Windows 2019 and RHEL 7.3. Also, confirmed that only one 
instance of StaticSkuDataDxe (Outside FSP) is present in the source.

InstallProtocolInterface: 5B1B31A1-9562-11D2-8E3F-00A0C969723B 68F098C0 PDB = 
c:\XXX\XXX\XXX\icx\ocp_mar14\whitley\Build\WhitleyOpenBoardPkg\DEBUG_VS2015\X64\WhitleyOpenBoardPkg\Uba\UbaMain\StaticSkuDataDxe\StaticSkuDataDxe\DEBUG\StaticSkuDataDxeBaseline.pdb

Thank you

-Manic

From: Manickavasakam Karpagavinayagam
Sent: Monday, March 14, 2022 4:27 PM
To: Isaac Oram mailto:isaac.w.o...@intel.com>>; 
devel@edk2.groups.io; Sureshkumar Ponnusamy 
mailto:sureshkum...@ami.com>>
Cc: Nate DeSimone 
mailto:nathaniel.l.desim...@intel.com>>; Chasel 
Chiu mailto:chasel.c...@intel.com>>; Harikrishna 
Doppalapudi mailto:harikrish...@ami.com>>
Subject: RE: [EXTERNAL] [edk2-devel][edk2-platforms][PATCH V1 1/1] 
WhitleyOpenBoardPkg/JunctionCity: Build ACPI content


Isaac/Nate :



Extracted the patch (refer the attached patch) from this email. When trying to 
apply the patch on latest edk2-platform 
(7cd51aa3c1ee601e0bf56d34dcf054c38997), we are seeing patch apply failure.

It says conflict at line number 39 or 26 based on the patch command used.





[cid:image001.png@01D83931.99261460]



Please let us know EDKII-Platform commit you used for creating the patch ? 
Also, let us know which EDKII tag used by you to build the source ?



Thank you



-Manic



-Original Message-
From: Isaac Oram mailto:isaac.w.o...@intel.com>>
Sent: Friday, March 11, 2022 6:31 PM
To: devel@edk2.groups.io
Cc: Nate DeSimone 
mailto:nathaniel.l.desim...@intel.com>>; Chasel 
Chiu mailto:chasel.c...@intel.com>>; Manickavasakam 
Karpagavinayagam mailto:manickavasak...@ami.com>>
Subject: [EXTERNAL] [edk2-devel][edk2-platforms][PATCH V1 1/1] 
WhitleyOpenBoardPkg/JunctionCity: Build ACPI content





**CAUTION: The e-mail below is from an external source. Please exercise caution 
before opening attachments, clicking links, or following guidance.**



Use source versions of AcpiTables, AcpiPlatform, and StaticSkuDataDxe.



Cc: Nate DeSimone 
mailto:nathaniel.l.desim...@intel.com>>

Cc: Chasel Chiu mailto:chasel.c...@intel.com>>

Cc: Manickavasakam Karpagavinayagam 
mailto:manickavasak...@ami.com>>

Signed-off-by: Isaac Oram 
mailto:isaac.w.o...@intel.com>>

---

Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.fdf  |  3 +

Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/build_board.py   | 63 


Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/build_config.cfg | 15 +

3 files changed, 81 insertions(+)



diff --git a/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.fdf 
b/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.fdf

index 0b919b5ea9..b72aa2b688 100644

--- a/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.fdf

+++ b/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.fdf

@@ -601,6 +601,7 @@ SET gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize 
= 0x0100

   # UBA DXE common and board specific components

   #

   !include WhitleyOpenBoardPkg/Uba/UbaDxeCommon.fdf

+  INF $(RP_PKG)/Uba/UbaMain/StaticSkuDataDxe/StaticSkuDataDxe.inf

   INF 
$(RP_PKG)/$(BOARD_NAME)/Uba/TypeJunctionCity/Dxe/UsbOcUpdateDxe/UsbOcUpdateDxe.inf

   INF 
$(RP_PKG)/$(BOARD_NAME)/Uba/TypeJunctionCity/Dxe/IioCfgUpdateDxe/IioCfgUpdateDxe.inf

   INF 
$(RP_PKG)/$(BOARD_NAME)/Uba/TypeJunctionCity/Dxe/SlotDataUpdateDxe/SlotDataUpdateDxe.inf

@@ -682,6 +683,8 @@ SET gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize 
= 0x0100

   INF  BoardModulePkg/LegacySioDxe/LegacySioDxe.inf

   INF  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf



+  INF  RuleOverride = ACPITABLE

+ WhitleyOpenBoardPkg/Features/Acpi/AcpiTables/AcpiTables10nm.inf

+  INF  WhitleyOpenBoardPkg/Features/Acpi/AcpiPlatform/AcpiPlatform.inf

   INF  WhitleyOpenBoardPkg/Features/AcpiVtd/AcpiVtd.inf

   INF  MinPlatformPkg/Acpi/AcpiSmm/AcpiSmm.inf



diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Juncti

Re: [edk2-devel] Applying for GSoC

2022-03-16 Thread Nate DeSimone
Hi Tejesh,

Great to meet you and welcome to the TianoCore project! Great to hear you are 
interested! Apologize for the tardiness in my response. I did not see any 
emails from you on the mailing list, you might want to contact the groups.io 
tech support for help in getting your email sent to the mailing list correctly.

Writing more unit tests sounds like a great GSoC project! I'm not quite sure 
where would be a good place to start though, Mike Kinney (cc'd) might have a 
good idea of where to start writing unit tests. I'll also look around the 
codebase and try to find some good suggestions for you. Once you are able to 
post to the mailing list, I bet other people in the community will also have 
some good ideas.

Hope this helps and welcome to the project!

With Best Regards,
Nate

From: Tejesh Anand 
Sent: Wednesday, March 16, 2022 3:03 PM
To: Desimone, Nathaniel L 
Subject: Re: Applying for GSoC

Hello,
Just wanted to check in if you had any updates on this.

Thanks,
Tejesh


Sent from Outlook


From: Tejesh Anand
Sent: Tuesday, March 15, 2022 5:15 PM
To: nathaniel.l.desim...@intel.com 
mailto:nathaniel.l.desim...@intel.com>>
Subject: Applying for GSoC

Dear Mr. Simone,
I'm interested in applying for GSoC to work on Tianocore, likely to work on the 
task of writing more unit tests for edk II. I've signed up for the edk2-devel 
email list and tried to post to the discussion board, but I'm not sure it went 
through. As I prepare to apply, I wanted to try contributing, so I wanted to 
ask if you had a suggestion for a good first issue to begin with.

Thank you so much,
Tejesh Anand
Sent from Outlook


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87635): https://edk2.groups.io/g/devel/message/87635
Mute This Topic: https://groups.io/mt/89833340/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH] MdeModulePkg/NvmExpressDxe: fix check for Cap.Css

2022-03-16 Thread littlefox via groups.io
Fix the check for NVMe command set being supported by the controller.

Was problematic with qemu (6.2.0, Debian 1:6.2+dfsg-3), which sets 0xC1 in that 
register, making the OVMF think the NVMe controller does not support NVMe.

Uncovered by commit 9dd14fc ( 
https://github.com/tianocore/edk2/commit/9dd14fc91c174eae87fd122c7ac70073a363527f
 ) , which changed the number of bits included in the Css register from 4 to 8.

Signed-off-by: Mara Sophie Grosch little...@lf-net.org

Patch is on GitHub: https://github.com/tianocore/edk2/pull/2637

$ git diff --stat master

MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87636): https://edk2.groups.io/g/devel/message/87636
Mute This Topic: https://groups.io/mt/89833412/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [GSoC 2022] Introducing Myself

2022-03-16 Thread ayushdevel1325
Hello everyone,

I am Ayush Singh, a 2nd-year student from India. I am interested in the 
proposal: *Add Rust support to EDK II*.

I am experienced in Rust, C, and Python. However, I have very little experience 
with Assembly. I am currently participating in Season of KDE ( 
https://dot.kde.org/2022/01/26/season-kde-kicks ) to write Rust Bindings for 
KConfig ( https://invent.kde.org/oreki/kconfig-rs ). I am also a collaborator 
in qmetaobject ( https://github.com/woboq/qmetaobject-rs ) project which allows 
creating Qt applications with Rust.

While I have not done anything much that is so low-level, I am interested in 
learning more about bare-metal programming. I have also used Rust without std 
although it was when I was following along with the OS Philip Blog ( 
https://os.phil-opp.com/ ) , so it was not all that special.

Are there any tasks for this project that I can complete? Due to COVID, my 
semester times are a bit off, so I don't have too much time to complete tasks 
right now, but I will try my best.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87637): https://edk2.groups.io/g/devel/message/87637
Mute This Topic: https://groups.io/mt/89833420/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 1/2] MdeModulePkg/UefiBootManagerLib: Add Pcd to prioritize internal devices

2022-03-16 Thread Sean Rhodes
From: Matt DeVillier 

Add Pcd to allow configuring internal devices to be prioritized over
internally-attached USB devices, such as card readers, over SATA, NVMe
and eMMC drives.

Cc: Jian J Wang 
Cc: Liming Gao 
Signed-off-by: Matt DeVillier 
Signed-off-by: Sean Rhodes 
---
 MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c   | 10 --
 .../Library/UefiBootManagerLib/UefiBootManagerLib.inf  |  1 +
 MdeModulePkg/MdeModulePkg.dec  |  3 +++
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c 
b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index 962892d38f..28c3cff471 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -2214,8 +2214,14 @@ BmEnumerateBootOptions (
   //
   // Skip the fixed block io then the removable block io
   //
-  if (BlkIo->Media->RemovableMedia == ((Removable == 0) ? FALSE : TRUE)) {
-continue;
+  if (FixedPcdGetBool (PcdPrioritizeInternal)) {
+if (BlkIo->Media->RemovableMedia == (Removable == 0)) {
+  continue;
+}
+  } else {
+if (BlkIo->Media->RemovableMedia == ((Removable == 0) ? FALSE : TRUE)) 
{
+  continue;
+}
   }
 
   Description = BmGetBootDescription (Handles[Index]);
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf 
b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
index fe05d5f1cc..207420e334 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.PcdPrioritizeInternal
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 463e889e9a..ded82d1cff 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -1077,6 +1077,9 @@
   # @Prompt Enable UEFI Stack Guard.
   gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard|FALSE|BOOLEAN|0x30001055
 
+  # Prioritize Internal Devices
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal|FALSE|BOOLEAN|0x0031
+
 [PcdsFixedAtBuild, PcdsPatchableInModule]
   ## Dynamic type PCD can be registered callback function for Pcd setting 
action.
   #  PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum number of 
callback function
-- 
2.32.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87639): https://edk2.groups.io/g/devel/message/87639
Mute This Topic: https://groups.io/mt/89833510/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 2/2] UefiPayloadPkg: Hookup Prioritise Internal build option

2022-03-16 Thread Sean Rhodes
Hook PRIORITISE_INTERNAL build option to PrioritiseInternal PCD.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Sean Rhodes 
---
 MdeModulePkg/MdeModulePkg.dec | 7 +--
 UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index ded82d1cff..50b2eddd3f 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -1077,8 +1077,11 @@
   # @Prompt Enable UEFI Stack Guard.
   gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard|FALSE|BOOLEAN|0x30001055
 
-  # Prioritize Internal Devices
-  gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal|FALSE|BOOLEAN|0x0031
+  ## Prioritize Internal Devices.
+  #  If enabled, internal devices will be prioritized over external devices in 
the boot order.
+  #   TRUE  - Internal devices are prioritized.
+  #   FALSE - Internal devices are not prioritized.
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal|FALSE|BOOLEAN|0x30001057
 
 [PcdsFixedAtBuild, PcdsPatchableInModule]
   ## Dynamic type PCD can be registered callback function for Pcd setting 
action.
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 558513baf1..56698fb61e 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -35,6 +35,7 @@
   DEFINE SMM_SUPPORT  = FALSE
   DEFINE ABOVE_4G_MEMORY  = TRUE
   DEFINE BOOT_MANAGER_ESCAPE  = FALSE
+  DEFINE PRIORITIZE_INTERNAL  = FALSE
   #
   # SBL:  UEFI payload for Slim Bootloader
   # COREBOOT: UEFI payload for coreboot
@@ -400,6 +401,7 @@
 !if $(PERFORMANCE_MEASUREMENT_ENABLE)
   gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask   | 0x1
 !endif
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPrioritizeInternal|$(PRIORITISE_INTERNAL)
 
   
gUefiPayloadPkgTokenSpaceGuid.PcdDispatchModuleAbove4GMemory|$(ABOVE_4G_MEMORY)
   gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT_MANAGER_ESCAPE)
-- 
2.32.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87638): https://edk2.groups.io/g/devel/message/87638
Mute This Topic: https://groups.io/mt/89833509/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] Ps2KbdCtrller: Make wait for SUCCESS after BAT non-fatal

2022-03-16 Thread Sean Rhodes
Hi Ray

Would you be able to review please? :)

Thanks

Sean


On Fri, 18 Feb 2022 at 02:16, Wu, Hao A  wrote:

> Acked-by: Hao A Wu 
> I recommend to get Ray's input for this patch before merging.
>
> Best Regards,
> Hao Wu
>
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Sean
> > Rhodes
> > Sent: Friday, February 11, 2022 4:05 PM
> > To: devel@edk2.groups.io
> > Cc: Dong, Guo ; Matt DeVillier
> > ; Wu, Hao A ; Ni, Ray
> > ; Rhodes, Sean 
> > Subject: [edk2-devel] [PATCH] Ps2KbdCtrller: Make wait for SUCCESS after
> > BAT non-fatal
> >
> > From: Matt DeVillier 
> >
> > Recent model Chromebooks only return ACK, but not
> > BAT_SUCCESS, which causes hanging and failed ps2k init.
> > To mitigate this, make the absence of BAT_SUCCESS reply
> > non-fatal, and reduce the no-reply timeout from 4s to 1s.
> >
> > Tested on google/dracia and purism/librem_14
> >
> > Cc: Hao A Wu 
> > Cc: Ray Ni 
> > Signed-off-by: Matt DeVillier 
> > Signed-off-by: Sean Rhodes 
> > ---
> >  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c | 6 +-
> >  MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h   | 2 +-
> >  2 files changed, 2 insertions(+), 6 deletions(-)
> >
> > diff --git a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
> > b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
> > index 77dc226222..6c71355edd 100644
> > --- a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
> > +++ b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
> > @@ -1733,11 +1733,7 @@ InitKeyboard (
> >  //
> >
> >  mWaitForValueTimeOut = KEYBOARD_BAT_TIMEOUT;
> >
> >
> >
> > -Status = KeyboardWaitForValue (ConsoleIn,
> > KEYBOARD_8048_RETURN_8042_BAT_SUCCESS);
> >
> > -if (EFI_ERROR (Status)) {
> >
> > -  KeyboardError (ConsoleIn, L"Keyboard self test failed!\n\r");
> >
> > -  goto Done;
> >
> > -}
> >
> > +KeyboardWaitForValue (ConsoleIn,
> > KEYBOARD_8048_RETURN_8042_BAT_SUCCESS);
> >
> >
> >
> >  mWaitForValueTimeOut = KEYBOARD_WAITFORVALUE_TIMEOUT;
> >
> >
> >
> > diff --git a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h
> > b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h
> > index ca1dd9b2c2..38df3e092d 100644
> > --- a/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h
> > +++ b/MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h
> > @@ -157,7 +157,7 @@ InstallPs2KeyboardDriver (
> >  #define KEYBOARD_MAX_TRY 256 // 256
> >
> >  #define KEYBOARD_TIMEOUT 65536   // 0.07s
> >
> >  #define KEYBOARD_WAITFORVALUE_TIMEOUT100 // 1s
> >
> > -#define KEYBOARD_BAT_TIMEOUT 400 // 4s
> >
> > +#define KEYBOARD_BAT_TIMEOUT 100 // 1s
> >
> >  #define KEYBOARD_TIMER_INTERVAL  20  // 0.02s
> >
> >  #define SCANCODE_EXTENDED0   0xE0
> >
> >  #define SCANCODE_EXTENDED1   0xE1
> >
> > --
> > 2.32.0
> >
> >
> >
> > -=-=-=-=-=-=
> > Groups.io Links: You receive all messages sent to this group.
> > View/Reply Online (#86611): https://edk2.groups.io/g/devel/message/86611
> > Mute This Topic: https://groups.io/mt/89066601/1768737
> > Group Owner: devel+ow...@edk2.groups.io
> > Unsubscribe: https://edk2.groups.io/g/devel/unsub [hao.a...@intel.com]
> > -=-=-=-=-=-=
> >
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87640): https://edk2.groups.io/g/devel/message/87640
Mute This Topic: https://groups.io/mt/89066601/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




回复: [edk2-devel] [PATCH V8 00/47] Enable Intel TDX in OvmfPkg (Config-A)

2022-03-16 Thread gaoliming
Min:
  I suggest to add it into OvmfPkg/Library/PlatformInitLib/IntelTdx.c as the 
internal implementation. 

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Min Xu
> 发送时间: 2022年3月15日 15:12
> 收件人: devel@edk2.groups.io; Gao, Liming 
> 抄送: 'Brijesh Singh' ; Dong, Eric
> ; Aktas, Erdem ; Wu, Hao
> A ; Wang, Jian J ; 'James
> Bottomley' ; Yao, Jiewen ;
> Kinney, Michael D ; Ni, Ray ;
> Kumar, Rahul1 ; 'Tom Lendacky'
> ; Liu, Zhiguang ;
> 'Gerd Hoffmann' 
> 主题: Re: [edk2-devel] [PATCH V8 00/47] Enable Intel TDX in OvmfPkg
> (Config-A)
> 
> On March 15, 2022 11:55 AM, Gao Liming wrote:
> > Min:
> >   As Jiewen mentions, EFI_RESOURCE_MEMORY_UNACCEPTED will be in
> next
> > public spec. So, it can't be added now.
> >
> >   I suggest to add edk2 definition for this type in MdeModulePkg first, such
> as
> > EDKII_RESOURCE_MEMORY_UNACCEPTED. It can be removed after new
> spec is
> > published.
> >
> Thanks for the comments. In the patch
> EFI_RESOURCE_MEMORY_UNACCEPTED was defined in
> MdePkg/Include/Pi/PiHob.h.
> I check the MdeModulePkg/Include but don't find some proper header files
> for this definition.
> 
> Or can we define EFI_RESOURCE_MEMORY_UNACCEPTED in
> OvmfPkg/Library/PlatformInitLib/IntelTdx.c?
> In current stage all the unaccepted memory passed from host VMM are all
> accepted in OvmfPkg/Library/PlatformInitLib/IntelTdx.c. After that these
> unaccepted memory hob are transferred to private memory hob. So currently
> EFI_RESOURCE_MEMORY_UNACCEPTED is only seen in above IntelTdx.c.
> 
> [TDVF] Sec 7.3.1 defines the unaccepted memory resource HOB for DXE
> phase. But this is for the lazy-accept feature which will be implemented in 
> the
> future.
> 
> What's your suggestion?
> 
> [TDVF]
> https://www.intel.com/content/dam/develop/external/us/en/documents/td
> x-virtual-firmware-design-guide-rev-1.01.pdf
> 
> Thanks
> Min
> 
> 
> 
> 





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87641): https://edk2.groups.io/g/devel/message/87641
Mute This Topic: https://groups.io/mt/89836301/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel][PATCH] MdeModulePkg: Make RSP 16-byte boundary aligned for PEI 64bit

2022-03-16 Thread Kuo, Ted
Hi Liming and Mike,

Can you please review the change?

Thanks,
Ted

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Kuo, Ted
Sent: Thursday, March 10, 2022 2:21 PM
To: devel@edk2.groups.io
Cc: Bi, Dandan ; Gao, Liming ; 
De, Debkumar ; Han, Harry ; West, 
Catharine ; Wang, Jian J ; S, 
Ashraf Ali 
Subject: [edk2-devel][PATCH] MdeModulePkg: Make RSP 16-byte boundary aligned 
for PEI 64bit

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3865
Use SwitchPeiCore instead of calling PeiCore directly when switching PeiCore 
from temporary memory to permanent memory. For PEI 32bit, SwitchPeiCore always 
calls PeiCore without any additional step. For PEI 64bit, SwitchPeiCore makes 
RSP 16-byte boundary aligned and then allocate 32 bytes as a shadow store on 
call stack before calling PeiCore.

Cc: Dandan Bi 
Cc: Liming Gao 
Cc: Debkumar De 
Cc: Harry Han 
Cc: Catharine West 
Cc: Jian J Wang 
Cc: Ashraf Ali S 
Signed-off-by: Ted Kuo 
---
 MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c |  2 +-  
MdeModulePkg/Core/Pei/Ia32/SwitchPeiCore.nasm | 33 +++
 MdeModulePkg/Core/Pei/PeiMain.h   | 25 ++
 MdeModulePkg/Core/Pei/PeiMain.inf |  6 +
 MdeModulePkg/Core/Pei/X64/SwitchPeiCore.nasm  | 38 +++
 5 files changed, 103 insertions(+), 1 deletion(-)  create mode 100644 
MdeModulePkg/Core/Pei/Ia32/SwitchPeiCore.nasm
 create mode 100644 MdeModulePkg/Core/Pei/X64/SwitchPeiCore.nasm

diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c 
b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
index 3552feda8f..5af6e6e86f 100644
--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
@@ -871,7 +871,7 @@ PeiCheckAndSwitchStack (
   //
   // Entry PEI Phase 2
   //
-  PeiCore (SecCoreData, NULL, Private);
+  SwitchPeiCore (SecCoreData, NULL, Private);
 } else {
   //
   // Migrate memory pages allocated in pre-memory phase.
diff --git a/MdeModulePkg/Core/Pei/Ia32/SwitchPeiCore.nasm 
b/MdeModulePkg/Core/Pei/Ia32/SwitchPeiCore.nasm
new file mode 100644
index 00..23cfb5090b
--- /dev/null
+++ b/MdeModulePkg/Core/Pei/Ia32/SwitchPeiCore.nasm
@@ -0,0 +1,33 @@
+;--
+
+;
+; Copyright (c) 2022, Intel Corporation. All rights reserved. ; 
+SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Abstract:
+;
+;   Switch PeiCore from temporary memory to permanent memory.
+;
+;--
+
+
+SECTION .text
+
+extern ASM_PFX(PeiCore)
+
+;--
+
+; VOID
+; EFIAPI
+; SwitchPeiCore (
+;   EFI_SEC_PEI_HAND_OFF*SecCoreDataPtr,
+;   EFI_PEI_PPI_DESCRIPTOR  *PpiList,
+;   VOID*Data
+;   );
+;--
+
+global ASM_PFX(SwitchPeiCore)
+ASM_PFX(SwitchPeiCore):
+  push   DWORD [esp + 12]
+  push   DWORD [esp + 12]
+  push   DWORD [esp + 12]
+  call   ASM_PFX(PeiCore)
+  jmp$; Should never reach here
+  ret
+
diff --git a/MdeModulePkg/Core/Pei/PeiMain.h b/MdeModulePkg/Core/Pei/PeiMain.h 
index 556beddad5..8e8ed3dadf 100644
--- a/MdeModulePkg/Core/Pei/PeiMain.h
+++ b/MdeModulePkg/Core/Pei/PeiMain.h
@@ -2038,4 +2038,29 @@ PeiReinitializeFv (
   IN  PEI_CORE_INSTANCE  *PrivateData
   );
 
+/**
+  This routine is invoked by main entry of PeiMain module during 
+transition
+  from temporary memory to permanent memory.
+
+  @param SecCoreDataPtr  Points to a data structure containing information 
about the PEI core's operating
+ environment, such as the size and location of 
temporary RAM, the stack location and
+ the BFV location.
+  @param PpiList Points to a list of one or more PPI descriptors to be 
installed initially by the PEI core.
+ An empty PPI list consists of a single descriptor 
with the end-tag
+ EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its 
initialization
+ phase, the PEI Foundation will add these SEC-hosted 
PPIs to its PPI database such
+ that both the PEI Foundation and any modules can 
leverage the associated service
+ calls and/or code in these early PPIs
+  @param DataPointer to old core data that is used to initialize 
the
+ core's data areas.
+ If NULL, it is first PeiCore entering.
+
+**/
+VOID
+EFIAPI
+SwitchPeiCore (
+  IN CONST EFI_SEC_PEI_HAND_OFF*SecCoreDataPtr,
+  IN CONST EFI_PEI_PPI_DESCRIPTOR  *PpiList,
+  IN VOID  *Data
+  );
 #endif
diff --git a/MdeModulePkg/Core/Pei/PeiMain.inf 
b/MdeModulePkg/Core/Pei/PeiMain.inf
index 0cf357371a..b597aed8f6 100644
-

Re: [edk2-devel] [PATCH V8 00/47] Enable Intel TDX in OvmfPkg (Config-A)

2022-03-16 Thread Min Xu
On March 17, 2022 9:00 AM, Gao Liming wrote:
> Min:
>   I suggest to add it into OvmfPkg/Library/PlatformInitLib/IntelTdx.c as the
> internal implementation.
> 
Thanks for the suggestion. It will be updated in the next version.

Thanks
Min


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87643): https://edk2.groups.io/g/devel/message/87643
Mute This Topic: https://groups.io/mt/89836602/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v5 1/1] CryptoPkg: Add new hash algorithm ParallelHash256HashAll in BaseCryptLib.

2022-03-16 Thread Li, Zhihao
Will send patch_v6 with following update soon.
1. adjust the position of new field in the data structure.
2.update the version of data structure if it existing.
3.With the usability test, the CrytoLibOnProtocol version code can be used 
normally as static version.

Best Regard
Zhihao


-Original Message-
From: Yao, Jiewen  
Sent: Monday, March 14, 2022 1:50 PM
To: devel@edk2.groups.io; Li, Zhihao 
Cc: Wang, Jian J ; Lu, Xiaoyu1 ; 
Jiang, Guomin ; Fu, Siyuan 
Subject: RE: [edk2-devel] [PATCH v5 1/1] CryptoPkg: Add new hash algorithm 
ParallelHash256HashAll in BaseCryptLib.

Thanks. It is close to final version, but there are some compatibility issue 
need to be address.

1) Whenever you add a new field in the data structure, please add it at the 
end. Don't add them in the middle.
E.g. PCD_CRYPTO_SERVICE_FAMILY_ENABLE, _EDKII_CRYPTO_PROTOCOL

2) Whenever you add a new field for a data structure, please remember to 
increase the version.
E.g. EDKII_CRYPTO_VERSION


3) Please clarify if you have tested the CrytoLibOnProtocol version code.

Thank you
Yao Jiewen


> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Li, Zhihao
> Sent: Wednesday, March 9, 2022 4:44 PM
> To: devel@edk2.groups.io
> Cc: Yao, Jiewen ; Wang, Jian J ;
> Lu, Xiaoyu1 ; Jiang, Guomin ;
> Fu, Siyuan 
> Subject: [edk2-devel] [PATCH v5 1/1] CryptoPkg: Add new hash algorithm
> ParallelHash256HashAll in BaseCryptLib.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3596
> 
> Parallel hash function ParallelHash256HashAll, as defined in NIST's
> Special Publication 800-185, published December 2016. It utilizes
> multi-process to calculate the digest.
> 
> Some modifications to pass CI test.
> 
> Cc: Jiewen Yao 
> Cc: Jian J Wang 
> Cc: Xiaoyu Lu 
> Cc: Guomin Jiang 
> Cc: Siyuan Fu 
> Cc: Zhihao Li 
> 
> Signed-off-by: Zhihao Li 
> ---
>  CryptoPkg/Driver/Crypto.c |  36 
> ++-
>  CryptoPkg/Library/BaseCryptLib/Hash/CryptCShake256.c  | 282
> 
>  CryptoPkg/Library/BaseCryptLib/Hash/CryptParallelHash.c   | 278
> +++
>  CryptoPkg/Library/BaseCryptLib/Hash/CryptParallelHashNull.c   |  40 
> +++
>  CryptoPkg/Library/BaseCryptLib/Hash/CryptSha3.c   | 166
> 
>  CryptoPkg/Library/BaseCryptLib/Hash/CryptXkcp.c   | 107 
> 
>  CryptoPkg/Library/BaseCryptLibNull/Hash/CryptParallelHashNull.c   |  40 
> +++
>  CryptoPkg/Library/BaseCryptLibOnProtocolPpi/CryptLib.c|  34 
> ++-
>  CryptoPkg/Test/UnitTest/Library/BaseCryptLib/ParallelhashTests.c  | 145
> ++
>  CryptoPkg/CryptoPkg.ci.yaml   |   4 
> +-
>  CryptoPkg/Include/Library/BaseCryptLib.h  |  31 
> ++-
>  CryptoPkg/Include/Pcd/PcdCryptoServiceFamilyEnable.h  |   8 
> +-
>  CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf   |   3 
> +-
>  CryptoPkg/Library/BaseCryptLib/Hash/CryptParallelHash.h   | 201
> ++
>  CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf|   3 
> +-
>  CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf|   3 
> +-
>  CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf|   8 
> +-
>  CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf   |   3 
> +-
>  CryptoPkg/Library/Include/CrtLibSupport.h |   3 
> +-
>  CryptoPkg/Private/Protocol/Crypto.h   |  31 
> +++
>  CryptoPkg/Test/CryptoPkgHostUnitTest.dsc  |   3 +
>  CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestBaseCryptLibHost.inf |   4 +
>  22 files changed, 1422 insertions(+), 11 deletions(-)
> 
> diff --git a/CryptoPkg/Driver/Crypto.c b/CryptoPkg/Driver/Crypto.c
> index d5d6aa8e5820..35312e0818a0 100644
> --- a/CryptoPkg/Driver/Crypto.c
> +++ b/CryptoPkg/Driver/Crypto.c
> @@ -3,7 +3,7 @@
>from BaseCryptLib and TlsLib.
> 
> 
> 
>Copyright (C) Microsoft Corporation. All rights reserved.
> 
> -  Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.
> 
> +  Copyright (c) 2019 - 2022, Intel Corporation. All rights reserved.
> 
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> 
> 
>  **/
> 
> @@ -1314,6 +1314,38 @@ CryptoServiceSha512HashAll (
>return CALL_BASECRYPTLIB (Sha512.Services.HashAll, Sha512HashAll, (Data,
> DataSize, HashValue), FALSE);
> 
>  }
> 
> 
> 
> +/**
> 
> +  Parallel hash function ParallelHash256, as defined in NIST's Special 
> Publication
> 800-185,
> 
> +  published December 2016.
> 
> +
> 
> +  @param[in]   InputPointer to the input message (X).
> 
> +  @param[in]   InputByteLen The number(>0) of input bytes provided for 
> the
> input data.
> 
> +  @param[in]   BlockSizeThe size of each block (B).
> 
> +  @param[out]  Output   Pointe

Re: [edk2-devel] [PATCH v5 1/1] CryptoPkg: Add new hash algorithm ParallelHash256HashAll in BaseCryptLib.

2022-03-16 Thread Yao, Jiewen
Sounds good. Thanks for the update.

> -Original Message-
> From: Li, Zhihao 
> Sent: Thursday, March 17, 2022 10:43 AM
> To: Yao, Jiewen ; devel@edk2.groups.io
> Cc: Wang, Jian J ; Lu, Xiaoyu1 ;
> Jiang, Guomin ; Fu, Siyuan 
> Subject: RE: [edk2-devel] [PATCH v5 1/1] CryptoPkg: Add new hash algorithm
> ParallelHash256HashAll in BaseCryptLib.
> 
> Will send patch_v6 with following update soon.
> 1. adjust the position of new field in the data structure.
> 2.update the version of data structure if it existing.
> 3.With the usability test, the CrytoLibOnProtocol version code can be used
> normally as static version.
> 
> Best Regard
> Zhihao
> 
> 
> -Original Message-
> From: Yao, Jiewen 
> Sent: Monday, March 14, 2022 1:50 PM
> To: devel@edk2.groups.io; Li, Zhihao 
> Cc: Wang, Jian J ; Lu, Xiaoyu1 ;
> Jiang, Guomin ; Fu, Siyuan 
> Subject: RE: [edk2-devel] [PATCH v5 1/1] CryptoPkg: Add new hash algorithm
> ParallelHash256HashAll in BaseCryptLib.
> 
> Thanks. It is close to final version, but there are some compatibility issue 
> need to
> be address.
> 
> 1) Whenever you add a new field in the data structure, please add it at the 
> end.
> Don't add them in the middle.
> E.g. PCD_CRYPTO_SERVICE_FAMILY_ENABLE, _EDKII_CRYPTO_PROTOCOL
> 
> 2) Whenever you add a new field for a data structure, please remember to
> increase the version.
> E.g. EDKII_CRYPTO_VERSION
> 
> 
> 3) Please clarify if you have tested the CrytoLibOnProtocol version code.
> 
> Thank you
> Yao Jiewen
> 
> 
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Li, Zhihao
> > Sent: Wednesday, March 9, 2022 4:44 PM
> > To: devel@edk2.groups.io
> > Cc: Yao, Jiewen ; Wang, Jian J
> ;
> > Lu, Xiaoyu1 ; Jiang, Guomin
> ;
> > Fu, Siyuan 
> > Subject: [edk2-devel] [PATCH v5 1/1] CryptoPkg: Add new hash algorithm
> > ParallelHash256HashAll in BaseCryptLib.
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3596
> >
> > Parallel hash function ParallelHash256HashAll, as defined in NIST's
> > Special Publication 800-185, published December 2016. It utilizes
> > multi-process to calculate the digest.
> >
> > Some modifications to pass CI test.
> >
> > Cc: Jiewen Yao 
> > Cc: Jian J Wang 
> > Cc: Xiaoyu Lu 
> > Cc: Guomin Jiang 
> > Cc: Siyuan Fu 
> > Cc: Zhihao Li 
> >
> > Signed-off-by: Zhihao Li 
> > ---
> >  CryptoPkg/Driver/Crypto.c |  
> > 36 ++-
> >  CryptoPkg/Library/BaseCryptLib/Hash/CryptCShake256.c  | 282
> > 
> >  CryptoPkg/Library/BaseCryptLib/Hash/CryptParallelHash.c   | 278
> > +++
> >  CryptoPkg/Library/BaseCryptLib/Hash/CryptParallelHashNull.c   |  
> > 40 +++
> >  CryptoPkg/Library/BaseCryptLib/Hash/CryptSha3.c   | 166
> > 
> >  CryptoPkg/Library/BaseCryptLib/Hash/CryptXkcp.c   | 107
> 
> >  CryptoPkg/Library/BaseCryptLibNull/Hash/CryptParallelHashNull.c   |  40
> +++
> >  CryptoPkg/Library/BaseCryptLibOnProtocolPpi/CryptLib.c|  
> > 34 ++-
> >  CryptoPkg/Test/UnitTest/Library/BaseCryptLib/ParallelhashTests.c  | 145
> > ++
> >  CryptoPkg/CryptoPkg.ci.yaml   |   
> > 4 +-
> >  CryptoPkg/Include/Library/BaseCryptLib.h  |  
> > 31 ++-
> >  CryptoPkg/Include/Pcd/PcdCryptoServiceFamilyEnable.h  |   
> > 8 +-
> >  CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf   |   
> > 3 +-
> >  CryptoPkg/Library/BaseCryptLib/Hash/CryptParallelHash.h   | 201
> > ++
> >  CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf|   
> > 3 +-
> >  CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf|   
> > 3 +-
> >  CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf|   
> > 8 +-
> >  CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf   |   
> > 3 +-
> >  CryptoPkg/Library/Include/CrtLibSupport.h |   
> > 3 +-
> >  CryptoPkg/Private/Protocol/Crypto.h   |  
> > 31 +++
> >  CryptoPkg/Test/CryptoPkgHostUnitTest.dsc  |   
> > 3 +
> >  CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestBaseCryptLibHost.inf |   4
> +
> >  22 files changed, 1422 insertions(+), 11 deletions(-)
> >
> > diff --git a/CryptoPkg/Driver/Crypto.c b/CryptoPkg/Driver/Crypto.c
> > index d5d6aa8e5820..35312e0818a0 100644
> > --- a/CryptoPkg/Driver/Crypto.c
> > +++ b/CryptoPkg/Driver/Crypto.c
> > @@ -3,7 +3,7 @@
> >from BaseCryptLib and TlsLib.
> >
> >
> >
> >Copyright (C) Microsoft Corporation. All rights reserved.
> >
> > -  Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.
> >
> > +  Copyright (c) 2019 - 2022, Intel Corporation. All rights reserved.
> >
> >SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> >
> >
> >  **/
> >
> > @@ -1314,

Re: [edk2-devel] **NOTICE** EDK II CI downloading gcc_arm_linux tools Failing

2022-03-16 Thread Bob Feng
Thank you. The CI was recovered.

Thanks,
Bob

From: Sami Mujawar 
Sent: Wednesday, March 16, 2022 1:43 PM
To: devel@edk2.groups.io; Feng, Bob C ; Kinney, Michael D 
; Sean Brogan 
Cc: nd 
Subject: Re: [edk2-devel] **NOTICE** EDK II CI downloading gcc_arm_linux tools 
Failing

Hi Bob,

The gcc_arm_linux tools failure was due to a broken download link for the 
toolchain. I noticed this issue while trying to merge 
https://edk2.groups.io/g/devel/message/87538. However, the download link should 
now be restored as I was able to merge a change yesterday evening.

I am not sure if you would need to retrigger the stalled pull request for the 
CI to proceed.
If you still find that the gcc_arm_linux tools are failing, please do let me 
know.

Regards,

Sami Mujawar




From: mailto:devel@edk2.groups.io>> on behalf of "Bob 
Feng via groups.io" 
mailto:bob.c.feng=intel@groups.io>>
Reply to: "devel@edk2.groups.io" 
mailto:devel@edk2.groups.io>>, 
"bob.c.f...@intel.com" 
mailto:bob.c.f...@intel.com>>
Date: Wednesday, 16 March 2022 at 01:37
To: "devel@edk2.groups.io" 
mailto:devel@edk2.groups.io>>, "Kinney, Michael D" 
mailto:michael.d.kin...@intel.com>>, Sean Brogan 
mailto:sean.bro...@microsoft.com>>
Subject: Re: [edk2-devel] **NOTICE** EDK II CI downloading gcc_arm_linux tools 
Failing

Hi Sean,

Do you have anything update for this issue?

Thanks,
Bob

From: Feng, Bob C mailto:bob.c.f...@intel.com>>
Sent: Wednesday, March 16, 2022 9:35 AM
To: devel@edk2.groups.io; Kinney, Michael D 
mailto:michael.d.kin...@intel.com>>; Sean Brogan 
mailto:sean.bro...@microsoft.com>>
Cc: Feng, Bob C mailto:bob.c.f...@intel.com>>
Subject: [edk2-devel] **NOTICE** EDK II CI downloading gcc_arm_linux tools 
Failing


Hello,



The EDK II CI downloading gcc_arm_linux tools failing right now that cause some 
of the CI build task failed.



First failure occurred on 3-15-2022.



The issue is being worked.



Thank you for your patience.



Best Regards,
Bob Feng




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87646): https://edk2.groups.io/g/devel/message/87646
Mute This Topic: https://groups.io/mt/89813403/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v6 1/1] CryptoPkg: Add new hash algorithm ParallelHash256HashAll in BaseCryptLib.

2022-03-16 Thread Li, Zhihao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3596

Parallel hash function ParallelHash256HashAll, as defined in NIST's
Special Publication 800-185, published December 2016. It utilizes
multi-process to calculate the digest.

Passed CI test.
Onprotocol version code passed test.

Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Xiaoyu Lu 
Cc: Guomin Jiang 
Cc: Siyuan Fu 
Cc: Zhihao Li 

Signed-off-by: Zhihao Li 
---
 CryptoPkg/Driver/Crypto.c |  38 ++-
 CryptoPkg/Library/BaseCryptLib/Hash/CryptCShake256.c  | 282 

 CryptoPkg/Library/BaseCryptLib/Hash/CryptParallelHash.c   | 278 
+++
 CryptoPkg/Library/BaseCryptLib/Hash/CryptParallelHashNull.c   |  40 +++
 CryptoPkg/Library/BaseCryptLib/Hash/CryptSha3.c   | 166 

 CryptoPkg/Library/BaseCryptLib/Hash/CryptXkcp.c   | 107 

 CryptoPkg/Library/BaseCryptLibNull/Hash/CryptParallelHashNull.c   |  40 +++
 CryptoPkg/Library/BaseCryptLibOnProtocolPpi/CryptLib.c|  34 ++-
 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/ParallelhashTests.c  | 145 
++
 CryptoPkg/CryptoPkg.ci.yaml   |   4 +-
 CryptoPkg/Include/Library/BaseCryptLib.h  |  31 ++-
 CryptoPkg/Include/Pcd/PcdCryptoServiceFamilyEnable.h  |   8 +-
 CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf   |   3 +-
 CryptoPkg/Library/BaseCryptLib/Hash/CryptParallelHash.h   | 201 
++
 CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf|   3 +-
 CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf|   3 +-
 CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf|   8 +-
 CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf   |   3 +-
 CryptoPkg/Library/Include/CrtLibSupport.h |   3 +-
 CryptoPkg/Private/Protocol/Crypto.h   |  35 ++-
 CryptoPkg/Test/CryptoPkgHostUnitTest.dsc  |   4 +
 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestBaseCryptLibHost.inf |   4 +
 22 files changed, 1426 insertions(+), 14 deletions(-)

diff --git a/CryptoPkg/Driver/Crypto.c b/CryptoPkg/Driver/Crypto.c
index d5d6aa8e5820..5a9245c07cc5 100644
--- a/CryptoPkg/Driver/Crypto.c
+++ b/CryptoPkg/Driver/Crypto.c
@@ -3,7 +3,7 @@
   from BaseCryptLib and TlsLib.
 
   Copyright (C) Microsoft Corporation. All rights reserved.
-  Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.
+  Copyright (c) 2019 - 2022, Intel Corporation. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -4470,6 +4470,38 @@ CryptoServiceTlsGetCertRevocationList (
   return CALL_BASECRYPTLIB (TlsGet.Services.CertRevocationList, 
TlsGetCertRevocationList, (Data, DataSize), EFI_UNSUPPORTED);
 }
 
+/**
+  Parallel hash function ParallelHash256, as defined in NIST's Special 
Publication 800-185,
+  published December 2016.
+
+  @param[in]   InputPointer to the input message (X).
+  @param[in]   InputByteLen The number(>0) of input bytes provided for the 
input data.
+  @param[in]   BlockSizeThe size of each block (B).
+  @param[out]  Output   Pointer to the output buffer.
+  @param[in]   OutputByteLenThe desired number of output bytes (L).
+  @param[in]   CustomizationPointer to the customization string (S).
+  @param[in]   CustomByteLenThe length of the customization string in 
bytes.
+
+  @retval TRUE   ParallelHash256 digest computation succeeded.
+  @retval FALSE  ParallelHash256 digest computation failed.
+  @retval FALSE  This interface is not supported.
+
+**/
+BOOLEAN
+EFIAPI
+CryptoServiceParallelHash256HashAll (
+  IN CONST VOID   *Input,
+  IN   UINTN  InputByteLen,
+  IN   UINTN  BlockSize,
+  OUT  VOID   *Output,
+  IN   UINTN  OutputByteLen,
+  IN CONST VOID   *Customization,
+  IN   UINTN  CustomByteLen
+  )
+{
+  return CALL_BASECRYPTLIB (ParallelHash.Services.HashAll, 
ParallelHash256HashAll, (Input, InputByteLen, BlockSize, Output, OutputByteLen, 
Customization, CustomByteLen), FALSE);
+}
+
 const EDKII_CRYPTO_PROTOCOL  mEdkiiCrypto = {
   /// Version
   CryptoServiceGetCryptoVersion,
@@ -4670,5 +4702,7 @@ const EDKII_CRYPTO_PROTOCOL  mEdkiiCrypto = {
   CryptoServiceTlsGetCaCertificate,
   CryptoServiceTlsGetHostPublicCert,
   CryptoServiceTlsGetHostPrivateKey,
-  CryptoServiceTlsGetCertRevocationList
+  CryptoServiceTlsGetCertRevocationList,
+  /// Parallel hash
+  CryptoServiceParallelHash256HashAll
 };
diff --git a/CryptoPkg/Library/BaseCryptLib/Hash/CryptCShake256.c 
b/CryptoPkg/Library/BaseCryptLib/Hash/CryptCShake256.c
new file mode 100644
index ..2a9eaf9eec40
--- /dev/null
+++ b/CryptoPkg/Library/BaseCryptLib/Hash/CryptCShake256.c
@@ -0,0 +1,282 @@
+/** @file
+  cSHAKE-256 D

Re: [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm

2022-03-16 Thread Ni, Ray
Ted,
Have you considered a case that BFV is a FFS2 FV and the logic may find a FFS3 
FV just below the BFV?

Thanks,
Ray

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Ni, Ray
Sent: Friday, March 11, 2022 3:42 PM
To: Kuo, Ted ; devel@edk2.groups.io
Cc: De, Debkumar ; Han, Harry ; 
West, Catharine 
Subject: Re: [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in 
SearchForBfvBase.asm

Reviewed-by: Ray Ni 

-Original Message-
From: Kuo, Ted 
Sent: Friday, March 11, 2022 3:29 PM
To: devel@edk2.groups.io
Cc: Ni, Ray ; De, Debkumar ; Han, 
Harry ; West, Catharine 
Subject: [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in 
SearchForBfvBase.asm

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3862
The new algorithm searches BFV address with FFS3 GUID first.
If not found, it will search BFV address with FFS2 GUID.

Cc: Ray Ni 
Cc: Debkumar De 
Cc: Harry Han 
Cc: Catharine West 
Signed-off-by: Ted Kuo 
---
 .../Vtf0/Bin/IA32/ResetVector.ia32.port80.raw  | Bin 484 -> 548 bytes
 .../ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.raw | Bin 468 -> 516 bytes
 .../Vtf0/Bin/IA32/ResetVector.ia32.serial.raw  | Bin 868 -> 932 bytes
 .../Bin/X64/PageTable1G/ResetVector.x64.port80.raw | Bin 12292 -> 12292 bytes
 .../Vtf0/Bin/X64/PageTable1G/ResetVector.x64.raw   | Bin 12292 -> 12292 bytes
 .../Bin/X64/PageTable1G/ResetVector.x64.serial.raw | Bin 12292 -> 12292 bytes  
.../Bin/X64/PageTable2M/ResetVector.x64.port80.raw | Bin 28676 -> 28676 bytes
 .../Vtf0/Bin/X64/PageTable2M/ResetVector.x64.raw   | Bin 28676 -> 28676 bytes
 .../Bin/X64/PageTable2M/ResetVector.x64.serial.raw | Bin 28676 -> 28676 bytes
 .../ResetVector/Vtf0/Ia32/SearchForBfvBase.asm |  51 +
 10 files changed, 41 insertions(+), 10 deletions(-)

diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.port80.raw 
b/UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.port80.raw
index 
79b23c047bdc6e552d77d5c9e9aeae21ff04d91d..23254e83bf1a17dee9f38c235fcc9948624a7536
 100644 GIT binary patch delta 227 
zcmaFDyo9BG0uUG;*vZVmz@W<@z`$S&Wc)9RYyQbxs@7N`P<5a2DnL~gPkVYw4**r!cFFjcZU?HGY1)}sx(=wS^|0>c
z(xuH6Dh#FbI}bBQD3s24Eoykcv-u}uY2Sto!p|CZ><5C*qp$yU9^J6;8$wu(9TV=}(c8
zUjg)y@_Q48|1M?^0T*VtBLDzE4S>dJ0U!uIkRJe$|NsA!umLp*>x1c7{{R2!
Mtds8n6_W!3A^UepbpQYW

diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.raw 
b/UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.raw
index 
ce7faa502b858e99908bcdb397b776258205e1d5..18562d8f1f58601f66fcb0cbf2f994046ce48fde
 100644 GIT binary patch delta 225 
zcmcb@+`>{n0SF8a>||zOV9;d{U|_HXGX59EHUDHTRcoves5(#_Qu?g1LgcjVDc{n&
zjTI7m^W~3nW7tMv416`-n$r#(HT2Y{+C)y36^7FJorjqt6iR2j7BoEI+5D5Sv~S0L?*04scOHHHuk+|j`-wr}jBh5cDmQQY
zub0NpD4w=MnSsH9U+F;FtK9$p{|hkeaA0F#;8%K(wu6JA??&H&z6X6T`Yyb-n;_3H
Z0jOYd0;3s6_e+a^|Np<-GkG4P833r5W}5&2

delta 153
zcmZo+xxySY0SF8a=rRZ}FxWCMF#InvZmbZfc-qrb`ns_~#I{Suzw}XKg~UwL&cxE2
zjTJJjhjlNPUTCgRVJJP-d6+puq4e-;&K>)Kp!4YKf1O8Px=-v1XZ$kpQMqv4f4ww*
zM)9;A$_xw+{7MJXUZqaXVU!VYn;_3H;s5{tAge)O@&raRj^>vc|Nj4fxn=S>Ml%58
CZbm==

diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.serial.raw 
b/UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.serial.raw
index 
6503a988abdac06f9aa88f0a65f2525e12233b0a..e4aa4fc30a32bc3d4d8d0e1726c43fdafef4a374
 100644 GIT binary patch delta 214 
zcmaFDwuF6xY`rV9;enmZ3=9mq3<3-cwm`=JqPXUt%%y6L6#`WUibG1DHCBk6wms!r
zdbhDcVsF0Ow9+e$6*8UAO=gvzeysvjRq?c^r}O|&m2H=df9ZChs+p#piKXj+s#*{0
zUM^kQT%p2HI=}NUbA&?ajMssN2Rxg9GM4tG?fT0+F{OjiW8&Lej75`AFs>J_`LCD8
z&nTX@Lz#iWfnVuB+AHPBT}&|oJ`>~_Cj9^Ze*zRte#c}Yu;9;Yrq|zIvi^U${?Gsa
LFE>v%Vm1N**#ci0

delta 146
zcmV;D0B!%I2jm8j9YX~JF~BVV5C8x@00030ax;N=5P0Q`jCJdQcoaQ~98Y!Pfp{31
zHHl$$*@1W*g~Kh=brcl3=nSp^pmqCDm!4}B)UliB;letu_u|lBgKygUvv&IUM)3&F4OYb&T
zNbJp*n^t{?AX75Kkxp|qp$yU9^J6Bj4$8^oS9{Mya%q3`zYTOak(_!-61
zb|^D2IPfbSNPD$!a;u^OyQ4b81EBWFTNEw%UN^ja@b~}!mpT7{gvsPTiV}

delta 259
zcmZokXi3<>rVygbAi%(2%fP_!zsR_;LZISlPfzLV#tISJE*byQM~xK{Gfg`aOK&z-
z$h02Tysxk81Z^i=0z<_Lw-!>@TaY`>8ANp?ZUi48fjh|6GZHF=g
zg9E?PfwWg`llLkr@O!Brcl3=nSp^pmqCDm!4}B)UliB;letu_u|lBgKygUvv&IUM)3&F4OYb&T
zNbJp*n^tq;e#OWC
z|0Nh+&I3AT2g8N`|M`_}ygvDBH^Ya%+q?ID)Jx-M6i?fs%)sEluXG^o)w0RCiZc9u
z>I@fv+9p83MyJRzkL7q|Noc8|A2(?|NsAY0P%kh#bX|dM?DmecyvDa|7^m9
eje;9^6<$hx0&4}@$q*Le#xP;ROJ;}$oEHj+dD

delta 239
zcmZokXi3<>rr@K?Ai%(2%fP_!zsR_;LZISlPfzLV#tISJE*byQM~xK{Gfg`aOK&z-
z$h02Tysxk81Z^i=0z<_Lw-!>>7a><5C*qp$yU9(`Fqxl19OQD^cag(*P}AOHWC
zV0bwdXz&h(3;+M~E8Tc~^4D&L4}G_Hw|&%0<7X64+o8{
z27aXnX*)O=`fl_c=zGxjqVK|MS9OL7K>5iR6m9ulx4bm?_y7OP8W3SKSw=~Mal%Hy
e54;L5Z+)Bq0zms1!b02_CQNvF7$O1|o&W$orgJI)

diff --git 
a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.serial.raw 
b/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetVector.x64.serial.raw
index 
d9b051ff06d1d30b0dfd585e05e75c98ebd88b03..de97b858ddd03171114aa0efb1929796b1aa5435
 100644 GIT binary patch delta 259 
zcmZokXi3;0t5Cm}+3>(lW(EcZT?PRL23sKGe^FfXPv%m!#tMO|1H~bw&l)R4PTQXH
zExp@VA+a}KZd&P;#tNCv=O(jCPrp_Hs;YR}(^Gl?sLHlW#=mqsP}NM+&cxDnKvk`W
zb

Re: [edk2-devel] [PATCH V8 12/47] MdePkg: Add macro to check SEV / TDX guest

2022-03-16 Thread Min Xu
Hi, Liming
Can you help to review this patch?
https://edk2.groups.io/g/devel/message/87480

Thanks
Min
> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Min Xu
> Sent: Saturday, March 12, 2022 9:54 AM
> To: devel@edk2.groups.io
> Cc: Xu, Min M ; Michael Roth ;
> Ni, Ray ; Kumar, Rahul1 ; Dong,
> Eric ; James Bottomley ; Yao,
> Jiewen ; Tom Lendacky ;
> Justen, Jordan L ; Ard Biesheuvel
> ; Aktas, Erdem ; Gerd
> Hoffmann ; Kinney, Michael D
> ; Gao, Liming ; Liu,
> Zhiguang 
> Subject: [edk2-devel] [PATCH V8 12/47] MdePkg: Add macro to check SEV /
> TDX guest
> 
> RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429
> 
> Add macros CC_GUEST_IS_SEV / CC_GUEST_IS_TDX to check SEV / TDX guest.
> 
> Cc: Michael Roth 
> Cc: Ray Ni 
> Cc: Rahul Kumar 
> Cc: Eric Dong 
> Cc: James Bottomley 
> Cc: Min Xu 
> Cc: Jiewen Yao 
> Cc: Tom Lendacky 
> Cc: Jordan Justen 
> Cc: Ard Biesheuvel 
> Cc: Erdem Aktas 
> Cc: Gerd Hoffmann 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Acked-by: Gerd Hoffmann 
> Signed-off-by: Min Xu 
> ---
>  MdePkg/Include/ConfidentialComputingGuestAttr.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/MdePkg/Include/ConfidentialComputingGuestAttr.h
> b/MdePkg/Include/ConfidentialComputingGuestAttr.h
> index 6a1301801519..dd2541c6dcdf 100644
> --- a/MdePkg/Include/ConfidentialComputingGuestAttr.h
> +++ b/MdePkg/Include/ConfidentialComputingGuestAttr.h
> @@ -22,4 +22,7 @@ typedef enum {
>CCAttrIntelTdx = 0x200,
>  } CONFIDENTIAL_COMPUTING_GUEST_ATTR;
> 
> +#define CC_GUEST_IS_TDX(x)  ((x) == CCAttrIntelTdx) #define
> +CC_GUEST_IS_SEV(x)  ((x) == CCAttrAmdSev || (x) == CCAttrAmdSevEs ||
> +(x) == CCAttrAmdSevSnp)
> +
>  #endif
> --
> 2.29.2.windows.2
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87649): https://edk2.groups.io/g/devel/message/87649
Mute This Topic: https://groups.io/mt/89839571/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in SearchForBfvBase.asm

2022-03-16 Thread Kuo, Ted
Hi Ray,

No, I'll send patch to update the searching algorithm.

Thanks,
Ted

-Original Message-
From: Ni, Ray  
Sent: Thursday, March 17, 2022 1:21 PM
To: devel@edk2.groups.io; Ni, Ray ; Kuo, Ted 

Cc: De, Debkumar ; Han, Harry ; 
West, Catharine ; Xu, Min M 
Subject: RE: [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in 
SearchForBfvBase.asm

Ted,
Have you considered a case that BFV is a FFS2 FV and the logic may find a FFS3 
FV just below the BFV?

Thanks,
Ray

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Ni, Ray
Sent: Friday, March 11, 2022 3:42 PM
To: Kuo, Ted ; devel@edk2.groups.io
Cc: De, Debkumar ; Han, Harry ; 
West, Catharine 
Subject: Re: [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in 
SearchForBfvBase.asm

Reviewed-by: Ray Ni 

-Original Message-
From: Kuo, Ted 
Sent: Friday, March 11, 2022 3:29 PM
To: devel@edk2.groups.io
Cc: Ni, Ray ; De, Debkumar ; Han, 
Harry ; West, Catharine 
Subject: [edk2-devel][PATCH v2] UefiCpuPkg: Support FFS3 GUID in 
SearchForBfvBase.asm

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3862
The new algorithm searches BFV address with FFS3 GUID first.
If not found, it will search BFV address with FFS2 GUID.

Cc: Ray Ni 
Cc: Debkumar De 
Cc: Harry Han 
Cc: Catharine West 
Signed-off-by: Ted Kuo 
---
 .../Vtf0/Bin/IA32/ResetVector.ia32.port80.raw  | Bin 484 -> 548 bytes
 .../ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.raw | Bin 468 -> 516 bytes
 .../Vtf0/Bin/IA32/ResetVector.ia32.serial.raw  | Bin 868 -> 932 bytes
 .../Bin/X64/PageTable1G/ResetVector.x64.port80.raw | Bin 12292 -> 12292 bytes
 .../Vtf0/Bin/X64/PageTable1G/ResetVector.x64.raw   | Bin 12292 -> 12292 bytes
 .../Bin/X64/PageTable1G/ResetVector.x64.serial.raw | Bin 12292 -> 12292 bytes  
.../Bin/X64/PageTable2M/ResetVector.x64.port80.raw | Bin 28676 -> 28676 bytes
 .../Vtf0/Bin/X64/PageTable2M/ResetVector.x64.raw   | Bin 28676 -> 28676 bytes
 .../Bin/X64/PageTable2M/ResetVector.x64.serial.raw | Bin 28676 -> 28676 bytes
 .../ResetVector/Vtf0/Ia32/SearchForBfvBase.asm |  51 +
 10 files changed, 41 insertions(+), 10 deletions(-)

diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.port80.raw 
b/UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.port80.raw
index 
79b23c047bdc6e552d77d5c9e9aeae21ff04d91d..23254e83bf1a17dee9f38c235fcc9948624a7536
 100644 GIT binary patch delta 227 
zcmaFDyo9BG0uUG;*vZVmz@W<@z`$S&Wc)9RYyQbxs@7N`P<5a2DnL~gPkVYw4**r!cFFjcZU?HGY1)}sx(=wS^|0>c
z(xuH6Dh#FbI}bBQD3s24Eoykcv-u}uY2Sto!p|CZ><5C*qp$yU9^J6;8$wu(9TV=}(c8
zUjg)y@_Q48|1M?^0T*VtBLDzE4S>dJ0U!uIkRJe$|NsA!umLp*>x1c7{{R2!
Mtds8n6_W!3A^UepbpQYW

diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.raw 
b/UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.raw
index 
ce7faa502b858e99908bcdb397b776258205e1d5..18562d8f1f58601f66fcb0cbf2f994046ce48fde
 100644 GIT binary patch delta 225 
zcmcb@+`>{n0SF8a>||zOV9;d{U|_HXGX59EHUDHTRcoves5(#_Qu?g1LgcjVDc{n&
zjTI7m^W~3nW7tMv416`-n$r#(HT2Y{+C)y36^7FJorjqt6iR2j7BoEI+5D5Sv~S0L?*04scOHHHuk+|j`-wr}jBh5cDmQQY
zub0NpD4w=MnSsH9U+F;FtK9$p{|hkeaA0F#;8%K(wu6JA??&H&z6X6T`Yyb-n;_3H
Z0jOYd0;3s6_e+a^|Np<-GkG4P833r5W}5&2

delta 153
zcmZo+xxySY0SF8a=rRZ}FxWCMF#InvZmbZfc-qrb`ns_~#I{Suzw}XKg~UwL&cxE2
zjTJJjhjlNPUTCgRVJJP-d6+puq4e-;&K>)Kp!4YKf1O8Px=-v1XZ$kpQMqv4f4ww*
zM)9;A$_xw+{7MJXUZqaXVU!VYn;_3H;s5{tAge)O@&raRj^>vc|Nj4fxn=S>Ml%58
CZbm==

diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.serial.raw 
b/UefiCpuPkg/ResetVector/Vtf0/Bin/IA32/ResetVector.ia32.serial.raw
index 
6503a988abdac06f9aa88f0a65f2525e12233b0a..e4aa4fc30a32bc3d4d8d0e1726c43fdafef4a374
 100644 GIT binary patch delta 214 
zcmaFDwuF6xY`rV9;enmZ3=9mq3<3-cwm`=JqPXUt%%y6L6#`WUibG1DHCBk6wms!r
zdbhDcVsF0Ow9+e$6*8UAO=gvzeysvjRq?c^r}O|&m2H=df9ZChs+p#piKXj+s#*{0
zUM^kQT%p2HI=}NUbA&?ajMssN2Rxg9GM4tG?fT0+F{OjiW8&Lej75`AFs>J_`LCD8
z&nTX@Lz#iWfnVuB+AHPBT}&|oJ`>~_Cj9^Ze*zRte#c}Yu;9;Yrq|zIvi^U${?Gsa
LFE>v%Vm1N**#ci0

delta 146
zcmV;D0B!%I2jm8j9YX~JF~BVV5C8x@00030ax;N=5P0Q`jCJdQcoaQ~98Y!Pfp{31
zHHl$$*@1W*g~Kh=brcl3=nSp^pmqCDm!4}B)UliB;letu_u|lBgKygUvv&IUM)3&F4OYb&T
zNbJp*n^t{?AX75Kkxp|qp$yU9^J6Bj4$8^oS9{Mya%q3`zYTOak(_!-61
zb|^D2IPfbSNPD$!a;u^OyQ4b81EBWFTNEw%UN^ja@b~}!mpT7{gvsPTiV}

delta 259
zcmZokXi3<>rVygbAi%(2%fP_!zsR_;LZISlPfzLV#tISJE*byQM~xK{Gfg`aOK&z-
z$h02Tysxk81Z^i=0z<_Lw-!>@TaY`>8ANp?ZUi48fjh|6GZHF=g
zg9E?PfwWg`llLkr@O!Brcl3=nSp^pmqCDm!4}B)UliB;letu_u|lBgKygUvv&IUM)3&F4OYb&T
zNbJp*n^tq;e#OWC
z|0Nh+&I3AT2g8N`|M`_}ygvDBH^Ya%+q?ID)Jx-M6i?fs%)sEluXG^o)w0RCiZc9u
z>I@fv+9p83MyJRzkL7q|Noc8|A2(?|NsAY0P%kh#bX|dM?DmecyvDa|7^m9
eje;9^6<$hx0&4}@$q*Le#xP;ROJ;}$oEHj+dD

delta 239
zcmZokXi3<>rr@K?Ai%(2%fP_!zsR_;LZISlPfzLV#tISJE*byQM~xK{Gfg`aOK&z-
z$h02Tysxk81Z^i=0z<_Lw-!>>7a><5C*qp$yU9(`Fqxl19OQD^cag(*P}AOHWC
zV0bwdXz&h(3;+M~E8Tc~^4D&L4}G_Hw|&%0<7X64+o8{
z27aXnX*)O=`fl_c=zGxjqVK|MS9OL7K>5iR6m9ulx4bm?_y7OP8W3SKSw=~Mal%Hy
e54;L5Z+)Bq0zms1!b02_CQNvF7$O1|o&W$orgJI)

diff --git 
a/UefiCpuPkg/ResetVector/Vtf0/Bin/X64/PageTable1G/ResetV

[edk2-devel] [PATCH 0/2] BaseTools: TEST ONLY0 FeatureFlagExpression

2022-03-16 Thread yi1 li
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1446

FeatureFlagExpression Support in LibraryClasses/Guids/Ppi/Protocols/
Source section of INF file. The Pcd value in the expression is from 
INF or DEC When a FeatureFlagExpression is present,if the expression
evaluates to TRUE,then the entry is valid. If the expression evaluates
to FALSE, then the EDK II build tools must ignore the entry.

This patch is going to add this feature.

Signed-off-by: yi1 li 

yi1 li (2):
  BaseTools:Add the FeatureFlagExpression usage to the InfBuildData
  BaseTools:Add the FeatureFlagExpression usage to the Source Section

 BaseTools/Source/Python/Common/Expression.py  |  2 +-
 BaseTools/Source/Python/Common/GlobalData.py  |  1 +
 .../Source/Python/Workspace/InfBuildData.py   | 81 ---
 .../Source/Python/Workspace/MetaFileParser.py |  4 +
 .../Python/Workspace/WorkspaceCommon.py   | 10 ++-
 5 files changed, 86 insertions(+), 12 deletions(-)

-- 
2.33.0.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87651): https://edk2.groups.io/g/devel/message/87651
Mute This Topic: https://groups.io/mt/89839902/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 2/2] BaseTools: TEST ONLY2 FeatureFlagExpression

2022-03-16 Thread yi1 li
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1446

FeatureFlagExpression Support in Source section of INF file. The Pcd
value in the expression is from INF or DEC.
When a FeatureFlagExpression is present,if the expression evaluates
to TRUE,then the entry is valid. If the expression evaluates to FALSE,
then the EDK II build tools must ignore the entry.

This patch is going to add this feature.

Signed-off-by: yi1 li 
---
 BaseTools/Source/Python/Workspace/InfBuildData.py  | 14 ++
 .../Source/Python/Workspace/MetaFileParser.py  |  4 
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py 
b/BaseTools/Source/Python/Workspace/InfBuildData.py
index 91d986d8cb1b..cb58e612cbd0 100644
--- a/BaseTools/Source/Python/Workspace/InfBuildData.py
+++ b/BaseTools/Source/Python/Workspace/InfBuildData.py
@@ -529,11 +529,17 @@ class InfBuildData(ModuleBuildClassObject):
 for Record in RecordList:
 LineNo = Record[-1]
 ToolChainFamily = Record[1]
-TagName = Record[2]
-ToolCode = Record[3]
-
+# OptionsList := [TagName, ToolCode, FeatureFlag]
+OptionsList = ['','','']
+TokenList = GetSplitValueList(Record[2], TAB_VALUE_SPLIT)
+for Index in range(len(TokenList)):
+OptionsList[Index] = TokenList[Index]
+if OptionsList[2]:
+FeaturePcdExpression = self.CheckFeatureFlagPcd(OptionsList[2])
+if not FeaturePcdExpression:
+continue
 File = PathClass(NormPath(Record[0], Macros), self._ModuleDir, '',
- '', False, self._Arch, ToolChainFamily, '', 
TagName, ToolCode)
+ '', False, self._Arch, ToolChainFamily, '', 
OptionsList[0], OptionsList[1])
 # check the file validation
 ErrorCode, ErrorInfo = File.Validate()
 if ErrorCode != 0:
diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py 
b/BaseTools/Source/Python/Workspace/MetaFileParser.py
index a3b6edbd15ee..3508591b281e 100644
--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -736,6 +736,10 @@ class InfParser(MetaFileParser):
 @ParseMacro
 def _SourceFileParser(self):
 TokenList = GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT)
+# Let TokenList[2] be TagName|ToolCode|FeatureFlag
+if len(TokenList) > 3:
+for extraToken in range(3, len(TokenList)):
+TokenList[2] = TokenList[2] + '|' + TokenList[extraToken]
 self._ValueList[0:len(TokenList)] = TokenList
 Macros = self._Macros
 # For Acpi tables, remove macro like ' TABLE_NAME=Sata1'
-- 
2.33.0.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87653): https://edk2.groups.io/g/devel/message/87653
Mute This Topic: https://groups.io/mt/89839904/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 1/2] BaseTools: TEST ONLY1 FeatureFlagExpression

2022-03-16 Thread yi1 li
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1446

FeatureFlagExpression Support in LibraryClasses/Guids/Ppi/Protocols
section of INF file. The Pcd value in the expression is from INF or DEC
When a FeatureFlagExpression is present,if the expression evaluates
to TRUE,then the entry is valid. If the expression evaluates to FALSE,
then the EDK II build tools must ignore the entry.

This patch is going to add this feature.

Signed-off-by: yi1 li 
---
 BaseTools/Source/Python/Common/Expression.py  |  2 +-
 BaseTools/Source/Python/Common/GlobalData.py  |  1 +
 .../Source/Python/Workspace/InfBuildData.py   | 67 +--
 .../Python/Workspace/WorkspaceCommon.py   | 10 ++-
 4 files changed, 72 insertions(+), 8 deletions(-)

diff --git a/BaseTools/Source/Python/Common/Expression.py 
b/BaseTools/Source/Python/Common/Expression.py
index 07ca039a9cf3..31bf0e4b6cf7 100644
--- a/BaseTools/Source/Python/Common/Expression.py
+++ b/BaseTools/Source/Python/Common/Expression.py
@@ -43,7 +43,7 @@ ERR_IN_OPERAND  = 'Macro after IN operator can only 
be: $(FAMILY), $(ARC
 __ValidString = re.compile(r'[_a-zA-Z][_0-9a-zA-Z]*$')
 _ReLabel = re.compile('LABEL\((\w+)\)')
 _ReOffset = re.compile('OFFSET_OF\((\w+)\)')
-PcdPattern = re.compile(r'[_a-zA-Z][0-9A-Za-z_]*\.[_a-zA-Z][0-9A-Za-z_]*$')
+PcdPattern = re.compile(r'^[_a-zA-Z][0-9A-Za-z_]*\.[_a-zA-Z][0-9A-Za-z_]*$')
 
 ## SplitString
 #  Split string to list according double quote
diff --git a/BaseTools/Source/Python/Common/GlobalData.py 
b/BaseTools/Source/Python/Common/GlobalData.py
index 61ab3f7e24cd..197bd8366682 100755
--- a/BaseTools/Source/Python/Common/GlobalData.py
+++ b/BaseTools/Source/Python/Common/GlobalData.py
@@ -18,6 +18,7 @@ gGlobalDefines = {}
 gPlatformDefines = {}
 # PCD name and value pair for fixed at build and feature flag
 gPlatformPcds = {}
+gPlatformFinalPcds = {}
 # PCDs with type that are not fixed at build and feature flag
 gPlatformOtherPcds = {}
 gActivePlatform = None
diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py 
b/BaseTools/Source/Python/Workspace/InfBuildData.py
index 45b8ef4716dd..91d986d8cb1b 100644
--- a/BaseTools/Source/Python/Workspace/InfBuildData.py
+++ b/BaseTools/Source/Python/Workspace/InfBuildData.py
@@ -14,6 +14,7 @@ from types import *
 from .MetaFileParser import *
 from collections import OrderedDict
 from Workspace.BuildClassObject import ModuleBuildClassObject, 
LibraryClassObject, PcdClassObject
+from Common.Expression import ValueExpressionEx, PcdPattern
 
 ## Get Protocol value from given packages
 #
@@ -554,6 +555,9 @@ class InfBuildData(ModuleBuildClassObject):
 Instance = Record[1]
 if Instance:
 Instance = NormPath(Instance, self._Macros)
+FeaturePcdExpression = self.CheckFeatureFlagPcd(Instance)
+if not FeaturePcdExpression:
+continue
 RetVal[Lib] = Instance
 else:
 RetVal[Lib] = None
@@ -584,6 +588,10 @@ class InfBuildData(ModuleBuildClassObject):
 self._ProtocolComments = OrderedDict()
 RecordList = self._RawData[MODEL_EFI_PROTOCOL, self._Arch, 
self._Platform]
 for Record in RecordList:
+if Record[1]:
+FeaturePcdExpression = self.CheckFeatureFlagPcd(Record[1])
+if not FeaturePcdExpression:
+continue
 CName = Record[0]
 Value = _ProtocolValue(CName, self.Packages, self.MetaFile.Path)
 if Value is None:
@@ -608,6 +616,10 @@ class InfBuildData(ModuleBuildClassObject):
 self._PpiComments = OrderedDict()
 RecordList = self._RawData[MODEL_EFI_PPI, self._Arch, self._Platform]
 for Record in RecordList:
+if Record[1]:
+FeaturePcdExpression = self.CheckFeatureFlagPcd(Record[1])
+if not FeaturePcdExpression:
+continue
 CName = Record[0]
 Value = _PpiValue(CName, self.Packages, self.MetaFile.Path)
 if Value is None:
@@ -631,7 +643,12 @@ class InfBuildData(ModuleBuildClassObject):
 RetVal = OrderedDict()
 self._GuidComments = OrderedDict()
 RecordList = self._RawData[MODEL_EFI_GUID, self._Arch, self._Platform]
+RetVal.update(self.GetGuidsUsedByPcd())
 for Record in RecordList:
+if Record[1]:
+FeaturePcdExpression = self.CheckFeatureFlagPcd(Record[1])
+if not FeaturePcdExpression:
+continue
 CName = Record[0]
 Value = GuidValue(CName, self.Packages, self.MetaFile.Path)
 if Value is None:
@@ -860,7 +877,12 @@ class InfBuildData(ModuleBuildClassObject):
 def GetGuidsUsedByPcd(self):
 self.Guid
 return self._GuidsUsedByPcd
-
+@cached_class_function
+def GetGuidDict(self):
+GuidDict = OrderedDict()
+for Package in self.Packages:
+