Re: [edk2-devel] [PATCH V4 05/31] OvmfPkg: Extend VmgExitLib to handle #VE exception

2022-01-19 Thread Min Xu
Hi
> > The base VmgExitLib library provides a default limited interface to
> > handle #VE exception. To provide full support, the OVMF version of
> > VmgExitLib is extended to provide full support of #VE handler.
> >
> > PcdIgnoreVeHalt is created in OvmfPkg.dec to ignore the VE halt.
> 
> Why this is useful?
This Pcd is deprecated. It will be removed in the next version.
> 
> > +  X64/TdVmcallCpuid.nasm
> 
> Hmm, why not simply call the functions added by patch #2?
> 
TdVmcall in patch #2 assumes the returned value is in r11 (if there is returned 
data). But from [GHCI] spec Table 3-17, TDVMCALL_CPUID returns the values in 
R12/R13/R14/R15. So there has to be a new TdVmcallCpuid.nasm.
[GHCI] 
https://www.intel.com/content/dam/develop/external/us/en/documents/intel-tdx-guest-hypervisor-communication-interface-1.0-344426-002.pdf

Thanks
Min


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




Re: [edk2-devel] [PATCH EDK2 v1 0/1] RedfishPkg/RedfishRestExDxe:Simplify status check

2022-01-19 Thread Abner Chang
Hi Wenyi,
Could you please create PR for this change? So we can have core CI on this 
patch and I can also merge this patch later when the core CI is finished 
successfully.
Just send me the link to PR once you create it.

Thanks
Abner

From: xiewenyi (A) 
Sent: Wednesday, January 19, 2022 3:39 PM
To: Chang, Abner (HPS SW/FW Technologist) ; 
devel@edk2.groups.io ; Wang, Nickle (Server BIOS) 

Cc: songdongku...@huawei.com 
Subject: Re: [PATCH EDK2 v1 0/1] RedfishPkg/RedfishRestExDxe:Simplify status 
check



On 2022/1/19 15:29, Chang, Abner (HPS SW/FW Technologist) wrote:
> Hi Wenyi,
> May I know what is the problem you encountered and what environment causes 
> the issue? Is that under edk2 emulation or the real Redfish service?
>
Hi Abner,
I didn't encounter any issue and there's no functional change in this patch, 
just try to simplify the code. Please review whether it's OK or not.

Thanks
Wenyi
> Thanks
> Abner
> --
> *From:* Wenyi Xie 
> *Sent:* Wednesday, January 19, 2022 2:12 PM
> *To:* devel@edk2.groups.io ; Chang, Abner (HPS SW/FW 
> Technologist) ; Wang, Nickle (Server BIOS) 
> 
> *Cc:* songdongku...@huawei.com ; 
> xiewen...@huawei.com 
> *Subject:* [PATCH EDK2 v1 0/1] RedfishPkg/RedfishRestExDxe:Simplify status 
> check
>
> Main Changes :
> 1.Remove redundant if statement.
>
> Wenyi Xie (1):
>   RedfishPkg/RedfishRestExDxe:Simplify status check
>
>  RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c | 38 +---
>  1 file changed, 17 insertions(+), 21 deletions(-)
>
> --
> 2.20.1.windows.1
>


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




回复: [edk2-devel] [PATCH v1 1/1] FmpDevicePkg/FmpDxe: Update FmpDeviceCheckImageWithStatus() handling

2022-01-19 Thread gaoliming
Create PR https://github.com/tianocore/edk2/pull/2427 for it. 

Thanks
Liming
> -邮件原件-
> 发件人: Michael Kubacki 
> 发送时间: 2022年1月20日 3:46
> 收件人: devel@edk2.groups.io; guomin.ji...@intel.com
> 抄送: Gao, Liming ; Kinney, Michael D
> ; Xu, Wei6 
> 主题: Re: [edk2-devel] [PATCH v1 1/1] FmpDevicePkg/FmpDxe: Update
> FmpDeviceCheckImageWithStatus() handling
> 
> Hi Guomin,
> 
> It has been a couple of weeks since your review and I have not seen the
> patch merged yet.
> 
> Do you know when it will be merged?
> 
> Thanks,
> Michael
> 
> On 1/6/2022 10:45 PM, Guomin Jiang wrote:
> > Reviewed-by: Guomin Jiang 
> >
> > Guomin
> >
> >> -Original Message-
> >> From: mikub...@linux.microsoft.com 
> >> Sent: Wednesday, January 5, 2022 4:38 AM
> >> To: devel@edk2.groups.io
> >> Cc: Gao, Liming ; Kinney, Michael D
> >> ; Jiang, Guomin
> ;
> >> Xu, Wei6 
> >> Subject: [PATCH v1 1/1] FmpDevicePkg/FmpDxe: Update
> >> FmpDeviceCheckImageWithStatus() handling
> >>
> >> From: Michael Kubacki 
> >>
> >> Update the logic handling last attempt status codes from
> >> FmpDeviceCheckImageWithStatus() implementations to account for cases
> >> when the function return status code is EFI_SUCCESS (since the image was
> >> checked successfully) but the ImageUpdatable value is not valid.
> >>
> >> In addition the following sentence is removed from the LastAttemptStatus
> >> parameter definition for
> >> FmpDeviceCheckImageWithStatus() since it can lead to confusion.
> >> The expected status code value range is sufficient to implement the library
> >> API.
> >>
> >>"This value will only be checked when this
> >> function returns an error."
> >>
> >> Cc: Liming Gao 
> >> Cc: Michael D Kinney 
> >> Cc: Guomin Jiang 
> >> Cc: Wei6 Xu 
> >> Signed-off-by: Michael Kubacki 
> >> ---
> >>   FmpDevicePkg/FmpDxe/FmpDxe.c | 23
> +++-
> >>   FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLib.c |  3 +--
> >>   FmpDevicePkg/Include/Library/FmpDeviceLib.h  |  3 +--
> >>   3 files changed, 19 insertions(+), 10 deletions(-)
> >>
> >> diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c
> >> b/FmpDevicePkg/FmpDxe/FmpDxe.c index 197df28c8dd6..1e7ec4a09e16
> >> 100644
> >> --- a/FmpDevicePkg/FmpDxe/FmpDxe.c
> >> +++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
> >> @@ -1040,8 +1040,19 @@ CheckTheImageInternal (
> >> //
> >> Status = FmpDeviceCheckImageWithStatus UINT8 *)Image) +
> >> AllHeaderSize), RawSize, ImageUpdatable, LastAttemptStatus);
> >> if (EFI_ERROR (Status)) {
> >> +// The image cannot be valid if an error occurred checking the image
> >> +if (*ImageUpdatable == IMAGE_UPDATABLE_VALID) {
> >> +  *ImageUpdatable = IMAGE_UPDATABLE_INVALID;
> >> +}
> >> +
> >>   DEBUG ((DEBUG_ERROR, "FmpDxe(%s): CheckTheImage() -
> FmpDeviceLib
> >> CheckImage failed. Status = %r\n", mImageIdName, Status));
> >> +  }
> >>
> >> +  //
> >> +  // Only validate the library last attempt status code if the image is 
> >> not
> >> updatable.
> >> +  // This specifically avoids converting LAST_ATTEMPT_STATUS_SUCCESS
> if it
> >> set for an updatable image.
> >> +  //
> >> +  if (*ImageUpdatable != IMAGE_UPDATABLE_VALID) {
> >>   //
> >>   // LastAttemptStatus returned from the device library should fall
> within
> >> the designated error range
> >>   //
> [LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MIN_ERROR_CODE_VALUE,
> >> LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MAX_ERROR_CODE_VALUE]
> >> @@ -1049,12 +1060,12 @@ CheckTheImageInternal (
> >>   if ((*LastAttemptStatus <
> >> LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MIN_ERROR_CODE_VALUE)
> ||
> >>   (*LastAttemptStatus >
> >> LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MAX_ERROR_CODE_VALUE))
> >>   {
> >> -  DEBUG (
> >> -(DEBUG_ERROR,
> >> - "FmpDxe(%s): CheckTheImage() - LastAttemptStatus %d from
> >> FmpDeviceCheckImageWithStatus() is invalid.\n",
> >> - mImageIdName,
> >> - *LastAttemptStatus)
> >> -);
> >> +  DEBUG ((
> >> +DEBUG_ERROR,
> >> +"FmpDxe(%s): CheckTheImage() - LastAttemptStatus %d from
> >> FmpDeviceCheckImageWithStatus() is invalid.\n",
> >> +mImageIdName,
> >> +*LastAttemptStatus
> >> +));
> >> *LastAttemptStatus =
> LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL;
> >>   }
> >> }
> >> diff --git a/FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLib.c
> >> b/FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLib.c
> >> index 2e5c17b2b0f9..82219e87a430 100644
> >> --- a/FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLib.c
> >> +++ b/FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLib.c
> >> @@ -434,8 +434,7 @@ FmpDeviceCheckImage (
> >>
> IMAGE_UPDATABLE_VALID_WITH_VENDOR_CODE
> >> @param[out] LastAttemptStatus   A pointer to a UINT32 that holds
> the last
> >> attempt
> >> status to report back to the
> ESRT table in case
> >> -  of error. This value will only be
> 

[edk2-devel][edk2-platforms][PATCH V2 14/14] WhitleyOpenBoardPkg/Build: Enable Features/Intel features

2022-01-19 Thread Oram, Isaac W
This enables Whitley as a test vehicle for features.
These are not expected to be fully functional at this time.
Specifically UserAuthentication causes a boot failure and the others
have only been verified to be built and dispatched, not ported to
the Whitley reference platform hardware.

Cc: Nate DeSimone 
Cc: Chasel Chiu 

Signed-off-by: Isaac Oram 
---
 Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc | 44 
 Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.fdf |  6 ++-
 2 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc 
b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
index f07b0a8ccf..42680254d1 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
+++ b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
@@ -39,6 +39,50 @@
   DEFINE IIO_INSTANCE   = UnknownCpu
 !endif
 
+!include AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc
+
+[PcdsFixedAtBuild]
+  gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugPortLibInstance|1
+
+[PcdsFeatureFlag]
+  #
+  # Debugging features
+  #
+  gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable  
|FALSE
+  gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable  
|FALSE
+  gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdPostCodeDebugFeatureEnable  
|FALSE
+  gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable  
|FALSE
+
+  #
+  # Network features
+  #
+  gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable  
|FALSE
+
+  #
+  # OutOfBandManagement features
+  #
+  gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable
|FALSE
+  gSpcrFeaturePkgTokenSpaceGuid.PcdSpcrFeatureEnable
|FALSE
+
+  #
+  # PowerManagement features
+  #
+  gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable
|FALSE
+
+  #
+  # SystemInformation features
+  #
+  gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable
|FALSE
+
+  #
+  # UserInterface features
+  #
+  gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable
|FALSE
+  gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable  
|FALSE
+  gVirtualKeyboardFeaturePkgTokenSpaceGuid.PcdVirtualKeyboardFeatureEnable  
|FALSE
+
+!include AdvancedFeaturePkg/Include/AdvancedFeatures.dsc
+
   #
   # Platform On/Off features are defined here
   #
diff --git a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.fdf 
b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.fdf
index 7e2a8b1b9f..45460570d9 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.fdf
+++ b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.fdf
@@ -84,7 +84,7 @@ SET gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize = 
0x0100
   SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize  = 0x0004 # 
Size must match WhitleyFspPkg.fdf content
   SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMSize  = 0x00221000 # 
Size must match WhitleyFspPkg.fdf content
   SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize  = 0x6000 # 
Size must match WhitleyFspPkg.fdf content
-  SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvBspPreMemorySize  = 0x1000
+  SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvBspPreMemorySize  = 0x0001
   SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize = 
gCpPlatFlashTokenSpaceGuid.PcdFlashFdSecPeiSize - 
gMinPlatformPkgTokenSpaceGuid.PcdFlashFvBspSize - 
gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize - 
gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize - 
gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMSize - 
gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize - 
gMinPlatformPkgTokenSpaceGuid.PcdFlashFvBspPreMemorySize
 
   #
@@ -481,6 +481,8 @@ SET gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize 
= 0x0100
   !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
   FvNameGuid = 09f25d44-b2ef-4225-8b2e-e0e094b51775
 
+  !include AdvancedFeaturePkg/Include/PreMemory.fdf
+
 [FV.FvBspPreMemory]
   !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
   FvNameGuid = e6c65995-8c2d-4119-a52d-7dbf1acb45a1
@@ -710,6 +712,8 @@ SET gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize 
= 0x0100
   !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
   FvNameGuid = 70aeaf57-4997-49ce-a4f7-122980745670
 
+  !include AdvancedFeaturePkg/Include/PostMemory.fdf
+
 [FV.FvAdvanced]
   !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
   FvNameGuid = f21ee7a1-53a9-453d-aee3-b6a5c25bada5
-- 
2.27.0.windows.1



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




[edk2-devel][edk2-platforms][PATCH V2 13/14] AdvancedFeaturePkg/Build: Add FDF to create FV for all features

2022-01-19 Thread Oram, Isaac W
This produces three FV and no FD.
FvAdvancedPreMemory.fv contains PEIM for pre-memory use.
FvAdvancedUncompressed.fv contains post memory PEIM and drivers for DXE
and SMM.
FvAdvanced.fv contains the compressed FvAdvancedUncompressed.fv in an
FV file format as is common practice.

These FV are not expected to be used as is, but are needed to test the
individual features for things like filename collisions.  Some features
require build customization so binary reuse is not feasible at this time.

Cc: Sai Chaganty 
Cc: Liming Gao 

Signed-off-by: Isaac Oram 
---
 Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc |  1 +
 Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.fdf | 49 

 2 files changed, 50 insertions(+)

diff --git a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc 
b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
index 02636da916..28530b8c67 100644
--- a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
+++ b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
@@ -29,6 +29,7 @@
   SKUID_IDENTIFIER= DEFAULT
   PEI_ARCH= IA32
   DXE_ARCH= X64
+  FLASH_DEFINITION= 
AdvancedFeaturePkg/AdvancedFeaturePkg.fdf
 
 [Packages]
   MdePkg/MdePkg.dec
diff --git a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.fdf 
b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.fdf
new file mode 100644
index 00..76a02c5d1c
--- /dev/null
+++ b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.fdf
@@ -0,0 +1,49 @@
+## @file
+# FDF file generating AdvancedFeature FV for inclusion in a MinPlatform design.
+#
+# There are three FV produced, FvAdvancedPreMemory.fv, 
FvAdvancedUncompressed.fv, and
+# FvAdvanced.fv.  The sizes are arbitrary as these are not expected to be used 
as is
+# in today's usages.  Boards will tune FV by selecting or deseleting features 
and building.
+#
+# @copyright
+# Copyright (C) 2022 Intel Corporation
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+[Defines]
+  DEFINE UNCOMPRESSED_FV_ADVANCED_FILENAME = 
6d606b5c-2d45-4705-a700-73324306be06
+
+[FV.FvAdvancedPreMemory]
+  !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
+  FvNameGuid = ea9da344-a7f3-468c-ae84-2d22fc03b28e
+
+  !include AdvancedFeaturePkg/Include/PreMemory.fdf
+
+[FV.FvAdvancedUncompressed]
+  !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
+  FvNameGuid = $(UNCOMPRESSED_FV_ADVANCED_FILENAME)
+
+  !include AdvancedFeaturePkg/Include/PostMemory.fdf
+
+[FV.FvAdvanced]
+  !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
+  FvNameGuid = 445b121d-28d6-4801-8958-8253cf426cf7
+
+  FILE FV_IMAGE = $(UNCOMPRESSED_FV_ADVANCED_FILENAME) {
+SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = 
TRUE {
+  SECTION FV_IMAGE = FvAdvancedUncompressed
+}
+  }
+
+
+
+#
+# Rules are use with the [FV] section's module INF type to define
+# how an FFS file is created for a given INF file. The following Rule are the 
default
+# rules for the different module type. User can add the customized rules to 
define the
+# content of the FFS file.
+#
+
+
+!include MinPlatformPkg/Include/Fdf/RuleInclude.fdf
-- 
2.27.0.windows.1



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




[edk2-devel][edk2-platforms][PATCH V2 12/14] AdvancedFeaturePkg: Add missing features

2022-01-19 Thread Oram, Isaac W
The AdvancedFeaturePkg is supposed to include all features.
Add Beep Debug feature to include DSC and FDF.

Order features based on their domains.

Cc: Sai Chaganty 
Cc: Liming Gao 

Signed-off-by: Isaac Oram 
---
 Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc  | 66 

 Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc| 36 
---
 Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc | 64 
+++
 Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf  | 36 
---
 Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf   | 36 
---
 Features/Intel/Readme.md  | 49 
++-
 6 files changed, 219 insertions(+), 68 deletions(-)

diff --git a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc 
b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
index 0c7a29cc75..02636da916 100644
--- a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
+++ b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
@@ -36,7 +36,6 @@
 
 !include AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc
 
-
 

 #
 # Advanced Feature Enable section - all advanced features are enabling for the
@@ -44,26 +43,71 @@
 #
 

 [PcdsFeatureFlag]
-  gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable|TRUE
-  gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable  |TRUE
-  gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable|TRUE
-  gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable  |TRUE
-  gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable  |TRUE
-  gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable|TRUE
-  gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable|TRUE
-  gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable  |TRUE
-  gLogoFeaturePkgTokenSpaceGuid.PcdJpgEnable  
|FALSE
+  #
+  # Debugging features
+  #
+  gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable  
|TRUE
+  gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable  
|TRUE
+  gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdPostCodeDebugFeatureEnable  
|TRUE
+  gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable  
|TRUE
+
+  #
+  # Network features
+  #
+  gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable  
|TRUE
+
+  #
+  # OutOfBandManagement features
+  #
+  gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable
|TRUE
+  gSpcrFeaturePkgTokenSpaceGuid.PcdSpcrFeatureEnable
|TRUE
+
+  #
+  # PowerManagement features
+  #
+  gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable
|TRUE
+
+  #
+  # SystemInformation features
+  #
+  gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable
|TRUE
+
+  #
+  # UserInterface features
+  #
+  gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable
|TRUE
+  gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable  
|TRUE
+  gVirtualKeyboardFeaturePkgTokenSpaceGuid.PcdVirtualKeyboardFeatureEnable  
|TRUE
+
+#
+# PCD that are required to be set by the build target should be configured 
here for test purposes
+# These settings are only for the purposes of buildings, boards should follow 
instructions in Readme files.
+#
+
+[PcdsFixedAtBuild]
+  gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugPortLibInstance|1
+
+[PcdsFeatureFlag]
+  #
+  # MinPlatform common include currently required PCD
+  #
   gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable
|FALSE
   gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable   
|FALSE
   gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable  
|FALSE
 
 #
-# Include common library
+# Include common libraries
 #
 !include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
 !include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
 !include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
 
+#
+# Libraries required to be specified by the build target
+#
+[LibraryClasses.Common]
+  
PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.inf
 # Required by BeepDebugFeature
+
 #
 # This package builds all advanced features.
 #
diff --git a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc 
b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc
index 874b8ce7db..2b36938df6 100644
--- a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc
+++ b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc
@@ -11,51 +11,67 @@
 ##
 
 #
-# Debug Advanced Features
+# Debugging features
 #
 !if 

[edk2-devel][edk2-platforms][PATCH V2 02/14] SmbiosFeaturePkg: Use MinPlatformPkg build include files

2022-01-19 Thread Oram, Isaac W
Use the MinPlatformPkg common core build files to build libraries
needed by this feature.

Cc: Sai Chaganty 
Cc: Liming Gao 

Signed-off-by: Isaac Oram 
---
 Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf|  
2 +-
 Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc | 
52 
 Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dsc  | 
18 +++
 3 files changed, 19 insertions(+), 53 deletions(-)

diff --git 
a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf 
b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf
index c3a3e81503..d46bacfbd2 100644
--- a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf
+++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf
@@ -7,4 +7,4 @@
 #
 ##
 
-  INF SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf
+INF SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf
diff --git 
a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc 
b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc
index 094dd957b8..7a165f39d7 100644
--- 
a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc
+++ 
b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc
@@ -33,28 +33,6 @@
 
 !include MdePkg/MdeLibs.dsc.inc
 
-[LibraryClasses]
-  ###
-  # Edk2 Packages
-  ###
-  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
-  BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf
-  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
-  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
-  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
-  
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
-  
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
-  UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
-  
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
-
-[LibraryClasses.common.DXE_DRIVER]
-  ###
-  # Edk2 Packages
-  ###
-  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
-  
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
-  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
-
 

 #
 # Component section - list of all components that need built for this feature.
@@ -69,21 +47,6 @@
 #   generated for it, but the binary will not be put into any firmware 
volume.
 #
 

-#
-# Feature PEI Components
-#
-
-# @todo: Change below line to [Components.$(PEI_ARCH)] after 
https://bugzilla.tianocore.org/show_bug.cgi?id=2308
-#is completed.
-[Components.IA32]
-  #
-  # SMBIOS Feature Package
-  #
-
-  # Add library instances here that are not included in package components and 
should be tested
-  # in the package build.
-
-  # Add components here that should be included in the package build.
 
 #
 # Feature DXE Components
@@ -101,18 +64,3 @@
 
   # Add components here that should be included in the package build.
   SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf
-
-###
-#
-# BuildOptions Section - Define the module specific tool chain flags that 
should be used as
-#the default flags for a module. These flags are 
appended to any
-#standard flags that are defined by the build process. 
They can be
-#applied for any modules or only those modules with 
the specific
-#module style (EDK or EDKII) specified in [Components] 
section.
-#
-#For advanced features, it is recommended to enable 
[BuildOptions] in
-#the applicable INF file so it does not affect the 
whole board package
-#build when this DSC file is active.
-#
-###
-[BuildOptions]
diff --git 
a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dsc 
b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dsc
index 31141c0725..e72b341154 100644
--- a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dsc
+++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dsc
@@ -24,6 +24,24 @@
   PEI_ARCH   = IA32
   DXE_ARCH   = X64
 
+[Packages]
+  

[edk2-devel][edk2-platforms][PATCH V2 08/14] LogoFeaturePkg: Use MinPlatformPkg build include files

2022-01-19 Thread Oram, Isaac W
Use the MinPlatformPkg common core build files to build libraries
needed by this feature.

Cc: Dandan Bi 
Cc: Liming Gao 

Signed-off-by: Isaac Oram 
---
 Features/Intel/UserInterface/LogoFeaturePkg/Include/LogoFeature.dsc | 69 

 Features/Intel/UserInterface/LogoFeaturePkg/LogoFeaturePkg.dec  |  2 -
 Features/Intel/UserInterface/LogoFeaturePkg/LogoFeaturePkg.dsc  | 38 
---
 3 files changed, 41 insertions(+), 68 deletions(-)

diff --git 
a/Features/Intel/UserInterface/LogoFeaturePkg/Include/LogoFeature.dsc 
b/Features/Intel/UserInterface/LogoFeaturePkg/Include/LogoFeature.dsc
index 1898be12ed..0acce1c7df 100644
--- a/Features/Intel/UserInterface/LogoFeaturePkg/Include/LogoFeature.dsc
+++ b/Features/Intel/UserInterface/LogoFeaturePkg/Include/LogoFeature.dsc
@@ -18,36 +18,12 @@
 #
 

 [Defines]
-!ifndef $(PEI_ARCH)
-  !error "PEI_ARCH must be specified to build this feature!"
-!endif
-!ifndef $(DXE_ARCH)
-  !error "DXE_ARCH must be specified to build this feature!"
-!endif
-
-
-#
-# Library Class section - list of all Library Classes needed by this feature.
-#
-
-
-!include MdePkg/MdeLibs.dsc.inc
-
-[LibraryClasses]
-  ###
-  # Edk2 Packages
-  ###
-  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
-  BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf
-  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
-  
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
-  
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
-
-[LibraryClasses.common.DXE_DRIVER]
-  ###
-  # Edk2 Packages
-  ###
-  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
+  !ifndef $(PEI_ARCH)
+!error "PEI_ARCH must be specified to build this feature!"
+  !endif
+  !ifndef $(DXE_ARCH)
+!error "DXE_ARCH must be specified to build this feature!"
+  !endif
 
 

 #
@@ -71,31 +47,8 @@
 # @todo: Change below line to [Components.$(DXE_ARCH)] after 
https://bugzilla.tianocore.org/show_bug.cgi?id=2308
 #is completed.
 [Components.X64]
-  #
-  # Logo Feature Package
-  #
-
-  # Add library instances here that are not included in package components and 
should be tested
-  # in the package build.
-
-  # Add components here that should be included in the package build.
-!if gLogoFeaturePkgTokenSpaceGuid.PcdJpgEnable == TRUE
-  LogoFeaturePkg/LogoDxe/JpegLogoDxe.inf
-!else
-  LogoFeaturePkg/LogoDxe/LogoDxe.inf
-!endif
-
-###
-#
-# BuildOptions Section - Define the module specific tool chain flags that 
should be used as
-#the default flags for a module. These flags are 
appended to any
-#standard flags that are defined by the build process. 
They can be
-#applied for any modules or only those modules with 
the specific
-#module style (EDK or EDKII) specified in [Components] 
section.
-#
-#For advanced features, it is recommended to enable 
[BuildOptions] in
-#the applicable INF file so it does not affect the 
whole board package
-#build when this DSC file is active.
-#
-###
-[BuildOptions]
+  !if gLogoFeaturePkgTokenSpaceGuid.PcdJpgEnable == TRUE
+LogoFeaturePkg/LogoDxe/JpegLogoDxe.inf
+  !else
+LogoFeaturePkg/LogoDxe/LogoDxe.inf
+  !endif
diff --git a/Features/Intel/UserInterface/LogoFeaturePkg/LogoFeaturePkg.dec 
b/Features/Intel/UserInterface/LogoFeaturePkg/LogoFeaturePkg.dec
index 1418eb2137..4fa7dfea0f 100644
--- a/Features/Intel/UserInterface/LogoFeaturePkg/LogoFeaturePkg.dec
+++ b/Features/Intel/UserInterface/LogoFeaturePkg/LogoFeaturePkg.dec
@@ -21,8 +21,6 @@
 [Includes]
   Include
 
-[LibraryClasses]
-
 [Guids]
   gLogoFeaturePkgTokenSpaceGuid  =  {0x567199de, 0xb448, 0x4aa0, {0x99, 0x4e, 
0xd5, 0xd6, 0x82, 0x59, 0x91, 0x17}}
 
diff --git a/Features/Intel/UserInterface/LogoFeaturePkg/LogoFeaturePkg.dsc 
b/Features/Intel/UserInterface/LogoFeaturePkg/LogoFeaturePkg.dsc
index fca413b46b..5a6436178c 100644
--- a/Features/Intel/UserInterface/LogoFeaturePkg/LogoFeaturePkg.dsc
+++ b/Features/Intel/UserInterface/LogoFeaturePkg/LogoFeaturePkg.dsc
@@ -21,17 +21,39 @@
   SUPPORTED_ARCHITECTURES= IA32|X64
   

[edk2-devel][edk2-platforms][PATCH V2 11/14] Usb3DebugFeaturePkg: Align with feature design guidelines

2022-01-19 Thread Oram, Isaac W
Remove build of common libraries.  Boards will already have those.

Modified Usb3DebugFeature.dsc to treat libraries like libraries.
Usb3DebugFeaturePkg.dsc uses the component trick for standalone build
testing of the libraries.

Added a PCD to allow board to select between NULL, regular, and IO MMU
library instances.  Prior implementation of Usb3DebugFeature.dsc was not
useful as an includable file because it didn't specify LibaryClass
instance to use.

Removed unused CMOS PCD.

Updated some of the readme sections.

Cc: Eric Dong 
Cc: Liming Gao 

Signed-off-by: Isaac Oram 
---
 Features/Intel/Debugging/Usb3DebugFeaturePkg/Include/Usb3DebugFeature.dsc | 
131 
 Features/Intel/Debugging/Usb3DebugFeaturePkg/Readme.md|  
50 +---
 Features/Intel/Debugging/Usb3DebugFeaturePkg/Usb3DebugFeaturePkg.dec  |  
14 +--
 Features/Intel/Debugging/Usb3DebugFeaturePkg/Usb3DebugFeaturePkg.dsc  |  
18 +++
 4 files changed, 81 insertions(+), 132 deletions(-)

diff --git 
a/Features/Intel/Debugging/Usb3DebugFeaturePkg/Include/Usb3DebugFeature.dsc 
b/Features/Intel/Debugging/Usb3DebugFeaturePkg/Include/Usb3DebugFeature.dsc
index 1e3aaecd5d..2dc48d637b 100644
--- a/Features/Intel/Debugging/Usb3DebugFeaturePkg/Include/Usb3DebugFeature.dsc
+++ b/Features/Intel/Debugging/Usb3DebugFeaturePkg/Include/Usb3DebugFeature.dsc
@@ -31,122 +31,35 @@
 #
 

 
-!include MdePkg/MdeLibs.dsc.inc
+[LibraryClasses.Common]
+  
Usb3DebugPortParamLib|Usb3DebugFeaturePkg/Library/Usb3DebugPortParamLibPcd/Usb3DebugPortParamLibPcd.inf
 
-[LibraryClasses]
-  ###
-  # Edk2 Packages
-  ###
-  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
-  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
-  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
-  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
-  DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
-  IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
-  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
-  PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
-  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
-  TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
-  
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
-  
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
-  UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
-  
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
-
-[LibraryClasses.common.PEIM]
-  ###
-  # Edk2 Packages
-  ###
-  HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
-  
MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
-  
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf
-
-[LibraryClasses.common.DXE_DRIVER]
-  ###
-  # Edk2 Packages
-  ###
-  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
-  
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
-
-[LibraryClasses.common.DXE_RUNTIME_DRIVER]
-  ###
-  # Edk2 Packages
-  ###
-  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
-  
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
-  UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
-
-[LibraryClasses.common.UEFI_DRIVER]
-  ###
-  # Edk2 Packages
-  ###
-  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
-  
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
-
-
-#
-# Component section - list of all components that need built for this feature.
-#
-# Note: The EDK II DSC file is not used to specify how compiled binary images 
get placed
-#   into firmware volume images. This section is just a list of modules to 
compile from
-#   source into UEFI-compliant binaries.
-#   It is the FDF file that contains information on combining binary files 
into firmware
-#   volume images, whose concept is beyond UEFI and is described in PI 
specification.
-#   There may also be modules listed in this section that are not required 
in the FDF file,
-#   When a module listed here is excluded from FDF file, then 
UEFI-compliant binary will be
-#   generated for it, but the binary will not be put into any firmware 
volume.
-#

[edk2-devel][edk2-platforms][PATCH V2 05/14] VirtualKeyboardFeaturePkg: Fix all relative package paths

2022-01-19 Thread Oram, Isaac W
Packages should be at the root of a PACKAGES_PATH entry.
At some point, paths were relative to edk2-platforms/Features/Intel
which was functional, but interferes with the proper functioning
of packaging tools.

Cc: Liming Gao 
Cc: Dandan Bi 

Signed-off-by: Isaac Oram 
---
 Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/PostMemory.fdf  
   | 2 +-
 
Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/VirtualKeyboardFeature.dsc
 | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/PostMemory.fdf 
b/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/PostMemory.fdf
index bf4a4d5078..f40b5087e8 100644
--- 
a/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/PostMemory.fdf
+++ 
b/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/PostMemory.fdf
@@ -7,4 +7,4 @@
 #
 ##
 
-  INF 
UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/VirtualKeyboardDxe.inf
+  INF VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/VirtualKeyboardDxe.inf
diff --git 
a/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/VirtualKeyboardFeature.dsc
 
b/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/VirtualKeyboardFeature.dsc
index a8c3819480..8179f70c80 100644
--- 
a/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/VirtualKeyboardFeature.dsc
+++ 
b/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/VirtualKeyboardFeature.dsc
@@ -81,7 +81,7 @@
   #
   # Virtual Keyboard Feature Package
   #
-  
UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/VirtualKeyboardDxe.inf
+  VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/VirtualKeyboardDxe.inf
 
 
###
 #
-- 
2.27.0.windows.1



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




[edk2-devel][edk2-platforms][PATCH V2 04/14] UserAuthFeaturePkg: Use MinPlatformPkg build include files

2022-01-19 Thread Oram, Isaac W
Use the MinPlatformPkg common core build files to build libraries
needed by this feature.

Cc: Dandan Bi 
Cc: Liming Gao 

Signed-off-by: Isaac Oram 
---
 Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf  |  
6 +-
 Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc | 
80 ++--
 Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dsc  | 
18 +
 3 files changed, 27 insertions(+), 77 deletions(-)

diff --git 
a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf 
b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf
index c534bebcc0..030dcbe763 100644
--- a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf
+++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf
@@ -7,6 +7,6 @@
 #
 ##
 
-  INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf
-  INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf
-  INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf
+INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf
+INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf
+INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf
diff --git 
a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc 
b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc
index 7eeaf441c1..2f39a5580c 100644
--- 
a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc
+++ 
b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc
@@ -18,12 +18,12 @@
 #
 

 [Defines]
-!ifndef $(PEI_ARCH)
-  !error "PEI_ARCH must be specified to build this feature!"
-!endif
-!ifndef $(DXE_ARCH)
-  !error "DXE_ARCH must be specified to build this feature!"
-!endif
+  !ifndef $(PEI_ARCH)
+!error "PEI_ARCH must be specified to build this feature!"
+  !endif
+  !ifndef $(DXE_ARCH)
+!error "DXE_ARCH must be specified to build this feature!"
+  !endif
 
 

 #
@@ -34,47 +34,9 @@
 !include MdePkg/MdeLibs.dsc.inc
 
 [LibraryClasses]
-  ###
-  # Edk2 Packages
-  ###
-  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
-  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
-  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
-  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
-  HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
-  IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
-  IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
-  OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
-  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
-  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
-  TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
-  
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
-  
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
-  
UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
-  UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
-  
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
-  RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf
-
-  #
-  # User Authentication Feature Package
-  #
   
PlatformPasswordLib|UserAuthFeaturePkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf
   
UserPasswordLib|UserAuthFeaturePkg/Library/UserPasswordLib/UserPasswordLib.inf
 
-[LibraryClasses.common.DXE_DRIVER]
-  ###
-  # Edk2 Packages
-  ###
-  
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
-
-[LibraryClasses.common.DXE_SMM_DRIVER]
-  ###
-  # Edk2 Packages
-  ###
-  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
-  
MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf
-  
SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf
-
 
###
 #
 # Components Section - list of the modules and components that will be 
processed by compilation
@@ -93,21 +55,6 @@
 #   generated for it, but the binary will not be put into any firmware 
volume.
 #
 
###
-#
-# Feature PEI Components
-#
-
-# @todo: 

[edk2-devel][edk2-platforms][PATCH V2 10/14] AcpiDebugFeaturePkg: Use MinPlatformPkg build include files

2022-01-19 Thread Oram, Isaac W
Use the MinPlatformPkg common core build files to build libraries
needed by this feature.

Cc: Eric Dong 
Cc: Liming Gao 

Signed-off-by: Isaac Oram 
---
 Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dsc  | 21 
++
 Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc | 70 

 Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf   |  4 
+-
 3 files changed, 23 insertions(+), 72 deletions(-)

diff --git 
a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dsc 
b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dsc
index 62cc559d8f..3b76d39ea8 100644
--- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dsc
+++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dsc
@@ -24,6 +24,27 @@
   PEI_ARCH   = IA32
   DXE_ARCH   = X64
 
+[Packages]
+  MinPlatformPkg/MinPlatformPkg.dec
+
+#
+# Since there are no 32b libraries or components in this package, these PCD 
are specified for 64b only
+#
+[PcdsFeatureFlag.X64]
+  #
+  # PCD needed for MinPlatform build includes
+  #
+  gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable
|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable   
|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable  
|FALSE
+
+#
+# Include common libraries
+#
+!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
+!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
+!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
+
 #
 # This package always builds the feature.
 #
diff --git 
a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc 
b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc
index b142978be1..f5b8bacee0 100644
--- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc
+++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc
@@ -25,45 +25,6 @@
   !error "DXE_ARCH must be specified to build this feature!"
 !endif
 
-
-#
-# Library Class section - list of all Library Classes needed by this feature.
-#
-
-
-!include MdePkg/MdeLibs.dsc.inc
-
-[LibraryClasses]
-  ###
-  # Edk2 Packages
-  ###
-  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
-  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
-  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
-  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
-  DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
-  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
-  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
-  
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
-  
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
-  UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
-  
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
-
-[LibraryClasses.common.DXE_DRIVER,LibraryClasses.common.DXE_RUNTIME_DRIVER]
-  ###
-  # Edk2 Packages
-  ###
-  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
-  
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
-
-[LibraryClasses.common.DXE_SMM_DRIVER]
-  ###
-  # Edk2 Packages
-  ###
-  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
-  
MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf
-  
SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf
-
 

 #
 # Component section - list of all components that need built for this feature.
@@ -78,22 +39,6 @@
 #   generated for it, but the binary will not be put into any firmware 
volume.
 #
 

-#
-# Feature PEI Components
-#
-
-# @todo: Change below line to [Components.$(PEI_ARCH)] after 
https://bugzilla.tianocore.org/show_bug.cgi?id=2308
-#is completed.
-[Components.IA32]
-  #
-  # ACPI Debug Feature Package
-  #
-
-  # Add library instances here that are not included in package components and 
should be tested
-  # in the package build.
-
-  # Add components here that should be included in the package build.
-
 #
 # Feature DXE Components
 #
@@ -111,18 +56,3 @@
   # Add components here that should be included in the package build.
   

[edk2-devel][edk2-platforms][PATCH V2 09/14] PostCodeDebugFeaturePkg: Complete as an advanced feature

2022-01-19 Thread Oram, Isaac W
Add feature enable PCD.
Use MinPlatformPkg build include files.
Fix PEI_COR typo in PEI handler lib.
Build StatusCodeHandler components with unique filename GUID.
Add PreMemory.fdf and PostMemory.fdf include files.
Improve Readme formatting and feature enabling checklist.

Cc: Eric Dong 
Cc: Liming Gao 

Signed-off-by: Isaac Oram 
---
 
Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostCodeDebugFeature.dsc
 | 231 +---
 Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostMemory.fdf
   |  14 ++
 Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PreMemory.fdf 
   |  13 ++
 
Features/Intel/Debugging/PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/PeiPostCodeStatusCodeHandlerLib.inf
 |   2 +-
 Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeaturePkg.dec   
   |  11 +
 Features/Intel/Debugging/PostCodeDebugFeaturePkg/PostCodeDebugFeaturePkg.dsc   
   |  30 +++
 Features/Intel/Debugging/PostCodeDebugFeaturePkg/Readme.md 
   |  31 ++-
 7 files changed, 146 insertions(+), 186 deletions(-)

diff --git 
a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostCodeDebugFeature.dsc
 
b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostCodeDebugFeature.dsc
index 3d886fff38..31b0c02e79 100644
--- 
a/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostCodeDebugFeature.dsc
+++ 
b/Features/Intel/Debugging/PostCodeDebugFeaturePkg/Include/PostCodeDebugFeature.dsc
@@ -12,192 +12,71 @@
 #
 ##
 
-
-#
-# Defines Section - statements that will be processed to create a Makefile.
-#
-
 [Defines]
-!ifndef $(PEI_ARCH)
-  !error "PEI_ARCH must be specified to build this feature!"
-!endif
-!ifndef $(DXE_ARCH)
-  !error "DXE_ARCH must be specified to build this feature!"
-!endif
+  !ifndef $(PEI_ARCH)
+!error "PEI_ARCH must be specified to build this feature!"
+  !endif
+  !ifndef $(DXE_ARCH)
+!error "DXE_ARCH must be specified to build this feature!"
+  !endif
 
-
-#
-# PCD Section - list of PCD Entries modified by the feature.
-#
-
+  DEFINE POST_CODE_PEIM_FILENAME  = 3ea07dd3-f837-40c0-ac56-f3e18a30d01b
+  DEFINE POST_CODE_DXE_FILENAME   = e7d785f5-e2f3-45e3-b0e7-2291a6c6dea6
+  DEFINE POST_CODE_SMM_FILENAME   = 02a955c7-48c0-4178-989b-b3fea4b3c6a2
 
-# Unmark the following and StatusCodeHandler.efi to build the .dsc file 
directly
-#[PcdsDynamicDefault]
-#  gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUsePostCode|TRUE
+[PcdsDynamicExDefault]
+  #
+  # By default, make the functional control DynamicExDefault PCD so that it 
can be enabled when debugging.
+  #
+  gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUsePostCode
 
-
-#
-# Library Class section - list of all Library Classes needed by this feature.
-#
-
+[LibraryClasses.Common]
+  
PostCodeMapLib|PostCodeDebugFeaturePkg/Library/PostCodeMapLib/PostCodeMapLib.inf
 
-!include MdePkg/MdeLibs.dsc.inc
+[LibraryClasses.PEIM, LibraryClasses.PEI_CORE]
+  
StatusCodeHandlerLib|PostCodeDebugFeaturePkg/Library/PostCodeStatusCodeHandlerLib/PeiPostCodeStatusCodeHandlerLib.inf
 
-[LibraryClasses]
-  ###
-  # Edk2 Packages
-  ###
-  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
-  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
-  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
-  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
-  DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
-  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
-  PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
-  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
-  TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
-  
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
-  
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
-  UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
-  
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
-  PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
+[LibraryClasses.DXE_RUNTIME_DRIVER]
+  

[edk2-devel][edk2-platforms][PATCH V2 06/14] VirtualKeyboardFeaturePkg: Use MinPlatformPkg build include files

2022-01-19 Thread Oram, Isaac W
Use the MinPlatformPkg common core build files to build libraries
needed by this feature.

Cc: Dandan Bi 
Cc: Liming Gao 

Signed-off-by: Isaac Oram 
---
 
Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/VirtualKeyboardFeature.dsc
 | 62 +++-
 
Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardFeaturePkg.dsc
  | 18 ++
 2 files changed, 25 insertions(+), 55 deletions(-)

diff --git 
a/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/VirtualKeyboardFeature.dsc
 
b/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/VirtualKeyboardFeature.dsc
index 8179f70c80..0d4f14a412 100644
--- 
a/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/VirtualKeyboardFeature.dsc
+++ 
b/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/VirtualKeyboardFeature.dsc
@@ -18,43 +18,12 @@
 #
 

 [Defines]
-!ifndef $(PEI_ARCH)
-  !error "PEI_ARCH must be specified to build this feature!"
-!endif
-!ifndef $(DXE_ARCH)
-  !error "DXE_ARCH must be specified to build this feature!"
-!endif
-
-
-#
-# Library Class section - list of all Library Classes needed by this feature.
-#
-
-
-!include MdePkg/MdeLibs.dsc.inc
-
-[LibraryClasses]
-  ###
-  # Edk2 Packages
-  ###
-  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
-  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
-  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
-  
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
-  
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
-  UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
-  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
-  HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
-  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
-  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
-  
UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
-  
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
-
-[LibraryClasses.common.UEFI_DRIVER]
-  ###
-  # Edk2 Packages
-  ###
-  
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
+  !ifndef $(PEI_ARCH)
+!error "PEI_ARCH must be specified to build this feature!"
+  !endif
+  !ifndef $(DXE_ARCH)
+!error "DXE_ARCH must be specified to build this feature!"
+  !endif
 
 
###
 #
@@ -74,26 +43,9 @@
 #   generated for it, but the binary will not be put into any firmware 
volume.
 #
 
###
+
 #
 # Feature DXE Components
 #
 [Components.X64]
-  #
-  # Virtual Keyboard Feature Package
-  #
   VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/VirtualKeyboardDxe.inf
-
-###
-#
-# BuildOptions Section - Define the module specific tool chain flags that 
should be used as
-#the default flags for a module. These flags are 
appended to any
-#standard flags that are defined by the build process. 
They can be
-#applied for any modules or only those modules with 
the specific
-#module style (EDK or EDKII) specified in [Components] 
section.
-#
-#For advanced features, it is recommended to enable 
[BuildOptions] in
-#the applicable INF file so it does not affect the 
whole board package
-#build when this DSC file is active.
-#
-###
-[BuildOptions]
diff --git 
a/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardFeaturePkg.dsc
 
b/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardFeaturePkg.dsc
index ea2005c6d2..6717c892f1 100644
--- 
a/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardFeaturePkg.dsc
+++ 
b/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardFeaturePkg.dsc
@@ -24,6 +24,24 @@
   PEI_ARCH   = IA32
   DXE_ARCH   = X64
 
+[Packages]
+  MinPlatformPkg/MinPlatformPkg.dec
+
+[PcdsFeatureFlag]
+  #
+  # PCD needed for MinPlatform build includes
+  #
+  

[edk2-devel][edk2-platforms][PATCH V2 03/14] UserAuthFeaturePkg: Fix all relative package paths

2022-01-19 Thread Oram, Isaac W
Packages should be at the root of a PACKAGES_PATH entry.
At some point, paths were relative to edk2-platforms/Features/Intel
which was functional, but interferes with the proper functioning
of packaging tools.

Cc: Liming Gao 
Cc: Dandan Bi 

Signed-off-by: Isaac Oram 
---
 Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf 
 |  6 +++---
 Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc
 | 12 ++--
 
Features/Intel/UserInterface/UserAuthFeaturePkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf
 |  2 +-
 
Features/Intel/UserInterface/UserAuthFeaturePkg/Library/UserPasswordLib/UserPasswordLib.inf
 |  2 +-
 
Features/Intel/UserInterface/UserAuthFeaturePkg/Library/UserPasswordUiLib/UserPasswordUiLib.inf
 |  2 +-
 
Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf
 |  2 +-
 
Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf
  |  2 +-
 
Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf
  |  2 +-
 8 files changed, 15 insertions(+), 15 deletions(-)

diff --git 
a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf 
b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf
index f0b33aa44c..c534bebcc0 100644
--- a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf
+++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf
@@ -7,6 +7,6 @@
 #
 ##
 
-  INF 
UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf
-  INF 
UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf
-  INF 
UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf
+  INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf
+  INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf
+  INF UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf
diff --git 
a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc 
b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc
index d4f7a5ed23..7eeaf441c1 100644
--- 
a/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc
+++ 
b/Features/Intel/UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc
@@ -58,8 +58,8 @@
   #
   # User Authentication Feature Package
   #
-  
PlatformPasswordLib|UserInterface/UserAuthFeaturePkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf
-  
UserPasswordLib|UserInterface/UserAuthFeaturePkg/Library/UserPasswordLib/UserPasswordLib.inf
+  
PlatformPasswordLib|UserAuthFeaturePkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf
+  
UserPasswordLib|UserAuthFeaturePkg/Library/UserPasswordLib/UserPasswordLib.inf
 
 [LibraryClasses.common.DXE_DRIVER]
   ###
@@ -122,12 +122,12 @@
 
   # Add library instances here that are not included in package components and 
should be tested
   # in the package build.
-  
UserInterface/UserAuthFeaturePkg/Library/UserPasswordUiLib/UserPasswordUiLib.inf
+  UserAuthFeaturePkg/Library/UserPasswordUiLib/UserPasswordUiLib.inf
 
   # Add components here that should be included in the package build.
-  
UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf
-  
UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf
-  
UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf
+  UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.inf
+  UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthentication2Dxe.inf
+  UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationSmm.inf
 
 
###
 #
diff --git 
a/Features/Intel/UserInterface/UserAuthFeaturePkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf
 
b/Features/Intel/UserInterface/UserAuthFeaturePkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf
index 00be14df8a..278fe026a6 100644
--- 
a/Features/Intel/UserInterface/UserAuthFeaturePkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf
+++ 
b/Features/Intel/UserInterface/UserAuthFeaturePkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf
@@ -32,7 +32,7 @@
 
 [Packages]
   MdePkg/MdePkg.dec
-  UserInterface/UserAuthFeaturePkg/UserAuthFeaturePkg.dec
+  UserAuthFeaturePkg/UserAuthFeaturePkg.dec
 
 [Pcd]
   gUserAuthFeaturePkgTokenSpaceGuid.PcdPasswordCleared## CONSUMES
diff --git 
a/Features/Intel/UserInterface/UserAuthFeaturePkg/Library/UserPasswordLib/UserPasswordLib.inf
 

[edk2-devel][edk2-platforms][PATCH V2 01/14] BeepDebugFeaturePkg: Use MinPlatformPkg build include files

2022-01-19 Thread Oram, Isaac W
The BeepDebugFeaturePkg was malformed and did not build anything
and thus wasn't testable in standalone build.

Added gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable
to properly control the advanced feature inclusion.

Use the standard MinPlatform includes for core libraries. This
increases the build time, but reduces complexity when integrating
into a board build. Board build optimization is more valuable than
standalone build optimization.

Enable standalone build to test the library build and the component
builds using edk2 StatusCodeHandler drivers.

Add unique file names for the StatusCodeHandler components to avoid
collisions with any existing board handlers when incorporated in board
DSC and FDF files.

Add PreMemory.fdf and PostMemory.fdf content for including in board FDF
or AdvancedFeaturePkg in the future.

Removed unused sections in DSC and FDF to reduce file clutter.

Removed stale file header content from prior proprietary licensing.

Moved feature customization and common include into the package DSC
file to reduce board complexity when BeepDebugFeature.dsc is included.

Removed the FixedAtBuild build control for beep feature as it would be
redundant with the FeatureFlag control of the whole feature. Build
control is via PcdBeepDebugFeatureEnable and dynamic control is via
PcdStatusCodeUseBeep.

Improved Readme content, format, and coding style use.

Cc: Sai Chaganty 
Cc: Liming Gao 
Cc: Eric Dong 
Cc: Ming Tan 

Signed-off-by: Isaac Oram 
---
 Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec   
  |   7 +-
 Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dsc   
  |  28 +++
 Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc  
  | 222 ++--
 Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepLib.h 
  |   6 +-
 Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PostMemory.fdf
  |  14 ++
 Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PreMemory.fdf 
  |  13 ++
 
Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf
|   5 +-
 
Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf
 |   3 -
 
Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf
|   3 -
 Features/Intel/Debugging/BeepDebugFeaturePkg/Readme.md 
  |  91 +---
 10 files changed, 186 insertions(+), 206 deletions(-)

diff --git 
a/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec 
b/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec
index 4f4b36b091..d90611da51 100644
--- a/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec
+++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec
@@ -31,6 +31,9 @@
 [Guids]
   gBeepDebugFeaturePkgTokenSpaceGuid  =  {0x54f56fb5, 0xea0e, 0x4518, {0xa0, 
0x3e, 0x1b, 0xeb, 0x56, 0x94, 0xd2, 0x16}}
 
-[PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
+[PcdsFeatureFlag]
+  
gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable|FALSE|BOOLEAN|0x
+
+[PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
   # Beep is a legacy feature, disabled it by default
-  
gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep|FALSE|BOOLEAN|0x0001
+  
gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep|TRUE|BOOLEAN|0x0001
diff --git 
a/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dsc 
b/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dsc
index 47254f9974..56cad020bf 100644
--- a/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dsc
+++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dsc
@@ -24,6 +24,34 @@
   PEI_ARCH   = IA32
   DXE_ARCH   = X64
 
+[Packages]
+  MinPlatformPkg/MinPlatformPkg.dec
+  BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec
+
+[PcdsFeatureFlag]
+  #
+  # PCD needed for MinPlatform build includes
+  #
+  gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable
|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable   
|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable  
|FALSE
+
+[PcdsDynamicExDefault]
+  gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep|TRUE
+
+#
+# Include common libraries
+#
+!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
+!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
+!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
+
+[LibraryClasses.Common]
+  #
+  # 

[edk2-devel][edk2-platforms][PATCH V2 00/14] Improve feature build consistency

2022-01-19 Thread Oram, Isaac W
This series addresses inconsistencies in feature implementation and use. Some 
inconsistencies are just
conventions of the feature design/template/convention.  Some are inconsistency 
with feature design intent
that negatively affect the usability of the features and the amount of work 
required from board porting
engineers.

V2:
  19/27: Fixed typo in library class name, Usb3DebugPortParamLibo to 
Usb3DebugPortParamLib.
  01/27: Merged 02 into 01 so as to not introduce relative paths in the first 
place.
  Note approved commits 3, 4, 5, 6, 7, 8, 15, 20, 21, 22, 24, and 25 were 
pushed.

V1:

Some features were missing feature enable flags.
Some features had non-functional standalone builds.
Many features were implemented to include common core build content in their 
feature include files.
Updated some of the Readme content.
Added AdvancedFeaturePkg.fdf to build all feature content to support verifying 
no build time issues between features.
Removed duplicate and unused content from build files.
Modified the TemplateFeaturePkg to use the common MinPlatform include content.

Removed all instances where features were relative to Features/Intel and made 
them relative to the package roots.
This does mean PACKAGES_PATH may need to be extended for all the feature 
domains.  Debugging, PowerManagement, etc.
However, it should enable packaging tools to function properly as the relative 
paths violate spec.

Use of the common MinPlatformPkg build includes does increase the build time 
for each individual feature in standalone
build modes. It does not negatively impact board or AdvancedFeaturePkg builds 
as the common content is only built
once. Part of MinPlatform arch intent is to reduce cognitive complexity, so the 
simpler build is more valuable than
fast build time.

Cc: Sai Chaganty 
Cc: Liming Gao 
Cc: Eric Dong 
Cc: Ming Tan 
Cc: Nate DeSimone 
Cc: Chasel Chiu 
Cc: Dandan Bi 
Cc: Miki Shindo 
Cc: Mohamed Abbas 
Cc: Manickavasakam Karpagavinayagam 

Signed-off-by: Isaac Oram 


Isaac Oram (14):
  BeepDebugFeaturePkg: Use MinPlatformPkg build include files
  SmbiosFeaturePkg: Use MinPlatformPkg build include files
  UserAuthFeaturePkg: Fix all relative package paths
  UserAuthFeaturePkg: Use MinPlatformPkg build include files
  VirtualKeyboardFeaturePkg: Fix all relative package paths
  VirtualKeyboardFeaturePkg: Use MinPlatformPkg build include files
  VirtualKeyboardFeaturePkg: Add feature enable PCD
  LogoFeaturePkg: Use MinPlatformPkg build include files
  PostCodeDebugFeaturePkg: Complete as an advanced feature
  AcpiDebugFeaturePkg: Use MinPlatformPkg build include files
  Usb3DebugFeaturePkg: Align with feature design guidelines
  AdvancedFeaturePkg: Add missing features
  AdvancedFeaturePkg/Build: Add FDF to create FV for all features
  WhitleyOpenBoardPkg/Build: Enable Features/Intel features

 Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc   
   |  67 +-
 Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.fdf   
   |  49 +
 Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc 
   |  36 ++-
 Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc  
   |  64 +-
 Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf   
   |  36 ++-
 Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf
   |  36 ++-
 Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dsc   
   |  21 ++
 Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc  
   |  70 --
 Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf
   |   4 +-
 Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec   
   |   7 +-
 Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dsc   
   |  28 +++
 Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc  
   | 222 ++-
 Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepLib.h 
   |   6 +-
 Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PostMemory.fdf
   |  14 ++
 Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PreMemory.fdf 
   |  13 ++
 
Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf

[edk2-devel][edk2-platforms][PATCH V2 07/14] VirtualKeyboardFeaturePkg: Add feature enable PCD

2022-01-19 Thread Oram, Isaac W
VirtualKeyboard missing feature enable PCD.

Cc: Liming Gao 
Cc: Dandan Bi 

Signed-off-by: Isaac Oram 
---
 Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/PostMemory.fdf  
  | 2 +-
 
Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardFeaturePkg.dec
 | 7 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git 
a/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/PostMemory.fdf 
b/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/PostMemory.fdf
index f40b5087e8..31a9a6c35d 100644
--- 
a/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/PostMemory.fdf
+++ 
b/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/Include/PostMemory.fdf
@@ -7,4 +7,4 @@
 #
 ##
 
-  INF VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/VirtualKeyboardDxe.inf
+INF VirtualKeyboardFeaturePkg/VirtualKeyboardDxe/VirtualKeyboardDxe.inf
diff --git 
a/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardFeaturePkg.dec
 
b/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardFeaturePkg.dec
index c26db01f09..d4b5d67783 100644
--- 
a/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardFeaturePkg.dec
+++ 
b/Features/Intel/UserInterface/VirtualKeyboardFeaturePkg/VirtualKeyboardFeaturePkg.dec
@@ -22,5 +22,10 @@
   Include
 
 [Guids]
+  gVirtualKeyboardFeaturePkgTokenSpaceGuid= { 0x7a9af74f, 0x27ca, 
0x4834, { 0xa7, 0xd4, 0x62, 0x63, 0xf0, 0xe5, 0x7a, 0xd0 } }
+
   ## GUID used for VirtualKeyboardDriver to open TouchPanel protocol.
-  gEdkiiTouchPanelGuid = { 0x91b1d27b, 0xe126, 
0x48d1, { 0x82, 0x34, 0xd2, 0x8b, 0x81, 0xc8, 0x83, 0x62 }}
+  gEdkiiTouchPanelGuid= { 0x91b1d27b, 0xe126, 
0x48d1, { 0x82, 0x34, 0xd2, 0x8b, 0x81, 0xc8, 0x83, 0x62 }}
+
+[PcdsFeatureFlag]
+  
gVirtualKeyboardFeaturePkgTokenSpaceGuid.PcdVirtualKeyboardFeatureEnable|FALSE|BOOLEAN|0x0001
-- 
2.27.0.windows.1



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




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Use BaseCpuTimerLib for Universal Payload by default

2022-01-19 Thread Zhiguang Liu
Hi Guo ,
yes, I know it is merged, and I have some update based on that change.
I get comments from Ray, and he suggests using BaseCpuTimerLib for Universal 
Payload by default.
The reason is that we only want to enable UPL on latest CPUs and they should 
all support the BaseCpuTimerLib. (qemu is the exception, and can be special 
handled by change its Macro)
I was convinced by Ray, so I send patch to modify the default value.
Sorry for changing the same content so soon.

BTW, seems I missed devel@edk2.groups.io when I 
sent the patch. Include it in the thread.

Thanks
Zhiguang


发件人: Dong, Guo 
发送时间: 星期三, 一月 19, 2022 11:36 下午
收件人: Liu, Zhiguang
抄送: Ni, Ray; Ma, Maurice; You, Benjamin
主题: RE: [PATCH] UefiPayloadPkg: Use BaseCpuTimerLib for Universal Payload by 
default

Hi Zhiguang,

This patch was merged  on Monday. Did you make any changes to get this email?

Thanks,
Guo

-Original Message-
From: Liu, Zhiguang 
Sent: Wednesday, January 19, 2022 2:17 AM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Ni, Ray ; Ma, Maurice 
; You, Benjamin 
Subject: [PATCH] UefiPayloadPkg: Use BaseCpuTimerLib for Universal Payload by 
default

Current, a macro CPU_TIMER_LIB_ENABLE is added to determine which timerlib is 
used. BaseCpuTimerLib.inf is a better way and only fit for recent CPU.
Meanwhile, Universal Payload are only aimed to work with recent CPU.
Therefore, for Universal Payload, use the BaseCpuTimerLib by default

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Zhiguang Liu 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 65c1bd610e..1ce96a51c1 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -111,10 +111,10 @@
   DEFINE SERIAL_DRIVER_ENABLE = TRUE   DEFINE PERFORMANCE_MEASUREMENT_ENABLE  
= FALSE -  # For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp 
Counter.-  # This is recommended way to get the time, and also how 
BaseCpuTimerLib works.-  # However, some CPU doesn't support this feature, so 
disable it by default.-  DEFINE CPU_TIMER_LIB_ENABLE  = FALSE+  # For recent 
X86 CPU, 0x15 CPUID instruction will return Time Stamp Counter Frequence.+  # 
This is how BaseCpuTimerLib works, and a recommended way to get Frequence, so 
set the default value as TRUE.+  # Note: for emulation platform such as QEMU, 
this may not work and should set it as FALSE+  DEFINE CPU_TIMER_LIB_ENABLE  = 
TRUE  [BuildOptions]   *_*_*_CC_FLAGS = -D 
DISABLE_NEW_DEPRECATED_INTERFACES@@ -222,7 +222,7 @@
   #   # Platform   #-!if $(CPU_TIMER_LIB_ENABLE) == TRUE+!if 
$(CPU_TIMER_LIB_ENABLE) == TRUE && $(UNIVERSAL_PAYLOAD) == TRUE   
TimerLib|UefiCpuPkg/Library/CpuTimerLib/BaseCpuTimerLib.inf !else   
TimerLib|UefiPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf--
2.32.0.windows.2


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#85842): https://edk2.groups.io/g/devel/message/85842
Mute This Topic: https://groups.io/mt/88530668/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] Add maintainers for advanced features

2022-01-19 Thread Oram, Isaac W
Reviewed-by: Isaac Oram 

-Original Message-
From: Chaganty, Rangasai V  
Sent: Wednesday, January 19, 2022 4:04 PM
To: Desimone, Nathaniel L ; devel@edk2.groups.io
Cc: Oram, Isaac W ; Gao, Liming 
; Kinney, Michael D 
Subject: RE: [PATCH v1] Add maintainers for advanced features

Reviewed-by: Sai Chaganty 

-Original Message-
From: Desimone, Nathaniel L  
Sent: Wednesday, January 19, 2022 3:59 PM
To: devel@edk2.groups.io
Cc: Chaganty, Rangasai V ; Oram, Isaac W 
; Gao, Liming ; Kinney, 
Michael D 
Subject: [PATCH v1] Add maintainers for advanced features

Add maintainers to Features/Intel to enable expedient approval of new advanced 
features.

Cc: Sai Chaganty 
Cc: Isaac Oram 
Cc: Liming Gao 
Cc: Michael D Kinney 
Signed-off-by: Nate DeSimone 
---
 Maintainers.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Maintainers.txt b/Maintainers.txt index a6ce4eee0f..8dcc34ed0c 
100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -148,6 +148,8 @@ M: Pedro Falcato   Features/Intel
 F: Features/Intel/
 M: Sai Chaganty 
+M: Isaac Oram 
+M: Nate DeSimone 
 R: Liming Gao 
 
 Features/Intel/Debugging
--
2.27.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#85841): https://edk2.groups.io/g/devel/message/85841
Mute This Topic: https://groups.io/mt/88548334/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] Add maintainers for advanced features

2022-01-19 Thread Chaganty, Rangasai V
Reviewed-by: Sai Chaganty 

-Original Message-
From: Desimone, Nathaniel L  
Sent: Wednesday, January 19, 2022 3:59 PM
To: devel@edk2.groups.io
Cc: Chaganty, Rangasai V ; Oram, Isaac W 
; Gao, Liming ; Kinney, 
Michael D 
Subject: [PATCH v1] Add maintainers for advanced features

Add maintainers to Features/Intel to enable expedient approval of new advanced 
features.

Cc: Sai Chaganty 
Cc: Isaac Oram 
Cc: Liming Gao 
Cc: Michael D Kinney 
Signed-off-by: Nate DeSimone 
---
 Maintainers.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Maintainers.txt b/Maintainers.txt index a6ce4eee0f..8dcc34ed0c 
100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -148,6 +148,8 @@ M: Pedro Falcato   Features/Intel
 F: Features/Intel/
 M: Sai Chaganty 
+M: Isaac Oram 
+M: Nate DeSimone 
 R: Liming Gao 
 
 Features/Intel/Debugging
--
2.27.0.windows.1



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




[edk2-devel] [PATCH v1] Add maintainers for advanced features

2022-01-19 Thread Nate DeSimone
Add maintainers to Features/Intel to enable expedient approval
of new advanced features.

Cc: Sai Chaganty 
Cc: Isaac Oram 
Cc: Liming Gao 
Cc: Michael D Kinney 
Signed-off-by: Nate DeSimone 
---
 Maintainers.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Maintainers.txt b/Maintainers.txt
index a6ce4eee0f..8dcc34ed0c 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -148,6 +148,8 @@ M: Pedro Falcato 
 Features/Intel
 F: Features/Intel/
 M: Sai Chaganty 
+M: Isaac Oram 
+M: Nate DeSimone 
 R: Liming Gao 
 
 Features/Intel/Debugging
-- 
2.27.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#85839): https://edk2.groups.io/g/devel/message/85839
Mute This Topic: https://groups.io/mt/88548334/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 V1 01/27] BeepDebugFeaturePkg: Use MinPlatformPkg build include files

2022-01-19 Thread Nate DeSimone
Reviewed-by: Nate DeSimone 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Oram, Isaac W
Sent: Tuesday, January 11, 2022 6:20 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Chaganty, Rangasai V 
; Gao, Liming ; Dong, 
Eric ; Tan, Ming 
Subject: [edk2-devel][edk2-platforms][PATCH V1 01/27] BeepDebugFeaturePkg: Use 
MinPlatformPkg build include files

The BeepDebugFeaturePkg was malformed and did not build anything and thus 
wasn't testable in standalone build.

Added gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable
to properly control the advanced feature inclusion.

Use the standard MinPlatform includes for core libraries. This increases the 
build time, but reduces complexity when integrating into a board build. Board 
build optimization is more valuable than standalone build optimization.

Enable standalone build to test the library build and the component builds 
using edk2 StatusCodeHandler drivers.

Add unique file names for the StatusCodeHandler components to avoid collisions 
with any existing board handlers when incorporated in board DSC and FDF files.

Add PreMemory.fdf and PostMemory.fdf content for including in board FDF or 
AdvancedFeaturePkg in the future.

Removed unused sections in DSC and FDF to reduce file clutter.

Removed stale file header content from prior proprietary licensing.

Moved feature customization and common include into the package DSC file to 
reduce board complexity when BeepDebugFeature.dsc is included.

Removed the FixedAtBuild build control for beep feature as it would be 
redundant with the FeatureFlag control of the whole feature. Build control is 
via PcdBeepDebugFeatureEnable and dynamic control is via PcdStatusCodeUseBeep.

Improved Readme content, format, and coding style use.

Cc: Sai Chaganty 
Cc: Liming Gao 
Cc: Eric Dong 
Cc: Ming Tan 

Signed-off-by: Isaac Oram 
---
 Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec   
  |   7 +-
 Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dsc   
  |  28 +++
 Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc  
  | 222 ++--
 Features/Intel/Debugging/BeepDebugFeaturePkg/Include/Library/BeepLib.h 
  |   6 +-
 Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PostMemory.fdf
  |  14 ++
 Features/Intel/Debugging/BeepDebugFeaturePkg/Include/PreMemory.fdf 
  |  13 ++
 
Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf
|   5 +-
 
Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf
 |   3 -
 
Features/Intel/Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf
|   3 -
 Features/Intel/Debugging/BeepDebugFeaturePkg/Readme.md 
  |  91 +---
 10 files changed, 186 insertions(+), 206 deletions(-)

diff --git 
a/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec 
b/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec
index 4f4b36b091..d90611da51 100644
--- a/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec
+++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.d
+++ ec
@@ -31,6 +31,9 @@
 [Guids]
   gBeepDebugFeaturePkgTokenSpaceGuid  =  {0x54f56fb5, 0xea0e, 0x4518, {0xa0, 
0x3e, 0x1b, 0xeb, 0x56, 0x94, 0xd2, 0x16}}
 
-[PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
+[PcdsFeatureFlag]
+  
+gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable|FALSE|BOOL
+EAN|0x
+
+[PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
   # Beep is a legacy feature, disabled it by default
-  
gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep|FALSE|BOOLEAN|0x0001
+  
+ gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep|TRUE|BOOLEAN|0
+ x0001
diff --git 
a/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dsc 
b/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dsc
index 47254f9974..56cad020bf 100644
--- a/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.dsc
+++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/BeepDebugFeaturePkg.d
+++ sc
@@ -24,6 +24,34 @@
   PEI_ARCH   = IA32
   DXE_ARCH   = X64
 
+[Packages]
+  MinPlatformPkg/MinPlatformPkg.dec
+  BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec
+
+[PcdsFeatureFlag]
+  #
+  # PCD needed for MinPlatform build includes
+  #
+  gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable
|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable   
|FALSE
+  

Re: [edk2-devel][edk2-platforms][PATCH V1 18/27] AcpiDebugFeaturePkg: Use MinPlatformPkg build include files

2022-01-19 Thread Nate DeSimone
Reviewed-by: Nate DeSimone 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Oram, Isaac W
Sent: Tuesday, January 11, 2022 6:20 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Dong, Eric ; 
Gao, Liming 
Subject: [edk2-devel][edk2-platforms][PATCH V1 18/27] AcpiDebugFeaturePkg: Use 
MinPlatformPkg build include files

Use the MinPlatformPkg common core build files to build libraries needed by 
this feature.

Cc: Eric Dong 
Cc: Liming Gao 

Signed-off-by: Isaac Oram 
---
 Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dsc  | 21 
++
 Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc | 70 

 Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf   |  4 
+-
 3 files changed, 23 insertions(+), 72 deletions(-)

diff --git 
a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dsc 
b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dsc
index 62cc559d8f..3b76d39ea8 100644
--- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dsc
+++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.d
+++ sc
@@ -24,6 +24,27 @@
   PEI_ARCH   = IA32
   DXE_ARCH   = X64
 
+[Packages]
+  MinPlatformPkg/MinPlatformPkg.dec
+
+#
+# Since there are no 32b libraries or components in this package, these 
+PCD are specified for 64b only # [PcdsFeatureFlag.X64]
+  #
+  # PCD needed for MinPlatform build includes
+  #
+  gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable
|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable   
|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable  
|FALSE
+
+#
+# Include common libraries
+#
+!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
+!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
+!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
+
 #
 # This package always builds the feature.
 #
diff --git 
a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc 
b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc
index b142978be1..f5b8bacee0 100644
--- a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc
+++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeat
+++ ure.dsc
@@ -25,45 +25,6 @@
   !error "DXE_ARCH must be specified to build this feature!"
 !endif
 
-
-#
-# Library Class section - list of all Library Classes needed by this feature.
-#
-
-
-!include MdePkg/MdeLibs.dsc.inc
-
-[LibraryClasses]
-  ###
-  # Edk2 Packages
-  ###
-  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
-  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
-  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
-  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
-  DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
-  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
-  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
-  
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
-  
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
-  UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
-  
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
-
-[LibraryClasses.common.DXE_DRIVER,LibraryClasses.common.DXE_RUNTIME_DRIVER]
-  ###
-  # Edk2 Packages
-  ###
-  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
-  
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
-
-[LibraryClasses.common.DXE_SMM_DRIVER]
-  ###
-  # Edk2 Packages
-  ###
-  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
-  
MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf
-  
SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf
-
 

 #
 # Component section - list of all components that need built for this feature.
@@ -78,22 +39,6 @@
 #   generated for it, but the binary will not be put into any firmware 
volume.
 #
 

-#
-# Feature PEI Components
-#
-
-# @todo: Change below line to [Components.$(PEI_ARCH)] after 
https://bugzilla.tianocore.org/show_bug.cgi?id=2308
-#is completed.
-[Components.IA32]
-  #
-  # ACPI Debug Feature Package
-  #
-
-  

Re: [edk2-devel][edk2-platforms][PATCH V1 00/27] Improve feature build consistency

2022-01-19 Thread Nate DeSimone
Hi Isaac,

Thank you for digging into the PEI_ARCH/DXE_ARCH issue. It is unfortunate that 
issue is not totally solved in BaseTools yet. With that new knowledge, Patch 1 
and 18 are now approved. Please fix patch 19 and resend it. I think that should 
complete the series.

Thanks,
Nate

-Original Message-
From: Oram, Isaac W  
Sent: Thursday, January 13, 2022 11:34 AM
To: Desimone, Nathaniel L ; devel@edk2.groups.io
Cc: Chaganty, Rangasai V ; Gao, Liming 
; Dong, Eric ; Tan, Ming 
; Chiu, Chasel ; Bi, Dandan 
; Shindo, Miki ; Abbas, Mohamed 
; KARPAGAVINAYAGAM, MANICKAVASAKAM 

Subject: RE: [edk2-devel][edk2-platforms][PATCH V1 00/27] Improve feature build 
consistency

Inline discussion continues.

Regards,
Isaac

-Original Message-
From: Desimone, Nathaniel L 
Sent: Wednesday, January 12, 2022 7:54 PM
To: Oram, Isaac W ; devel@edk2.groups.io
Cc: Chaganty, Rangasai V ; Gao, Liming 
; Dong, Eric ; Tan, Ming 
; Chiu, Chasel ; Bi, Dandan 
; Shindo, Miki ; Abbas, Mohamed 
; KARPAGAVINAYAGAM, MANICKAVASAKAM 

Subject: RE: [edk2-devel][edk2-platforms][PATCH V1 00/27] Improve feature build 
consistency

Hi Isaac,

Comments inline.

Thanks,
Nate

-Original Message-
From: Oram, Isaac W 
Sent: Wednesday, January 12, 2022 7:15 PM
To: Desimone, Nathaniel L ; devel@edk2.groups.io
Cc: Chaganty, Rangasai V ; Gao, Liming 
; Dong, Eric ; Tan, Ming 
; Chiu, Chasel ; Bi, Dandan 
; Shindo, Miki ; Abbas, Mohamed 
; KARPAGAVINAYAGAM, MANICKAVASAKAM 

Subject: RE: [edk2-devel][edk2-platforms][PATCH V1 00/27] Improve feature build 
consistency

Thanks Nate.

Comments in line.

Regards,
Isaac

-Original Message-
From: Desimone, Nathaniel L 
Sent: Wednesday, January 12, 2022 6:47 PM
To: Oram, Isaac W ; devel@edk2.groups.io
Cc: Chaganty, Rangasai V ; Gao, Liming 
; Dong, Eric ; Tan, Ming 
; Chiu, Chasel ; Bi, Dandan 
; Shindo, Miki ; Abbas, Mohamed 
; KARPAGAVINAYAGAM, MANICKAVASAKAM 

Subject: RE: [edk2-devel][edk2-platforms][PATCH V1 00/27] Improve feature build 
consistency

Hi Isaac,

Thank you for doing this cleanup work. I have some comments for you. I have 
provided a summary of my feedback below:

PATCH 01/27

* Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc

Line 69: [Components.IA32] should be changed to [Components.$(PEI_ARCH)] Line 
83: [Components.X64] should be changed to [Components.$(DXE_ARCH)]

Note: These comments can also be addressed by restoring the @todo comment 
stating that these changes still need to be done (which you deleted.)

[Isaac] $(DXE_ARCH) and $(PEI_ARCH) are not fully functional.  It appears that 
they are fine in DSC files, even when inside an include.  But they are not fine 
inside an include in an FDF file.  The PreMemory.fdf and PostMemory.fdf do not 
work when I try to introduce this change.  
As these are not required, ToDo are against coding style and are bad for 
comprehensibility, I would prefer to not add such useless comments back in.  
Comments should improve the comprehensibility of code and should not distract 
from understanding the code.

[Nate] The $(PEI_ARCH)/$(DXE_ARCH) additions are not be necessary in the FDF 
files. Adding them to the DSC file should be sufficient. Can you re-test with 
just the DSC file change?

[Isaac] I can't make the build work with a macros in the DSC.  FDF parsing 
throws an error.  I misspoke slightly in the prior comment, it is not the FDF 
include that is the problem.  It is the DSC include.

The macros aren't used in the FDF, but the presence of the included macro 
somehow interferes with the FDF parser determining the architecture for 
components.  It only seems to work without DSC includes.

If I use $(DXE_ARCH) in an includable DSC file, the FDF parsing throws this 
kind of error:  For example modifying AcpiDebugFeature.dsc to use $(DXE_ARCH) 
Standalone build works fine (no FDF) Enabling in a board build, you get:
build.py...
 : error F001: Module 
o:\edk2-platforms\Features\Intel\Debugging\AcpiDebugFeaturePkg\AcpiDebugDxeSmm\AcpiDebugDxe.inf
 NOT found in DSC file; Is it really a binary module?

If I move the [Components.$(DXE_ARCH)] to the platform DSC file, then the build 
succeeds.

I have submitted a bug to document this issue:  
https://bugzilla.tianocore.org/show_bug.cgi?id=3803



PATCH 18/27

* Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dsc

Line 33: [PcdsFeatureFlag.X64] should be changed to 
[PcdsFeatureFlag.$(DXE_ARCH)]

Note: This comment can also be addressed by adding a @todo comment stating that 
this change still needs to be done.
[Isaac] See prior response.

PATCH 19/27

* Features/Intel/Debugging/Usb3DebugFeaturePkg/Include/Usb3DebugFeature.dsc

Line 35: Typo here. Usb3DebugPortParamLibo should be Usb3DebugPortParamLib.
[Isaac] Good catch.  I guess we don't catch that class of error if the library 
class is not used.

* Features/Intel/Debugging/Usb3DebugFeaturePkg/Usb3DebugFeaturePkg.dsc

Line 40: Did you test compilation for the 

[edk2-devel] [PATCH 2/2] OvmfPkg/BaseMemEncryptLib: use the SEV_STATUS MSR value from workarea

2022-01-19 Thread Brijesh Singh via groups.io
Improve the MemEncryptSev{Es,Snp}IsEnabled() to use the SEV_STATUS MSR
value saved in the workarea. Since workarea is valid until the PEI phase,
so, for the Dxe phase use the PcdConfidentialComputingGuestAttr to
determine which SEV technology is enabled.

Cc: Min Xu 
Cc: Jiewen Yao 
Cc: Tom Lendacky 
Cc: Jordan Justen 
Cc: Ard Biesheuvel 
Cc: Erdem Aktas 
Cc: Gerd Hoffmann 
Signed-off-by: Brijesh Singh 
---
 .../DxeMemEncryptSevLib.inf   |   1 +
 .../PeiMemEncryptSevLib.inf   |   1 +
 .../SecMemEncryptSevLib.inf   |   1 +
 .../DxeMemEncryptSevLibInternal.c | 142 --
 .../PeiMemEncryptSevLibInternal.c | 139 ++---
 .../SecMemEncryptSevLibInternal.c |  80 +-
 6 files changed, 150 insertions(+), 214 deletions(-)

diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf 
b/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf
index f613bb314f5f..35b7d519d938 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf
@@ -58,3 +58,4 @@ [FeaturePcd]
 
 [Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask
+  gEfiMdePkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr
diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf 
b/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf
index 50c83859d7e7..714da3323765 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf
@@ -58,6 +58,7 @@ [FeaturePcd]
 
 [FixedPcd]
   gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase
+  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecValidatedEnd
diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLib.inf 
b/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLib.inf
index 939af0a91ea4..284e5acc1177 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLib.inf
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLib.inf
@@ -52,3 +52,4 @@ [LibraryClasses]
 
 [FixedPcd]
   gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase
+  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase
diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c 
b/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c
index 15fcd5529587..25768daf5467 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c
@@ -16,83 +16,77 @@
 #include 
 #include 
 #include 
-
-STATIC BOOLEAN  mSevStatus= FALSE;
-STATIC BOOLEAN  mSevEsStatus  = FALSE;
-STATIC BOOLEAN  mSevSnpStatus = FALSE;
-STATIC BOOLEAN  mSevStatusChecked = FALSE;
+#include 
 
 STATIC UINT64   mSevEncryptionMask  = 0;
 STATIC BOOLEAN  mSevEncryptionMaskSaved = FALSE;
 
 /**
-  Reads and sets the status of SEV features.
+  The function check if the specified Attr is set.
 
-  **/
+  @param[in]  CurrentAttr   The current attribute.
+  @param[in]  Attr  The attribute to check.
+
+  @retval  TRUE  The specified Attr is set.
+  @retval  FALSE The specified Attr is not set.
+
+**/
+STATIC
+BOOLEAN
+AmdMemEncryptionAttrCheck (
+  IN  UINT64 CurrentAttr,
+  IN  CONFIDENTIAL_COMPUTING_GUEST_ATTR  Attr
+  )
+{
+  switch (Attr) {
+case CCAttrAmdSev:
+  //
+  // SEV is automatically enabled if SEV-ES or SEV-SNP is active.
+  //
+  return CurrentAttr >= CCAttrAmdSev;
+case CCAttrAmdSevEs:
+  //
+  // SEV-ES is automatically enabled if SEV-SNP is active.
+  //
+  return CurrentAttr >= CCAttrAmdSevEs;
+case CCAttrAmdSevSnp:
+  return CurrentAttr == CCAttrAmdSevSnp;
+default:
+  return FALSE;
+  }
+}
+
+/**
+  Check if the specified confidential computing attribute is active.
+
+  @param[in]  Attr  The attribute to check.
+
+  @retval TRUE   The specified Attr is active.
+  @retval FALSE  The specified Attr is not active.
+
+**/
 STATIC
-VOID
+BOOLEAN
 EFIAPI
-InternalMemEncryptSevStatus (
-  VOID
+ConfidentialComputingGuestHas (
+  IN  CONFIDENTIAL_COMPUTING_GUEST_ATTR  Attr
   )
 {
-  UINT32RegEax;
-  MSR_SEV_STATUS_REGISTER   Msr;
-  CPUID_MEMORY_ENCRYPTION_INFO_EAX  Eax;
-  BOOLEAN   ReadSevMsr;
-  UINT64EncryptionMask;
-
-  ReadSevMsr = FALSE;
-
-  EncryptionMask = PcdGet64 (PcdPteMemoryEncryptionAddressOrMask);
-  if (EncryptionMask != 0) {
-//
-// The MSR has been read before, so it is safe to read it again and avoid
-// having to validate the CPUID information.
-//
-ReadSevMsr = TRUE;
-  } else {
-//
-// Check if memory encryption leaf exist

[edk2-devel] [PATCH 1/2] OvmfPkg/ResetVector: cache the SEV status MSR value in workarea

2022-01-19 Thread Brijesh Singh via groups.io
In order to probe the SEV feature the BaseMemEncryptLib and Reset vector
reads the SEV_STATUS MSR. Cache the value on the first read in the
workarea. In the next patches the value saved in the workarea will
be used by the BaseMemEncryptLib. This not only eliminates the extra
MSR reads it also helps cleaning up the code in BaseMemEncryptLib.

Cc: Min Xu 
Cc: Jiewen Yao 
Cc: Tom Lendacky 
Cc: Jordan Justen 
Cc: Ard Biesheuvel 
Cc: Erdem Aktas 
Cc: Gerd Hoffmann 
Signed-off-by: Brijesh Singh 
---
 OvmfPkg/Include/WorkArea.h  | 12 +--
 OvmfPkg/Sec/AmdSev.c|  2 +-
 OvmfPkg/ResetVector/Ia32/AmdSev.asm | 38 +
 OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm |  3 +-
 OvmfPkg/ResetVector/ResetVector.nasmb   |  3 ++
 5 files changed, 39 insertions(+), 19 deletions(-)

diff --git a/OvmfPkg/Include/WorkArea.h b/OvmfPkg/Include/WorkArea.h
index ce60d97aa886..d982e026def7 100644
--- a/OvmfPkg/Include/WorkArea.h
+++ b/OvmfPkg/Include/WorkArea.h
@@ -46,12 +46,20 @@ typedef struct _CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER {
 // any changes must stay in sync with its usage.
 //
 typedef struct _SEC_SEV_ES_WORK_AREA {
-  UINT8 SevEsEnabled;
-  UINT8 Reserved1[7];
+  //
+  // Hold the SevStatus MSR value read by OvmfPkg/ResetVector/Ia32/AmdSev.c
+  //
+  UINT64SevStatusMsrValue;
 
   UINT64RandomData;
 
   UINT64EncryptionMask;
+
+  //
+  // Indicator that the VC handler is called. It is used during the SevFeature
+  // detection in OvmfPkg/ResetVector/Ia32/AmdSev.c
+  //
+  UINT8 ReceivedVc;
 } SEC_SEV_ES_WORK_AREA;
 
 //
diff --git a/OvmfPkg/Sec/AmdSev.c b/OvmfPkg/Sec/AmdSev.c
index 499d0c27d8fa..d8fd35650d7d 100644
--- a/OvmfPkg/Sec/AmdSev.c
+++ b/OvmfPkg/Sec/AmdSev.c
@@ -278,7 +278,7 @@ SevEsIsEnabled (
 
   SevEsWorkArea = (SEC_SEV_ES_WORK_AREA *)FixedPcdGet32 (PcdSevEsWorkAreaBase);
 
-  return (SevEsWorkArea->SevEsEnabled != 0);
+  return ((SevEsWorkArea->SevStatusMsrValue & BIT1) != 0);
 }
 
 /**
diff --git a/OvmfPkg/ResetVector/Ia32/AmdSev.asm 
b/OvmfPkg/ResetVector/Ia32/AmdSev.asm
index 1f827da3b929..864d68385342 100644
--- a/OvmfPkg/ResetVector/Ia32/AmdSev.asm
+++ b/OvmfPkg/ResetVector/Ia32/AmdSev.asm
@@ -157,8 +157,9 @@ SevClearPageEncMaskForGhcbPage:
 jnz   SevClearPageEncMaskForGhcbPageExit
 
 ; Check if SEV-ES is enabled
-cmp   byte[SEV_ES_WORK_AREA], 1
-jnz   SevClearPageEncMaskForGhcbPageExit
+mov   ecx, 1
+bt[SEV_ES_WORK_AREA_STATUS_MSR], ecx
+jnc   SevClearPageEncMaskForGhcbPageExit
 
 ;
 ; The initial GHCB will live at GHCB_BASE and needs to be un-encrypted.
@@ -219,12 +220,16 @@ GetSevCBitMaskAbove31Exit:
 ; If SEV is disabled then EAX will be zero.
 ;
 CheckSevFeatures:
-; Set the first byte of the workarea to zero to communicate to the SEC
-; phase that SEV-ES is not enabled. If SEV-ES is enabled, the CPUID
-; instruction will trigger a #VC exception where the first byte of the
-; workarea will be set to one or, if CPUID is not being intercepted,
-; the MSR check below will set the first byte of the workarea to one.
-mov byte[SEV_ES_WORK_AREA], 0
+;
+; Clear the workarea, if SEV is enabled then later part of routine
+; will populate the workarea fields.
+;
+movecx, SEV_ES_WORK_AREA_SIZE
+moveax, SEV_ES_WORK_AREA
+ClearSevEsWorkArea:
+movbyte [eax], 0
+inceax
+loop   ClearSevEsWorkArea
 
 ;
 ; Set up exception handlers to check for SEV-ES
@@ -265,6 +270,10 @@ CheckSevFeatures:
 ; Set the work area header to indicate that the SEV is enabled
 mov byte[WORK_AREA_GUEST_TYPE], 1
 
+; Save the SevStatus MSR value in the workarea
+mov [SEV_ES_WORK_AREA_STATUS_MSR], eax
+mov [SEV_ES_WORK_AREA_STATUS_MSR + 4], edx
+
 ; Check for SEV-ES memory encryption feature:
 ; CPUID  Fn8000_001F[EAX] - Bit 3
 ;   CPUID raises a #VC exception if running as an SEV-ES guest
@@ -280,10 +289,6 @@ CheckSevFeatures:
 bteax, 1
 jnc   GetSevEncBit
 
-; Set the first byte of the workarea to one to communicate to the SEC
-; phase that SEV-ES is enabled.
-mov   byte[SEV_ES_WORK_AREA], 1
-
 GetSevEncBit:
 ; Get pte bit position to enable memory encryption
 ; CPUID Fn8000_001F[EBX] - Bits 5:0
@@ -313,7 +318,10 @@ NoSev:
 ;
 ; Perform an SEV-ES sanity check by seeing if a #VC exception occurred.
 ;
-cmp   byte[SEV_ES_WORK_AREA], 0
+; If SEV-ES is enabled, the CPUID instruction will trigger a #VC exception
+; where the RECEIVED_VC offset in the workarea will be set to one.
+;
+cmp   byte[SEV_ES_WORK_AREA_RECEIVED_VC], 0
 jzNoSevPass
 
 ;
@@ -407,9 +415,9 @@ SevEsIdtVmmComm:
 ; If we're here, then we are an SEV-ES guest and this
 ; was triggered by a CPUID instruction
 ;
-; Set the first byte of the workarea to one to communicate that
+; 

[edk2-devel] [PATCH 0/2] SEV BaseMemEncryptLib cleanup

2022-01-19 Thread Brijesh Singh via groups.io
This is the first of cleanup for SEV MemEncryptLib. The library uses
the CPUID followed by the MSR read to determine whether SEV is enabled.

Now that we have a workarea concept, the logic can be simplified to
store the msr status in workarea and use that to build PCDs and then
later simply use the PCDs instead of going through the CPUID and RDMSR.

The complete branch is available at
  https://github.com/codomania/edk2/tree/sev-workarea-cleanup

Brijesh Singh (2):
  OvmfPkg/ResetVector: cache the SEV status MSR value in workarea
  OvmfPkg/BaseMemEncryptLib: use the SEV_STATUS MSR value from workarea

 .../DxeMemEncryptSevLib.inf   |   1 +
 .../PeiMemEncryptSevLib.inf   |   1 +
 .../SecMemEncryptSevLib.inf   |   1 +
 OvmfPkg/Include/WorkArea.h|  12 +-
 .../DxeMemEncryptSevLibInternal.c | 142 --
 .../PeiMemEncryptSevLibInternal.c | 139 ++---
 .../SecMemEncryptSevLibInternal.c |  80 +-
 OvmfPkg/Sec/AmdSev.c  |   2 +-
 OvmfPkg/ResetVector/Ia32/AmdSev.asm   |  38 +++--
 OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm   |   3 +-
 OvmfPkg/ResetVector/ResetVector.nasmb |   3 +
 11 files changed, 189 insertions(+), 233 deletions(-)

-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#85834): https://edk2.groups.io/g/devel/message/85834
Mute This Topic: https://groups.io/mt/88547250/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] MdeModulePkg/BdsDxe: Update BdsEntry to use Variable Policy

2022-01-19 Thread Rebecca Cran
Oh, thanks! It turns out there was one remaining use in MdeModulePkg, by 
UefiBootManagerLib.


I've sent the following patch to fix it: [PATCH 1/1] 
MdeModulePkg/UefiBootManagerLib: Convert BmLoadOption to Variable Policy .



--
Rebecca Cran


On 1/18/22 23:30, gaoliming wrote:

Rebecca:
   It has been merged @ d9a7612f8d1da197883bd1cb9f91f229522d39b1

Thanks
Liming

-邮件原件-
发件人: Rebecca Cran 
发送时间: 2022年1月19日 8:18
收件人: devel@edk2.groups.io; gaolim...@byosoft.com.cn;
kenlautn...@gmail.com
抄送: 'Jian J Wang' ; 'Hao A Wu'
; 'Zhichao Gao' ; 'Ray Ni'

主题: Re: [edk2-devel] 回复: [PATCH v2 1/1] MdeModulePkg/BdsDxe:
Update BdsEntry to use Variable Policy

It looks like the BZ associated with this change is
https://bugzilla.tianocore.org/show_bug.cgi?id=3421 .

It would be nice to get this fix committed, to stop the loud deprecated
interface messages.


--
Rebecca Cran


On 6/16/21 18:58, gaoliming wrote:

Ken:
Thanks for your update. Please also update
MdeModulePkg\Universal\BdsDxe\Bds.h to remove #include
, because EDKII_VARIABLE_LOCK_PROTOCOL is

not used

any more.

Thanks
Liming

-邮件原件-
发件人: kenlautn...@gmail.com 
发送时间: 2021年6月17日 6:45
收件人: devel@edk2.groups.io
抄送: Jian J Wang ; Hao A Wu
; Zhichao Gao ; Ray Ni
; Liming Gao 
主题: [PATCH v2 1/1] MdeModulePkg/BdsDxe: Update BdsEntry to use
Variable Policy

From: Ken Lautner 

Changed BdsEntry.c to use Variable Policy instead of Variable Lock
as Variable Lock will be Deprecated eventually

Cc: Jian J Wang 
Cc: Hao A Wu 
Cc: Zhichao Gao 
Cc: Ray Ni 
Cc: Liming Gao 
Signed-off-by: Kenneth Lautner 

Reviewed-by Liming Gao 
---
   MdeModulePkg/Universal/BdsDxe/BdsDxe.inf |  4 +++-
   MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 20

+++-

   2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
index 9310b4dccb18..76ff6a0f5fc3 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
+++ b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
@@ -50,6 +50,8 @@
 BaseMemoryLib

 DebugLib

 UefiBootManagerLib

+  VariablePolicyLib

+  VariablePolicyHelperLib

 PlatformBootManagerLib

 PcdLib

 PrintLib

@@ -77,7 +79,7 @@
   [Protocols]

 gEfiBdsArchProtocolGuid   ## PRODUCES

 gEfiSimpleTextInputExProtocolGuid ## CONSUMES

-  gEdkiiVariableLockProtocolGuid##
SOMETIMES_CONSUMES

+  gEdkiiVariablePolicyProtocolGuid  ##
SOMETIMES_CONSUMES

 gEfiDeferredImageLoadProtocolGuid ## CONSUMES



   [FeaturePcd]

diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
index 83b773a2fa5f..13c10bdc5bf8 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -15,6 +15,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
   #include "Bds.h"

   #include "Language.h"

   #include "HwErrRecSupport.h"

+#include 



   #define SET_BOOT_OPTION_SUPPORT_KEY_COUNT(a, c) {  \

 (a) = ((a) & ~EFI_BOOT_OPTION_SUPPORT_COUNT) | (((c) <<
LowBitSet32 (EFI_BOOT_OPTION_SUPPORT_COUNT)) &
EFI_BOOT_OPTION_SUPPORT_COUNT); \

@@ -670,7 +671,7 @@ BdsEntry (
 EFI_STATUS  Status;

 UINT32  BootOptionSupport;

 UINT16  BootTimeOut;

-  EDKII_VARIABLE_LOCK_PROTOCOL*VariableLock;

+  EDKII_VARIABLE_POLICY_PROTOCOL  *VariablePolicy;

 UINTN   Index;

 EFI_BOOT_MANAGER_LOAD_OPTIONLoadOption;

 UINT16  *BootNext;

@@ -716,12 +717,21 @@ BdsEntry (
 //

 // Mark the read-only variables if the Variable Lock protocol exists

 //

-  Status = gBS->LocateProtocol (, NULL,
(VOID **) );

-  DEBUG ((EFI_D_INFO, "[BdsDxe] Locate Variable Lock protocol - %r\n",
Status));

+  Status = gBS->LocateProtocol(, NULL,
(VOID**));

+  DEBUG((DEBUG_INFO, "[BdsDxe] Locate Variable Policy protocol

- %r\n",

Status));

 if (!EFI_ERROR (Status)) {

   for (Index = 0; Index < ARRAY_SIZE (mReadOnlyVariables); Index++)

{

-  Status = VariableLock->RequestToLock (VariableLock,
mReadOnlyVariables[Index], );

-  ASSERT_EFI_ERROR (Status);

+  Status = RegisterBasicVariablePolicy(

+ VariablePolicy,

+ ,

+ mReadOnlyVariables[Index],

+ VARIABLE_POLICY_NO_MIN_SIZE,

+ VARIABLE_POLICY_NO_MAX_SIZE,

+ VARIABLE_POLICY_NO_MUST_ATTR,

+ VARIABLE_POLICY_NO_CANT_ATTR,

+ VARIABLE_POLICY_TYPE_LOCK_NOW

+ );

+  ASSERT_EFI_ERROR(Status);

   }

 }



--
2.31.1.windows.1












-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#85832): https://edk2.groups.io/g/devel/message/85832
Mute This Topic: https://groups.io/mt/88529480/21656
Group Owner: 

[edk2-devel] [PATCH 1/1] MdeModulePkg/UefiBootManagerLib: Convert BmLoadOption to Variable Policy

2022-01-19 Thread Rebecca Cran
Since the Variable Lock protocol is deprecated, convert locking of
PlatformRecovery in EfiBootManagerLoadOptionToVariable to use the
Variable Policy protocol.

Cc: Jian J Wang 
Cc: Liming Gao 
Cc: Zhichao Gao 
Cc: Ray Ni 

Signed-off-by: Rebecca Cran 
---
 MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c | 33 
+---
 MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h   |  1 -
 MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf |  3 +-
 3 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c 
b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
index 32a9cbb425fa..2087f0b91df7 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
@@ -9,6 +9,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 #include "InternalBm.h"
 
+#include 
+
 GLOBAL_REMOVE_IF_UNREFERENCED
 CHAR16  *mBmLoadOptionName[] = {
   L"Driver",
@@ -169,15 +171,15 @@ EfiBootManagerLoadOptionToVariable (
   IN CONST EFI_BOOT_MANAGER_LOAD_OPTION  *Option
   )
 {
-  EFI_STATUSStatus;
-  UINTN VariableSize;
-  UINT8 *Variable;
-  UINT8 *Ptr;
-  CHAR16OptionName[BM_OPTION_NAME_LEN];
-  CHAR16*Description;
-  CHAR16NullChar;
-  EDKII_VARIABLE_LOCK_PROTOCOL  *VariableLock;
-  UINT32VariableAttributes;
+  EFI_STATUS  Status;
+  UINTN   VariableSize;
+  UINT8   *Variable;
+  UINT8   *Ptr;
+  CHAR16  OptionName[BM_OPTION_NAME_LEN];
+  CHAR16  *Description;
+  CHAR16  NullChar;
+  EDKII_VARIABLE_POLICY_PROTOCOL  *VariablePolicy;
+  UINT32  VariableAttributes;
 
   if ((Option->OptionNumber == LoadOptionNumberUnassigned) ||
   (Option->FilePath == NULL) ||
@@ -242,9 +244,18 @@ structure.
 //
 // Lock the PlatformRecovery
 //
-Status = gBS->LocateProtocol (, NULL, (VOID 
**));
+Status = gBS->LocateProtocol (, NULL, 
(VOID **));
 if (!EFI_ERROR (Status)) {
-  Status = VariableLock->RequestToLock (VariableLock, OptionName, 
);
+  Status = RegisterBasicVariablePolicy (
+ VariablePolicy,
+ ,
+ OptionName,
+ VARIABLE_POLICY_NO_MIN_SIZE,
+ VARIABLE_POLICY_NO_MAX_SIZE,
+ VARIABLE_POLICY_NO_MUST_ATTR,
+ VARIABLE_POLICY_NO_CANT_ATTR,
+ VARIABLE_POLICY_TYPE_LOCK_NOW
+ );
   ASSERT_EFI_ERROR (Status);
 }
 
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h 
b/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h
index a9b0d485cace..b7dfe2a7e0bd 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h
+++ b/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h
@@ -39,7 +39,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf 
b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
index cf5908692fa7..fe05d5f1cc9d 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
+++ b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
@@ -62,6 +62,7 @@
   PerformanceLib
   HiiLib
   SortLib
+  VariablePolicyHelperLib
 
 [Guids]
   ## SOMETIMES_CONSUMES ## SystemTable (The identifier of memory type 
information type in system table)
@@ -99,7 +100,7 @@
   gEfiDevicePathProtocolGuid## SOMETIMES_CONSUMES
   gEfiBootLogoProtocolGuid  ## SOMETIMES_CONSUMES
   gEfiSimpleTextInputExProtocolGuid ## SOMETIMES_CONSUMES
-  gEdkiiVariableLockProtocolGuid## SOMETIMES_CONSUMES
+  gEdkiiVariablePolicyProtocolGuid  ## SOMETIMES_CONSUMES
   gEfiGraphicsOutputProtocolGuid## SOMETIMES_CONSUMES
   gEfiUsbIoProtocolGuid ## SOMETIMES_CONSUMES
   gEfiNvmExpressPassThruProtocolGuid## SOMETIMES_CONSUMES
-- 
2.31.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#85831): https://edk2.groups.io/g/devel/message/85831
Mute This Topic: https://groups.io/mt/88544752/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] FmpDevicePkg/FmpDxe: Update FmpDeviceCheckImageWithStatus() handling

2022-01-19 Thread Michael Kubacki

Hi Guomin,

It has been a couple of weeks since your review and I have not seen the 
patch merged yet.


Do you know when it will be merged?

Thanks,
Michael

On 1/6/2022 10:45 PM, Guomin Jiang wrote:

Reviewed-by: Guomin Jiang 

Guomin


-Original Message-
From: mikub...@linux.microsoft.com 
Sent: Wednesday, January 5, 2022 4:38 AM
To: devel@edk2.groups.io
Cc: Gao, Liming ; Kinney, Michael D
; Jiang, Guomin ;
Xu, Wei6 
Subject: [PATCH v1 1/1] FmpDevicePkg/FmpDxe: Update
FmpDeviceCheckImageWithStatus() handling

From: Michael Kubacki 

Update the logic handling last attempt status codes from
FmpDeviceCheckImageWithStatus() implementations to account for cases
when the function return status code is EFI_SUCCESS (since the image was
checked successfully) but the ImageUpdatable value is not valid.

In addition the following sentence is removed from the LastAttemptStatus
parameter definition for
FmpDeviceCheckImageWithStatus() since it can lead to confusion.
The expected status code value range is sufficient to implement the library
API.

   "This value will only be checked when this
function returns an error."

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Guomin Jiang 
Cc: Wei6 Xu 
Signed-off-by: Michael Kubacki 
---
  FmpDevicePkg/FmpDxe/FmpDxe.c | 23 +++-
  FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLib.c |  3 +--
  FmpDevicePkg/Include/Library/FmpDeviceLib.h  |  3 +--
  3 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c
b/FmpDevicePkg/FmpDxe/FmpDxe.c index 197df28c8dd6..1e7ec4a09e16
100644
--- a/FmpDevicePkg/FmpDxe/FmpDxe.c
+++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
@@ -1040,8 +1040,19 @@ CheckTheImageInternal (
//
Status = FmpDeviceCheckImageWithStatus UINT8 *)Image) +
AllHeaderSize), RawSize, ImageUpdatable, LastAttemptStatus);
if (EFI_ERROR (Status)) {
+// The image cannot be valid if an error occurred checking the image
+if (*ImageUpdatable == IMAGE_UPDATABLE_VALID) {
+  *ImageUpdatable = IMAGE_UPDATABLE_INVALID;
+}
+
  DEBUG ((DEBUG_ERROR, "FmpDxe(%s): CheckTheImage() - FmpDeviceLib
CheckImage failed. Status = %r\n", mImageIdName, Status));
+  }

+  //
+  // Only validate the library last attempt status code if the image is not
updatable.
+  // This specifically avoids converting LAST_ATTEMPT_STATUS_SUCCESS if it
set for an updatable image.
+  //
+  if (*ImageUpdatable != IMAGE_UPDATABLE_VALID) {
  //
  // LastAttemptStatus returned from the device library should fall within
the designated error range
  // [LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MIN_ERROR_CODE_VALUE,
LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MAX_ERROR_CODE_VALUE]
@@ -1049,12 +1060,12 @@ CheckTheImageInternal (
  if ((*LastAttemptStatus <
LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MIN_ERROR_CODE_VALUE) ||
  (*LastAttemptStatus >
LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MAX_ERROR_CODE_VALUE))
  {
-  DEBUG (
-(DEBUG_ERROR,
- "FmpDxe(%s): CheckTheImage() - LastAttemptStatus %d from
FmpDeviceCheckImageWithStatus() is invalid.\n",
- mImageIdName,
- *LastAttemptStatus)
-);
+  DEBUG ((
+DEBUG_ERROR,
+"FmpDxe(%s): CheckTheImage() - LastAttemptStatus %d from
FmpDeviceCheckImageWithStatus() is invalid.\n",
+mImageIdName,
+*LastAttemptStatus
+));
*LastAttemptStatus = LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL;
  }
}
diff --git a/FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLib.c
b/FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLib.c
index 2e5c17b2b0f9..82219e87a430 100644
--- a/FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLib.c
+++ b/FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLib.c
@@ -434,8 +434,7 @@ FmpDeviceCheckImage (
  IMAGE_UPDATABLE_VALID_WITH_VENDOR_CODE
@param[out] LastAttemptStatus   A pointer to a UINT32 that holds the last
attempt
status to report back to the ESRT table in 
case
-  of error. This value will only be checked 
when this
-  function returns an error.
+  of error.

The return status code must fall in the 
range of

LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MIN_ERROR_CODE_VALUE to
diff --git a/FmpDevicePkg/Include/Library/FmpDeviceLib.h
b/FmpDevicePkg/Include/Library/FmpDeviceLib.h
index a14406abe8b5..f82ef64503fa 100644
--- a/FmpDevicePkg/Include/Library/FmpDeviceLib.h
+++ b/FmpDevicePkg/Include/Library/FmpDeviceLib.h
@@ -421,8 +421,7 @@ FmpDeviceCheckImage (
  IMAGE_UPDATABLE_VALID_WITH_VENDOR_CODE
@param[out] LastAttemptStatus   A pointer to a UINT32 that holds the last
attempt
status to report back to the ESRT table in 
case
-  of error. This value will only be checked 
when 

Re: [edk2-devel][edk2-platforms][PATCH V1 25/27] WhitleyOpenBoardPkg/Build: Use common SPI FV Header include

2022-01-19 Thread Oram, Isaac W
Pushed as 6e4384833e..b2503a71a3

-Original Message-
From: Desimone, Nathaniel L  
Sent: Wednesday, January 12, 2022 6:51 PM
To: Oram, Isaac W ; devel@edk2.groups.io
Cc: Chiu, Chasel 
Subject: RE: [edk2-devel][edk2-platforms][PATCH V1 25/27] 
WhitleyOpenBoardPkg/Build: Use common SPI FV Header include

Reviewed-by: Nate DeSimone 

> -Original Message-
> From: Oram, Isaac W 
> Sent: Tuesday, January 11, 2022 6:20 PM
> To: devel@edk2.groups.io
> Cc: Oram, Isaac W ; Desimone, Nathaniel L 
> ; Chiu, Chasel 
> Subject: [edk2-devel][edk2-platforms][PATCH V1 25/27]
> WhitleyOpenBoardPkg/Build: Use common SPI FV Header include
> 
> Use the MinPlatformPkg version of CommonSpiFvHeaderInfo.fdf.
> 
> Cc: Nate DeSimone 
> Cc: Chasel Chiu 
> 
> Signed-off-by: Isaac Oram 
> ---
> 
> Platform/Intel/WhitleyOpenBoardPkg/Include/Fdf/CommonSpiFvHeaderInf
> o.fdf | 24 --
>  Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.fdf  |
> 48 ++--
>  Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.fdf   | 48
> ++--
>  3 files changed, 48 insertions(+), 72 deletions(-)
> 
> diff --git
> a/Platform/Intel/WhitleyOpenBoardPkg/Include/Fdf/CommonSpiFvHeaderI
> nfo.fdf
> b/Platform/Intel/WhitleyOpenBoardPkg/Include/Fdf/CommonSpiFvHeaderI
> nfo.fdf
> deleted file mode 100644
> index 08f8b95938..00
> ---
> a/Platform/Intel/WhitleyOpenBoardPkg/Include/Fdf/CommonSpiFvHeaderI
> nfo.fdf
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -## @file CommonSpiFvHeaderInfo.fdf
> -#
> -# @copyright
> -# Copyright 2020 - 2021 Intel Corporation.  -# -# SPDX-License-
> Identifier: BSD-2-Clause-Patent -##
> -
> -FvAlignment= 16 #FV alignment and FV attributes setting.
> -ERASE_POLARITY = 1
> -MEMORY_MAPPED  = TRUE
> -STICKY_WRITE   = TRUE
> -LOCK_CAP   = TRUE
> -LOCK_STATUS= TRUE
> -WRITE_DISABLED_CAP = TRUE
> -WRITE_ENABLED_CAP  = TRUE
> -WRITE_STATUS   = TRUE
> -WRITE_LOCK_CAP = TRUE
> -WRITE_LOCK_STATUS  = TRUE
> -READ_DISABLED_CAP  = TRUE
> -READ_ENABLED_CAP   = TRUE
> -READ_STATUS= TRUE
> -READ_LOCK_CAP  = TRUE
> -READ_LOCK_STATUS   = TRUE
> diff --git
> a/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.fdf
> b/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.fdf
> index 70ceaa1889..0b919b5ea9 100644
> --- a/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.fdf
> +++ b/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.fdf
> @@ -394,13 +394,13 @@ SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize = 0x0100
> 
> ##
> ##
> 
>  [FV.FvSecurityPreMemory]
> -  !include WhitleyOpenBoardPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
> +  !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
>FvNameGuid = 40ab290f-8494-41cf-b302-31b178b4ce0b
> 
>!include 
> MinPlatformPkg/Include/Fdf/CoreSecurityPreMemoryInclude.fdf
> 
>  [FV.FvPreMemory]
> -  !include WhitleyOpenBoardPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
> +  !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
>FvNameGuid = 6522280D-28F9-4131-ADC4-F40EBFA45864
> 
>INF  UefiCpuPkg/SecCore/SecCore.inf @@ -481,13 +481,13 @@ SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize = 0x0100
>}
> 
>  [FV.FvAdvancedPreMemory]
> -  !include WhitleyOpenBoardPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
> +  !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
>FvNameGuid = 09f25d44-b2ef-4225-8b2e-e0e094b51775
> 
>!include AdvancedFeaturePkg/Include/PreMemory.fdf
> 
>  [FV.FvBspPreMemory]
> -  !include WhitleyOpenBoardPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
> +  !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
>FvNameGuid = e6c65995-8c2d-4119-a52d-7dbf1acb45a1
> 
>FILE FV_IMAGE = 09f25d44-b2ef-4225-8b2e-e0e094b51775 { @@ -498,11 
> +498,11 @@ SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize = 0x0100
>  # FvPostMemory includes common hardware, common core variable 
> services, load and invoke DXE etc  #  [FV.FvPostMemoryUncompressed]
> -  !include WhitleyOpenBoardPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
> +  !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
>FvNameGuid = B4705B4B-0BE6-4BDB-A83A-51CAD2345CEA
> 
>  [FV.FvPostMemory]
> -  !include WhitleyOpenBoardPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
> +  !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
>FvNameGuid = 3298afc4-c484-47f1-a65a-5917a54b5e8c
> 
>FILE FV_IMAGE = B4705B4B-0BE6-4BDB-A83A-51CAD2345CEA { @@ -515,11 
> +515,11 @@ SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize = 0x0100
>  # FvBsp includes board specific components  #  [FV.FvBspUncompressed]
> -  !include WhitleyOpenBoardPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
> +  !include 

Re: [edk2-devel][edk2-platforms][PATCH V1 24/27] MinPlatformPkg/Build: Add an include file for the common SPI FV info

2022-01-19 Thread Oram, Isaac W
Pushed as dd5139c6a6..6e4384833e

-Original Message-
From: Chaganty, Rangasai V  
Sent: Thursday, January 13, 2022 10:02 PM
To: Oram, Isaac W ; devel@edk2.groups.io
Cc: Desimone, Nathaniel L ; Gao, Liming 
; Dong, Eric 
Subject: RE: [edk2-devel][edk2-platforms][PATCH V1 24/27] MinPlatformPkg/Build: 
Add an include file for the common SPI FV info

Reviewed-by: Sai Chaganty 

-Original Message-
From: Oram, Isaac W  
Sent: Tuesday, January 11, 2022 6:20 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Chaganty, Rangasai V 
; Desimone, Nathaniel L 
; Gao, Liming ; Dong, 
Eric 
Subject: [edk2-devel][edk2-platforms][PATCH V1 24/27] MinPlatformPkg/Build: Add 
an include file for the common SPI FV info

This include file allows for elimination of a lot of duplicate code and makes 
FDF files more readable.

Cc: Sai Chaganty 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: Isaac Oram 
---
 Platform/Intel/MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf | 24 

 1 file changed, 24 insertions(+)

diff --git 
a/Platform/Intel/MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf 
b/Platform/Intel/MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
new file mode 100644
index 00..fdda085a41
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fd
+++ f
@@ -0,0 +1,24 @@
+## @file CommonSpiFvHeaderInfo.fdf
+#
+# @copyright
+# Copyright (C) 2020 - 2021 Intel Corporation # # 
+SPDX-License-Identifier: BSD-2-Clause-Patent ##
+
+FvAlignment= 16 #FV alignment and FV attributes setting.
+ERASE_POLARITY = 1
+MEMORY_MAPPED  = TRUE
+STICKY_WRITE   = TRUE
+LOCK_CAP   = TRUE
+LOCK_STATUS= TRUE
+WRITE_DISABLED_CAP = TRUE
+WRITE_ENABLED_CAP  = TRUE
+WRITE_STATUS   = TRUE
+WRITE_LOCK_CAP = TRUE
+WRITE_LOCK_STATUS  = TRUE
+READ_DISABLED_CAP  = TRUE
+READ_ENABLED_CAP   = TRUE
+READ_STATUS= TRUE
+READ_LOCK_CAP  = TRUE
+READ_LOCK_STATUS   = TRUE
--
2.27.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#85828): https://edk2.groups.io/g/devel/message/85828
Mute This Topic: https://groups.io/mt/88365353/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 V1 22/27] AdvancedFeaturePkg: Fix all relative package paths

2022-01-19 Thread Oram, Isaac W
Pushed as 92228e9e4b..dd5139c6a6

-Original Message-
From: Chaganty, Rangasai V  
Sent: Thursday, January 13, 2022 9:39 PM
To: Oram, Isaac W ; devel@edk2.groups.io
Cc: Gao, Liming 
Subject: RE: [edk2-devel][edk2-platforms][PATCH V1 22/27] AdvancedFeaturePkg: 
Fix all relative package paths

Reviewed-by: Sai Chaganty 

-Original Message-
From: Oram, Isaac W  
Sent: Tuesday, January 11, 2022 6:20 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Chaganty, Rangasai V 
; Gao, Liming 
Subject: [edk2-devel][edk2-platforms][PATCH V1 22/27] AdvancedFeaturePkg: Fix 
all relative package paths

Packages should be at the root of a PACKAGES_PATH entry.
At some point, paths were relative to edk2-platforms/Features/Intel which was 
functional, but interferes with the proper functioning of packaging tools.

Cc: Sai Chaganty 
Cc: Liming Gao 

Signed-off-by: Isaac Oram 
---
 Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc | 15 
---
 Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf   | 15 
---
 Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf| 15 
---
 3 files changed, 24 insertions(+), 21 deletions(-)

diff --git a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc 
b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc
index ac9ab80e8e..874b8ce7db 100644
--- a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc
+++ b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc
@@ -14,45 +14,46 @@
 # Debug Advanced Features
 #
 !if gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable == TRUE
-  !include Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc
+  !include AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc
 !endif
+
 !if gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable == TRUE
-  !include Debugging/Usb3DebugFeaturePkg/Include/Usb3DebugFeature.dsc
+  !include Usb3DebugFeaturePkg/Include/Usb3DebugFeature.dsc
 !endif
 
 #
 # Network Advanced Features
 #
 !if gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable == TRUE
-  !include Network/NetworkFeaturePkg/Include/NetworkFeature.dsc
+  !include NetworkFeaturePkg/Include/NetworkFeature.dsc
 !endif
 
 #
 # Out-of-Band Management Advanced Features  #  !if 
gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable == TRUE
-  !include OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc
+  !include IpmiFeaturePkg/Include/IpmiFeature.dsc
 !endif
 
 #
 # Power Management Advanced Features
 #
 !if gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable == TRUE
-  !include PowerManagement/S3FeaturePkg/Include/S3Feature.dsc
+  !include S3FeaturePkg/Include/S3Feature.dsc
 !endif
 
 #
 # System Information Advanced Features
 #
 !if gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable == TRUE
-  !include SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc
+  !include SmbiosFeaturePkg/Include/SmbiosFeature.dsc
 !endif
 
 #
 # User Interface Advanced Features
 #
 !if gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable == 
TRUE
-  !include UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc
+  !include UserAuthFeaturePkg/Include/UserAuthFeature.dsc
 !endif
 
 !if gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable == TRUE diff --git 
a/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf 
b/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf
index c49a0fd875..e710fe7f01 100644
--- a/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf
+++ b/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf
@@ -15,45 +15,46 @@
 # Debug Advanced Features
 #
 !if gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable == TRUE
-  !include Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf
+  !include AcpiDebugFeaturePkg/Include/PostMemory.fdf
 !endif
+
 !if gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable == TRUE
-  !include Debugging/Usb3DebugFeaturePkg/Include/PostMemory.fdf
+  !include Usb3DebugFeaturePkg/Include/PostMemory.fdf
 !endif
 
 #
 # Network Advanced Features
 #
 !if gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable == TRUE
-  !include Network/NetworkFeaturePkg/Include/PostMemory.fdf
+  !include NetworkFeaturePkg/Include/PostMemory.fdf
 !endif
 
 #
 # Out-of-Band Management Advanced Features  #  !if 
gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable == TRUE
-  !include OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf
+  !include IpmiFeaturePkg/Include/PostMemory.fdf
 !endif
 
 #
 # Power Management Advanced Features
 #
 !if gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable == TRUE
-  !include PowerManagement/S3FeaturePkg/Include/PostMemory.fdf
+  !include S3FeaturePkg/Include/PostMemory.fdf
 !endif
 
 #
 # System Information Advanced Features
 #
 !if gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable == TRUE
-  !include SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf
+  !include SmbiosFeaturePkg/Include/PostMemory.fdf
 !endif
 
 #
 # User 

Re: [edk2-devel][edk2-platforms][PATCH V1 21/27] TemplateFeaturePkg: Use MinPlatform build include files

2022-01-19 Thread Oram, Isaac W
Pushed as 2082072cc8..92228e9e4b

-Original Message-
From: Chaganty, Rangasai V  
Sent: Thursday, January 13, 2022 10:06 PM
To: Oram, Isaac W ; devel@edk2.groups.io
Cc: Gao, Liming 
Subject: RE: [edk2-devel][edk2-platforms][PATCH V1 21/27] TemplateFeaturePkg: 
Use MinPlatform build include files

Reviewed-by: Sai Chaganty 

-Original Message-
From: Oram, Isaac W  
Sent: Tuesday, January 11, 2022 6:20 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Chaganty, Rangasai V 
; Gao, Liming 
Subject: [edk2-devel][edk2-platforms][PATCH V1 21/27] TemplateFeaturePkg: Use 
MinPlatform build include files

Extend the template to leverage common library build files.

Cc: Sai Chaganty 
Cc: Liming Gao 

Signed-off-by: Isaac Oram 
---
 Features/Intel/TemplateFeaturePkg/Include/TemplateFeature.dsc |  2 +-
 Features/Intel/TemplateFeaturePkg/TemplateFeaturePkg.dsc  | 18 
++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/Features/Intel/TemplateFeaturePkg/Include/TemplateFeature.dsc 
b/Features/Intel/TemplateFeaturePkg/Include/TemplateFeature.dsc
index 6742eddcf9..dd6d033aca 100644
--- a/Features/Intel/TemplateFeaturePkg/Include/TemplateFeature.dsc
+++ b/Features/Intel/TemplateFeaturePkg/Include/TemplateFeature.dsc
@@ -73,7 +73,7 @@
 #is completed.
 [Components.IA32]
   #
-  #  Feature Package
+  #  Feature Package
   #
 
   # Add library instances here that are not included in package components and 
should be tested diff --git 
a/Features/Intel/TemplateFeaturePkg/TemplateFeaturePkg.dsc 
b/Features/Intel/TemplateFeaturePkg/TemplateFeaturePkg.dsc
index 0ce8debee0..03657047dc 100644
--- a/Features/Intel/TemplateFeaturePkg/TemplateFeaturePkg.dsc
+++ b/Features/Intel/TemplateFeaturePkg/TemplateFeaturePkg.dsc
@@ -24,6 +24,24 @@
   PEI_ARCH   = IA32
   DXE_ARCH   = X64
 
+[Packages]
+  MinPlatformPkg/MinPlatformPkg.dec
+
+[PcdsFeatureFlag]
+  #
+  # PCD needed for MinPlatform build includes
+  #
+  gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable
|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable   
|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable  
|FALSE
+
+#
+# Include common libraries
+#
+!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
+!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
+!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
+
 #
 # This package always builds the feature.
 #
--
2.27.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#85826): https://edk2.groups.io/g/devel/message/85826
Mute This Topic: https://groups.io/mt/88365331/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 V1 20/27] SpcrFeaturePkg: Use MinPlatform build include files

2022-01-19 Thread Oram, Isaac W
Pushed as d0919cab63..2082072cc8

-Original Message-
From: Chaganty, Rangasai V  
Sent: Thursday, January 13, 2022 10:10 PM
To: Oram, Isaac W ; devel@edk2.groups.io
Cc: Gao, Liming 
Subject: RE: [edk2-devel][edk2-platforms][PATCH V1 20/27] SpcrFeaturePkg: Use 
MinPlatform build include files

Reviewed-by: Sai Chaganty 

-Original Message-
From: Oram, Isaac W 
Sent: Tuesday, January 11, 2022 6:20 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Chaganty, Rangasai V 
; Gao, Liming 
Subject: [edk2-devel][edk2-platforms][PATCH V1 20/27] SpcrFeaturePkg: Use 
MinPlatform build include files

Also added feature enable flag

Cc: Sai Chaganty 
Cc: Liming Gao 

Signed-off-by: Isaac Oram 
---
 
Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/Library/SpcrDeviceLib.h
 |  2 +-
 Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PostMemory.fdf   
   | 13 
 Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PreMemory.fdf
   | 11 
 Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/SpcrFeature.dsc  
   | 62 
 Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Readme.md
   | 12 ++--
 Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dec   
   |  6 ++
 Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dsc   
   | 18 ++
 7 files changed, 55 insertions(+), 69 deletions(-)

diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/Library/SpcrDeviceLib.h
 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/Library/SpcrDeviceLib.h
index 947813815e..2e50270ee6 100644
--- 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/Library/SpcrDeviceLib.h
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/Library/
+++ SpcrDeviceLib.h
@@ -12,7 +12,7 @@
 
 /**
   Get a Serial Port device used for SPCR.
-  The caller should call FreePool() to free the memory if return value is not 
NULL.
+  The caller should call FreePool () to free the memory if return value is not 
NULL.
 
   @retval NULL  Can not get device.
   @retval OthersA serial port device path.
diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PostMemory.fdf 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PostMemory.fdf
new file mode 100644
index 00..f963f567c2
--- /dev/null
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PostMemo
+++ ry.fdf
@@ -0,0 +1,13 @@
+## @file
+#  FDF file for post-memory SpcrFeature advanced feature.
+#
+#  This file is intended to be included into another package so 
+advanced features #  can be conditionally included in the flash image 
+by enabling the respective #  feature via its FeaturePCD.
+#
+# Copyright (C) 2022 Intel Corporation.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent ##
+
+INF SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf
diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PreMemory.fdf 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PreMemory.fdf
new file mode 100644
index 00..3c461e7fbc
--- /dev/null
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PreMemor
+++ y.fdf
@@ -0,0 +1,11 @@
+## @file
+#  FDF file for pre-memory SpcrFeature advanced feature.
+#
+#  This file is intended to be included into another package so 
+advanced features #  can be conditionally included in the flash image 
+by enabling the respective #  feature via its FeaturePCD.
+#
+# Copyright (C) 2022 Intel Corporation.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent ##
diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/SpcrFeature.dsc 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/SpcrFeature.dsc
index c51e552df5..b06ddf4fe6 100644
--- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/SpcrFeature.dsc
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/SpcrFeat
+++ ure.dsc
@@ -25,40 +25,9 @@
   !error "DXE_ARCH must be specified to build this feature!"
 !endif
 
-
-#
-# Library Class section - list of all Library Classes needed by this feature.
-#
-
-
-!include MdePkg/MdeLibs.dsc.inc
-
 [LibraryClasses]
-  ###
-  # Edk2 Packages
-  ###
-  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
-  BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf
-  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
-  
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
-  UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
-  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
-  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
-  

Re: [edk2-devel] [PATCH v2] OvmfPkg/ResetVector: Removing SEV-ES CPUID bit check

2022-01-19 Thread Lendacky, Thomas via groups.io

On 1/13/22 10:30 AM, Peter Gonda wrote:

The SEV-ES bit of Fn800-001F[EAX] - Bit 3 is used for a host to
determine support for running SEV-ES guests. It should not be checked by
a guest to determine if it is running under SEV-ES. The guest should use
the SEV_STATUS MSR Bit 1 to determine if SEV-ES is enabled. This check
was not part of the original SEV-ES support and was added in
a91b700e38. Removing the check makes this code consistent with the
Linux kernel

Fixes: a91b700e38 (Ovmf/ResetVector: Simplify and consolidate the SEV features 
checks)
Cc: James Bottomley 
Cc: Min Xu 
Cc: Jiewen Yao 
Cc: Tom Lendacky 
Cc: Jordan Justen 
Cc: Ard Biesheuvel 
Cc: Laszlo Ersek 
Cc: Erdem Aktas 
Cc: Brijesh Singh 
Cc: Erdem Aktas 
Cc: Marc Orr 
Signed-off-by: Peter Gonda 


Acked-by: Tom Lendacky 


---
  OvmfPkg/ResetVector/Ia32/AmdSev.asm | 8 
  1 file changed, 8 deletions(-)

diff --git a/OvmfPkg/ResetVector/Ia32/AmdSev.asm 
b/OvmfPkg/ResetVector/Ia32/AmdSev.asm
index 1f827da3b9..77692db27e 100644
--- a/OvmfPkg/ResetVector/Ia32/AmdSev.asm
+++ b/OvmfPkg/ResetVector/Ia32/AmdSev.asm
@@ -265,14 +265,6 @@ CheckSevFeatures:
  ; Set the work area header to indicate that the SEV is enabled
  mov byte[WORK_AREA_GUEST_TYPE], 1
  
-; Check for SEV-ES memory encryption feature:

-; CPUID  Fn8000_001F[EAX] - Bit 3
-;   CPUID raises a #VC exception if running as an SEV-ES guest
-mov   eax, 0x801f
-cpuid
-bteax, 3
-jnc   GetSevEncBit
-
  ; Check if SEV-ES is enabled
  ;  MSR_0xC0010131 - Bit 1 (SEV-ES enabled)
  mov   ecx, SEV_STATUS_MSR




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




Re: [edk2-devel] [PATCH v4 1/2] ShellPkg/AcpiView: Adds ACPI_PARSER bitfield parser

2022-01-19 Thread Sami Mujawar

Hi Abdul,

Please also create a bugzilla ticket and add a reference to it in the 
commit message.


Regards,

Sami Mujawar


On 19/01/2022 04:44 PM, Sami Mujawar wrote:


Hi Abdul,

Thank you for providing a patch to add this feature to Acpiview.

I have some minor feedback marked inline as [SAMI].

Regards,

Sami Mujawar


On 19/12/2021 02:44 PM, Abdul Lateef Attar wrote:

Adds ParseAcpiBitFields() which is based on
ParseAcpi() and capable of parsing the bit fields.
Supports parsing of UINT8, UINT16, UINT32 and UINT64 byte data.

Cc: Ray Ni
Cc: Zhichao Gao
Cc: Sami Mujawar
Signed-off-by: Abdul Lateef Attar
---
  ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h |  45 +
  ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c | 185 

  2 files changed, 230 insertions(+)

diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
index 5c916a4720b8..83266e8ec2d3 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
@@ -2,6 +2,7 @@
Header file for ACPI parser

  


Copyright (c) 2016 - 2020, Arm Limited. All rights reserved.

+  Copyright (c) 2021, AMD Incorporated. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

  **/

  


@@ -251,6 +252,11 @@ typedef VOID (EFIAPI *FNPTR_FIELD_VALIDATOR)(UINT8 *Ptr, 
VOID *Context);
the field data. If the field is more complex and requires additional

processing for formatting and representation a print formatter function

can be specified in 'PrintFormatter'.

+

+  ParseAcpiBitFields() uses AcpiParser structure to parse the bit fields.

+  It considers Length as a number of bits that need to be parsed.

+  Also, the Offset field will be considered as starting offset of the bitfield.

+

The PrintFormatter function may choose to use the format string

specified by 'Format' or use its own internal format string.

  


@@ -264,10 +270,12 @@ typedef struct AcpiParser {
  


/// The length of the field.

/// (Byte Length column from ACPI table spec)

+  /// Length(in bits) of the bitfield if used with ParseAcpiBitFields().

UINT32   Length;

  


/// The offset of the field from the start of the table.

/// (Byte Offset column from ACPI table spec)

+  /// The Bit offset of the field if used with ParseAcpiBitFields().

UINT32   Offset;

  


/// Optional Print() style format string for tracing the data. If not

@@ -364,6 +372,43 @@ ParseAcpi (
IN UINT32 ParserItems

);

  


+/**

+  This function is used to parse an ACPI table bitfield buffer.

+

+  The ACPI table buffer is parsed using the ACPI table parser information

+  specified by a pointer to an array of ACPI_PARSER elements. This parser

+  function iterates through each item on the ACPI_PARSER array and logs the 
ACPI table bitfields.

+

+  This function can optionally be used to parse ACPI tables and fetch specific

+  field values. The ItemPtr member of the ACPI_PARSER structure (where used)

+  is updated by this parser function to point to the selected field data

+  (e.g. useful for variable length nested fields).

+

+  @param [in] TraceTrace the ACPI fields TRUE else only parse the

+   table.

+  @param [in] Indent   Number of spaces to indent the output.

+  @param [in] AsciiNameOptional pointer to an ASCII string that describes

+   the table being parsed.

+  @param [in] Ptr  Pointer to the start of the buffer.

+  @param [in] Length   Length of the buffer pointed by Ptr.

+  @param [in] Parser   Pointer to an array of ACPI_PARSER structure that

+   describes the table being parsed.

+  @param [in] ParserItems  Number of items in the ACPI_PARSER array.

+

+  @retval Number of bits parsed.

+**/

+UINT32

+EFIAPI

+ParseAcpiBitFields (

+  IN BOOLEANTrace,

+  IN UINT32 Indent,

+  IN CONST CHAR8*AsciiName OPTIONAL,

+  IN UINT8  *Ptr,

+  IN UINT32 Length,

+  IN CONST ACPI_PARSER  *Parser,

+  IN UINT32 ParserItems

+  );

+

  /**

 This is a helper macro to pass parameters to the Parser functions.

  


diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
index cb193a5ea449..94ee26f42ab9 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
@@ -2,12 +2,14 @@
ACPI parser

  


Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.

+  Copyright (c) 2021, AMD Incorporated. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

  **/

  


  #include 

  #include 

  #include 

+#include 

  #include "AcpiParser.h"

  

Re: [edk2-devel] [PATCH v4 2/2] ShellPkg/AcpiView: PrintFormatter for FADT Flags field

2022-01-19 Thread Sami Mujawar

Hi Abdul,

Thank you for this patch.

These changes look good to me.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar


On 19/12/2021 02:44 PM, Abdul Lateef Attar wrote:

Adds PrintFormatter function to the FADT flags field.
Prints indivisual flag name along with flag value.

Cc: Ray Ni 
Cc: Zhichao Gao 
Cc: Sami Mujawar 
Signed-off-by: Abdul Lateef Attar 
---
  ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c | 167 
+---
  1 file changed, 112 insertions(+), 55 deletions(-)

diff --git 
a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c
index f8fbb4bcb8e9..5ff02f3d38a1 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c
@@ -2,6 +2,7 @@
FADT table parser

  


Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.

+  Copyright (c) 2021, AMD Incorporated. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

  


@par Reference(s):

@@ -130,69 +131,125 @@ ValidateFlags (
   #endif

  }

  


+STATIC CONST ACPI_PARSER  FadtFlagParser[] = {

+  { L"WBINVD",   1,  0,  L"%d", NULL, NULL, NULL, 
NULL },

+  { L"WBINVD_FLUSH", 1,  1,  L"%d", NULL, NULL, NULL, 
NULL },

+  { L"PROC_C1",  1,  2,  L"%d", NULL, NULL, NULL, 
NULL },

+  { L"P_LVL2_UP",1,  3,  L"%d", NULL, NULL, NULL, 
NULL },

+  { L"PWR_BUTTON",   1,  4,  L"%d", NULL, NULL, NULL, 
NULL },

+  { L"SLP_BUTTON",   1,  5,  L"%d", NULL, NULL, NULL, 
NULL },

+  { L"FIX_RTC",  1,  6,  L"%d", NULL, NULL, NULL, 
NULL },

+  { L"RTC_S4",   1,  7,  L"%d", NULL, NULL, NULL, 
NULL },

+  { L"TMR_VAL_EXT",  1,  8,  L"%d", NULL, NULL, NULL, 
NULL },

+  { L"DCK_CAP",  1,  9,  L"%d", NULL, NULL, NULL, 
NULL },

+  { L"RESET_REG_SUP",1,  10, L"%d", NULL, NULL, NULL, 
NULL },

+  { L"SEALED_CASE",  1,  11, L"%d", NULL, NULL, NULL, 
NULL },

+  { L"HEADLESS", 1,  12, L"%d", NULL, NULL, NULL, 
NULL },

+  { L"CPU_SW_SLP",   1,  13, L"%d", NULL, NULL, NULL, 
NULL },

+  { L"PCI_EXP_WAK",  1,  14, L"%d", NULL, NULL, NULL, 
NULL },

+  { L"USE_PLATFORM_CLOCK",   1,  15, L"%d", NULL, NULL, NULL, 
NULL },

+  { L"S4_RTC_STS_VALID", 1,  16, L"%d", NULL, NULL, NULL, 
NULL },

+  { L"REMOTE_POWER_ON_CAPABLE",  1,  17, L"%d", NULL, NULL, NULL, 
NULL },

+  { L"FORCE_APIC_CLUSTER_MODEL", 1,  18, L"%d", NULL, NULL, NULL, 
NULL },

+  { L"FORCE_APIC_PHYSICAL_DESTINATION_MODE", 1,  19, L"%d", NULL, NULL, NULL, 
NULL },

+  { L"HW_REDUCED_ACPI",  1,  20, L"%d", NULL, NULL, NULL, 
NULL },

+  { L"LOW_POWER_S0_IDLE_CAPABLE",1,  21, L"%d", NULL, NULL, NULL, 
NULL },

+  { L"Reserved", 10, 22, L"%d", NULL, NULL, NULL, 
NULL }

+};

+

+/**

+  This function traces FADT Flags fields.

+  If no format string is specified the Format must be NULL.

+

+  @param [in] Format  Optional format string for tracing the data.

+  @param [in] Ptr Pointer to the start of the buffer.

+**/

+VOID

+EFIAPI

+DumpFadtFlags (

+  IN CONST CHAR16  *Format OPTIONAL,

+  IN UINT8 *Ptr

+  )

+{

+  if (Format != NULL) {

+Print (Format, *(UINT32 *)Ptr);

+return;

+  }

+

+  Print (L"0x%X\n", *(UINT32 *)Ptr);

+  ParseAcpiBitFields (

+TRUE,

+2,

+NULL,

+Ptr,

+4,

+PARSER_PARAMS (FadtFlagParser)

+);

+}

+

  /**

An ACPI_PARSER array describing the ACPI FADT Table.

  **/

  STATIC CONST ACPI_PARSER  FadtParser[] = {

PARSE_ACPI_HEADER (),

-  { L"FIRMWARE_CTRL",  4,   36,  L"0x%x",  NULL,(VOID 
**),

+  { L"FIRMWARE_CTRL",  4,   36,  L"0x%x",  NULL,  (VOID 
**),

  ValidateFirmwareCtrl,  NULL },

-  { L"DSDT",   4,   40,  L"0x%x",  NULL,(VOID 
**),  NULL,   NULL },

-  { L"Reserved",   1,   44,  L"%x",NULL,NULL,  
 NULL,   NULL },

-  { L"Preferred_PM_Profile",   1,   45,  L"0x%x",  NULL,NULL,  
 NULL,   NULL },

-  { L"SCI_INT",2,   46,  L"0x%x",  NULL,NULL,  
 NULL,   NULL },

-  { L"SMI_CMD",4,   48,  L"0x%x",  NULL,NULL,  
 NULL,   NULL },

-  { L"ACPI_ENABLE",1,   52,  L"0x%x",  NULL,NULL,  
 NULL,   NULL },

-  { L"ACPI_DISABLE",   

Re: [edk2-devel] [PATCH v4 1/2] ShellPkg/AcpiView: Adds ACPI_PARSER bitfield parser

2022-01-19 Thread Sami Mujawar

Hi Abdul,

Thank you for providing a patch to add this feature to Acpiview.

I have some minor feedback marked inline as [SAMI].

Regards,

Sami Mujawar


On 19/12/2021 02:44 PM, Abdul Lateef Attar wrote:

Adds ParseAcpiBitFields() which is based on
ParseAcpi() and capable of parsing the bit fields.
Supports parsing of UINT8, UINT16, UINT32 and UINT64 byte data.

Cc: Ray Ni 
Cc: Zhichao Gao 
Cc: Sami Mujawar 
Signed-off-by: Abdul Lateef Attar 
---
  ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h |  45 +
  ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c | 185 

  2 files changed, 230 insertions(+)

diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
index 5c916a4720b8..83266e8ec2d3 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
@@ -2,6 +2,7 @@
Header file for ACPI parser

  


Copyright (c) 2016 - 2020, Arm Limited. All rights reserved.

+  Copyright (c) 2021, AMD Incorporated. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

  **/

  


@@ -251,6 +252,11 @@ typedef VOID (EFIAPI *FNPTR_FIELD_VALIDATOR)(UINT8 *Ptr, 
VOID *Context);
the field data. If the field is more complex and requires additional

processing for formatting and representation a print formatter function

can be specified in 'PrintFormatter'.

+

+  ParseAcpiBitFields() uses AcpiParser structure to parse the bit fields.

+  It considers Length as a number of bits that need to be parsed.

+  Also, the Offset field will be considered as starting offset of the bitfield.

+

The PrintFormatter function may choose to use the format string

specified by 'Format' or use its own internal format string.

  


@@ -264,10 +270,12 @@ typedef struct AcpiParser {
  


/// The length of the field.

/// (Byte Length column from ACPI table spec)

+  /// Length(in bits) of the bitfield if used with ParseAcpiBitFields().

UINT32   Length;

  


/// The offset of the field from the start of the table.

/// (Byte Offset column from ACPI table spec)

+  /// The Bit offset of the field if used with ParseAcpiBitFields().

UINT32   Offset;

  


/// Optional Print() style format string for tracing the data. If not

@@ -364,6 +372,43 @@ ParseAcpi (
IN UINT32 ParserItems

);

  


+/**

+  This function is used to parse an ACPI table bitfield buffer.

+

+  The ACPI table buffer is parsed using the ACPI table parser information

+  specified by a pointer to an array of ACPI_PARSER elements. This parser

+  function iterates through each item on the ACPI_PARSER array and logs the 
ACPI table bitfields.

+

+  This function can optionally be used to parse ACPI tables and fetch specific

+  field values. The ItemPtr member of the ACPI_PARSER structure (where used)

+  is updated by this parser function to point to the selected field data

+  (e.g. useful for variable length nested fields).

+

+  @param [in] TraceTrace the ACPI fields TRUE else only parse the

+   table.

+  @param [in] Indent   Number of spaces to indent the output.

+  @param [in] AsciiNameOptional pointer to an ASCII string that describes

+   the table being parsed.

+  @param [in] Ptr  Pointer to the start of the buffer.

+  @param [in] Length   Length of the buffer pointed by Ptr.

+  @param [in] Parser   Pointer to an array of ACPI_PARSER structure that

+   describes the table being parsed.

+  @param [in] ParserItems  Number of items in the ACPI_PARSER array.

+

+  @retval Number of bits parsed.

+**/

+UINT32

+EFIAPI

+ParseAcpiBitFields (

+  IN BOOLEANTrace,

+  IN UINT32 Indent,

+  IN CONST CHAR8*AsciiName OPTIONAL,

+  IN UINT8  *Ptr,

+  IN UINT32 Length,

+  IN CONST ACPI_PARSER  *Parser,

+  IN UINT32 ParserItems

+  );

+

  /**

 This is a helper macro to pass parameters to the Parser functions.

  


diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c 
b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
index cb193a5ea449..94ee26f42ab9 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
@@ -2,12 +2,14 @@
ACPI parser

  


Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.

+  Copyright (c) 2021, AMD Incorporated. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

  **/

  


  #include 

  #include 

  #include 

+#include 

  #include "AcpiParser.h"

  #include "AcpiView.h"

  #include "AcpiViewConfig.h"

@@ -752,3 +754,186 @@ ParseAcpiHeader (
  


return BytesParsed;

  }

+

+/**

+  This function is used to parse 

Re: [edk2-devel] [PATCH 1/1] BaseTools: Enable GNU make parallel jobs by default

2022-01-19 Thread Abner Chang
Hi Steven,
I don't have opinions with enabling GNU parallel job, that is fine if it does 
break the build.
However I am not the maintainer of BaseTools, thus I can't give the review tag 
to this change.

Regards,
Abner


> -Original Message-
> From: Shi, Steven 
> Sent: Wednesday, January 19, 2022 6:52 PM
> To: a...@kernel.org; l...@nuviainc.com; Chang, Abner (HPS SW/FW
> Technologist) ; Schaefer, Daniel (ROM Janitor)
> 
> Cc: Feng, Bob C ; Chen, Christine
> ; devel@edk2.groups.io
> Subject: RE: [edk2-devel] [PATCH 1/1] BaseTools: Enable GNU make parallel
> jobs by default
> 
> Hello Ard, Leif, Abner, Daniel,
> Are you ok to enable the GNU make "--jobs" option in GCC5 toolchain by
> default?
> 
> Thanks
> Steven Shi
> 
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of
> Steven
> > Shi
> > Sent: Monday, January 17, 2022 10:54 PM
> > To: a...@kernel.org; l...@nuviainc.com; Chang, Abner
> > ; Schaefer, Daniel 
> > Cc: Feng, Bob C ; Chen, Christine
> > ; devel@edk2.groups.io
> > Subject: Re: [edk2-devel] [PATCH 1/1] BaseTools: Enable GNU make
> parallel
> > jobs by default
> >
> > Hello Ard, Leif, Abner, Daniel,
> > I changed the GNU make flag to enable the "--jobs" option in GCC5
> toolchain
> > by default for all architectures. Please verify whether this change has
> impact
> > to the ARM and RISCV GCC5 builds. Thanks!
> >
> >
> > Thanks
> > Steven Shi
> >
> > > -Original Message-
> > > From: Shi, Steven 
> > > Sent: Monday, January 17, 2022 10:43 PM
> > > To: devel@edk2.groups.io
> > > Cc: Feng, Bob C ; Chen, Christine
> > > ; a...@kernel.org; l...@nuviainc.com; Chang,
> > > Abner ; Schaefer, Daniel
> > > ; Shi, Steven 
> > > Subject: [PATCH 1/1] BaseTools: Enable GNU make parallel jobs by
> default
> > >
> > > BZ:
> INVALID URI REMOVED
> d=3807__;!!NpxR!2rhlQ-
> hgxbtBujz5kn_RG5uJtBl209CFwFmXOlkS0vqky5LS5Yj8zwGnfwSahMs$
> > >
> > > * Enable GNU make parallel jobs support(--jobs flag) by
> > >   default in GCC5 and CLANGPDB toolchains. This gmake flag
> > >   can save full features bios linux build time by +20%.
> > > * Explictly distinguish and define the MS nmake flag and
> > >   GNU gmake flag in the toolchain which might support
> > >   both, e.g. CLANGPDB can use nmake in Windows and gmake
> > >   in Linux. General make flags cannot work for such hybrid
> > >   make usage scenario.
> > >
> > > Signed-off-by: Steven Shi 
> > > ---
> > >  BaseTools/Conf/tools_def.template  |  4 
> > >  BaseTools/Source/Python/AutoGen/GenMake.py |  5 +++--
> > >  BaseTools/Source/Python/AutoGen/PlatformAutoGen.py | 12
> > > +++-
> > >  3 files changed, 18 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/BaseTools/Conf/tools_def.template
> > > b/BaseTools/Conf/tools_def.template
> > > index 2e6b382ab623..84af08cca6ae 100755
> > > --- a/BaseTools/Conf/tools_def.template
> > > +++ b/BaseTools/Conf/tools_def.template
> > > @@ -2283,6 +2283,8 @@ RELEASE_GCC49_AARCH64_DLINK_XIPFLAGS =
> -
> > z
> > > common-page-size=0x20
> > >  *_GCC5_*_*_FAMILY= GCC
> > >
> > >
> > >
> > >  *_GCC5_*_MAKE_PATH   = DEF(GCC_HOST_PREFIX)make
> > >
> > > +*_GCC5_*_GMAKE_FLAGS = --jobs
> > >
> > > +*_GCC5_*_NMAKE_FLAGS = /nologo
> > >
> > >  *_GCC5_*_*_DLL   = ENV(GCC5_DLL)
> > >
> > >  *_GCC5_*_ASL_PATH= DEF(UNIX_IASL_BIN)
> > >
> > >
> > >
> > > @@ -2742,6 +2744,8 @@ RELEASE_CLANG38_AARCH64_DLINK_FLAGS =
> > > DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl
> > >  *_CLANGPDB_*_*_FAMILY= GCC
> > >
> > >  *_CLANGPDB_*_*_BUILDRULEFAMILY   = CLANGPDB
> > >
> > >  *_CLANGPDB_*_MAKE_PATH   = ENV(CLANG_HOST_BIN)make
> > >
> > > +*_CLANGPDB_*_GMAKE_FLAGS = --jobs
> > >
> > > +*_CLANGPDB_*_NMAKE_FLAGS = /nologo
> > >
> > >  *_CLANGPDB_*_*_DLL   = ENV(CLANGPDB_DLL)
> > >
> > >  *_CLANGPDB_*_ASL_PATH= DEF(UNIX_IASL_BIN)
> > >
> > >
> > >
> > > diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py
> > > b/BaseTools/Source/Python/AutoGen/GenMake.py
> > > index e55efff059f9..c6636d99fc7d 100755
> > > --- a/BaseTools/Source/Python/AutoGen/GenMake.py
> > > +++ b/BaseTools/Source/Python/AutoGen/GenMake.py
> > > @@ -732,10 +732,11 @@ cleanlib:
> > >  Src, Dst = CopyCmd
> > >
> > >  Src = self.ReplaceMacro(Src)
> > >
> > >  Dst = self.ReplaceMacro(Dst)
> > >
> > > +Efi = Src[:-3] + 'efi'
> > >
> > >  if Dst not in self.ResultFileList:
> > >
> > >  self.ResultFileList.append(Dst)
> > >
> > >  if '%s :' %(Dst) not in self.BuildTargetList:
> > >
> > > -self.BuildTargetList.append("%s : %s" %(Dst,Src))
> > >
> > > +self.BuildTargetList.append("%s : %s" %(Dst, 
> > > Efi))
> > >
> > >  

Re: [edk2-devel] [PATCH v5 4/4] Silicon/ARM/NeoverseN1Soc: Remove PciExpressLib use PciSegmentLib instead

2022-01-19 Thread Sami Mujawar

Hi Khasim,

Thank you for this patch.

These changes look good to me.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar


On 22/12/2021 01:14 AM, Khasim Mohammed via groups.io wrote:

The patch removes PciExpressLib implementation for N1Sdp as:

   a) The PciSegmentLib implementation for N1Sdp makes MmioRead() calls
  instead of PciRead() which makes the PciExpressLib redundant.

   b) Since N1Sdp requires multiple segments to be supported, PciExpressLib
  and PciLib cannot be used, PciSegmentLib should be used instead as it
  supports multiple segments.

Signed-off-by: Deepak Pandey 
Signed-off-by: Khasim Syed Mohammed 
---
  Platform/ARM/N1Sdp/N1SdpPlatform.dsc  |4 +-
  .../PciExpressLib.c   | 1589 -
  .../PciExpressLib.inf |   56 -
  3 files changed, 1 insertion(+), 1648 deletions(-)
  delete mode 100644 
Silicon/ARM/NeoverseN1Soc/Library/NeoverseN1SocPciExpressLib/PciExpressLib.c
  delete mode 100644 
Silicon/ARM/NeoverseN1Soc/Library/NeoverseN1SocPciExpressLib/PciExpressLib.inf

diff --git a/Platform/ARM/N1Sdp/N1SdpPlatform.dsc 
b/Platform/ARM/N1Sdp/N1SdpPlatform.dsc
index cb2049966c..8dac1bc54c 100644
--- a/Platform/ARM/N1Sdp/N1SdpPlatform.dsc
+++ b/Platform/ARM/N1Sdp/N1SdpPlatform.dsc
@@ -75,9 +75,7 @@
  [LibraryClasses.common.DXE_DRIVER]
FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf

PciHostBridgeLib|Silicon/ARM/NeoverseN1Soc/Library/PciHostBridgeLib/PciHostBridgeLib.inf
-  PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
-  PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf
-  
PciExpressLib|Silicon/ARM/NeoverseN1Soc/Library/NeoverseN1SocPciExpressLib/PciExpressLib.inf
+  
PciSegmentLib|Silicon/ARM/NeoverseN1Soc/Library/PciSegmentLib/PciSegmentLib.inf
  
  [LibraryClasses.common.DXE_RUNTIME_DRIVER]

BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
diff --git 
a/Silicon/ARM/NeoverseN1Soc/Library/NeoverseN1SocPciExpressLib/PciExpressLib.c 
b/Silicon/ARM/NeoverseN1Soc/Library/NeoverseN1SocPciExpressLib/PciExpressLib.c
deleted file mode 100644
index bb0246b4a9..00
--- 
a/Silicon/ARM/NeoverseN1Soc/Library/NeoverseN1SocPciExpressLib/PciExpressLib.c
+++ /dev/null
@@ -1,1589 +0,0 @@
-/** @file
-  Functions in this library instance make use of MMIO functions in IoLib to
-  access memory mapped PCI configuration space.
-
-  All assertions for I/O operations are handled in MMIO functions in the IoLib
-  Library.
-
-  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-
-  On the NeoverseN1Soc, a slave error is generated when host accesses the
-  configuration space of non-available device or unimplemented function on a
-  given bus. So this library introduces a workaround using IsBdfValid(),
-  to return 0x for all such access.
-
-  In addition to this, the hardware has two other limitations which affect
-  access to the PCIe root port:
-1. ECAM space is not contiguous, root port ECAM (BDF = 0:0:0) is isolated
-   from rest of the downstream hierarchy ECAM space.
-2. Root port ECAM space is not capable of 8bit/16bit writes.
-  The description of the workarounds included for these limitations can
-  be found in the comments below.
-
-  Copyright (c) 2020, ARM Limited. All rights reserved.
-
-  SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-/**
-  Assert the validity of a PCI address. A valid PCI address should contain 1's
-  only in the low 28 bits.
-
-  @param  A The address to validate.
-
-**/
-#define ASSERT_INVALID_PCI_ADDRESS(A) \
-  ASSERT (((A) & ~0xfff) == 0)
-
-/* Root port Entry, BDF Entries Count */
-#define BDF_TABLE_ENTRY_SIZE4
-#define BDF_TABLE_HEADER_COUNT  2
-#define BDF_TABLE_HEADER_SIZE   8
-
-/* BDF table offsets for PCIe */
-#define PCIE_BDF_TABLE_OFFSET   0
-
-#define GET_BUS_NUM(Address)(((Address) >> 20) & 0x7F)
-#define GET_DEV_NUM(Address)(((Address) >> 15) & 0x1F)
-#define GET_FUNC_NUM(Address)   (((Address) >> 12) & 0x07)
-#define GET_REG_NUM(Address)((Address) & 0xFFF)
-
-/**
-  BDF Table structure : (Header + BDF Entries)
-  
-  [Offset 0x00] ROOT PORT ADDRESS
-  [Offset 0x04] BDF ENTRIES COUNT
-  [Offset 0x08] BDF ENTRY 0
-  [Offset 0x0C] BDF ENTRY 1
-  [Offset 0x10] BDF ENTRY 2
-  [Offset 0x14] BDF ENTRY 3
-  [Offset 0x18] BDF ENTRY 4
-  ...
-  [Offset 0x--] BDF ENTRY N
-  
-**/
-
-/**
-   Value returned for reads on configuration space of unimplemented
-   device functions.
-**/
-STATIC UINTN mDummyConfigData = 0x;
-
-/**
-  Registers a PCI device so PCI configuration registers may be accessed after
-  SetVirtualAddressMap().
-
-  Registers the PCI device specified by Address so all the PCI configuration
-  registers associated with that PCI device may be accessed after 

Re: [edk2-devel] [PATCH v5 3/4] Silicon/ARM/NeoverseN1Soc: Add CCIX root complex support

2022-01-19 Thread Sami Mujawar

Hi Khasim,

Thank you for this patch.

These changes look good to me.

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar


On 22/12/2021 01:14 AM, Khasim Mohammed via groups.io wrote:

This patch enables CCIX root complex support by updating
the root complex node info in PciHostBridge library.

Signed-off-by: Khasim Syed Mohammed 
---
  .../PciHostBridgeLib/PciHostBridgeLib.c   | 71 +--
  .../PciHostBridgeLib/PciHostBridgeLib.inf | 11 ++-
  2 files changed, 76 insertions(+), 6 deletions(-)

diff --git 
a/Silicon/ARM/NeoverseN1Soc/Library/PciHostBridgeLib/PciHostBridgeLib.c 
b/Silicon/ARM/NeoverseN1Soc/Library/PciHostBridgeLib/PciHostBridgeLib.c
index 9332939f63..c3a14a6c17 100644
--- a/Silicon/ARM/NeoverseN1Soc/Library/PciHostBridgeLib/PciHostBridgeLib.c
+++ b/Silicon/ARM/NeoverseN1Soc/Library/PciHostBridgeLib/PciHostBridgeLib.c
@@ -1,7 +1,7 @@
  /** @file
  *  PCI Host Bridge Library instance for ARM Neoverse N1 platform
  *
-*  Copyright (c) 2019 - 2020, ARM Limited. All rights reserved.
+*  Copyright (c) 2019 - 2021, ARM Limited. All rights reserved.
  *
  *  SPDX-License-Identifier: BSD-2-Clause-Patent
  *
@@ -16,6 +16,8 @@
  #include 
  #include 
  
+#define ROOT_COMPLEX_NUM 2

+
  GLOBAL_REMOVE_IF_UNREFERENCED
  STATIC CHAR16 CONST * CONST mPciHostBridgeLibAcpiAddressSpaceTypeStr[] = {
L"Mem", L"I/O", L"Bus"
@@ -28,7 +30,7 @@ typedef struct {
  } EFI_PCI_ROOT_BRIDGE_DEVICE_PATH;
  #pragma pack ()
  
-STATIC EFI_PCI_ROOT_BRIDGE_DEVICE_PATH mEfiPciRootBridgeDevicePath[] = {

+STATIC EFI_PCI_ROOT_BRIDGE_DEVICE_PATH 
mEfiPciRootBridgeDevicePath[ROOT_COMPLEX_NUM] = {
// PCIe
{
  {
@@ -51,10 +53,33 @@ STATIC EFI_PCI_ROOT_BRIDGE_DEVICE_PATH 
mEfiPciRootBridgeDevicePath[] = {
  0
}
  }
-  }
+  },
+  //CCIX
+  {
+{
+  {
+ACPI_DEVICE_PATH,
+ACPI_DP,
+{
+  (UINT8)sizeof (ACPI_HID_DEVICE_PATH),
+  (UINT8)(sizeof (ACPI_HID_DEVICE_PATH) >> 8)
+}
+  },
+  EISA_PNP_ID(0x0A09), // CCIX
+  0
+},
+{
+  END_DEVICE_PATH_TYPE,
+  END_ENTIRE_DEVICE_PATH_SUBTYPE,
+  {
+END_DEVICE_PATH_LENGTH,
+0
+  }
+}
+  },
  };
  
-STATIC PCI_ROOT_BRIDGE mPciRootBridge[] = {

+STATIC PCI_ROOT_BRIDGE mPciRootBridge[ROOT_COMPLEX_NUM] = {
{
  0,  // Segment
  0,  // Supports
@@ -90,7 +115,43 @@ STATIC PCI_ROOT_BRIDGE mPciRootBridge[] = {
0
  },
  (EFI_DEVICE_PATH_PROTOCOL *)[0]
-  }
+  },
+  {
+1,  // Segment
+0,  // Supports
+0,  // Attributes
+TRUE,   // DmaAbove4G
+FALSE,  // NoExtendedConfigSpace
+FALSE,  // ResourceAssigned
+EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM |  // AllocationAttributes
+EFI_PCI_HOST_BRIDGE_MEM64_DECODE,
+{
+  // Bus
+  FixedPcdGet32 (PcdCcixBusMin),
+  FixedPcdGet32 (PcdCcixBusMax)
+}, {
+  // Io
+  FixedPcdGet64 (PcdCcixIoBase),
+  FixedPcdGet64 (PcdCcixIoBase) + FixedPcdGet64 (PcdCcixIoSize) - 1
+}, {
+  // Mem
+  FixedPcdGet32 (PcdCcixMmio32Base),
+  FixedPcdGet32 (PcdCcixMmio32Base) + FixedPcdGet32 (PcdCcixMmio32Size) - 1
+}, {
+  // MemAbove4G
+  FixedPcdGet64 (PcdCcixMmio64Base),
+  FixedPcdGet64 (PcdCcixMmio64Base) + FixedPcdGet64 (PcdCcixMmio64Size) - 1
+}, {
+  // PMem
+  MAX_UINT64,
+  0
+}, {
+  // PMemAbove4G
+  MAX_UINT64,
+  0
+},
+(EFI_DEVICE_PATH_PROTOCOL *)[1]
+  },
  };
  
  /**

diff --git 
a/Silicon/ARM/NeoverseN1Soc/Library/PciHostBridgeLib/PciHostBridgeLib.inf 
b/Silicon/ARM/NeoverseN1Soc/Library/PciHostBridgeLib/PciHostBridgeLib.inf
index 3ff1c592f2..3356c3ad35 100644
--- a/Silicon/ARM/NeoverseN1Soc/Library/PciHostBridgeLib/PciHostBridgeLib.inf
+++ b/Silicon/ARM/NeoverseN1Soc/Library/PciHostBridgeLib/PciHostBridgeLib.inf
@@ -1,7 +1,7 @@
  ## @file
  #  PCI Host Bridge Library instance for ARM Neoverse N1 platform.
  #
-#  Copyright (c) 2019 - 2020, ARM Limited. All rights reserved.
+#  Copyright (c) 2019 - 2021, ARM Limited. All rights reserved.
  #
  #  SPDX-License-Identifier: BSD-2-Clause-Patent
  #
@@ -42,6 +42,15 @@
gArmNeoverseN1SocTokenSpaceGuid.PcdPcieMmio64Base
gArmNeoverseN1SocTokenSpaceGuid.PcdPcieMmio64Size
  
+  gArmNeoverseN1SocTokenSpaceGuid.PcdCcixBusMin

+  gArmNeoverseN1SocTokenSpaceGuid.PcdCcixBusMax
+  gArmNeoverseN1SocTokenSpaceGuid.PcdCcixIoBase
+  gArmNeoverseN1SocTokenSpaceGuid.PcdCcixIoSize
+  gArmNeoverseN1SocTokenSpaceGuid.PcdCcixMmio32Base
+  gArmNeoverseN1SocTokenSpaceGuid.PcdCcixMmio32Size
+  gArmNeoverseN1SocTokenSpaceGuid.PcdCcixMmio64Base
+  

Re: [edk2-devel] [PATCH v5 2/4] Silicon/ARM/NeoverseN1Soc: Update PCDs to support multiple PCI root ports

2022-01-19 Thread Sami Mujawar

Hi Khasim,

Thank you for this patch.

I have a minor suggestion marked inline as [SAMI]. Otherwise this patch 
looks good to me.


With that changed,

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar

On 22/12/2021 01:14 AM, Khasim Mohammed via groups.io wrote:

PCD entries are updated to remove the hardcoded assignments and to
add support for multiple PCI root ports.

Signed-off-by: Khasim Syed Mohammed 
---
  .../AslTables/SsdtPci.asl |  8 +--
  .../AslTables/SsdtRemotePci.asl   |  4 +-
  .../ConfigurationManager.c| 24 
  .../ConfigurationManagerDxe.inf   | 18 --
  Platform/ARM/N1Sdp/N1SdpPlatform.dec  |  8 ---
  Platform/ARM/N1Sdp/N1SdpPlatform.dsc  |  1 -
  .../Library/PlatformLib/PlatformLib.inf   |  1 +
  .../Library/PlatformLib/PlatformLibMem.c  |  4 +-
  Silicon/ARM/NeoverseN1Soc/NeoverseN1Soc.dec   | 58 +++
  9 files changed, 68 insertions(+), 58 deletions(-)

diff --git 
a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/AslTables/SsdtPci.asl
 
b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/AslTables/SsdtPci.asl
index cdbd42c154..9922673d0d 100644
--- 
a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/AslTables/SsdtPci.asl
+++ 
b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/AslTables/SsdtPci.asl
@@ -80,8 +80,8 @@ DefinitionBlock("SsdtPci.aml", "SSDT", 1, "ARMLTD", "N1Sdp",
  Device(PCI0) {
Name (_HID, EISAID("PNP0A08")) // PCI Express Root Bridge
Name (_CID, EISAID("PNP0A03")) // Compatible PCI Root Bridge
-  Name (_SEG, Zero)  // PCI Segment Group number
-  Name (_BBN, Zero)  // PCI Base Bus Number
+  Name (_SEG, FixedPcdGet32 (PcdPcieSegmentNumber)) // Segment Number
+  Name (_BBN, FixedPcdGet32 (PcdPcieBusBaseNumber)) // Bus Base Number
Name (_CCA, 1) // Cache Coherency Attribute
  
// Root Complex 0

@@ -166,8 +166,8 @@ DefinitionBlock("SsdtPci.aml", "SSDT", 1, "ARMLTD", "N1Sdp",
  Device(PCI1) {
Name (_HID, EISAID("PNP0A08")) // PCI Express Root Bridge
Name (_CID, EISAID("PNP0A03")) // Compatible PCI Root Bridge
-  Name (_SEG, 1) // PCI Segment Group number
-  Name (_BBN, Zero)  // PCI Base Bus Number
+  Name (_SEG, FixedPcdGet32 (PcdCcixSegmentNumber)) // Segment Number
+  Name (_BBN, FixedPcdGet32 (PcdCcixBusBaseNumber)) // Bus Base Number
Name (_CCA, 1) // Cache Coherency Attribute
  
  // Root Complex 1

diff --git 
a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/AslTables/SsdtRemotePci.asl
 
b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/AslTables/SsdtRemotePci.asl
index b6bec7c106..4c6e0c762f 100644
--- 
a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/AslTables/SsdtRemotePci.asl
+++ 
b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/AslTables/SsdtRemotePci.asl
@@ -76,8 +76,8 @@ DefinitionBlock("SsdtRemotePci.aml", "SSDT", 1, "ARMLTD", 
"N1Sdp",
Device(PCI2) {
Name (_HID, EISAID("PNP0A08")) // PCI Express Root Bridge
Name (_CID, EISAID("PNP0A03")) // Compatible PCI Root Bridge
-  Name (_SEG, 2) // PCI Segment Group number
-  Name (_BBN, Zero)  // PCI Base Bus Number
+  Name (_SEG, FixedPcdGet32 (PcdRemotePcieSegmentNumber)) // Segment Number
+  Name (_BBN, FixedPcdGet32 (PcdRemotePcieBusBaseNumber)) // BusBase Number
Name (_CCA, 1) // Cache Coherency Attribute
  
// Remote Root Complex 0

diff --git 
a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
 
b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
index 9c91372c11..f50623ae3f 100644
--- 
a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
+++ 
b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
@@ -1047,24 +1047,24 @@ EDKII_PLATFORM_REPOSITORY_INFO N1sdpRepositoryInfo = {
{
  // PCIe ECAM
  {
-  0x7000,  // Base Address
-  0x0, // Segment Group Number
-  0x0, // Start Bus Number
-  17   // End Bus Number
+  FixedPcdGet64 (PcdPcieExpressBaseAddress),   // Base Address
+  FixedPcdGet32 (PcdPcieSegmentNumber),// Segment Group Number
+  FixedPcdGet32 (PcdPcieBusMin),   // Start Bus Number
+  FixedPcdGet32 (PcdPcieBusMax)// End Bus Number
  },
  // CCIX ECAM
  {
-  0x6800,  // Base Address
-  0x1, // Segment Group Number
-  0x0,   // Start Bus Number
-  17   // End Bus Number
+  FixedPcdGet32 (PcdCcixExpressBaseAddress),   // Base Address
+  FixedPcdGet32 

Re: [edk2-devel] [PATCH v5 1/4] Silicon/ARM/NeoverseN1Soc: Port PCI Segment Library

2022-01-19 Thread Sami Mujawar

Hi Khasim,

Thank you for this patch.

Please find my feedback marked inline as [SAMI].

Regards,

Sami Mujawar


On 22/12/2021 01:14 AM, Khasim Mohammed via groups.io wrote:

The BasePCISegment Library in MdePkg doesn't allow configuring
multiple segments required for PCIe and CCIX root port
enumeration. Therefore, a custom PCI Segment library is adapted
from SynQuacerPciSegmentLib and ported for N1Sdp.

In addition to this, the hardware has few other limitations which affects
the access to the PCIe root port:
   1. ECAM space is not contiguous, root port ECAM (BDF = 0:0:0) is isolated
  from rest of the downstream hierarchy ECAM space.
   2. Root port ECAM space is not capable of 8bit/16bit writes.
   3. A slave error is generated when host accesses the configuration
  space of non-available device or unimplemented function on a
  given bus.

The description of the workarounds included for these limitations can
be found in the corresponding files of this patch.

Signed-off-by: Khasim Syed Mohammed 
---
  .../Library/PciSegmentLib/PciSegmentLib.c | 1602 +
  .../Library/PciSegmentLib/PciSegmentLib.inf   |   38 +
  2 files changed, 1640 insertions(+)
  create mode 100644 
Silicon/ARM/NeoverseN1Soc/Library/PciSegmentLib/PciSegmentLib.c
  create mode 100644 
Silicon/ARM/NeoverseN1Soc/Library/PciSegmentLib/PciSegmentLib.inf

diff --git a/Silicon/ARM/NeoverseN1Soc/Library/PciSegmentLib/PciSegmentLib.c 
b/Silicon/ARM/NeoverseN1Soc/Library/PciSegmentLib/PciSegmentLib.c
new file mode 100644
index 00..a39a414044
--- /dev/null
+++ b/Silicon/ARM/NeoverseN1Soc/Library/PciSegmentLib/PciSegmentLib.c
@@ -0,0 +1,1602 @@
+/** @file
+  PCI Segment Library for N1SDP SoC with multiple RCs
+
+  Having two distinct root complexes is not supported by the standard
+  set of PciLib/PciExpressLib/PciSegmentLib, this PciSegmentLib
+  reimplements the functionality to support multiple root ports on
+  different segment numbers.
+
+  On the NeoverseN1Soc, a slave error is generated when host accesses the
+  configuration space of non-available device or unimplemented function on a
+  given bus. So this library introduces a workaround using IsBdfValid(),
+  to return 0x for all such access.
+
+  In addition to this, the hardware has two other limitations which affect
+  access to the PCIe root port:
+1. ECAM space is not contiguous, root port ECAM (BDF = 0:0:0) is isolated
+   from rest of the downstream hierarchy ECAM space.
+2. Root port ECAM space is not capable of 8bit/16bit writes.
+  The description of the workarounds included for these limitations can
+  be found in the comments below.
+
+  Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.
+  Copyright (c) 2021, ARM Limited. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+typedef enum {
+  PciCfgWidthUint8  = 0,
+  PciCfgWidthUint16,
+  PciCfgWidthUint32,
+  PciCfgWidthMax
+} PCI_CFG_WIDTH;
+
+/**
+ Assert the validity of a PCI Segment address.
+ A valid PCI Segment address should not contain 1's in bits 28..31 and 48..63
+
+  @param A The address to validate.
+  @param M Additional bits to assert to be zero.
+**/
+#define ASSERT_INVALID_PCI_SEGMENT_ADDRESS(A,M) \
+  ASSERT (((A) & (0xf000ULL | (M))) == 0)
+
+#define BUS_OFFSET  20
+#define DEV_OFFSET  15
+#define FUNC_OFFSET 12
+#define REG_OFFSET  4096
+
+#define EFI_PCIE_ADDRESS(bus, dev, func, reg) \
+  (UINT64) ( \
+  (((UINTN) bus)   << BUS_OFFSET)  | \
+  (((UINTN) dev)   << DEV_OFFSET)  | \
+  (((UINTN) func)  << FUNC_OFFSET) | \
+  (((UINTN) (reg)) <  REG_OFFSET ?   \
+   ((UINTN) (reg)) : (UINT64) (LShiftU64 ((UINT64) (reg), 32
+
+#define GET_PCIE_BASE_ADDRESS(Address)  (Address & 0xF800)
+
+/* Root port Entry, BDF Entries Count */
+#define BDF_TABLE_ENTRY_SIZE4
+#define BDF_TABLE_HEADER_COUNT  2
+#define BDF_TABLE_HEADER_SIZE   8
+
+/* BDF table offsets for PCIe */
+#define PCIE_BDF_TABLE_OFFSET   0
+#define CCIX_BDF_TABLE_OFFSET   (16 * 1024)
+
+#define GET_BUS_NUM(Address)(((Address) >> 20) & 0x7F)
[SAMI] Can BUS_OFFSET be used here instead of 20. Similar comment for 
the macros, below.

+#define GET_DEV_NUM(Address)(((Address) >> 15) & 0x1F)
+#define GET_FUNC_NUM(Address)   (((Address) >> 12) & 0x07)
+#define GET_REG_NUM(Address)((Address) & 0xFFF)
+#define GET_SEG_NUM(Address)(((Address) >> 32) & 0x)

[SAMI] Would it be possible to define a macro for the segment offset?

+
+CONST STATIC UINTN mDummyConfigData = 0x;
+
+/**
+  Check if the requested PCI address is a valid BDF address.
+
+  SCP performs the initial bus scan and prepares a table of valid BDF addresses
+  and shares them through non-trusted SRAM. This function validates if the PCI
+  address from any PCI request falls within the table of valid entries. If not,
+  this function will return 

Re: [edk2-devel] [PATCH v5 1/4] IntelSiliconPkg/VTd: Fix typos

2022-01-19 Thread Kowalewski, Robert
Reviewed-by: Robert Kowalewski 

-Original Message-
From: Sheng, W  
Sent: Tuesday, January 18, 2022 9:15 AM
To: devel@edk2.groups.io
Cc: Ni, Ray ; Chaganty, Rangasai V 
; Huang, Jenny ; 
Kowalewski, Robert 
Subject: [PATCH v5 1/4] IntelSiliconPkg/VTd: Fix typos

It is DRHD(DMA Remapping Hardware Unit Definition).

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

Cc: Ray Ni 
Cc: Rangasai V Chaganty 
Cc: Jenny Huang 
Cc: Robert Kowalewski 
Reviewed-by: Jenny Huang 
Signed-off-by: Sheng Wei 
---
 .../IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/DmarTable.c  | 12 ++-- 
 .../IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c  | 12 ++--
 .../IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/DmarTable.c   |  6 +++---
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git 
a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/DmarTable.c 
b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/DmarTable.c
index 2154690d..e9c99d0a 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/DmarTable.c
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/DmarTabl
+++ e.c
@@ -539,14 +539,14 @@ RegisterPciDevice (  }
 
 /**
-  Process DMAR DHRD table.
+  Process DMAR DRHD table.
 
   @param[in]  VTdUnitInfo   The VTd engine unit information.
   @param[in]  DmarDrhd  The DRHD table.
 
 **/
 VOID
-ProcessDhrd (
+ProcessDrhd (
   IN VTD_UNIT_INFO  *VTdUnitInfo,
   IN EFI_ACPI_DMAR_DRHD_HEADER  *DmarDrhd
   )
@@ -581,10 +581,10 @@ ProcessDhrd (
 
   if ((DmarDrhd->Flags & EFI_ACPI_DMAR_DRHD_FLAGS_INCLUDE_PCI_ALL) != 0) {
 VTdUnitInfo->PciDeviceInfo.IncludeAllFlag = TRUE;
-DEBUG ((DEBUG_INFO,"  ProcessDhrd: with INCLUDE ALL\n"));
+DEBUG ((DEBUG_INFO,"  ProcessDrhd: with INCLUDE ALL\n"));
   } else {
 VTdUnitInfo->PciDeviceInfo.IncludeAllFlag = FALSE;
-DEBUG ((DEBUG_INFO,"  ProcessDhrd: without INCLUDE ALL\n"));
+DEBUG ((DEBUG_INFO,"  ProcessDrhd: without INCLUDE ALL\n"));
   }
 
   VTdUnitInfo->PciDeviceInfo.PciDeviceDataNumber = 0; @@ -600,7 +600,7 @@ 
ProcessDhrd (
   return;
 }
 
-DEBUG ((DEBUG_INFO,"  ProcessDhrd: "));
+DEBUG ((DEBUG_INFO,"  ProcessDrhd: "));
 switch (DmarDevScopeEntry->Type) {
   case EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_PCI_ENDPOINT:
   DEBUG ((DEBUG_INFO,"PCI Endpoint")); @@ -708,7 +708,7 @@ 
ParseDmarAcpiTableDrhd (
 switch (DmarHeader->Type) {
 case EFI_ACPI_DMAR_TYPE_DRHD:
   ASSERT (VtdIndex < VtdUnitNumber);
-  ProcessDhrd (>VtdUnitInfo[VtdIndex], (EFI_ACPI_DMAR_DRHD_HEADER 
*) DmarHeader);
+  ProcessDrhd (>VtdUnitInfo[VtdIndex], 
+ (EFI_ACPI_DMAR_DRHD_HEADER *) DmarHeader);
   VtdIndex++;
 
   break;
diff --git 
a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c 
b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c
index 1ee290b7..75fbd53e 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTable.c
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmarAcpiTabl
+++ e.c
@@ -662,7 +662,7 @@ GetPciBusDeviceFunction (  }
 
 /**
-  Process DMAR DHRD table.
+  Process DMAR DRHD table.
 
   @param[in]  VtdIndex  The index of VTd engine.
   @param[in]  DmarDrhd  The DRHD table.
@@ -670,7 +670,7 @@ GetPciBusDeviceFunction (
   @retval EFI_SUCCESS The DRHD table is processed.
 **/
 EFI_STATUS
-ProcessDhrd (
+ProcessDrhd (
   IN UINTN  VtdIndex,
   IN EFI_ACPI_DMAR_DRHD_HEADER  *DmarDrhd
   )
@@ -690,7 +690,7 @@ ProcessDhrd (
 
   if ((DmarDrhd->Flags & EFI_ACPI_DMAR_DRHD_FLAGS_INCLUDE_PCI_ALL) != 0) {
 mVtdUnitInformation[VtdIndex].PciDeviceInfo.IncludeAllFlag = TRUE;
-DEBUG ((DEBUG_INFO,"  ProcessDhrd: with INCLUDE ALL\n"));
+DEBUG ((DEBUG_INFO,"  ProcessDrhd: with INCLUDE ALL\n"));
 
 Status = ScanAllPciBus((VOID *)VtdIndex, DmarDrhd->SegmentNumber, 
ScanBusCallbackRegisterPciDevice);
 if (EFI_ERROR (Status)) {
@@ -698,7 +698,7 @@ ProcessDhrd (
 }
   } else {
 mVtdUnitInformation[VtdIndex].PciDeviceInfo.IncludeAllFlag = FALSE;
-DEBUG ((DEBUG_INFO,"  ProcessDhrd: without INCLUDE ALL\n"));
+DEBUG ((DEBUG_INFO,"  ProcessDrhd: without INCLUDE ALL\n"));
   }
 
   DmarDevScopeEntry = (EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER 
*)((UINTN)(DmarDrhd + 1)); @@ -709,7 +709,7 @@ ProcessDhrd (
   return Status;
 }
 
-DEBUG ((DEBUG_INFO,"  ProcessDhrd: "));
+DEBUG ((DEBUG_INFO,"  ProcessDrhd: "));
 switch (DmarDevScopeEntry->Type) {
 case EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_PCI_ENDPOINT:
   DEBUG ((DEBUG_INFO,"PCI Endpoint")); @@ -877,7 +877,7 @@ 
ParseDmarAcpiTableDrhd (
 switch (DmarHeader->Type) {
 case EFI_ACPI_DMAR_TYPE_DRHD:
   ASSERT (VtdIndex < mVtdUnitNumber);
-  Status = ProcessDhrd (VtdIndex, (EFI_ACPI_DMAR_DRHD_HEADER *)DmarHeader);
+  Status = ProcessDrhd (VtdIndex, (EFI_ACPI_DMAR_DRHD_HEADER 
+ *)DmarHeader);
   if (EFI_ERROR (Status)) {
 return 

Re: [edk2-devel] [PATCH 1/1] BaseTools: Enable GNU make parallel jobs by default

2022-01-19 Thread Steven Shi
Hello Ard, Leif, Abner, Daniel,
Are you ok to enable the GNU make "--jobs" option in GCC5 toolchain by default?

Thanks
Steven Shi

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Steven
> Shi
> Sent: Monday, January 17, 2022 10:54 PM
> To: a...@kernel.org; l...@nuviainc.com; Chang, Abner
> ; Schaefer, Daniel 
> Cc: Feng, Bob C ; Chen, Christine
> ; devel@edk2.groups.io
> Subject: Re: [edk2-devel] [PATCH 1/1] BaseTools: Enable GNU make parallel
> jobs by default
> 
> Hello Ard, Leif, Abner, Daniel,
> I changed the GNU make flag to enable the "--jobs" option in GCC5 toolchain
> by default for all architectures. Please verify whether this change has impact
> to the ARM and RISCV GCC5 builds. Thanks!
> 
> 
> Thanks
> Steven Shi
> 
> > -Original Message-
> > From: Shi, Steven 
> > Sent: Monday, January 17, 2022 10:43 PM
> > To: devel@edk2.groups.io
> > Cc: Feng, Bob C ; Chen, Christine
> > ; a...@kernel.org; l...@nuviainc.com; Chang,
> > Abner ; Schaefer, Daniel
> > ; Shi, Steven 
> > Subject: [PATCH 1/1] BaseTools: Enable GNU make parallel jobs by default
> >
> > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3807
> >
> > * Enable GNU make parallel jobs support(--jobs flag) by
> >   default in GCC5 and CLANGPDB toolchains. This gmake flag
> >   can save full features bios linux build time by +20%.
> > * Explictly distinguish and define the MS nmake flag and
> >   GNU gmake flag in the toolchain which might support
> >   both, e.g. CLANGPDB can use nmake in Windows and gmake
> >   in Linux. General make flags cannot work for such hybrid
> >   make usage scenario.
> >
> > Signed-off-by: Steven Shi 
> > ---
> >  BaseTools/Conf/tools_def.template  |  4 
> >  BaseTools/Source/Python/AutoGen/GenMake.py |  5 +++--
> >  BaseTools/Source/Python/AutoGen/PlatformAutoGen.py | 12
> > +++-
> >  3 files changed, 18 insertions(+), 3 deletions(-)
> >
> > diff --git a/BaseTools/Conf/tools_def.template
> > b/BaseTools/Conf/tools_def.template
> > index 2e6b382ab623..84af08cca6ae 100755
> > --- a/BaseTools/Conf/tools_def.template
> > +++ b/BaseTools/Conf/tools_def.template
> > @@ -2283,6 +2283,8 @@ RELEASE_GCC49_AARCH64_DLINK_XIPFLAGS = -
> z
> > common-page-size=0x20
> >  *_GCC5_*_*_FAMILY= GCC
> >
> >
> >
> >  *_GCC5_*_MAKE_PATH   = DEF(GCC_HOST_PREFIX)make
> >
> > +*_GCC5_*_GMAKE_FLAGS = --jobs
> >
> > +*_GCC5_*_NMAKE_FLAGS = /nologo
> >
> >  *_GCC5_*_*_DLL   = ENV(GCC5_DLL)
> >
> >  *_GCC5_*_ASL_PATH= DEF(UNIX_IASL_BIN)
> >
> >
> >
> > @@ -2742,6 +2744,8 @@ RELEASE_CLANG38_AARCH64_DLINK_FLAGS =
> > DEF(CLANG38_AARCH64_DLINK_FLAGS) -flto -Wl
> >  *_CLANGPDB_*_*_FAMILY= GCC
> >
> >  *_CLANGPDB_*_*_BUILDRULEFAMILY   = CLANGPDB
> >
> >  *_CLANGPDB_*_MAKE_PATH   = ENV(CLANG_HOST_BIN)make
> >
> > +*_CLANGPDB_*_GMAKE_FLAGS = --jobs
> >
> > +*_CLANGPDB_*_NMAKE_FLAGS = /nologo
> >
> >  *_CLANGPDB_*_*_DLL   = ENV(CLANGPDB_DLL)
> >
> >  *_CLANGPDB_*_ASL_PATH= DEF(UNIX_IASL_BIN)
> >
> >
> >
> > diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py
> > b/BaseTools/Source/Python/AutoGen/GenMake.py
> > index e55efff059f9..c6636d99fc7d 100755
> > --- a/BaseTools/Source/Python/AutoGen/GenMake.py
> > +++ b/BaseTools/Source/Python/AutoGen/GenMake.py
> > @@ -732,10 +732,11 @@ cleanlib:
> >  Src, Dst = CopyCmd
> >
> >  Src = self.ReplaceMacro(Src)
> >
> >  Dst = self.ReplaceMacro(Dst)
> >
> > +Efi = Src[:-3] + 'efi'
> >
> >  if Dst not in self.ResultFileList:
> >
> >  self.ResultFileList.append(Dst)
> >
> >  if '%s :' %(Dst) not in self.BuildTargetList:
> >
> > -self.BuildTargetList.append("%s : %s" %(Dst,Src))
> >
> > +self.BuildTargetList.append("%s : %s" %(Dst, Efi))
> >
> >  self.BuildTargetList.append('\t' +
> > self._CP_TEMPLATE_[self._Platform] %{'Src': Src, 'Dst': Dst})
> >
> >
> >
> >  FfsCmdList = Cmd[0]
> >
> > @@ -778,7 +779,7 @@ cleanlib:
> >  SecDepsFileList.append(SecCmdList[index + 
> > 1])
> >
> >  index = index + 1
> >
> >  if CmdName == 'Trim':
> >
> > -
> > SecDepsFileList.append(os.path.join('$(DEBUG_DIR)',
> > os.path.basename(OutputFile).replace('offset', 'efi')))
> >
> > +
> > SecDepsFileList.append(os.path.join('$(OUTPUT_DIR)',
> > os.path.basename(OutputFile).replace('offset', 'efi')))
> >
> >  if OutputFile.endswith('.ui') or 
> > OutputFile.endswith('.ver'):
> >
> >  
> > SecDepsFileList.append(os.path.join('$(MODULE_DIR)',
> > '$(MODULE_FILE)'))
> >
> >

Re: [edk2-devel] [edk2-rfc] [RFC] [PATCH 0/2] Proposal to add EFI_MP_SERVICES_PROTOCOL support for AARCH64

2022-01-19 Thread Sami Mujawar
Hi Leif,

Apologies, I had forgotten to send a patch to add myself as the reviewer for 
ArmPkg.
I have now sent a patch to update the maintainer.txt at 
https://edk2.groups.io/g/devel/message/85812

Regards,

Sami Mujawar


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




[edk2-devel] [PATCH v1 1/1] Maintainers.txt: Add Sami Mujawar as reviewer for ArmPkg

2022-01-19 Thread Sami Mujawar
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
Signed-off-by: Sami Mujawar 
---

Notes:
v1:
 - Add Sami as the reviewer for ArmPkg[SAMI]
   Ref: https://edk2.groups.io/g/devel/message/82219

 Maintainers.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Maintainers.txt b/Maintainers.txt
index 
3bda97ef258318a52d632f7425bfe51b65debc57..4c5d3111c2ecdec00f6444884e6ba65211e5a2b3
 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -132,6 +132,7 @@ F: ArmPkg/
 W: https://github.com/tianocore/tianocore.github.io/wiki/ArmPkg
 M: Leif Lindholm  [leiflindholm]
 M: Ard Biesheuvel  [ardbiesheuvel]
+R: Sami Mujawar  [samimujawar]
 
 ArmPlatformPkg
 F: ArmPlatformPkg/
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



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




Re: [edk2-devel] Does CI support nested virtualization?

2022-01-19 Thread Boeuf, Sebastien
Any idea?

From: devel@edk2.groups.io  on behalf of Boeuf, Sebastien 

Sent: Tuesday, January 11, 2022 4:23 PM
To: Kinney, Michael D ; bret.barke...@microsoft.com 
; sean.bro...@microsoft.com 
; devel@edk2.groups.io 
Subject: [edk2-devel] Does CI support nested virtualization?

Hi,

I was thinking about running a simple test with Cloud Hypervisor (VMM
relying on KVM) to validate the associated Ovmf target can be properly
booted. Unfortunately I get an error about /dev/kvm not being
available.

Is there a way to let the Azure Pipelines know that we need a machine
that supports nested virtualization? Something like D2s_v3 should work.

If not, can we point to an external machine that we would provide as we
would know it has the nested virtualization feature?

Thanks,
Sebastien
-
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.





-
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#85811): https://edk2.groups.io/g/devel/message/85811
Mute This Topic: https://groups.io/mt/88350992/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/6] MM communicate functionality in variable policy

2022-01-19 Thread Sami Mujawar

Hi Kun,

Thank you for this patch series.

These changes look good to me. For this series

Reviewed-by: Sami Mujawar 

Regards,

Sami Mujawar

On 21/12/2021 01:33 AM, Kun Qin via groups.io wrote:

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

This patch series is a follow up of previous submission:
https://edk2.groups.io/g/devel/message/84140

v2 patches mainly focus on feedback for commits submitted in v1 patches:
a. Splitted the original ArmPkg patch into 4 separate patches;
b. Updated patches according to Uncrustify scanning results;

Patch v2 branch: https://github.com/kuqin12/edk2/tree/mm_communicate_check_v2

Cc: Jian J Wang 
Cc: Liming Gao 
Cc: Hao A Wu 
Cc: Michael D Kinney 
Cc: Zhiguang Liu 
Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
Cc: Bret Barkelew 
Cc: Michael Kubacki 

Kun Qin (6):
   MdeModulePkg: VariableSmmRuntimeDxe: Fix Variable Policy Message
 Length
   MdePkg: MmCommunication2: Update MM communicate2 function description
   ArmPkg: MmCommunicationDxe: MM communicate function argument
 attributes
   ArmPkg: MmCommunicationDxe: Update MM communicate `CommBuffer**`
 checks
   ArmPkg: MmCommunicationDxe: Update MM communicate `CommSize` check
   ArmPkg: MmCommunicationDxe: Update MM communicate `MessageLength`
 check

  ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c   | 46 

  MdeModulePkg/Universal/Variable/RuntimeDxe/VariablePolicySmmDxe.c | 10 ++---
  MdePkg/Include/Protocol/MmCommunication2.h| 13 +++---
  3 files changed, 41 insertions(+), 28 deletions(-)





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




[edk2-devel] [PATCH] UefiPayloadPkg: Use BaseCpuTimerLib for Universal Payload by default

2022-01-19 Thread Zhiguang Liu
Current, a macro CPU_TIMER_LIB_ENABLE is added to determine which timerlib
is used. BaseCpuTimerLib.inf is a better way and only fit for recent CPU.
Meanwhile, Universal Payload are only aimed to work with recent CPU.
Therefore, for Universal Payload, use the BaseCpuTimerLib by default

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Zhiguang Liu 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 65c1bd610e..1ce96a51c1 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -111,10 +111,10 @@
   DEFINE SERIAL_DRIVER_ENABLE = TRUE
   DEFINE PERFORMANCE_MEASUREMENT_ENABLE  = FALSE
 
-  # For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp Counter.
-  # This is recommended way to get the time, and also how BaseCpuTimerLib 
works.
-  # However, some CPU doesn't support this feature, so disable it by default.
-  DEFINE CPU_TIMER_LIB_ENABLE  = FALSE
+  # For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp Counter 
Frequence.
+  # This is how BaseCpuTimerLib works, and a recommended way to get Frequence, 
so set the default value as TRUE.
+  # Note: for emulation platform such as QEMU, this may not work and should 
set it as FALSE
+  DEFINE CPU_TIMER_LIB_ENABLE  = TRUE
 
 [BuildOptions]
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
@@ -222,7 +222,7 @@
   #
   # Platform
   #
-!if $(CPU_TIMER_LIB_ENABLE) == TRUE
+!if $(CPU_TIMER_LIB_ENABLE) == TRUE && $(UNIVERSAL_PAYLOAD) == TRUE
   TimerLib|UefiCpuPkg/Library/CpuTimerLib/BaseCpuTimerLib.inf
 !else
   TimerLib|UefiPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
-- 
2.32.0.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#85809): https://edk2.groups.io/g/devel/message/85809
Mute This Topic: https://groups.io/mt/88530668/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/6] MM communicate functionality in variable policy

2022-01-19 Thread Sami Mujawar
Hi Kun,

I will review this patch series shortly.

Regards,

Sami Mujawar

On 18/01/2022, 22:07, "devel@edk2.groups.io on behalf of Kun Qin via 
groups.io"  
wrote:

I thought the reply on website will retain the original CC list. But I 
was wrong about that.

Thanks for the reminder, Rebecca.

Regards,
Kun

On 01/18/2022 14:04, Rebecca Cran wrote:
> [+Leif, Ard]
> 
> 
> Kun,
> 
> 
> There's often so much mailing list traffic that you need to CC the 
> maintainers for them to see your emails.
> 
> 
> -- 
> 
> Rebecca Cran
> 
> 
> On 1/18/22 11:40, Kun Qin wrote:
>> Hi ArmPkg maintainers,
>>
>> It has been almost a month since this v2 patch series has been sent 
>> out for review. Could you please take a look and provide feedback? 
>> Thanks in advance.
>>
>> Regards,
>> Kun
>> 








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