Re: [edk2-devel] [PATCH 1/3] MdeModulePkg/BootLogoLib: Add option to follow Microsoft Recommendations

2022-10-07 Thread Sheng Lean Tan
Reminder for review, thanks.

From: devel@edk2.groups.io  on behalf of Sheng Lean Tan 
via groups.io 
Date: Monday, 3. October 2022 at 11:22
To: devel@edk2.groups.io , sean@starlabs.systems 

Cc: Sean Rhodes , Zhichao Gao , 
Ray Ni , Jian J Wang , Liming Gao 
, Dong, Guo , Guo, Gua 

Subject: Re: [edk2-devel] [PATCH 1/3] MdeModulePkg/BootLogoLib: Add option to 
follow Microsoft Recommendations
Hi Liming,
Mind to help to take a look at these 2 patches? Sean has updated the initial 
patches per your recommendation:
https://edk2.groups.io/g/devel/message/94318?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3ACreated%2C%2Cboot+logo+sean%2C20%2C2%2C0%2C93922542

https://edk2.groups.io/g/devel/message/94320?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3ACreated%2C%2Cboot+logo+sean%2C20%2C2%2C0%2C93922544

Previous feedback:
https://edk2.groups.io/g/devel/message/92385?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3ACreated%2C%2Cboot+logo+sean%2C20%2C2%2C0%2C92974182

https://edk2.groups.io/g/devel/message/92146?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3ACreated%2C%2Cboot+logo+sean%2C20%2C2%2C0%2C92830014

Thanks,
Sheng

From: devel@edk2.groups.io  on behalf of Sean Rhodes 

Date: Monday, 26. September 2022 at 10:10
To: devel@edk2.groups.io 
Cc: Sean Rhodes , Zhichao Gao , 
Ray Ni , Jian J Wang , Liming Gao 

Subject: [edk2-devel] [PATCH 1/3] MdeModulePkg/BootLogoLib: Add option to 
follow Microsoft Recommendations
Add an option to position the logo 38.2% from the top of the screen,
which follows the recommendations from Microsoft. These can be found
here:
https://docs.microsoft.com/en-us/windows-hardware/drivers/bringup/boot-screen-components

Cc: Zhichao Gao 
Cc: Ray Ni 
Cc: Jian J Wang 
Cc: Liming Gao 
Signed-off-by: Sean Rhodes 
---
 MdeModulePkg/Include/Protocol/PlatformLogo.h   | 3 ++-
 MdeModulePkg/Library/BootLogoLib/BootLogoLib.c | 7 ---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/MdeModulePkg/Include/Protocol/PlatformLogo.h 
b/MdeModulePkg/Include/Protocol/PlatformLogo.h
index 08e1dc35a4..b24d7d5b79 100644
--- a/MdeModulePkg/Include/Protocol/PlatformLogo.h
+++ b/MdeModulePkg/Include/Protocol/PlatformLogo.h
@@ -29,7 +29,8 @@ typedef enum {
   EdkiiPlatformLogoDisplayAttributeCenterBottom,

   EdkiiPlatformLogoDisplayAttributeLeftBottom,

   EdkiiPlatformLogoDisplayAttributeCenterLeft,

-  EdkiiPlatformLogoDisplayAttributeCenter

+  EdkiiPlatformLogoDisplayAttributeCenter,

+  EdkiiPlatformLogoDisplayAttributeMicrosoftRecommended

 } EDKII_PLATFORM_LOGO_DISPLAY_ATTRIBUTE;



 /**

diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c 
b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
index 478ec2d40e..9065e5281b 100644
--- a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
+++ b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
@@ -169,7 +169,6 @@ BootLogoEnableLogo (
 DestX = SizeOfX - Image.Width;

 DestY = 0;

 break;

-

   case EdkiiPlatformLogoDisplayAttributeCenterLeft:

 DestX = 0;

 DestY = (SizeOfY - Image.Height) / 2;

@@ -182,7 +181,6 @@ BootLogoEnableLogo (
 DestX = SizeOfX - Image.Width;

 DestY = (SizeOfY - Image.Height) / 2;

 break;

-

   case EdkiiPlatformLogoDisplayAttributeLeftBottom:

 DestX = 0;

 DestY = SizeOfY - Image.Height;

@@ -195,7 +193,10 @@ BootLogoEnableLogo (
 DestX = SizeOfX - Image.Width;

 DestY = SizeOfY - Image.Height;

 break;

-

+  case EdkiiPlatformLogoDisplayAttributeMicrosoftRecommended:

+DestX = (SizeOfX - Image.Width) / 2;

+DestY = (SizeOfY * 382) / 1000 - Image.Height / 2;

+break;

   default:

 ASSERT (FALSE);

 continue;

--
2.34.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94318): https://edk2.groups.io/g/devel/message/94318
Mute This Topic: https://groups.io/mt/93922542/6757431
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [sheng@9elements.com]
-=-=-=-=-=-=





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




[edk2-devel] [PATCH v2 1/1] ArmPlatformPkg/PrePeiCore: Print the firmware version early in boot

2022-10-07 Thread Rebecca Cran
Copy code from PrePi to PrePeiCore that prints the firmware version
and build date early in the boot process.

Signed-off-by: Rebecca Cran 
---
 ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf  |  3 +++
 ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf |  3 +++
 ArmPlatformPkg/PrePeiCore/PrePeiCore.c  | 14 ++
 3 files changed, 20 insertions(+)

diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf 
b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
index a5b4722459d1..4a3112b58dcb 100644
--- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
+++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
@@ -54,6 +54,9 @@ [Ppis]
   gEfiTemporaryRamSupportPpiGuid
   gArmMpCoreInfoPpiGuid
 
+[Pcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
+
 [FeaturePcd]
   gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores
 
diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf 
b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
index 466a2b01c384..ab5bf1dac2d8 100644
--- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
+++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
@@ -52,6 +52,9 @@ [LibraryClasses]
 [Ppis]
   gEfiTemporaryRamSupportPpiGuid
 
+[Pcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
+
 [FeaturePcd]
   gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores
 
diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c 
b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c
index 9c4b25df953d..49df21aca92a 100644
--- a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c
+++ b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c
@@ -11,6 +11,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include "PrePeiCore.h"
 
@@ -58,6 +60,9 @@ CEntryPoint (
   IN  EFI_PEI_CORE_ENTRY_POINT  PeiCoreEntryPoint
   )
 {
+  CHAR8  Buffer[100];
+  UINTN  CharCount;
+
   // Data Cache enabled on Primary core when MMU is enabled.
   ArmDisableDataCache ();
   // Invalidate instruction cache
@@ -93,6 +98,15 @@ CEntryPoint (
 // Invoke "ProcessLibraryConstructorList" to have all library constructors
 // called.
 ProcessLibraryConstructorList ();
+CharCount = AsciiSPrint (
+Buffer,
+sizeof (Buffer),
+"UEFI firmware (version %s built at %a on %a)\n\r",
+(CHAR16 *)PcdGetPtr (PcdFirmwareVersionString),
+__TIME__,
+__DATE__
+);
+SerialPortWrite ((UINT8 *)Buffer, CharCount);
 
 // Initialize the Debug Agent for Source Level Debugging
 InitializeDebugAgent (DEBUG_AGENT_INIT_POSTMEM_SEC, NULL, NULL);
-- 
2.30.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94805): https://edk2.groups.io/g/devel/message/94805
Mute This Topic: https://groups.io/mt/94177352/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 1/1] ArmPlatformPkg/PrePeiCore: Print the firmware version early in boot

2022-10-07 Thread Sami Mujawar
Hi Rebecca,

Thank you for this patch.

On Fri, Oct 7, 2022 at 04:38 AM, Rebecca Cran wrote:

> 
> + CharCount = AsciiSPrint (
> + Buffer,
> + sizeof (Buffer),
> + "UEFI firmware (version %s built at %a on %a)\n\r",
> + (CHAR16 *)PcdGetPtr (PcdFirmwareVersionString),
> + __TIME__,
> + __DATE__
> + );

Can you check if uncrustify reports any issue with the above, please?
Other than that this patch looks good to me.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94806): https://edk2.groups.io/g/devel/message/94806
Mute This Topic: https://groups.io/mt/94177352/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] SimicsOpenBoardPkg: Fix bug in DSDT

2022-10-07 Thread Guenzel, Robert


The DSDT had a syntax error that was not detected by older iasl versions.
This commit fixes the Syntax error.

Signed-off-by: Robert Guenzel 
---
 Platform/Intel/SimicsOpenBoardPkg/AcpiTables/Dsdt.asl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Platform/Intel/SimicsOpenBoardPkg/AcpiTables/Dsdt.asl 
b/Platform/Intel/SimicsOpenBoardPkg/AcpiTables/Dsdt.asl
index 8a6c3792..3421c9e8 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/AcpiTables/Dsdt.asl
+++ b/Platform/Intel/SimicsOpenBoardPkg/AcpiTables/Dsdt.asl
@@ -372,7 +372,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 1, "INTEL ", "SIMICS  
", 4) {
 
 Package () {0x000E, 0x00, 0, 16},
 Package () {0x000E, 0x01, 0, 17},
-Package () {0x000E, 0x02, 0C, 18},
+Package () {0x000E, 0x02, 0, 18},
 Package () {0x000E, 0x03, 0, 19},
 
 Package () {0x000F, 0x00, 0, 16},
-- 
2.34.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de 
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94808): https://edk2.groups.io/g/devel/message/94808
Mute This Topic: https://groups.io/mt/94178621/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] SimicsOpenBoardPkg: Override additional Pcd

2022-10-07 Thread Guenzel, Robert


The Pcd gUefiCpuPkgTokenSpaceGuid.PcdSmmFeatureControlEnable is by default True 
in UefiCpuPkg.
However, the Simics target does not have the MSRs whose access is guarded by 
this Pcd and
hence runs into a GP fault. Consequently, we override the Pcd to be False.

Signed-off-by: Robert Guenzel 
---
 .../Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc   | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc 
b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
index e2171dd3..472318cc 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
+++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
@@ -38,6 +38,7 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset|FALSE
   gUefiCpuPkgTokenSpaceGuid.PcdCpuHotPlugSupport|FALSE
   gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmEnableBspElection|FALSE
+  gUefiCpuPkgTokenSpaceGuid.PcdSmmFeatureControlEnable|FALSE
 
   ##
   # Platform Configuration
-- 
2.34.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de 
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928



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




[edk2-devel] Show platform-key fingerprint when secure boot is enabled

2022-10-07 Thread Simon Brand
Hello,

when secure boot is enabled and a custom platform-key is used, please
show the fingerprint of the platform-key in the UEFI interface and on
the POST screen.
This way a user can really verify, that only their signed EFI executables
gets booted/executed. (And nobody tampered the device keys/disk)
For the POST screen, it would be nice to pause execution with a specfic
key so people have time to verify the hash.

Android smartphones have this feature for several years [0], but I am not
talking about a big yellow warning, just the hash as a information.
Please keep in mind, that the screenshots are not fully up-to-date, devices
show not only the first 8 digits, but the full root of trust hash since a
few months. [1]
The reference source code is available here: [2]

Best and thanks,
Simon


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94807): https://edk2.groups.io/g/devel/message/94807
Mute This Topic: https://groups.io/mt/94178620/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 1/1] ArmPlatformPkg/PrePeiCore: Print the firmware version early in boot

2022-10-07 Thread Rebecca Cran

Ah, dangit! I completely forgot to run uncrustify.
I'll send out a v3.

--
Rebecca Cran

On 10/7/22 06:34, Sami Mujawar wrote:

Hi Rebecca,

Thank you for this patch.

On Fri, Oct 7, 2022 at 04:38 AM, Rebecca Cran wrote:

+ CharCount = AsciiSPrint (
+ Buffer,
+ sizeof (Buffer),
+ "UEFI firmware (version %s built at %a on %a)\n\r",
+ (CHAR16 *)PcdGetPtr (PcdFirmwareVersionString),
+ __TIME__,
+ __DATE__
+ );

Can you check if uncrustify reports any issue with the above, please?
Other than that this patch looks good to me.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar 




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




Re: [edk2-devel] [PATCH 1/1] Platform/ARM: Bump Dsdt/Ssdt ACPI table revision

2022-10-07 Thread Sami Mujawar
Hi Pierre,

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

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94811): https://edk2.groups.io/g/devel/message/94811
Mute This Topic: https://groups.io/mt/93548410/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 1/1] ArmPlatformPkg/PrePeiCore: Print the firmware version early in boot

2022-10-07 Thread Oliver Steffen
Quoting Rebecca Cran (2022-10-07 13:38:05)
> Copy code from PrePi to PrePeiCore that prints the firmware version
> and build date early in the boot process.
>
> Signed-off-by: Rebecca Cran 
> ---
>  ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf  |  3 +++
>  ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf |  3 +++
>  ArmPlatformPkg/PrePeiCore/PrePeiCore.c  | 14 ++
>  3 files changed, 20 insertions(+)
>
> diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf 
> b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
> index a5b4722459d1..4a3112b58dcb 100644
> --- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
> +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
> @@ -54,6 +54,9 @@ [Ppis]
>gEfiTemporaryRamSupportPpiGuid
>gArmMpCoreInfoPpiGuid
>
> +[Pcd]
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
> +
>  [FeaturePcd]
>gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores
>
> diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf 
> b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
> index 466a2b01c384..ab5bf1dac2d8 100644
> --- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
> +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
> @@ -52,6 +52,9 @@ [LibraryClasses]
>  [Ppis]
>gEfiTemporaryRamSupportPpiGuid
>
> +[Pcd]
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
> +
>  [FeaturePcd]
>gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores
>
> diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c 
> b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c
> index 9c4b25df953d..49df21aca92a 100644
> --- a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c
> +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c
> @@ -11,6 +11,8 @@
>  #include 
>  #include 
>  #include 
> +#include 
> +#include 
>
>  #include "PrePeiCore.h"
>
> @@ -58,6 +60,9 @@ CEntryPoint (
>IN  EFI_PEI_CORE_ENTRY_POINT  PeiCoreEntryPoint
>)
>  {
> +  CHAR8  Buffer[100];
> +  UINTN  CharCount;
> +
>// Data Cache enabled on Primary core when MMU is enabled.
>ArmDisableDataCache ();
>// Invalidate instruction cache
> @@ -93,6 +98,15 @@ CEntryPoint (
>  // Invoke "ProcessLibraryConstructorList" to have all library 
> constructors
>  // called.
>  ProcessLibraryConstructorList ();
> +CharCount = AsciiSPrint (
> +Buffer,
> +sizeof (Buffer),
> +"UEFI firmware (version %s built at %a on %a)\n\r",
> +(CHAR16 *)PcdGetPtr (PcdFirmwareVersionString),
> +__TIME__,
> +__DATE__
> +);
> +SerialPortWrite ((UINT8 *)Buffer, CharCount);
>
>  // Initialize the Debug Agent for Source Level Debugging
>  InitializeDebugAgent (DEBUG_AGENT_INIT_POSTMEM_SEC, NULL, NULL);
> --
> 2.30.2
>

Hi Rebecca,
thank you!

Tested-by: Oliver Steffen 



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




Re: [edk2-devel] [edk2-platforms PATCH v2] Platform/RaspberryPi: fix pci DT node address in SyncPcie()

2022-10-07 Thread Jeremy Linton

Hi,

On 10/6/22 12:46, Adrien Thierry wrote:

To make sure the XHCI controller does not get reset by Linux in DT mode,
we remove its pci parent node from the device tree. However, the pci
node address has been updated in the Raspberry Pi 4 device tree [1] and
no longer matches the one we are trying to remove in SyncPcie(). This
results in the XHCI controller actually being reset by Linux, which
leads to errors during USB initialization:

[3.563963] xhci_hcd :01:00.0: xHCI Host Controller
[3.569538] xhci_hcd :01:00.0: new USB bus registered, assigned bus 
number 1
[3.577452] xhci_hcd :01:00.0: hcc params 0x002841eb hci version 0x100 
quirks 0x04000890
[3.587725] xhci_hcd :01:00.0: xHCI Host Controller
[3.593115] xhci_hcd :01:00.0: new USB bus registered, assigned bus 
number 2
[3.600693] xhci_hcd :01:00.0: Host supports USB 3.0 SuperSpeed
[3.608106] hub 1-0:1.0: USB hub found
[3.612026] hub 1-0:1.0: 1 port detected
[3.616819] hub 2-0:1.0: USB hub found
[3.620726] hub 2-0:1.0: 4 ports detected
[3.875902] usb 1-1: new high-speed USB device number 2 using xhci_hcd
[4.008123] usb 1-1: device descriptor read/64, error -71
[4.256088] usb 1-1: device descriptor read/64, error -71
[4.495882] usb 1-1: new high-speed USB device number 3 using xhci_hcd
[4.628111] usb 1-1: device descriptor read/64, error -71
[4.872083] usb 1-1: device descriptor read/64, error -71
[5.407888] usb 1-1: new high-speed USB device number 4 using xhci_hcd
[6.023964] xhci_hcd :01:00.0: Setup ERROR: setup address command for 
slot 1.
[6.239977] xhci_hcd :01:00.0: Setup ERROR: setup address command for 
slot 1.

This patch allows matching any address for the pci node, thus working
with both legacy and new device trees.



Thanks a lot for looking into this! This looks fine to me, the only 
thing that poped out was that the uefi checkpatch complained about the 
linux log in the commit message, but I think that should be ok.


so:

Reviewed-by: Jeremy Linton 

and I also did some basic testing on a rpi4's so:

Tested-by: Jeremy Linton 

too.

Thanks again!


[1] https://lore.kernel.org/all/20210831125843.1233488-1-nsaen...@redhat.com/

Fixes: efff29cdcdb7 ("Platform/RaspberryPi: Always use non translating DMA in DT 
mode")
Signed-off-by: Adrien Thierry 
---

v1->v2: Match both pci@1,0 and pci@0,0

I chose to remove the address altogether, since there is only one pci
node for the Raspberry Pi 4 and thus no ambiguity. Let me know if you
prefer explicitly matching pci@1,0 and pci@0,0.

  Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c 
b/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c
index e72d132b18..cbbc2ad30d 100644
--- a/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c
+++ b/Platform/RaspberryPi/Drivers/FdtDxe/FdtDxe.c
@@ -388,14 +388,14 @@ SyncPcie (
 * triggering the mailbox by removing the node.
 */
  
-  Node = fdt_path_offset (mFdtImage, "/scb/pcie@7d50/pci@1,0");

+  Node = fdt_path_offset (mFdtImage, "/scb/pcie@7d50/pci");
if (Node < 0) {
  // This can happen on CM4/etc which doesn't have an onboard XHCI
-DEBUG ((DEBUG_INFO, "%a: failed to locate 
/scb/pcie@7d50/pci@1/usb@1\n", __FUNCTION__));
+DEBUG ((DEBUG_INFO, "%a: failed to locate /scb/pcie@7d50/pci\n", 
__FUNCTION__));
} else {
  Retval = fdt_del_node (mFdtImage, Node);
  if (Retval != 0) {
-  DEBUG ((DEBUG_ERROR, "Failed to remove 
/scb/pcie@7d50/pci@1/usb@1\n"));
+  DEBUG ((DEBUG_ERROR, "Failed to remove /scb/pcie@7d50/pci\n"));
return EFI_NOT_FOUND;
  }
}

base-commit: ae75c51f27e21036b6ee021a2d5b9f365f951413




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




[edk2-devel] [[edk2-staging/HttpProxy PATCH v2] 0/6] Support HTTPS Proxy Server for HTTP Boot

2022-10-07 Thread Saloni Kasbekar
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3951
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4052

- Add CONNECT HTTP Method to create a tunnel through the Proxy Server
- TLS adjustments to establish handshake with the Endpoint Server
- Use multi-URI device path to support Proxy Server URI as a 
  part of the Http Boot Device Path

Saloni Kasbekar (6):
  MdeModulePkg/Library: Support multi-URI HTTP Boot device path
  MdePkg/Include: Add Proxy Server URL in EFI_HTTP_REQUEST_DATA
  NetworkPkg/HttpBootDxe: Update HTTP Boot Driver with parsed Proxy URL
  NetworkPkg: Add Proxy Support to HTTP_PROTOCOL
  NetworkPkg: Add support for HTTP CONNECT Method
  NetworkPkg/HttpDxe: Support HTTPS EndPoint server with Proxy

 .../Library/UefiBootManagerLib/BmBoot.c   |  28 ++
 .../UefiBootManagerLib/BmBootDescription.c|   4 +-
 MdePkg/Include/Protocol/Http.h|  10 +-
 NetworkPkg/HttpBootDxe/HttpBootClient.c   | 206 ++-
 NetworkPkg/HttpBootDxe/HttpBootClient.h   |  15 ++
 NetworkPkg/HttpBootDxe/HttpBootDxe.h  |   6 +
 NetworkPkg/HttpBootDxe/HttpBootImpl.c | 249 --
 NetworkPkg/HttpBootDxe/HttpBootImpl.h |   8 +
 NetworkPkg/HttpBootDxe/HttpBootSupport.c  | 154 ---
 NetworkPkg/HttpBootDxe/HttpBootSupport.h  |  13 +-
 NetworkPkg/HttpDxe/HttpDriver.h   |   2 +
 NetworkPkg/HttpDxe/HttpDxe.inf|   1 +
 NetworkPkg/HttpDxe/HttpImpl.c | 215 +++
 NetworkPkg/HttpDxe/HttpProto.c|  58 ++--
 NetworkPkg/HttpDxe/HttpProto.h|  17 +-
 NetworkPkg/HttpDxe/HttpsSupport.c |  16 +-
 NetworkPkg/Library/DxeHttpLib/DxeHttpLib.c|   5 +
 17 files changed, 805 insertions(+), 202 deletions(-)

-- 
2.36.1.windows.1



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




[edk2-devel] [[edk2-staging/HttpProxy PATCH v2] 1/6] MdeModulePkg/Library: Support multi-URI HTTP Boot device path

2022-10-07 Thread Saloni Kasbekar
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3951

Process device path with proxy server and endpoint server included.
Update comment for sample HTTP Boot device path.

Cc: Jian J Wang 
Cc: Liming Gao 
Signed-off-by: Saloni Kasbekar 
---
 .../Library/UefiBootManagerLib/BmBoot.c   | 28 +++
 .../UefiBootManagerLib/BmBootDescription.c|  4 +--
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c 
b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index 962892d38f..fdef1ba292 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -1513,6 +1513,9 @@ BmExpandLoadFiles (
   UINTN HandleCount;
   UINTN Index;
   EFI_DEVICE_PATH_PROTOCOL  *Node;
+  URI_DEVICE_PATH   *NullUriPath;
+
+  NullUriPath = NULL;
 
   //
   // Get file buffer from load file instance.
@@ -1545,11 +1548,36 @@ BmExpandLoadFiles (
 
 for (Index = 0; Index < HandleCount; Index++) {
   if (BmMatchHttpBootDevicePath (DevicePathFromHandle (Handles[Index]), 
FilePath)) {
+//
+// Matches HTTP Boot Device Path described as
+//   
../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)[/Dns(...)]/Uri(...)
+//   
../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)[/Dns(...)]/Uri(...)
+//
+Handle = Handles[Index];
+goto Done;
+  }
+}
+
+NullUriPath = (URI_DEVICE_PATH *)CreateDeviceNode (
+   MESSAGING_DEVICE_PATH,
+   MSG_URI_DP,
+   (UINT16)(sizeof (URI_DEVICE_PATH))
+   );
+for (Index = 0; Index < HandleCount; Index++) {
+  if (BmMatchHttpBootDevicePath (AppendDevicePathNode 
(DevicePathFromHandle (Handles[Index]), (EFI_DEVICE_PATH_PROTOCOL 
*)NullUriPath), FilePath)) {
+//
+// Matches HTTP Boot Device Path described as
+//   
../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)[/Dns(...)]/Uri(...)/Uri(...)
+//   
../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)[/Dns(...)]/Uri(...)/Uri(...)
+//
 Handle = Handles[Index];
 break;
   }
 }
 
+FreePool (NullUriPath);
+
+Done:
 if (Handles != NULL) {
   FreePool (Handles);
 }
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c 
b/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c
index fac33b9ee9..108efd8096 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c
@@ -412,8 +412,8 @@ BmGetNetworkDescription (
   //   ../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)
   //
   // The HTTP device path is like:
-  //   ../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)[/Dns(...)]/Uri(...)
-  //   ../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)[/Dns(...)]/Uri(...)
+  //   
../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)[/Dns(...)][/Uri(...)]/Uri(...)
+  //   
../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)[/Dns(...)][/Uri(...)]/Uri(...)
   //
   while (!IsDevicePathEnd (DevicePath) &&
  ((DevicePathType (DevicePath) != MESSAGING_DEVICE_PATH) ||
-- 
2.36.1.windows.1



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




[edk2-devel] [[edk2-staging/HttpProxy PATCH v2] 2/6] MdePkg/Include: Add Proxy Server URL in EFI_HTTP_REQUEST_DATA

2022-10-07 Thread Saloni Kasbekar
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3951

Add Proxy Server URL to EFI_HTTP_REQUEST_DATA.
This will be used when a Proxy Server URL is a part of the
HTTP Boot device path.

Cc: Zhiguang Liu 
Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Saloni Kasbekar 
---
 MdePkg/Include/Protocol/Http.h | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/MdePkg/Include/Protocol/Http.h b/MdePkg/Include/Protocol/Http.h
index 28e6221593..9ee08baa14 100644
--- a/MdePkg/Include/Protocol/Http.h
+++ b/MdePkg/Include/Protocol/Http.h
@@ -188,9 +188,17 @@ typedef struct {
   /// The URI of a remote host. From the information in this field, the HTTP 
instance
   /// will be able to determine whether to use HTTP or HTTPS and will also be 
able to
   /// determine the port number to use. If no port number is specified, port 
80 (HTTP)
-  /// is assumed. See RFC 3986 for more details on URI syntax.
+  /// or 443 (HTTPS) is assumed. See RFC 3986 for more details on URI syntax.
   ///
   CHAR16 *Url;
+  ///
+  /// The URI of an Proxy Host. This field will be NULL if there is no Proxy 
Host
+  /// in the device path. From the information in this field, the HTTP 
instance will
+  /// be able to determine whether to use HTTP or HTTPS and will also be able 
to
+  /// determine the port number to use. If no port number is specified, port 
80 (HTTP)
+  /// or 443 (HTTPS) is assumed. See RFC 3986 for more details on URI syntax.
+  ///
+  CHAR16 *ProxyUrl;
 } EFI_HTTP_REQUEST_DATA;
 
 ///
-- 
2.36.1.windows.1



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




[edk2-devel] [[edk2-staging/HttpProxy PATCH v2] 3/6] NetworkPkg/HttpBootDxe: Update HTTP Boot Driver with parsed Proxy URL

2022-10-07 Thread Saloni Kasbekar
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3951

Add ProxyUri to HTTP_BOOT_PRIVATE_DATA
Parse HTTP Boot Device path to process Proxy and EndPoint URLs

Cc: Maciej Rabeda 
Cc: Wu Jiaxin 
Cc: Siyuan Fu 
Signed-off-by: Saloni Kasbekar 
---
 NetworkPkg/HttpBootDxe/HttpBootClient.c  |  30 -
 NetworkPkg/HttpBootDxe/HttpBootDxe.h |   6 +
 NetworkPkg/HttpBootDxe/HttpBootImpl.c|  57 +
 NetworkPkg/HttpBootDxe/HttpBootSupport.c | 154 +--
 NetworkPkg/HttpBootDxe/HttpBootSupport.h |  13 +-
 5 files changed, 189 insertions(+), 71 deletions(-)

diff --git a/NetworkPkg/HttpBootDxe/HttpBootClient.c 
b/NetworkPkg/HttpBootDxe/HttpBootClient.c
index 40f64fcb6b..b13155b576 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootClient.c
+++ b/NetworkPkg/HttpBootDxe/HttpBootClient.c
@@ -678,6 +678,10 @@ HttpBootFreeCache (
 FreePool (Cache->RequestData->Url);
   }
 
+  if (Cache->RequestData->ProxyUrl != NULL) {
+FreePool (Cache->RequestData->ProxyUrl);
+  }
+
   FreePool (Cache->RequestData);
 }
 
@@ -950,6 +954,7 @@ HttpBootGetBootFile (
   UINT8*Block;
   UINTNUrlSize;
   CHAR16   *Url;
+  CHAR16   *ProxyUrl;
   BOOLEAN  IdentityMode;
   UINTNReceivedSize;
   CHAR8BaseAuthValue[80];
@@ -989,6 +994,22 @@ HttpBootGetBootFile (
   // Not found in cache, try to download it through HTTP.
   //
 
+  //
+  // Initialize ProxyUrl - Set to NULL if connecting without Proxy
+  //
+  if (Private->ProxyUri != NULL) {
+UrlSize  = AsciiStrSize (Private->ProxyUri);
+ProxyUrl = AllocatePool (UrlSize * (sizeof (CHAR16)));
+if (ProxyUrl == NULL) {
+  Status = EFI_OUT_OF_RESOURCES;
+  goto ERROR_1;
+}
+
+AsciiStrToUnicodeStrS (Private->ProxyUri, ProxyUrl, UrlSize);
+  } else {
+ProxyUrl = NULL;
+  }
+
   //
   // 1. Create a temp cache item for the requested URI if caller doesn't 
provide buffer.
   //
@@ -1106,8 +1127,9 @@ HttpBootGetBootFile (
 goto ERROR_3;
   }
 
-  RequestData->Method = HeaderOnly ? HttpMethodHead : HttpMethodGet;
-  RequestData->Url= Url;
+  RequestData->Method   = HeaderOnly ? HttpMethodHead : HttpMethodGet;
+  RequestData->Url  = Url;
+  RequestData->ProxyUrl = ProxyUrl;
 
   //
   // 2.3 Record the request info in a temp cache item.
@@ -1441,6 +1463,10 @@ ERROR_2:
   }
 
 ERROR_1:
+  if (ProxyUrl != NULL) {
+FreePool (ProxyUrl);
+  }
+
   if (Url != NULL) {
 FreePool (Url);
   }
diff --git a/NetworkPkg/HttpBootDxe/HttpBootDxe.h 
b/NetworkPkg/HttpBootDxe/HttpBootDxe.h
index 5ff8ad4698..8caf2e9a45 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootDxe.h
+++ b/NetworkPkg/HttpBootDxe/HttpBootDxe.h
@@ -223,6 +223,12 @@ struct _HTTP_BOOT_PRIVATE_DATA {
   CHAR8*FilePathUri;
   VOID *FilePathUriParser;
 
+  //
+  // URI string for the Proxy host if BootFileUri contains a Proxy
+  // URI in the path
+  //
+  CHAR8*ProxyUri;
+
   //
   // Cached HTTP data
   //
diff --git a/NetworkPkg/HttpBootDxe/HttpBootImpl.c 
b/NetworkPkg/HttpBootDxe/HttpBootImpl.c
index b4c61925b9..5735b96d9e 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootImpl.c
+++ b/NetworkPkg/HttpBootDxe/HttpBootImpl.c
@@ -115,19 +115,21 @@ HttpBootStart (
 {
   UINTN   Index;
   EFI_STATUS  Status;
-  CHAR8   *Uri;
+  CHAR8   *ProxyUri;
+  CHAR8   *EndPointUri;
 
-  Uri = NULL;
+  ProxyUri= NULL;
+  EndPointUri = NULL;
 
   if ((Private == NULL) || (FilePath == NULL)) {
 return EFI_INVALID_PARAMETER;
   }
 
   //
-  // Check the URI in the input FilePath, in order to see whether it is
+  // Check the URIs in the input FilePath, in order to see whether it is
   // required to boot from a new specified boot file.
   //
-  Status = HttpBootParseFilePath (FilePath, &Uri);
+  Status = HttpBootParseFilePath (FilePath, &ProxyUri, &EndPointUri);
   if (EFI_ERROR (Status)) {
 return EFI_INVALID_PARAMETER;
   }
@@ -143,28 +145,21 @@ HttpBootStart (
 // recorded before.
 //
 if ((UsingIpv6 != Private->UsingIpv6) ||
-((Uri != NULL) && (AsciiStrCmp (Private->BootFileUri, Uri) != 0)))
+((EndPointUri != NULL) && (AsciiStrCmp (Private->BootFileUri, 
EndPointUri) != 0)))
 {
   //
   // Restart is required, first stop then continue this start function.
   //
   Status = HttpBootStop (Private);
   if (EFI_ERROR (Status)) {
-if (Uri != NULL) {
-  FreePool (Uri);
-}
-
-return Status;
+goto ERROR;
   }
 } else {
   //
   // Restart is not required.
   //
-  if (Uri != NULL) {
-FreePool (Uri);
-  }
-
-  return EFI_ALREADY_STARTED;
+  Status = EFI_ALREADY_STARTED;
+  goto ERROR;
 }
   }
 
@@ -176,17 +171,16 @@ HttpBootStart (
   } else if (!UsingIpv6 && (Private->Ip4Ni

[edk2-devel] [[edk2-staging/HttpProxy PATCH v2] 4/6] NetworkPkg: Add Proxy Support to HTTP_PROTOCOL

2022-10-07 Thread Saloni Kasbekar
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3951

Update HTTP Protocol with variables to support Proxy
Use state machine to call HttpBootGetBootFile()
Add switch/case for EfiHttpRequest request method

Cc: Maciej Rabeda 
Cc: Wu Jiaxin 
Cc: Siyuan Fu 
Signed-off-by: Saloni Kasbekar 
---
 NetworkPkg/HttpBootDxe/HttpBootImpl.c | 178 +-
 NetworkPkg/HttpBootDxe/HttpBootImpl.h |   7 +
 NetworkPkg/HttpDxe/HttpImpl.c |  59 +++--
 NetworkPkg/HttpDxe/HttpProto.c|  18 ++-
 NetworkPkg/HttpDxe/HttpProto.h|   9 ++
 5 files changed, 199 insertions(+), 72 deletions(-)

diff --git a/NetworkPkg/HttpBootDxe/HttpBootImpl.c 
b/NetworkPkg/HttpBootDxe/HttpBootImpl.c
index 5735b96d9e..4748de0603 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootImpl.c
+++ b/NetworkPkg/HttpBootDxe/HttpBootImpl.c
@@ -278,6 +278,122 @@ HttpBootDhcp (
   return Status;
 }
 
+/**
+  Issue calls to HttpBootGetBootFile() based on current Boot File State
+
+  @param[in]  Private The pointer to the driver's private data.
+  @param[in, out] BufferSize  On input the size of Buffer in bytes. On 
output with a return
+  code of EFI_SUCCESS, the amount of data 
transferred to
+  Buffer. On output with a return code of 
EFI_BUFFER_TOO_SMALL,
+  the size of Buffer required to retrieve 
the requested file.
+  @param[in]  Buffer  The memory buffer to transfer the file 
to. If Buffer is NULL,
+  then the size of the requested file is 
returned in
+  BufferSize.
+  @param[out] ImageType   The image type of the downloaded file.
+
+  @retval EFI_SUCCESS  The file was loaded.
+  @retval EFI_INVALID_PARAMETERBufferSize is NULL or Buffer Size is not 
NULL but Buffer is NULL.
+  @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources
+  @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the 
current directory entry.
+   BufferSize has been updated with the size 
needed to complete
+   the request.
+  @retval EFI_ACCESS_DENIEDServer authentication failed.
+  @retval Others   Unexpected error happened.
+
+**/
+EFI_STATUS
+HttpBootGetBootFileCaller (
+  IN HTTP_BOOT_PRIVATE_DATA  *Private,
+  IN OUT UINTN   *BufferSize,
+  IN VOID*BufferOPTIONAL,
+  OUT HTTP_BOOT_IMAGE_TYPE   *ImageType
+  )
+{
+  HTTP_GET_BOOT_FILE_STATE  State;
+  EFI_STATUSStatus;
+
+  if (Private->BootFileSize == 0) {
+State = GetBootFileHead;
+  } else {
+State = LoadBootFile;
+  }
+
+  for ( ; ;) {
+switch (State) {
+  case GetBootFileHead:
+//
+// Try to use HTTP HEAD method.
+//
+Status = HttpBootGetBootFile (
+   Private,
+   TRUE,
+   &Private->BootFileSize,
+   NULL,
+   &Private->ImageType
+   );
+if ((EFI_ERROR (Status)) && (Status != EFI_BUFFER_TOO_SMALL)) {
+  if ((Private->AuthData != NULL) && (Status == EFI_ACCESS_DENIED)) {
+//
+// Try to use HTTP HEAD method again since the Authentication 
information is provided.
+//
+State = GetBootFileHead;
+  } else {
+State = GetBootFileGet;
+  }
+} else {
+  State = LoadBootFile;
+}
+
+break;
+
+  case GetBootFileGet:
+//
+// Failed to get file size by HEAD method, may be trunked encoding, 
try HTTP GET method.
+//
+ASSERT (Private->BootFileSize == 0);
+Status = HttpBootGetBootFile (
+   Private,
+   FALSE,
+   &Private->BootFileSize,
+   NULL,
+   &Private->ImageType
+   );
+if (EFI_ERROR (Status) && (Status != EFI_BUFFER_TOO_SMALL)) {
+  State = GetBootFileError;
+} else {
+  State = LoadBootFile;
+}
+
+break;
+
+  case LoadBootFile:
+if (*BufferSize < Private->BootFileSize) {
+  *BufferSize = Private->BootFileSize;
+  *ImageType  = Private->ImageType;
+  Status  = EFI_BUFFER_TOO_SMALL;
+  return Status;
+}
+
+//
+// Load the boot file into Buffer
+//
+Status = HttpBootGetBootFile (
+   Private,
+   FALSE,
+   BufferSize,
+   Buffer,
+   ImageType
+   );
+return Status;
+
+  case GetBootFileError:
+  default:
+AsciiPrint ("\n  Error: Could not retrieve NBP file size from HTTP 
server.\n");
+return Status;

[edk2-devel] [[edk2-staging/HttpProxy PATCH v2] 6/6] NetworkPkg/HttpDxe: Support HTTPS EndPoint server with Proxy

2022-10-07 Thread Saloni Kasbekar
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3951

Add support for Proxy server to connect to a HTTPS EndPoint server.
TLS Connection to be created during GET/HEAD after CONNECT method.

Cc: Maciej Rabeda 
Cc: Wu Jiaxin 
Cc: Siyuan Fu 
Signed-off-by: Saloni Kasbekar 
---
 NetworkPkg/HttpDxe/HttpImpl.c |  9 +++
 NetworkPkg/HttpDxe/HttpProto.c| 40 ++-
 NetworkPkg/HttpDxe/HttpProto.h|  8 +--
 NetworkPkg/HttpDxe/HttpsSupport.c | 16 +
 4 files changed, 46 insertions(+), 27 deletions(-)

diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
index 2a305e0864..f7d6a4c8f6 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -511,9 +511,10 @@ EfiHttpRequest (
   if ((HttpInstance->ConnectionClose == FALSE) &&
   (HttpInstance->RemotePort == RemotePort) &&
   (AsciiStrCmp (HttpInstance->RemoteHost, HostName) == 0) &&
-  (!HttpInstance->UseHttps || (HttpInstance->UseHttps &&
-   !TlsConfigure &&
-   (HttpInstance->TlsSessionState == 
EfiTlsSessionDataTransferring
+  (!HttpInstance->UseHttps ||
+   HttpInstance->ProxyConnected || (HttpInstance->UseHttps &&
+!TlsConfigure &&
+(HttpInstance->TlsSessionState == 
EfiTlsSessionDataTransferring
   {
 //
 // Host Name and port number of the request URL are the same with 
previous call to Request().
@@ -666,7 +667,7 @@ EfiHttpRequest (
 goto Error2;
   }
 
-  if (!Configure && !ReConfigure && !TlsConfigure) {
+  if ((!Configure && !ReConfigure) && ((HttpInstance->ProxyConnected && 
TlsConfigure) || (!TlsConfigure))) {
 //
 // For the new HTTP token, create TX TCP token events.
 //
diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c
index 6767d90c7d..cc69401943 100644
--- a/NetworkPkg/HttpDxe/HttpProto.c
+++ b/NetworkPkg/HttpDxe/HttpProto.c
@@ -1222,6 +1222,7 @@ HttpConfigureTcp6 (
   connect one TLS session if required.
 
   @param[in]  HttpInstance   The HTTP instance private data.
+  @param[in]  TlsConfigure   The Flag indicates whether it's the new Tls 
session.
 
   @retval EFI_SUCCESSThe TCP connection is established.
   @retval EFI_NOT_READY  TCP4 protocol child is not created or 
configured.
@@ -1230,7 +1231,8 @@ HttpConfigureTcp6 (
 **/
 EFI_STATUS
 HttpConnectTcp4 (
-  IN  HTTP_PROTOCOL  *HttpInstance
+  IN  HTTP_PROTOCOL  *HttpInstance,
+  IN  BOOLEANTlsConfigure
   )
 {
   EFI_STATUS Status;
@@ -1253,16 +1255,18 @@ HttpConnectTcp4 (
 return Status;
   }
 
-  if (Tcp4State == Tcp4StateEstablished) {
+  if ((Tcp4State == Tcp4StateEstablished) && (!HttpInstance->ProxyConnected || 
!TlsConfigure)) {
 return EFI_SUCCESS;
-  } else if (Tcp4State > Tcp4StateEstablished ) {
+  } else if (Tcp4State > Tcp4StateEstablished) {
 HttpCloseConnection (HttpInstance);
   }
 
-  Status = HttpCreateConnection (HttpInstance);
-  if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "Tcp4 Connection fail - %x\n", Status));
-return Status;
+  if (!HttpInstance->ProxyConnected) {
+Status = HttpCreateConnection (HttpInstance);
+if (EFI_ERROR (Status)) {
+  DEBUG ((DEBUG_ERROR, "Tcp4 Connection fail - %x\n", Status));
+  return Status;
+}
   }
 
   //
@@ -1314,6 +1318,7 @@ HttpConnectTcp4 (
   connect one TLS session if required.
 
   @param[in]  HttpInstance   The HTTP instance private data.
+  @param[in]  TlsConfigure   The Flag indicates whether it's the new Tls 
session.
 
   @retval EFI_SUCCESSThe TCP connection is established.
   @retval EFI_NOT_READY  TCP6 protocol child is not created or 
configured.
@@ -1322,7 +1327,8 @@ HttpConnectTcp4 (
 **/
 EFI_STATUS
 HttpConnectTcp6 (
-  IN  HTTP_PROTOCOL  *HttpInstance
+  IN  HTTP_PROTOCOL  *HttpInstance,
+  IN  BOOLEANTlsConfigure
   )
 {
   EFI_STATUS Status;
@@ -1346,16 +1352,18 @@ HttpConnectTcp6 (
 return Status;
   }
 
-  if (Tcp6State == Tcp6StateEstablished) {
+  if ((Tcp6State == Tcp6StateEstablished) && (!HttpInstance->ProxyConnected || 
!TlsConfigure)) {
 return EFI_SUCCESS;
-  } else if (Tcp6State > Tcp6StateEstablished ) {
+  } else if (Tcp6State > Tcp6StateEstablished) {
 HttpCloseConnection (HttpInstance);
   }
 
-  Status = HttpCreateConnection (HttpInstance);
-  if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "Tcp6 Connection fail - %x\n", Status));
-return Status;
+  if (!HttpInstance->ProxyConnected) {
+Status = HttpCreateConnection (HttpInstance);
+if (EFI_ERROR (Status)) {
+  DEBUG ((DEBUG_ERROR, "Tcp6 Connection fail - %x\n", Status));
+  return Status;
+}
   }
 
   //
@@ -1450,7 +1458,7 @@ HttpInitSession (
 //
 // Connect TCP.
 //
-Status = Http

[edk2-devel] [[edk2-staging/HttpProxy PATCH v2] 5/6] NetworkPkg: Add support for HTTP CONNECT Method

2022-10-07 Thread Saloni Kasbekar
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3951

Add support for the HTTP CONNECT method to request the Proxy Server
to open a tunnel to the EndPoint Server

Cc: Maciej Rabeda 
Cc: Wu Jiaxin 
Cc: Siyuan Fu 
Signed-off-by: Saloni Kasbekar 
---
 NetworkPkg/HttpBootDxe/HttpBootClient.c| 176 +
 NetworkPkg/HttpBootDxe/HttpBootClient.h|  15 ++
 NetworkPkg/HttpBootDxe/HttpBootImpl.c  |  16 +-
 NetworkPkg/HttpBootDxe/HttpBootImpl.h  |   1 +
 NetworkPkg/HttpDxe/HttpDriver.h|   2 +
 NetworkPkg/HttpDxe/HttpDxe.inf |   1 +
 NetworkPkg/HttpDxe/HttpImpl.c  | 151 ++
 NetworkPkg/Library/DxeHttpLib/DxeHttpLib.c |   5 +
 8 files changed, 335 insertions(+), 32 deletions(-)

diff --git a/NetworkPkg/HttpBootDxe/HttpBootClient.c 
b/NetworkPkg/HttpBootDxe/HttpBootClient.c
index b13155b576..b4d02eaff2 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootClient.c
+++ b/NetworkPkg/HttpBootDxe/HttpBootClient.c
@@ -905,6 +905,182 @@ HttpBootGetBootFileCallback (
   return EFI_SUCCESS;
 }
 
+/**
+  This function establishes a connection through a proxy server
+
+  @param[in]   Private The pointer to the driver's private data.
+
+  @retval EFI_SUCCESS  Connection successful.
+  @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources
+  @retval Others   Unexpected error happened.
+
+**/
+EFI_STATUS
+HttpBootConnectProxy (
+  IN HTTP_BOOT_PRIVATE_DATA  *Private
+  )
+{
+  EFI_STATUS Status;
+  EFI_HTTP_STATUS_CODE   StatusCode;
+  CHAR8  *HostName;
+  EFI_HTTP_REQUEST_DATA  *RequestData;
+  HTTP_IO_RESPONSE_DATA  *ResponseData;
+  HTTP_IO*HttpIo;
+  HTTP_IO_HEADER *HttpIoHeader;
+  CHAR16 *Url;
+  CHAR16 *ProxyUrl;
+  UINTN  UrlSize;
+
+  Url  = NULL;
+  ProxyUrl = NULL;
+  RequestData  = NULL;
+  ResponseData = NULL;
+  HttpIoHeader = NULL;
+
+  UrlSize = AsciiStrSize (Private->BootFileUri);
+  Url = AllocatePool (UrlSize * sizeof (CHAR16));
+  if (Url == NULL) {
+return EFI_OUT_OF_RESOURCES;
+  }
+
+  AsciiStrToUnicodeStrS (Private->BootFileUri, Url, UrlSize);
+
+  UrlSize  = AsciiStrSize (Private->ProxyUri);
+  ProxyUrl = AllocatePool (UrlSize * (sizeof (CHAR16)));
+  if (ProxyUrl == NULL) {
+Status = EFI_OUT_OF_RESOURCES;
+goto EXIT;
+  }
+
+  AsciiStrToUnicodeStrS (Private->ProxyUri, ProxyUrl, UrlSize);
+
+  //
+  // Send HTTP request message.
+  //
+
+  //
+  // Build HTTP header for the request, 2 headers are needed to send a CONNECT 
method:
+  //   Host
+  //   User
+  //
+  HttpIoHeader = HttpIoCreateHeader (2);
+  if (HttpIoHeader == NULL) {
+Status = EFI_OUT_OF_RESOURCES;
+goto EXIT;
+  }
+
+  //
+  // Add HTTP header field 1: Host (EndPoint URI)
+  //
+  HostName = NULL;
+  Status   = HttpUrlGetHostName (
+   Private->BootFileUri,
+   Private->BootFileUriParser,
+   &HostName
+   );
+  if (EFI_ERROR (Status)) {
+goto EXIT;
+  }
+
+  Status = HttpIoSetHeader (
+ HttpIoHeader,
+ HTTP_HEADER_HOST,
+ HostName
+ );
+  if (EFI_ERROR (Status)) {
+goto EXIT;
+  }
+
+  //
+  // Add HTTP header field 2: User-Agent
+  //
+  Status = HttpIoSetHeader (
+ HttpIoHeader,
+ HTTP_HEADER_USER_AGENT,
+ HTTP_USER_AGENT_EFI_HTTP_BOOT
+ );
+  if (EFI_ERROR (Status)) {
+goto EXIT;
+  }
+
+  //
+  // Build the rest of HTTP request info.
+  //
+  RequestData = AllocatePool (sizeof (EFI_HTTP_REQUEST_DATA));
+  if (RequestData == NULL) {
+Status = EFI_OUT_OF_RESOURCES;
+goto EXIT;
+  }
+
+  RequestData->Method   = HttpMethodConnect;
+  RequestData->ProxyUrl = ProxyUrl;
+  RequestData->Url  = Url;
+
+  //
+  // Send out the request to HTTP server.
+  //
+  HttpIo = &Private->HttpIo;
+  Status = HttpIoSendRequest (
+ HttpIo,
+ RequestData,
+ HttpIoHeader->HeaderCount,
+ HttpIoHeader->Headers,
+ 0,
+ NULL
+ );
+  if (EFI_ERROR (Status)) {
+goto EXIT;
+  }
+
+  //
+  // Receive HTTP response message.
+  //
+
+  //
+  // Use zero BodyLength to only receive the response headers.
+  //
+  ResponseData = AllocateZeroPool (sizeof (HTTP_IO_RESPONSE_DATA));
+  if (ResponseData == NULL) {
+Status = EFI_OUT_OF_RESOURCES;
+goto EXIT;
+  }
+
+  Status = HttpIoRecvResponse (
+ &Private->HttpIo,
+ TRUE,
+ ResponseData
+ );
+
+  if (EFI_ERROR (Status) || EFI_ERROR (ResponseData->Status)) {
+if (EFI_ERROR (ResponseData->Status)) {
+  StatusCode = HttpIo->RspToken.Message->Data.Response->StatusCode;
+  HttpBootPrintErrorMessage (StatusCode);
+  Status = ResponseData->Status;
+}
+  }
+
+EXIT:
+  if (ResponseData != NULL) {
+FreePool (ResponseData);
+  }
+
+  if (Reque

Re: [edk2-devel] [PATCH 0/2] OvmfPkg/Microvm: support stateless secure boot

2022-10-07 Thread Ard Biesheuvel
Merged #3449 into master.

On Thu, 6 Oct 2022 at 13:05, Gerd Hoffmann  wrote:
>
>
>
> Gerd Hoffmann (2):
>   OvmfPkg/Microvm: add SECURE_BOOT_FEATURE_ENABLED
>   Revert "OvmfPkg/Microvm: no secure boot"
>
>  OvmfPkg/Microvm/MicrovmX64.dsc | 31 ++-
>  OvmfPkg/Microvm/MicrovmX64.fdf |  4 
>  2 files changed, 34 insertions(+), 1 deletion(-)
>
> --
> 2.37.3
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94821): https://edk2.groups.io/g/devel/message/94821
Mute This Topic: https://groups.io/mt/94155094/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 0/4] OvmfPkg: make better use of physical address space.

2022-10-07 Thread Ard Biesheuvel
Merged #3449 into master.

On Tue, 4 Oct 2022 at 15:47, Gerd Hoffmann  wrote:
>
> For historical reasons ovmf is quite conservative on address space
> usage, to play safe and avoid using more than 36 physical address bits
> (the guaranteed minimum) if possible.  With devices (specifically GPUs)
> becoming larger and larger pci memory bars this becomes increasingly
> problematic.
>
> This patch series address that by trying to figure what the physical
> address space size is (which is a bit tricky, see patch #1 for details).
> If that worked scale up the 64-bit mmio window and also pcie bridge
> windows dynamically with the available address space.
>
> v2:
>  - fix pcie bridge window logic, track prefetchable and non-prefetchable
>default state separately (Laszlo).
>
> Gerd Hoffmann (4):
>   OvmfPkg/PlatformInitLib: qemu cpuid physbits detection
>   OvmfPkg/PlatformInitLib: detect physical address space
>   OvmfPkg/PlatformInitLib: dynamic mmio window size
>   OvmfPkg/PciHotPlugInitDxe: reserve more mmio space
>
>  OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf |   1 +
>  OvmfPkg/Library/PlatformInitLib/MemDetect.c  | 143 ---
>  OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c   |  21 ++-
>  3 files changed, 145 insertions(+), 20 deletions(-)
>
> --
> 2.37.3
>
>
>
> 
>
>


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




Re: [edk2-devel] [PATCH 1/1] OvmfPkg: rename QemuBootOrderNNNN to VMMBootOrderNNNN

2022-10-07 Thread Ard Biesheuvel
Merged #3449 into master.

On Tue, 4 Oct 2022 at 13:22, Gerd Hoffmann  wrote:
>
> While the actual implementation (using qemu fw_cfg) is qemu-specific,
> the idea to store the boot order as configured by the VMM in EFI
> variables is not.  So lets give the variables a more neutral name while
> we still can (i.e. no stable tag yet with the new feature).
>
> While being at it also fix the  format (use %x instead of %d for
> consistency with Boot).
>
> Signed-off-by: Gerd Hoffmann 
> ---
>  OvmfPkg/OvmfPkg.dec   | 2 +-
>  OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf | 2 +-
>  OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c   | 6 +++---
>  3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec
> index 6d689ecc5d55..f13dd4a61f01 100644
> --- a/OvmfPkg/OvmfPkg.dec
> +++ b/OvmfPkg/OvmfPkg.dec
> @@ -146,7 +146,7 @@ [Guids]
>gConfidentialComputingSecretGuid  = {0xadf956ad, 0xe98c, 0x484c, 
> {0xae, 0x11, 0xb5, 0x1c, 0x7d, 0x33, 0x64, 0x47}}
>gConfidentialComputingSevSnpBlobGuid  = {0x067b1f5f, 0xcf26, 0x44c5, 
> {0x85, 0x54, 0x93, 0xd7, 0x77, 0x91, 0x2d, 0x42}}
>gUefiOvmfPkgPlatformInfoGuid  = {0xdec9b486, 0x1f16, 0x47c7, 
> {0x8f, 0x68, 0xdf, 0x1a, 0x41, 0x88, 0x8b, 0xa5}}
> -  gQemuBootOrderGuid= {0x668f4529, 0x63d0, 0x4bb5, 
> {0xb6, 0x5d, 0x6f, 0xbb, 0x9d, 0x36, 0xa4, 0x4a}}
> +  gVMMBootOrderGuid = {0x668f4529, 0x63d0, 0x4bb5, 
> {0xb6, 0x5d, 0x6f, 0xbb, 0x9d, 0x36, 0xa4, 0x4a}}
>
>  [Ppis]
># PPI whose presence in the PPI database signals that the TPM base address
> diff --git a/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf 
> b/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
> index 211344fb0b89..6e320e3e8514 100644
> --- a/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
> +++ b/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
> @@ -49,7 +49,7 @@ [LibraryClasses]
>  [Guids]
>gEfiGlobalVariableGuid
>gVirtioMmioTransportGuid
> -  gQemuBootOrderGuid
> +  gVMMBootOrderGuid
>
>  [FeaturePcd]
>gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderPciTranslation
> diff --git a/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c 
> b/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c
> index 18646daa67e3..cea4b7a099e3 100644
> --- a/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c
> +++ b/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c
> @@ -1709,7 +1709,7 @@ ConnectDevicesFromQemu (
>Attempt to retrieve the "bootorder" fw_cfg file from QEMU. Translate
>the OpenFirmware device paths therein to UEFI device path fragments.
>
> -  On Success store the device path in QemuBootOrder variables.
> +  On Success store the device path in VMMBootOrder variables.
>  **/
>  VOID
>  EFIAPI
> @@ -1794,13 +1794,13 @@ StoreQemuBootOrder (
>UnicodeSPrint (
>  VariableName,
>  sizeof (VariableName),
> -L"QemuBootOrder%04d",
> +L"VMMBootOrder%04x",
>  VariableIndex++
>  );
>DEBUG ((DEBUG_INFO, "%a: %s = %s\n", __FUNCTION__, VariableName, 
> Translated));
>gRT->SetVariable (
>   VariableName,
> - &gQemuBootOrderGuid,
> + &gVMMBootOrderGuid,
>   EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
>   GetDevicePathSize (DevicePath),
>   DevicePath
> --
> 2.37.3
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94823): https://edk2.groups.io/g/devel/message/94823
Mute This Topic: https://groups.io/mt/94110999/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 VariablePei: Add Variable state check when find variable in IndexTable.

2022-10-07 Thread Jiading Zhang
Hello,
Can anyone please help to review the patch?

Thanks very much!


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




回复: 回复: [edk2-devel] [RFC] Adoption of CodeQL in edk2

2022-10-07 Thread gaoliming via groups.io
Michael:
  I get your point to enable CodeQL rule step by step. This way doesn't impact 
normal PR process. 

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Michael
> Kubacki
> 发送时间: 2022年10月3日 22:29
> 收件人: gaoliming ; devel@edk2.groups.io;
> michael.d.kin...@intel.com
> 主题: Re: 回复: [edk2-devel] [RFC] Adoption of CodeQL in edk2
> 
> I believe you are asking, when CodeQL CI is enabled in the edk2 project,
> how soon after will all of the issues be fixed so CI passes?
> 
> The process that will be used to enable CodeQL in CI will follow what is
> described in the "Enable One Query at a Time" section in the RFC
> (https://github.com/tianocore/edk2/discussions/3258).
> 
> As proposed in that section, there should not be a time when a new
> CodeQL CLI query is enabled that does not pass. Queries will be enabled
> one at a time. Each time a new query is enabled, the query enable and
> the corresponding changes will be staged on a branch that get merged to
> edk2 master in a single PR.
> 
> CodeQL CI will run in that PR and it must pass for the PR to be completed.
> 
> On 9/30/2022 2:33 AM, gaoliming wrote:
> > Michael:
> >
> >   Could you estimate when  CodeQL CI  check can pass after CodeQL
> check
> > is enabled?
> >
> > Thanks
> >
> > Liming
> >
> > *发件人:*devel@edk2.groups.io  *代表 *Michael
> D Kinney
> > *发送时间:*2022年9月30日9:03
> > *收件人:*devel@edk2.groups.io; mikub...@linux.microsoft.com; Kinney,
> > Michael D 
> > *主题:*Re: [edk2-devel] [RFC] Adoption of CodeQL in edk2
> >
> > I just want to reiterate.  If there are no concerns or objections raised
> > by Oct 4, then the
> >
> > CodeQL static analysis will be phased into use in the edk2 repo and
> > there will be code
> >
> > changes made to address the issues identified by COdeQL and all future
> > code changes
> >
> > after a CodeQL check is enabled will be blocked until the CodeQL CI
> > checks pass.
> >
> > This will impact all future code changes and all developers will have to
> > learn how to
> >
> > interpret CodeQL reports and fix issues.
> >
> > Thanks,
> >
> > Mike
> >
> > *From:*devel@edk2.groups.io 
> > mailto:devel@edk2.groups.io>> *On Behalf Of
> > *Michael Kubacki
> > *Sent:* Thursday, September 29, 2022 5:05 PM
> > *To:* Michael Kubacki  > >; devel@edk2.groups.io
> > 
> > *Subject:* Re: [edk2-devel] [RFC] Adoption of CodeQL in edk2
> >
> > If there's any further feedback on this RFC, please respond by Tuesday,
> > October 4th. We plan to start implementing the changes later in the week.
> >
> > Thanks,
> > Michael
> >
> >
> >
> 
> 
> 
> 





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




回复: [edk2-devel] [PATCH] MdeModulePkg VariablePei: Add Variable state check when find variable in IndexTable.

2022-10-07 Thread gaoliming via groups.io
Jiading:

 I have gave my comment on https://edk2.groups.io/g/devel/message/94555 for 
this patch. Have you got it?

 

Thanks

Liming

发件人: devel@edk2.groups.io  代表 Jiading Zhang
发送时间: 2022年10月8日 8:21
收件人: Jiading Zhang ; devel@edk2.groups.io
主题: Re: [edk2-devel] [PATCH] MdeModulePkg VariablePei: Add Variable state check 
when find variable in IndexTable.

 

Hello, 
  Can anyone please help to review the patch?

Thanks very much! 





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




[edk2-devel] 回复: [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the position of the Logo

2022-10-07 Thread gaoliming via groups.io
Sean:
  Thanks for your update. I have one minor comment in below. Other change is
good to me. 

Thanks
Liming
> -邮件原件-
> 发件人: Sean Rhodes 
> 发送时间: 2022年9月26日 16:10
> 收件人: devel@edk2.groups.io
> 抄送: Sean Rhodes ; Zhichao Gao
> ; Ray Ni ; Jian J Wang
> ; Liming Gao 
> 主题: [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the position of
> the Logo
> 
> When set to true, the Logo is positioned according to the BGRT
> specification, 38.2% from the top of the screen. When set to false,
> no behaviour is changed and the logo is positioned centrally.
> 
> Cc: Zhichao Gao 
> Cc: Ray Ni 
> Cc: Jian J Wang 
> Cc: Liming Gao 
> Signed-off-by: Sean Rhodes 
> ---
>  MdeModulePkg/Logo/Logo.c  | 5 +
>  MdeModulePkg/Logo/LogoDxe.inf | 4 
>  MdeModulePkg/MdeModulePkg.dec | 6 ++
>  MdeModulePkg/MdeModulePkg.uni | 6 ++
>  4 files changed, 21 insertions(+)
> 
> diff --git a/MdeModulePkg/Logo/Logo.c b/MdeModulePkg/Logo/Logo.c
> index 8ab874d2da..1638d0f984 100644
> --- a/MdeModulePkg/Logo/Logo.c
> +++ b/MdeModulePkg/Logo/Logo.c
> @@ -13,6 +13,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  #include 
> 
>  #include 
> 
>  #include 
> 
> +#include 
> 
> 
> 
>  typedef struct {
> 
>EFI_IMAGE_ID ImageId;
> 
> @@ -69,6 +70,10 @@ GetImage (
>  return EFI_NOT_FOUND;
> 
>}
> 
> 
> 
> +  if (FixedPcdGetBool (PcdFollowMicrosoftRecommended)) {
> 
> +mLogos[Current].Attribute =
> EdkiiPlatformLogoDisplayAttributeMicrosoftRecommended;
> 
> +  }
> 
> +

[Liming] Please use PcdGetBool (PcdFollowMicrosoftRecommended), 
PcdGetBool is more flexible for PCD usage. 

Thanks
Liming
> 
>(*Instance)++;
> 
>*Attribute = mLogos[Current].Attribute;
> 
>*OffsetX   = mLogos[Current].OffsetX;
> 
> diff --git a/MdeModulePkg/Logo/LogoDxe.inf
> b/MdeModulePkg/Logo/LogoDxe.inf
> index 41215d25d8..ce29950089 100644
> --- a/MdeModulePkg/Logo/LogoDxe.inf
> +++ b/MdeModulePkg/Logo/LogoDxe.inf
> @@ -41,6 +41,7 @@
>UefiBootServicesTableLib
> 
>UefiDriverEntryPoint
> 
>DebugLib
> 
> +  PcdLib
> 
> 
> 
>  [Protocols]
> 
>gEfiHiiDatabaseProtocolGuid## CONSUMES
> 
> @@ -48,6 +49,9 @@
>gEfiHiiPackageListProtocolGuid ## PRODUCES CONSUMES
> 
>gEdkiiPlatformLogoProtocolGuid ## PRODUCES
> 
> 
> 
> +[Pcd]
> 
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFollowMicrosoftRecommended ##
> CONSUMES
> 
> +
> 
>  [Depex]
> 
>gEfiHiiDatabaseProtocolGuid AND
> 
>gEfiHiiImageExProtocolGuid
> 
> diff --git a/MdeModulePkg/MdeModulePkg.dec
> b/MdeModulePkg/MdeModulePkg.dec
> index 58e6ab0048..ac437990f1 100644
> --- a/MdeModulePkg/MdeModulePkg.dec
> +++ b/MdeModulePkg/MdeModulePkg.dec
> @@ -2102,6 +2102,12 @@
># @Prompt The shared bit mask when Intel Tdx is enabled.
> 
> 
> gEfiMdeModulePkgTokenSpaceGuid.PcdTdxSharedBitMask|0x0|UINT64|0x10
> 25
> 
> 
> 
> +  ## This PCD sets the position of the Boot Logo.
> 
> +  #   TRUE  - The Logo is positioned following the recommendations from
> Microsoft.
> 
> +  #   FALSE - The logo is positioned in the center of the screen.
> 
> +  # @ Prompt This position of the boot logo
> 
> +
> gEfiMdeModulePkgTokenSpaceGuid.PcdFollowMicrosoftRecommended|FALSE
> |BOOLEAN|0x1026
> 
> +
> 
>  [PcdsPatchableInModule]
> 
>## Specify memory size with page number for PEI code when
> 
>#  Loading Module at Fixed Address feature is enabled.
> 
> diff --git a/MdeModulePkg/MdeModulePkg.uni
> b/MdeModulePkg/MdeModulePkg.uni
> index 33ce9f6198..09c1ac1cc1 100644
> --- a/MdeModulePkg/MdeModulePkg.uni
> +++ b/MdeModulePkg/MdeModulePkg.uni
> @@ -1338,3 +1338,9 @@
>  #string
> STR_gEfiMdeModulePkgTokenSpaceGuid_PcdPcieResizableBarSupport_HELP
> #language en-US "Indicates if the PCIe Resizable BAR Capability
> Supported.\n"
> 
> 
> "TRUE  - PCIe Resizable BAR Capability is supported.\n"
> 
> 
> "FALSE - PCIe Resizable BAR Capability is not supported."
> 
> +
> 
> +#string
> STR_gEfiMdeModulePkgTokenSpaceGuid_PcdFollowMicrosoftRecommended_
> PROMPT #language en-US "The position of the Boot Logo"
> 
> +
> 
> +#string
> STR_gEfiMdeModulePkgTokenSpaceGuid_PcdFollowMicrosoftRecommend_HE
> LP   #language en-US "Sets the position of the Logo. When set to true, the
> Logo is positioned following the recommendations"
> 
> +
> " from Microsoft, 38.2% from the top of the screen."
> 
> +
> 
> --
> 2.34.1





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




[edk2-devel] 回复: [PATCH 1/3] MdeModulePkg/BootLogoLib: Add option to follow Microsoft Recommendations

2022-10-07 Thread gaoliming via groups.io
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: Sean Rhodes 
> 发送时间: 2022年9月26日 16:10
> 收件人: devel@edk2.groups.io
> 抄送: Sean Rhodes ; Zhichao Gao
> ; Ray Ni ; Jian J Wang
> ; Liming Gao 
> 主题: [PATCH 1/3] MdeModulePkg/BootLogoLib: Add option to follow
> Microsoft Recommendations
> 
> Add an option to position the logo 38.2% from the top of the screen,
> which follows the recommendations from Microsoft. These can be found
> here:
> https://docs.microsoft.com/en-us/windows-hardware/drivers/bringup/boot-s
> creen-components
> 
> Cc: Zhichao Gao 
> Cc: Ray Ni 
> Cc: Jian J Wang 
> Cc: Liming Gao 
> Signed-off-by: Sean Rhodes 
> ---
>  MdeModulePkg/Include/Protocol/PlatformLogo.h   | 3 ++-
>  MdeModulePkg/Library/BootLogoLib/BootLogoLib.c | 7 ---
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/MdeModulePkg/Include/Protocol/PlatformLogo.h
> b/MdeModulePkg/Include/Protocol/PlatformLogo.h
> index 08e1dc35a4..b24d7d5b79 100644
> --- a/MdeModulePkg/Include/Protocol/PlatformLogo.h
> +++ b/MdeModulePkg/Include/Protocol/PlatformLogo.h
> @@ -29,7 +29,8 @@ typedef enum {
>EdkiiPlatformLogoDisplayAttributeCenterBottom,
> 
>EdkiiPlatformLogoDisplayAttributeLeftBottom,
> 
>EdkiiPlatformLogoDisplayAttributeCenterLeft,
> 
> -  EdkiiPlatformLogoDisplayAttributeCenter
> 
> +  EdkiiPlatformLogoDisplayAttributeCenter,
> 
> +  EdkiiPlatformLogoDisplayAttributeMicrosoftRecommended
> 
>  } EDKII_PLATFORM_LOGO_DISPLAY_ATTRIBUTE;
> 
> 
> 
>  /**
> 
> diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
> b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
> index 478ec2d40e..9065e5281b 100644
> --- a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
> +++ b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
> @@ -169,7 +169,6 @@ BootLogoEnableLogo (
>  DestX = SizeOfX - Image.Width;
> 
>  DestY = 0;
> 
>  break;
> 
> -
> 
>case EdkiiPlatformLogoDisplayAttributeCenterLeft:
> 
>  DestX = 0;
> 
>  DestY = (SizeOfY - Image.Height) / 2;
> 
> @@ -182,7 +181,6 @@ BootLogoEnableLogo (
>  DestX = SizeOfX - Image.Width;
> 
>  DestY = (SizeOfY - Image.Height) / 2;
> 
>  break;
> 
> -
> 
>case EdkiiPlatformLogoDisplayAttributeLeftBottom:
> 
>  DestX = 0;
> 
>  DestY = SizeOfY - Image.Height;
> 
> @@ -195,7 +193,10 @@ BootLogoEnableLogo (
>  DestX = SizeOfX - Image.Width;
> 
>  DestY = SizeOfY - Image.Height;
> 
>  break;
> 
> -
> 
> +  case EdkiiPlatformLogoDisplayAttributeMicrosoftRecommended:
> 
> +DestX = (SizeOfX - Image.Width) / 2;
> 
> +DestY = (SizeOfY * 382) / 1000 - Image.Height / 2;
> 
> +break;
> 
>default:
> 
>  ASSERT (FALSE);
> 
>  continue;
> 
> --
> 2.34.1





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




回复: [edk2-devel] 回复: [edk2-devel] 回复: [edk2-devel] [edk2] [PATCH]MdeModulePkg\scsi: Coverity scan flags multiple issues in edk2-stable202205

2022-10-07 Thread gaoliming via groups.io
Please see below wiki pages. 

 

https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Development-Process

 

https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request

 

Thanks

Liming

发件人: devel@edk2.groups.io  代表 sivaparvathi C via groups.io
发送时间: 2022年10月6日 15:56
收件人: gaoliming ; devel@edk2.groups.io
主题: Re: [edk2-devel] 回复: [edk2-devel] 回复: [edk2-devel] [edk2] 
[PATCH]MdeModulePkg\scsi: Coverity scan flags multiple issues in 
edk2-stable202205

 

Hi gaoliming, 

 

How can i create EDK2 pull request ?

Can you share the steps?

 

Thanks,

Sivaparvathi C

 





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




回复: [edk2-devel] 回复: [edk2-devel] [PATCH] [PATCH]MdeModulePkg/Ufs: Coverity scan flags multiple issues in edk2-stable202205 Signed-off-by: sivaparvat...@ami.com

2022-10-07 Thread gaoliming via groups.io
I have gave my reviewed-by https://edk2.groups.io/g/devel/message/93694. 

 

But, I can’t get this patch from the mail. Can you share this patch in Pull 
Request or your fork GitHub Edk2 repo branch?

 

Thanks

Liming

发件人: devel@edk2.groups.io  代表 sivaparvathi C via groups.io
发送时间: 2022年10月6日 16:17
收件人: gaoliming ; devel@edk2.groups.io
主题: Re: [edk2-devel] 回复: [edk2-devel] [PATCH] [PATCH]MdeModulePkg/Ufs: Coverity 
scan flags multiple issues in edk2-stable202205 Signed-off-by: 
sivaparvat...@ami.com

 

On Tue, Sep 13, 2022 at 10:44 AM, gaoliming wrote:

gaoliming

Hi GaoLiming,

Could you please review the changes?

Thanks,
Sivaparvathi  





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




Re: [edk2-devel] [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the position of the Logo

2022-10-07 Thread Ni, Ray
Sean,
I remember that I evaluated the BGRT requirement when designing the 
PlatformLogo protocol.

So, I went back to got the code I wrote long time ago as below.
I didn't try to understand them now. Does it make sense to you?

Status = gBS->HandleProtocol (gST->ConsoleOutHandle, 
&gEfiGraphicsOutputProtocolGuid, (VOID **) &GraphicsOutput);
if (!EFI_ERROR (Status)) {
  //
  // Center of LOGO is in the vertical position 38.2% when 
PcdBootLogoOnlyEnable is TRUE
  // Y = (VerticalResolution - LogoHeight) / 2
  // Y' = VerticalResolution * 0.382 - LogoHeight * 0.5
  // OffsetY + Y = Y'
  // OffsetY = Y' - Y = -0.118 * VerticalResolution
  //
  *Attribute = EdkiiPlatformLogoDisplayAttributeCenter;
  *OffsetX   = 0;
  *OffsetY   = -118 * (INTN) GraphicsOutput->Mode->Info->VerticalResolution 
/ 1000;
}

Thanks,
Ray

> -Original Message-
> From: Sean Rhodes 
> Sent: Monday, September 26, 2022 4:10 PM
> To: devel@edk2.groups.io
> Cc: Rhodes, Sean ; Gao, Zhichao
> ; Ni, Ray ; Wang, Jian J
> ; Gao, Liming 
> Subject: [PATCH 2/3] MdeModulePkg/Logo: Add a PCD to control the
> position of the Logo
> 
> When set to true, the Logo is positioned according to the BGRT
> specification, 38.2% from the top of the screen. When set to false,
> no behaviour is changed and the logo is positioned centrally.
> 
> Cc: Zhichao Gao 
> Cc: Ray Ni 
> Cc: Jian J Wang 
> Cc: Liming Gao 
> Signed-off-by: Sean Rhodes 
> ---
>  MdeModulePkg/Logo/Logo.c  | 5 +
>  MdeModulePkg/Logo/LogoDxe.inf | 4 
>  MdeModulePkg/MdeModulePkg.dec | 6 ++
>  MdeModulePkg/MdeModulePkg.uni | 6 ++
>  4 files changed, 21 insertions(+)
> 
> diff --git a/MdeModulePkg/Logo/Logo.c b/MdeModulePkg/Logo/Logo.c
> index 8ab874d2da..1638d0f984 100644
> --- a/MdeModulePkg/Logo/Logo.c
> +++ b/MdeModulePkg/Logo/Logo.c
> @@ -13,6 +13,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  #include 
> 
>  #include 
> 
>  #include 
> 
> +#include 
> 
> 
> 
>  typedef struct {
> 
>EFI_IMAGE_ID ImageId;
> 
> @@ -69,6 +70,10 @@ GetImage (
>  return EFI_NOT_FOUND;
> 
>}
> 
> 
> 
> +  if (FixedPcdGetBool (PcdFollowMicrosoftRecommended)) {
> 
> +mLogos[Current].Attribute =
> EdkiiPlatformLogoDisplayAttributeMicrosoftRecommended;
> 
> +  }
> 
> +
> 
>(*Instance)++;
> 
>*Attribute = mLogos[Current].Attribute;
> 
>*OffsetX   = mLogos[Current].OffsetX;
> 
> diff --git a/MdeModulePkg/Logo/LogoDxe.inf
> b/MdeModulePkg/Logo/LogoDxe.inf
> index 41215d25d8..ce29950089 100644
> --- a/MdeModulePkg/Logo/LogoDxe.inf
> +++ b/MdeModulePkg/Logo/LogoDxe.inf
> @@ -41,6 +41,7 @@
>UefiBootServicesTableLib
> 
>UefiDriverEntryPoint
> 
>DebugLib
> 
> +  PcdLib
> 
> 
> 
>  [Protocols]
> 
>gEfiHiiDatabaseProtocolGuid## CONSUMES
> 
> @@ -48,6 +49,9 @@
>gEfiHiiPackageListProtocolGuid ## PRODUCES CONSUMES
> 
>gEdkiiPlatformLogoProtocolGuid ## PRODUCES
> 
> 
> 
> +[Pcd]
> 
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFollowMicrosoftRecommended
> ## CONSUMES
> 
> +
> 
>  [Depex]
> 
>gEfiHiiDatabaseProtocolGuid AND
> 
>gEfiHiiImageExProtocolGuid
> 
> diff --git a/MdeModulePkg/MdeModulePkg.dec
> b/MdeModulePkg/MdeModulePkg.dec
> index 58e6ab0048..ac437990f1 100644
> --- a/MdeModulePkg/MdeModulePkg.dec
> +++ b/MdeModulePkg/MdeModulePkg.dec
> @@ -2102,6 +2102,12 @@
># @Prompt The shared bit mask when Intel Tdx is enabled.
> 
> 
> gEfiMdeModulePkgTokenSpaceGuid.PcdTdxSharedBitMask|0x0|UINT64|0x
> 1025
> 
> 
> 
> +  ## This PCD sets the position of the Boot Logo.
> 
> +  #   TRUE  - The Logo is positioned following the recommendations from
> Microsoft.
> 
> +  #   FALSE - The logo is positioned in the center of the screen.
> 
> +  # @ Prompt This position of the boot logo
> 
> +
> gEfiMdeModulePkgTokenSpaceGuid.PcdFollowMicrosoftRecommended|FA
> LSE|BOOLEAN|0x1026
> 
> +
> 
>  [PcdsPatchableInModule]
> 
>## Specify memory size with page number for PEI code when
> 
>#  Loading Module at Fixed Address feature is enabled.
> 
> diff --git a/MdeModulePkg/MdeModulePkg.uni
> b/MdeModulePkg/MdeModulePkg.uni
> index 33ce9f6198..09c1ac1cc1 100644
> --- a/MdeModulePkg/MdeModulePkg.uni
> +++ b/MdeModulePkg/MdeModulePkg.uni
> @@ -1338,3 +1338,9 @@
>  #string
> STR_gEfiMdeModulePkgTokenSpaceGuid_PcdPcieResizableBarSupport_HEL
> P #language en-US "Indicates if the PCIe Resizable BAR Capability
> Supported.\n"
> 
>   
>"TRUE  - PCIe Resizable BAR
> Capability is supported.\n"
> 
>   
>"FALSE - PCIe Resizable BAR
> Capability is not supported."
> 
> +
> 
> +#string
> STR_gEfiMdeModulePkgTokenSpaceGuid_PcdFollowMicrosoftRecommende
> d_PROMPT #language en-US "The position of the Boot Logo"
> 
> +
> 
> +#string
> STR_gEfiMdeModulePkgTokenSpaceGuid_PcdFollowMicrosoftReco

[edk2-devel] [PATCH V2 0/3] CryptoPkg: Extend Tls library

2022-10-07 Thread Li, Yi
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3892

Review PR: https://github.com/tianocore/edk2/pull/3400
This patch sequence is used to extend Tls library, which are wrapped
over OpenSSL. The implementation provides library functions for EFI
DXE dirver and Protocol.

All APIs passed unit test and fuzzing test, detail as:
1. Unit test:
New Tls APIs tested on Intel platform as part of WIFI WPA3 feature.
2. Fuzzing test:
Various Fuzz Testing are employed across the all introduced APIs, and the
test is used AFL (2.52b) and Libfuzzer (clang+llvm-11.0.0) as the fuzzer,
based on HBFA.
Fuzzing Pass Rate is 100%;
The Code Coverage of new APIs is 91%.
All test case show in:
https://github.com/liyi77/edk2-staging/tree/HBFA/HBFA/UefiHostFuzzTestCasePkg/TestCase/CryptoPkg

V2 change:
Move the newly added APIs to the end of struct PCD.

Tested-by: Yi Li 
Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Xiaoyu Lu 
Cc: Guomin Jiang 
Cc: Michael D Kinney 
Cc: Liming Gao 

Signed-off-by: Yi Li 

Yi Li (3):
  MdePkg: Add Tls configuration related define
  CryptoPkg: Extend Tls function library
  CryptoPkg: Add new Tls APIs to DXE and protocol

 CryptoPkg/Driver/Crypto.c | 155 ++-
 CryptoPkg/Include/Library/TlsLib.h| 126 +-
 .../Pcd/PcdCryptoServiceFamilyEnable.h|   5 +
 .../BaseCryptLibOnProtocolPpi/CryptLib.c  | 146 ++-
 CryptoPkg/Library/TlsLib/InternalTlsLib.h |   4 +
 CryptoPkg/Library/TlsLib/TlsConfig.c  | 412 --
 CryptoPkg/Library/TlsLib/TlsProcess.c |  32 ++
 CryptoPkg/Library/TlsLibNull/TlsConfigNull.c  | 123 +-
 CryptoPkg/Library/TlsLibNull/TlsProcessNull.c |  23 +
 CryptoPkg/Private/Protocol/Crypto.h   | 136 +-
 MdePkg/Include/IndustryStandard/Tls1.h| 110 +++--
 11 files changed, 1199 insertions(+), 73 deletions(-)

-- 
2.31.1.windows.1



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




[edk2-devel] [PATCH V2 1/3] MdePkg: Add Tls configuration related define

2022-10-07 Thread Li, Yi
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3892

Consumed by TlsSetEcCurve and TlsSetSignatureAlgoList.

Cc: Jiewen Yao 
Cc: Michael D Kinney 
Cc: Liming Gao 
Signed-off-by: Yi Li 
---
 MdePkg/Include/IndustryStandard/Tls1.h | 110 +
 1 file changed, 74 insertions(+), 36 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/Tls1.h 
b/MdePkg/Include/IndustryStandard/Tls1.h
index cf67428b11..5cf2860caf 100644
--- a/MdePkg/Include/IndustryStandard/Tls1.h
+++ b/MdePkg/Include/IndustryStandard/Tls1.h
@@ -15,42 +15,46 @@
 ///
 /// TLS Cipher Suite, refers to A.5 of rfc-2246, rfc-4346 and rfc-5246.
 ///
-#define TLS_RSA_WITH_NULL_MD5{0x00, 0x01}
-#define TLS_RSA_WITH_NULL_SHA{0x00, 0x02}
-#define TLS_RSA_WITH_RC4_128_MD5 {0x00, 0x04}
-#define TLS_RSA_WITH_RC4_128_SHA {0x00, 0x05}
-#define TLS_RSA_WITH_IDEA_CBC_SHA{0x00, 0x07}
-#define TLS_RSA_WITH_DES_CBC_SHA {0x00, 0x09}
-#define TLS_RSA_WITH_3DES_EDE_CBC_SHA{0x00, 0x0A}
-#define TLS_DH_DSS_WITH_DES_CBC_SHA  {0x00, 0x0C}
-#define TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA {0x00, 0x0D}
-#define TLS_DH_RSA_WITH_DES_CBC_SHA  {0x00, 0x0F}
-#define TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA {0x00, 0x10}
-#define TLS_DHE_DSS_WITH_DES_CBC_SHA {0x00, 0x12}
-#define TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA{0x00, 0x13}
-#define TLS_DHE_RSA_WITH_DES_CBC_SHA {0x00, 0x15}
-#define TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA{0x00, 0x16}
-#define TLS_RSA_WITH_AES_128_CBC_SHA {0x00, 0x2F}
-#define TLS_DH_DSS_WITH_AES_128_CBC_SHA  {0x00, 0x30}
-#define TLS_DH_RSA_WITH_AES_128_CBC_SHA  {0x00, 0x31}
-#define TLS_DHE_DSS_WITH_AES_128_CBC_SHA {0x00, 0x32}
-#define TLS_DHE_RSA_WITH_AES_128_CBC_SHA {0x00, 0x33}
-#define TLS_RSA_WITH_AES_256_CBC_SHA {0x00, 0x35}
-#define TLS_DH_DSS_WITH_AES_256_CBC_SHA  {0x00, 0x36}
-#define TLS_DH_RSA_WITH_AES_256_CBC_SHA  {0x00, 0x37}
-#define TLS_DHE_DSS_WITH_AES_256_CBC_SHA {0x00, 0x38}
-#define TLS_DHE_RSA_WITH_AES_256_CBC_SHA {0x00, 0x39}
-#define TLS_RSA_WITH_NULL_SHA256 {0x00, 0x3B}
-#define TLS_RSA_WITH_AES_128_CBC_SHA256  {0x00, 0x3C}
-#define TLS_RSA_WITH_AES_256_CBC_SHA256  {0x00, 0x3D}
-#define TLS_DH_DSS_WITH_AES_128_CBC_SHA256   {0x00, 0x3E}
-#define TLS_DH_RSA_WITH_AES_128_CBC_SHA256   {0x00, 0x3F}
-#define TLS_DHE_DSS_WITH_AES_128_CBC_SHA256  {0x00, 0x40}
-#define TLS_DHE_RSA_WITH_AES_128_CBC_SHA256  {0x00, 0x67}
-#define TLS_DH_DSS_WITH_AES_256_CBC_SHA256   {0x00, 0x68}
-#define TLS_DH_RSA_WITH_AES_256_CBC_SHA256   {0x00, 0x69}
-#define TLS_DHE_DSS_WITH_AES_256_CBC_SHA256  {0x00, 0x6A}
-#define TLS_DHE_RSA_WITH_AES_256_CBC_SHA256  {0x00, 0x6B}
+#define TLS_RSA_WITH_NULL_MD5  {0x00, 0x01}
+#define TLS_RSA_WITH_NULL_SHA  {0x00, 0x02}
+#define TLS_RSA_WITH_RC4_128_MD5   {0x00, 0x04}
+#define TLS_RSA_WITH_RC4_128_SHA   {0x00, 0x05}
+#define TLS_RSA_WITH_IDEA_CBC_SHA  {0x00, 0x07}
+#define TLS_RSA_WITH_DES_CBC_SHA   {0x00, 0x09}
+#define TLS_RSA_WITH_3DES_EDE_CBC_SHA  {0x00, 0x0A}
+#define TLS_DH_DSS_WITH_DES_CBC_SHA{0x00, 0x0C}
+#define TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA   {0x00, 0x0D}
+#define TLS_DH_RSA_WITH_DES_CBC_SHA{0x00, 0x0F}
+#define TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA   {0x00, 0x10}
+#define TLS_DHE_DSS_WITH_DES_CBC_SHA   {0x00, 0x12}
+#define TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA  {0x00, 0x13}
+#define TLS_DHE_RSA_WITH_DES_CBC_SHA   {0x00, 0x15}
+#define TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA  {0x00, 0x16}
+#define TLS_RSA_WITH_AES_128_CBC_SHA   {0x00, 0x2F}
+#define TLS_DH_DSS_WITH_AES_128_CBC_SHA{0x00, 0x30}
+#define TLS_DH_RSA_WITH_AES_128_CBC_SHA{0x00, 0x31}
+#define TLS_DHE_DSS_WITH_AES_128_CBC_SHA   {0x00, 0x32}
+#define TLS_DHE_RSA_WITH_AES_128_CBC_SHA   {0x00, 0x33}
+#define TLS_RSA_WITH_AES_256_CBC_SHA   {0x00, 0x35}
+#define TLS_DH_DSS_WITH_AES_256_CBC_SHA{0x00, 0x36}
+#define TLS_DH_RSA_WITH_AES_256_CBC_SHA{0x00, 0x37}
+#define TLS_DHE_DSS_WITH_AES_256_CBC_SHA   {0x00, 0x38}
+#define TLS_DHE_RSA_WITH_AES_256_CBC_SHA   {0x00, 0x39}
+#define TLS_RSA_WITH_NULL_SHA256   {0x00, 0x3B}
+#define TLS_RSA_WITH_AES_128_CBC_SHA256{0x00, 0x3C}
+#define TLS_RSA_WITH_AES_256_CBC_SHA256{0x00, 0x3D}
+#define TLS_DH_DSS_WITH_AES_128_CBC_SHA256 {0x00, 0x3E}
+#define TLS_DH_RSA_WITH_AES_128_CBC_SHA256 {0x00, 0x3F}
+#define TLS_DHE_DSS_WITH_AES_128_CBC_SHA256{0x00, 0x40}
+#define TLS_DHE_RSA_WITH_AES_128_CBC_SHA256{0x00, 0x67}
+#define TLS_DH_DSS_WITH_AES_256_CBC_SHA256 {0x00, 0x68}
+#define TLS_DH_RSA_WITH_AES_256_CBC_SHA256 {0x00, 0x69}
+#define TLS_DHE_DSS_WITH_AES_256_CBC_SHA256{0x00, 0x6A}
+#define TLS_DHE_RSA_WITH_AES_256_CBC_SHA256{0x00, 0x6B}
+#define TLS_DHE_RSA_WITH_AES_256_GCM_S

[edk2-devel] [PATCH V2 2/3] CryptoPkg: Extend Tls function library

2022-10-07 Thread Li, Yi
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3892

1. TlsSetSignatureAlgoList(): Configure the list of TLS signature algorithms
that should be used as part of the TLS session establishment.
This is needed for some WLAN Supplicant connection establishment flows
that allow only specific TLS signature algorithms to be used, e.g.,
Authenticate and Key Managmenet (AKM) suites that are SUITE-B compliant.

2. TlsSetEcCurve(): Configure the Elliptic Curve that should be used for
TLS flows the use cipher suite with EC,
e.g., TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384.
This is needed for some WLAN Supplicant connection establishment flows
that allow only specific TLS signature algorithms to be used,
e.g., Authenticate and Key Managmenet (AKM) suites that are SUITE-B compliant.

3. TlsShutdown():
Shutdown the TLS connection without releasing the resources,
meaning a new connection can be started without calling TlsNew() and
without setting certificates etc.

4. TlsGetExportKey(): Derive keying material from a TLS connection using the
mechanism described in RFC 5705 and export the key material (needed
by EAP methods such as EAP-TTLS and EAP-PEAP).

5. TlsSetHostPrivateKeyEx(): This function adds the local private key
(PEM-encoded or PKCS#8 or DER-encoded private key) into the specified
TLS object for TLS negotiation. There is already a similar function
TlsSetHostPrivateKey(), the new Ex function introduces a new parameter
Password, set Password to NULL when useless.

Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Xiaoyu Lu 
Cc: Guomin Jiang 
Signed-off-by: Yi Li 
---
 CryptoPkg/Include/Library/TlsLib.h| 126 +-
 CryptoPkg/Library/TlsLib/InternalTlsLib.h |   4 +
 CryptoPkg/Library/TlsLib/TlsConfig.c  | 412 --
 CryptoPkg/Library/TlsLib/TlsProcess.c |  32 ++
 CryptoPkg/Library/TlsLibNull/TlsConfigNull.c  | 123 +-
 CryptoPkg/Library/TlsLibNull/TlsProcessNull.c |  23 +
 6 files changed, 690 insertions(+), 30 deletions(-)

diff --git a/CryptoPkg/Include/Library/TlsLib.h 
b/CryptoPkg/Include/Library/TlsLib.h
index 3b75fde0aa..d37c5fcc35 100644
--- a/CryptoPkg/Include/Library/TlsLib.h
+++ b/CryptoPkg/Include/Library/TlsLib.h
@@ -294,6 +294,25 @@ TlsWrite (
   IN UINTN  BufferSize
   );
 
+/**
+  Shutdown a TLS connection.
+
+  Shutdown the TLS connection without releasing the resources, meaning a new
+  connection can be started without calling TlsNew() and without setting
+  certificates etc.
+
+  @param[in]   TlsPointer to the TLS object to shutdown.
+
+  @retval EFI_SUCCESS The TLS is shutdown successfully.
+  @retval EFI_INVALID_PARAMETER   Tls is NULL.
+  @retval EFI_PROTOCOL_ERROR  Some other error occurred.
+**/
+EFI_STATUS
+EFIAPI
+TlsShutdown (
+  IN VOID  *Tls
+  );
+
 /**
   Set a new TLS/SSL method for a particular TLS object.
 
@@ -492,11 +511,38 @@ TlsSetHostPublicCert (
 /**
   Adds the local private key to the specified TLS object.
 
-  This function adds the local private key (PEM-encoded RSA or PKCS#8 private
+  This function adds the local private key (DER-encoded or PEM-encoded or 
PKCS#8 private
   key) into the specified TLS object for TLS negotiation.
 
   @param[in]  Tls Pointer to the TLS object.
-  @param[in]  DataPointer to the data buffer of a PEM-encoded RSA
+  @param[in]  DataPointer to the data buffer of a DER-encoded or 
PEM-encoded
+  or PKCS#8 private key.
+  @param[in]  DataSizeThe size of data buffer in bytes.
+  @param[in]  PasswordPointer to NULL-terminated private key password, set 
it to NULL
+  if private key not encrypted.
+
+  @retval  EFI_SUCCESS The operation succeeded.
+  @retval  EFI_UNSUPPORTED This function is not supported.
+  @retval  EFI_ABORTED Invalid private key data.
+
+**/
+EFI_STATUS
+EFIAPI
+TlsSetHostPrivateKeyEx (
+  IN VOID   *Tls,
+  IN VOID   *Data,
+  IN UINTN  DataSize,
+  IN VOID   *Password  OPTIONAL
+  );
+
+/**
+  Adds the local private key to the specified TLS object.
+
+  This function adds the local private key (DER-encoded or PEM-encoded or 
PKCS#8 private
+  key) into the specified TLS object for TLS negotiation.
+
+  @param[in]  Tls Pointer to the TLS object.
+  @param[in]  DataPointer to the data buffer of a DER-encoded or 
PEM-encoded
   or PKCS#8 private key.
   @param[in]  DataSizeThe size of data buffer in bytes.
 
@@ -534,6 +580,53 @@ TlsSetCertRevocationList (
   IN UINTN  DataSize
   );
 
+/**
+  Set the signature algorithm list to used by the TLS object.
+
+  This function sets the signature algorithms for use by a specified TLS 
object.
+
+  @param[in]  TlsPointer to a TLS object.
+  @param[in]  Data   Array of UINT8 of signature algorithms. The 
array consists of
+ pairs of the hash algorithm and the signature 
algorithm as defined
+  

[edk2-devel] [PATCH V2 3/3] CryptoPkg: Add new Tls APIs to DXE and protocol

2022-10-07 Thread Li, Yi
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3892

The implementation provides new Tls library functions
for Crypto EFI Driver and Protocol.

Cc: Jiewen Yao 
Cc: Jian J Wang 
Cc: Xiaoyu Lu 
Cc: Guomin Jiang 
Signed-off-by: Yi Li 
---
 CryptoPkg/Driver/Crypto.c | 155 +-
 .../Pcd/PcdCryptoServiceFamilyEnable.h|   5 +
 .../BaseCryptLibOnProtocolPpi/CryptLib.c  | 146 -
 CryptoPkg/Private/Protocol/Crypto.h   | 136 ++-
 4 files changed, 435 insertions(+), 7 deletions(-)

diff --git a/CryptoPkg/Driver/Crypto.c b/CryptoPkg/Driver/Crypto.c
index 7a8266aaba..f1ff77855c 100644
--- a/CryptoPkg/Driver/Crypto.c
+++ b/CryptoPkg/Driver/Crypto.c
@@ -4238,6 +4238,28 @@ CryptoServiceTlsWrite (
   return CALL_BASECRYPTLIB (Tls.Services.Write, TlsWrite, (Tls, Buffer, 
BufferSize), 0);
 }
 
+/**
+  Shutdown a TLS connection.
+
+  Shutdown the TLS connection without releasing the resources, meaning a new
+  connection can be started without calling TlsNew() and without setting
+  certificates etc.
+
+  @param[in]   TlsPointer to the TLS object to shutdown.
+
+  @retval EFI_SUCCESS The TLS is shutdown successfully.
+  @retval EFI_INVALID_PARAMETER   Tls is NULL.
+  @retval EFI_PROTOCOL_ERROR  Some other error occurred.
+**/
+EFI_STATUS
+EFIAPI
+CryptoServiceTlsShutdown (
+  IN VOID  *Tls
+  )
+{
+  return CALL_BASECRYPTLIB (Tls.Services.Shutdown, TlsShutdown, (Tls), 
EFI_UNSUPPORTED);
+}
+
 /**
   Set a new TLS/SSL method for a particular TLS object.
 
@@ -4463,11 +4485,41 @@ CryptoServiceTlsSetHostPublicCert (
 /**
   Adds the local private key to the specified TLS object.
 
-  This function adds the local private key (PEM-encoded RSA or PKCS#8 private
+  This function adds the local private key (DER-encoded or PEM-encoded or 
PKCS#8 private
+  key) into the specified TLS object for TLS negotiation.
+
+  @param[in]  Tls Pointer to the TLS object.
+  @param[in]  DataPointer to the data buffer of a DER-encoded or 
PEM-encoded
+  or PKCS#8 private key.
+  @param[in]  DataSizeThe size of data buffer in bytes.
+  @param[in]  PasswordPointer to NULL-terminated private key password, set 
it to NULL
+  if private key not encrypted.
+
+  @retval  EFI_SUCCESS The operation succeeded.
+  @retval  EFI_UNSUPPORTED This function is not supported.
+  @retval  EFI_ABORTED Invalid private key data.
+
+**/
+EFI_STATUS
+EFIAPI
+CryptoServiceTlsSetHostPrivateKeyEx (
+  IN VOID   *Tls,
+  IN VOID   *Data,
+  IN UINTN  DataSize,
+  IN VOID   *Password  OPTIONAL
+  )
+{
+  return CALL_BASECRYPTLIB (TlsSet.Services.HostPrivateKeyEx, 
TlsSetHostPrivateKeyEx, (Tls, Data, DataSize, Password), EFI_UNSUPPORTED);
+}
+
+/**
+  Adds the local private key to the specified TLS object.
+
+  This function adds the local private key (DER-encoded or PEM-encoded or 
PKCS#8 private
   key) into the specified TLS object for TLS negotiation.
 
   @param[in]  Tls Pointer to the TLS object.
-  @param[in]  DataPointer to the data buffer of a PEM-encoded RSA
+  @param[in]  DataPointer to the data buffer of a DER-encoded or 
PEM-encoded
   or PKCS#8 private key.
   @param[in]  DataSizeThe size of data buffer in bytes.
 
@@ -4511,6 +4563,59 @@ CryptoServiceTlsSetCertRevocationList (
   return CALL_BASECRYPTLIB (TlsSet.Services.CertRevocationList, 
TlsSetCertRevocationList, (Data, DataSize), EFI_UNSUPPORTED);
 }
 
+/**
+  Set the signature algorithm list to used by the TLS object.
+
+  This function sets the signature algorithms for use by a specified TLS 
object.
+
+  @param[in]  TlsPointer to a TLS object.
+  @param[in]  Data   Array of UINT8 of signature algorithms. The 
array consists of
+ pairs of the hash algorithm and the signature 
algorithm as defined
+ in RFC 5246
+  @param[in]  DataSize   The length the SignatureAlgoList. Must be 
divisible by 2.
+
+  @retval  EFI_SUCCESS   The signature algorithm list was set 
successfully.
+  @retval  EFI_INVALID_PARAMETER The parameters are invalid.
+  @retval  EFI_UNSUPPORTED   No supported TLS signature algorithm was 
found in SignatureAlgoList
+  @retval  EFI_OUT_OF_RESOURCES  Memory allocation failed.
+
+**/
+EFI_STATUS
+EFIAPI
+CryptoServiceTlsSetSignatureAlgoList (
+  IN VOID   *Tls,
+  IN UINT8  *Data,
+  IN UINTN  DataSize
+  )
+{
+  return CALL_BASECRYPTLIB (TlsSet.Services.SignatureAlgoList, 
TlsSetSignatureAlgoList, (Tls, Data, DataSize), EFI_UNSUPPORTED);
+}
+
+/**
+  Set the EC curve to be used for TLS flows
+
+  This function sets the EC curve to be used for TLS flows.
+
+  @param[in]  TlsPointer to a TLS object.
+  @param[in]  Data   An EC named curve as defined in section 5.1.1 
of RFC 4492.
+  

回复: [edk2-devel] [PATCH v3] remove GCC build warning

2022-10-07 Thread gaoliming via groups.io
Have you verified GCC5 and GCC49 tool chain?

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 JessyX Wu
> 发送时间: 2022年10月4日 10:04
> 收件人: devel@edk2.groups.io
> 抄送: JessyX Wu ; Bob Feng ;
> Liming Gao ; Yuwei Chen
> 
> 主题: [edk2-devel] [PATCH v3] remove GCC build warning
> 
> Fix gcc: warning:
>  -x c after last input file has no effect
> 
> These kind of flag can only affect the source code after them.
> For the build command in build_rule.template, we have no other source code
> or object after these two flag.
> It seems we don't need them here.
> 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Cc: Yuwei Chen 
> Signed-off-by: JessyX Wu 
> ---
>  BaseTools/Conf/build_rule.template | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Conf/build_rule.template
> b/BaseTools/Conf/build_rule.template
> index 5895b48fd8..af4819de92 100755
> --- a/BaseTools/Conf/build_rule.template
> +++ b/BaseTools/Conf/build_rule.template
> @@ -463,7 +463,7 @@
> 
>  
>  "$(ASLCC)" $(DEPS_FLAGS) -c -o
> $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS)
> $(DEPS_FLAGS) $(INC) ${src}
> -"$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll
> $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS)
> $(ASLCC_FLAGS)
> +"$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll
> $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
>  "$(GENFW)" -o ${dst} -c
> $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(GENFW_FLAGS)
> 
>  
> --
> 2.37.3.windows.1
> 
> 
> 
> 
> 





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




回复: [edk2-devel] [PATCH v2 02/17] BaseTools: Remove duplicated words

2022-10-07 Thread gaoliming via groups.io
Pierre:
  If the whole serials have passed review, one of package maintainer can merge 
them together. 

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表
> PierreGondois
> 发送时间: 2022年10月3日 16:00
> 收件人: Feng, Bob C ; devel@edk2.groups.io
> 抄送: Gao, Liming 
> 主题: Re: [edk2-devel] [PATCH v2 02/17] BaseTools: Remove duplicated
> words
> 
> Hello Bob,
> Thanks for the review. Other patches in the serie received a Reviewed-by:
> - [PATCH v2 04/17] DynamicTablesPkg: Remove duplicated words
> - [PATCH v2 09/17] NetworkPkg: Remove duplicated words
> - [PATCH v2 11/17] RedfishPkg: Remove duplicated words
> - [PATCH v2 13/17] ShellPkg: Remove duplicated words
> - [PATCH v2 14/17] SourceLevelDebugPkg: Remove duplicated words
> - [PATCH v2 17/17] UnitTestFrameworkPkg: Remove duplicated words
> 
> Would it be possible to take them aswell ? I'm not sure who should take them
> as
> they are accross multiple packages,
> 
> Regards,
> Pierre
> 
> 
> On 10/1/22 17:08, Feng, Bob C wrote:
> > Reviewed-by: Bob Feng 
> >
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of
> PierreGondois
> > Sent: Tuesday, September 6, 2022 4:29 PM
> > To: devel@edk2.groups.io
> > Cc: Pierre Gondois ; Feng, Bob C
> ; Gao, Liming 
> > Subject: [edk2-devel] [PATCH v2 02/17] BaseTools: Remove duplicated
> words
> >
> > From: Pierre Gondois 
> >
> > In an effort to clean the documentation of the above package, remove
> duplicated words.
> >
> > Cc: Bob Feng 
> > Cc: Liming Gao 
> > Signed-off-by: Pierre Gondois 
> > ---
> >   BaseTools/Source/C/Common/FirmwareVolumeBuffer.c| 6 +++---
> >   BaseTools/Source/C/DevicePath/DevicePathUtilities.c | 2 +-
> >   BaseTools/Source/C/GenFv/GenFv.c| 2 +-
> >   BaseTools/Source/C/VfrCompile/Pccts/antlr/mrhoist.c | 4 ++--
> >   BaseTools/Source/Python/Ecc/EccToolError.py | 2 +-
> >   BaseTools/Source/Python/build/build.py  | 2 +-
> >   6 files changed, 9 insertions(+), 9 deletions(-)
> >
> > diff --git a/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
> b/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
> > index 70741c8afcb5..ace26eb71c6b 100644
> > --- a/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
> > +++ b/BaseTools/Source/C/Common/FirmwareVolumeBuffer.c
> > @@ -91,7 +91,7 @@ Routine Description:
> >
> >   Arguments:
> >
> > -  SourceFv - Address of the Fv in memory, this firmware volume volume
> will
> > +  SourceFv - Address of the Fv in memory, this firmware volume will
> >be modified, if SourceFfsFile exists
> > SourceFfsFile - Input FFS file to replace
> >
> > @@ -141,7 +141,7 @@ Routine Description:
> >
> >   Arguments:
> >
> > -  SourceFv - Address of the Fv in memory, this firmware volume volume
> will
> > +  SourceFv - Address of the Fv in memory, this firmware volume will
> >be modified, if SourceFfsFile exists
> > SourceFfsFile - Input FFS file to replace
> >
> > @@ -285,7 +285,7 @@ Routine Description:
> >
> >   Arguments:
> >
> > -  SourceFv - Address of the Fv in memory, this firmware volume volume
> will
> > +  SourceFv - Address of the Fv in memory, this firmware volume will
> >be modified, if SourceFfsFile exists
> > SourceFfsFile - Input FFS file to replace
> >
> > diff --git a/BaseTools/Source/C/DevicePath/DevicePathUtilities.c
> b/BaseTools/Source/C/DevicePath/DevicePathUtilities.c
> > index 2ffefa8ceeef..49078aac8caf 100644
> > --- a/BaseTools/Source/C/DevicePath/DevicePathUtilities.c
> > +++ b/BaseTools/Source/C/DevicePath/DevicePathUtilities.c
> > @@ -37,7 +37,7 @@ CONST EFI_DEVICE_PATH_PROTOCOL
> mUefiDevicePathLibEndDevicePath = {
> > @retval TRUEDevicePath is valid.
> > @retval FALSE   DevicePath is NULL.
> > @retval FALSE   Maxsize is less than
> sizeof(EFI_DEVICE_PATH_PROTOCOL).
> > -  @retval FALSE   The length of any node node in the DevicePath is
> less
> > +  @retval FALSE   The length of any node in the DevicePath is less
> > than sizeof (EFI_DEVICE_PATH_PROTOCOL).
> > @retval FALSE   If MaxSize is not zero, the size of the
> DevicePath
> > exceeds MaxSize.
> > diff --git a/BaseTools/Source/C/GenFv/GenFv.c
> b/BaseTools/Source/C/GenFv/GenFv.c
> > index 43cc5cd3fe82..a742d55e5270 100644
> > --- a/BaseTools/Source/C/GenFv/GenFv.c
> > +++ b/BaseTools/Source/C/GenFv/GenFv.c
> > @@ -299,7 +299,7 @@ Returns:
> >   return STATUS_ERROR;
> > }
> > if (TempNumber == 0) {
> > -Error (NULL, 0, 1003, "Invalid option value", "Fv block size can't
> be be set to zero");
> > +Error (NULL, 0, 1003, "Invalid option value", "Fv block size
> > + can't be set to zero");
> >   return STATUS_ERROR;
> > }
> > mFvDataInfo.FvBlocks[0].Length = (UINT32) TempNumber; diff
> --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/mrhoist.c
> b/BaseTools/Source/C/VfrCompile/Pccts/antlr/mrhoist.c
> > index b57f5ded846c

[edk2-devel] Updated Event: TianoCore edk2-test Bug Triage Meeting #cal-invite

2022-10-07 Thread Group Notification
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Groups.io Inc//Groups.io Calendar//EN
METHOD:PUBLISH
REFRESH-INTERVAL;VALUE=DURATION:PT1H
X-PUBLISHED-TTL:PT1H
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:Asia/Shanghai
LAST-MODIFIED:20220816T024022Z
TZURL:http://tzurl.org/zoneinfo-outlook/Asia/Shanghai
X-LIC-LOCATION:Asia/Shanghai
BEGIN:STANDARD
TZNAME:CST
TZOFFSETFROM:+0800
TZOFFSETTO:+0800
DTSTART:19700101T00
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
X-GIOIDS:Repeat:39460
UID:uhga.1631071627369023388.p...@groups.io
DTSTAMP:20221008T024048Z
ORGANIZER;CN=Edhaya Chandran:mailto:edhaya.chand...@arm.com
DTSTART;TZID=Asia/Shanghai:20220901T22
DTEND;TZID=Asia/Shanghai:20220901T23
RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=1TH
SUMMARY:TianoCore edk2-test Bug Triage Meeting
LOCATION:https://armltd.zoom.us/j/91247522013?pwd=ei9nUndTbG9oWEROS2M1aVR
 EZkpiQT09&from=addon
SEQUENCE:5313
END:VEVENT
END:VCALENDAR


invite.ics
Description: application/ics


Re: [edk2-devel] [Patch V2] UefiCpuPkg/CpuExceptionHandlerLib: Code optimization to allow bigger stack

2022-10-07 Thread Ni, Ray
Reviewed-by: Ray Ni 

> -Original Message-
> From: Tan, Dun 
> Sent: Thursday, September 29, 2022 5:07 PM
> To: devel@edk2.groups.io
> Cc: Dong, Eric ; Ni, Ray ; Kumar,
> Rahul R 
> Subject: [Patch V2] UefiCpuPkg/CpuExceptionHandlerLib: Code optimization
> to allow bigger stack
> 
> This commit is a code optimization to allow bigger seperate stack size in
> ArchSetupExceptionStack. In previous code logic, CPU_STACK_ALIGNMENT
> bytes
> will be wasted if StackTop is already CPU_STACK_ALIGNMENT aligned.
> 
> Signed-off-by: Dun Tan 
> Cc: Eric Dong 
> Reviewed-by: Ray Ni 
> Cc: Rahul Kumar 
> ---
>  UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c |
> 5 -
>  UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c  |
> 5 -
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.
> c
> index 8c398ebc5b..c30ece1dc9 100644
> ---
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c
> +++
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.
> c
> @@ -215,7 +215,10 @@ ArchSetupExceptionStack (
>// Fixup exception task descriptor and task-state segment
>//
>AsmGetTssTemplateMap (&TemplateMap);
> -  StackTop = StackTop - CPU_STACK_ALIGNMENT;
> +  //
> +  // Plus 1 byte is for compact stack layout in case StackTop is already 
> aligned.
> +  //
> +  StackTop = StackTop - CPU_STACK_ALIGNMENT + 1;
>StackTop = (UINTN)ALIGN_POINTER (StackTop, CPU_STACK_ALIGNMENT);
>IdtTable = (IA32_IDT_GATE_DESCRIPTOR  *)Idtr.Base;
>for (Index = 0; Index < CPU_STACK_SWITCH_EXCEPTION_NUMBER;
> ++Index) {
> diff --git
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c
> index 80e9f08e5b..4e85880ed4 100644
> ---
> a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c
> +++
> b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c
> @@ -223,7 +223,10 @@ ArchSetupExceptionStack (
>// Fixup exception task descriptor and task-state segment
>//
>ZeroMem (Tss, sizeof (*Tss));
> -  StackTop = StackTop - CPU_STACK_ALIGNMENT;
> +  //
> +  // Plus 1 byte is for compact stack layout in case StackTop is already 
> aligned.
> +  //
> +  StackTop = StackTop - CPU_STACK_ALIGNMENT + 1;
>StackTop = (UINTN)ALIGN_POINTER (StackTop, CPU_STACK_ALIGNMENT);
>IdtTable = (IA32_IDT_GATE_DESCRIPTOR  *)Idtr.Base;
>for (Index = 0; Index < CPU_STACK_SWITCH_EXCEPTION_NUMBER;
> ++Index) {
> --
> 2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94839): https://edk2.groups.io/g/devel/message/94839
Mute This Topic: https://groups.io/mt/93990596/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 00/34] Add a new architecture called LoongArch in EDK II

2022-10-07 Thread Chao Li
Hi All,
I have updated LoongArch repo, the CI has passed, please check again:
https://dev.azure.com/kilaterlee/LoongArch_edk2/_build/results?buildId=77&view=results
 
(https://link.getmailspring.com/link/f2807860-fe79-4500-aaac-a40889944...@getmailspring.com/0?redirect=https%3A%2F%2Fdev.azure.com%2Fkilaterlee%2FLoongArch_edk2%2F_build%2Fresults%3FbuildId%3D77%26view%3Dresults&recipient=ZGV2ZWxAZWRrMi5ncm91cHMuaW8%3D)

Thanks,
Chao


On 10月 1 2022, at 8:54 早上, "Chao Li"  wrote:
> Hi All,
> Today, all of LoongArch patches have been approved, a big thank you to all 
> the maintainers!
>
> I have updated the LoongArch code repo to the EDK2 latest commit, applied the 
> LoongArch patches based on it, and CI passed.
> LoongArch repo URL: https://github.com/loongson/edk2/tree/LoongArch
> CI results: 
> https://dev.azure.com/kilaterlee/LoongArch_edk2/_build/results?buildId=75&view=results
>
> I think the LoongArch port is ready to merge into the EDK2 master branch, if 
> so please help me merge them. Please let me know if something should I do 
> next.
>
> --
> Thanks,
> Chao
>
> > -原始邮件-
> > 发件人: "Chao Li" 
> > 发送时间:2022-09-27 19:13:20 (星期二)
> > 收件人: devel@edk2.groups.io
> > 抄送: "Ray Ni" , "Liming Gao" , 
> > "Michael D Kinney" , "Guomin Jiang" 
> > , "Wei6 Xu" , "Maciej Rabeda" 
> > , "Jiaxin Wu" , "Siyuan 
> > Fu" , "Jiewen Yao" , "Jian J 
> > Wang" , "Xiaoyu Lu" , 
> > "Zhiguang Liu" , "Zhichao Gao" 
> > , "Bob Feng" , "Yuwei Chen" 
> > 
> > 主题: [edk2-devel] [PATCH v3 00/34] Add a new architecture called LoongArch 
> > in EDK II
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4053
> >
> > UEFI Spec V2.10 already supports LoongArch and all changes of this
> > commit passwed Azure CI testing, so let's enable it in EDK2. This commit
> > contains 35 patches, with patch 0 is the cover and the rest being the
> > LoongArch base code.
> >
> > Changes from v1 to v2:
> > 1. For patch 0008, added IANA website link in the commit message and
> > Dhcp.h.
> > 2. Added IANA, Microsft and UEFI specification links in every patch
> > commit message that uses them.
> > 3. For patch 0023, LoongArch64 supports unaligned access operations, so
> > use the unaligned read/write generic implementation. Added Barrier.S
> > file to provide barrier operations for LoongArch.
> > 4. For patch 0024, convert inline assembly code to ASM code.
> > 5. Added the BZ link in every patch commit message.
> >
> > Changes from v2 to v3:
> > 1. Added all reviewer in the correspondings patches.
> > 2. For patch 0029, converted LoongArch synchronization operations from
> > inline assembly code to ASM code.
> > 3. For patch 0015, 0016, 0017, changed the commit message for more
> > clarity.
> > 4. For patch 0034, move it to patch 0018, as it also changes the BaseTools.
> >
> > Please refer to this URL for the code repo of LoongArch64:
> > https://github.com/loongson/edk2/tree/LoongArch
> >
> > Fore more documents of LoongArch please refer to following URL:
> > https://loongson.github.io/LoongArch-Documentation/README-EN.html
> >
> > Modified modules: FatPkg, FmpDevicePkg, NetworkPkg,
> > NetworkPkg/HttpBootDxe, CryptoPkg, MdePkg/Include, SecurityPkg,
> > ShellPkg, UnitTestFrameworkPkg, MdePkg/DxeServicesLib, MdeModulePkg,
> > .python/SpellCheck, BaseTools, .azurepipelines, .pytool, MdePkg,
> > MdeModulePkg and MdePkg/MdePkg.ci.yaml.
> >
> > Cc: Ray Ni 
> > Cc: Liming Gao 
> > Cc: Michael D Kinney 
> > Cc: Guomin Jiang 
> > Cc: Wei6 Xu 
> > Cc: Maciej Rabeda 
> > Cc: Jiaxin Wu 
> > Cc: Siyuan Fu 
> > Cc: Jiewen Yao 
> > Cc: Jian J Wang 
> > Cc: Xiaoyu Lu 
> > Cc: Zhiguang Liu 
> > Cc: Zhichao Gao 
> > Cc: Bob Feng 
> > Cc: Yuwei Chen 
> >
> > Chao Li (34):
> > MdePkg: Added file of DebugSupport.h to MdePkg.ci.yaml
> > MdePkg: Added LoongArch jump buffer register definition to
> > MdePkg.ci.yaml
> > FatPkg: Add LOONGARCH64 architecture for EDK2 CI.
> > FmpDevicePkg: Add LOONGARCH64 architecture for EDK2 CI.
> > NetworkPkg: Add LOONGARCH64 architecture for EDK2 CI.
> > NetworkPkg/HttpBootDxe: Add LOONGARCH64 architecture for EDK2 CI.
> > CryptoPkg: Add LOONGARCH64 architecture for EDK2 CI.
> > MdePkg/Include: Add LOONGARCH related definitions EDK2 CI.
> > SecurityPkg: Add LOONGARCH64 architecture for EDK2 CI.
> > ShellPkg: Add LOONGARCH64 architecture for EDK2 CI.
> > UnitTestFrameworkPkg: Add LOONGARCH64 architecture for EDK2 CI.
> > MdePkg/DxeServicesLib: Add LOONGARCH64 architecture
> > MdeModulePkg: Use LockBoxNullLib for LOONGARCH64
> > .python/SpellCheck: Add "Loongson" and "LOONGARCH" to "words" section
> > BaseTools: Update GenFw/GenFv to support LoongArch platform.
> > BaseTools: Updated for GCC5 tool chain for LoongArch platfrom.
> > BaseTools: Updated build tools to support new LoongArch.
> > BaseTools: Add LoongArch64 binding.
> > BaseTools: Enable LoongArch64 architecture for LoongArch64 EDK2 CI.
> > .azurepipelines: Add LoongArch64 architecture on LoongArch64 EDK2 CI.
> > .pytool: Add LoongArch64 architecture on LoongAr

[edk2-devel] [PATCH v2 1/1] UefiCpuPkg: Reset a parameter when BSP Exit in CPU relaxed mode.

2022-10-07 Thread Li, Zhihao
From: Zhihao Li 

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

In CPU relaxed mode, it doesn't reset the value of
mSmmMpSyncData->AllApArrivedWithException when BSP exit smm mode.
So this patch will reset this variable. Modified the flow of
SmmCpuRendezvous to avoid enter SmmWaitForApArrival repeatedly.

Cc: Eric Dong 
Cc: Ray Ni 

Signed-off-by: Zhihao Li 
---
 UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c | 17 -
 UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c  |  5 +++--
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c 
b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c
index 2ebf4543c3ed..368bacd29ea1 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c
@@ -421,11 +421,18 @@ SmmCpuRendezvous (
 goto ON_EXIT;
   }
 
-  //
-  // There are some APs outside SMM, Wait for all avaiable APs to arrive.
-  //
-  SmmWaitForApArrival ();
-  Status = mSmmMpSyncData->AllApArrivedWithException ? EFI_SUCCESS : 
EFI_TIMEOUT;
+  if ((mSmmMpSyncData->EffectiveSyncMode != SmmCpuSyncModeTradition) && 
!SmmCpuFeaturesNeedConfigureMtrrs ()) {
+//
+// There are some APs outside SMM, Wait for all avaiable APs to arrive.
+//
+SmmWaitForApArrival ();
+Status = mSmmMpSyncData->AllApArrivedWithException ? EFI_SUCCESS : 
EFI_TIMEOUT;
+  } else {
+//
+// BSP has already waitted for APs to arrive SMM if SmmCpuSyncMode 
selected or need config MTRR.
+//
+Status = EFI_TIMEOUT;
+  }
 
 ON_EXIT:
   if (!mSmmMpSyncData->AllApArrivedWithException) {
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c 
b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
index 13c2cb8da4c3..c79da418e37c 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
@@ -696,8 +696,9 @@ BSPHandler (
   //
   // Allow APs to check in from this point on
   //
-  *mSmmMpSyncData->Counter   = 0;
-  *mSmmMpSyncData->AllCpusInSync = FALSE;
+  *mSmmMpSyncData->Counter  = 0;
+  *mSmmMpSyncData->AllCpusInSync= FALSE;
+  mSmmMpSyncData->AllApArrivedWithException = FALSE;
 }
 
 /**
-- 
2.26.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94841): https://edk2.groups.io/g/devel/message/94841
Mute This Topic: https://groups.io/mt/94195356/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 1/1] UefiCpuPkg: Reset a parameter when BSP Exit in CPU relaxed mode.

2022-10-07 Thread Ni, Ray
Can you please split the patch to 2 patches?

> -Original Message-
> From: Li, Zhihao 
> Sent: Saturday, October 8, 2022 1:58 PM
> To: devel@edk2.groups.io
> Cc: Dong, Eric ; Ni, Ray 
> Subject: [PATCH v2 1/1] UefiCpuPkg: Reset a parameter when BSP Exit in
> CPU relaxed mode.
> 
> From: Zhihao Li 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4083
> 
> In CPU relaxed mode, it doesn't reset the value of
> mSmmMpSyncData->AllApArrivedWithException when BSP exit smm mode.
> So this patch will reset this variable. Modified the flow of
> SmmCpuRendezvous to avoid enter SmmWaitForApArrival repeatedly.
> 
> Cc: Eric Dong 
> Cc: Ray Ni 
> 
> Signed-off-by: Zhihao Li 
> ---
>  UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c | 17 -
>  UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c  |  5 +++--
>  2 files changed, 15 insertions(+), 7 deletions(-)
> 
> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c
> b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c
> index 2ebf4543c3ed..368bacd29ea1 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuService.c
> @@ -421,11 +421,18 @@ SmmCpuRendezvous (
>  goto ON_EXIT;
> 
>}
> 
> 
> 
> -  //
> 
> -  // There are some APs outside SMM, Wait for all avaiable APs to arrive.
> 
> -  //
> 
> -  SmmWaitForApArrival ();
> 
> -  Status = mSmmMpSyncData->AllApArrivedWithException ? EFI_SUCCESS :
> EFI_TIMEOUT;
> 
> +  if ((mSmmMpSyncData->EffectiveSyncMode !=
> SmmCpuSyncModeTradition) && !SmmCpuFeaturesNeedConfigureMtrrs ())
> {
> 
> +//
> 
> +// There are some APs outside SMM, Wait for all avaiable APs to arrive.
> 
> +//
> 
> +SmmWaitForApArrival ();
> 
> +Status = mSmmMpSyncData->AllApArrivedWithException ? EFI_SUCCESS :
> EFI_TIMEOUT;
> 
> +  } else {
> 
> +//
> 
> +// BSP has already waitted for APs to arrive SMM if SmmCpuSyncMode
> selected or need config MTRR.
> 
> +//
> 
> +Status = EFI_TIMEOUT;
> 
> +  }
> 
> 
> 
>  ON_EXIT:
> 
>if (!mSmmMpSyncData->AllApArrivedWithException) {
> 
> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> index 13c2cb8da4c3..c79da418e37c 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> @@ -696,8 +696,9 @@ BSPHandler (
>//
> 
>// Allow APs to check in from this point on
> 
>//
> 
> -  *mSmmMpSyncData->Counter   = 0;
> 
> -  *mSmmMpSyncData->AllCpusInSync = FALSE;
> 
> +  *mSmmMpSyncData->Counter  = 0;
> 
> +  *mSmmMpSyncData->AllCpusInSync= FALSE;
> 
> +  mSmmMpSyncData->AllApArrivedWithException = FALSE;
> 
>  }
> 
> 
> 
>  /**
> 
> --
> 2.26.2.windows.1



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




Re: [edk2-devel] [PATCH v1 1/1] UefiCpuPkg: Reset a parameter when BSP Exit in CPU relaxed mode.

2022-10-07 Thread Ni, Ray
Reviewed-by: Ray Ni 

> -Original Message-
> From: Li, Zhihao 
> Sent: Tuesday, September 27, 2022 8:58 PM
> To: devel@edk2.groups.io
> Cc: Dong, Eric ; Ni, Ray 
> Subject: [PATCH v1 1/1] UefiCpuPkg: Reset a parameter when BSP Exit in
> CPU relaxed mode.
> 
> From: Zhihao Li 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4083
> 
> In CPU relaxed mode, it doesn't reset the value of
> mSmmMpSyncData->AllApArrivedWithException when BSP exit smm mode.
> So this patch will reset this variable.
> 
> Cc: Eric Dong 
> Cc: Ray Ni 
> 
> Signed-off-by: Zhihao Li 
> ---
>  UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> index 13c2cb8da4c3..c79da418e37c 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
> @@ -696,8 +696,9 @@ BSPHandler (
>//
> 
>// Allow APs to check in from this point on
> 
>//
> 
> -  *mSmmMpSyncData->Counter   = 0;
> 
> -  *mSmmMpSyncData->AllCpusInSync = FALSE;
> 
> +  *mSmmMpSyncData->Counter  = 0;
> 
> +  *mSmmMpSyncData->AllCpusInSync= FALSE;
> 
> +  mSmmMpSyncData->AllApArrivedWithException = FALSE;
> 
>  }
> 
> 
> 
>  /**
> 
> --
> 2.26.2.windows.1



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