[edk2-devel] [PATCH v2] XiangshanSeriesPkg:Add BOSC NanhuDev platform

2024-04-09 Thread WangYang
This commit adds the initial support for BOSC's
nanhu platform which provides up to 2 RISC-V RV64
processor cores.

Signed-off-by: Yang Wang 
Signed-off-by: Ran Wang 
Signed-off-by: YunFeng Yang 
Signed-off-by: YaXing Guo 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Sunil V L 
Cc: Daniel Schaefer 

---
 V2:This solution is changed to EDK2 as the payload of opensbi.

 Platform/Bosc/Readme.md   |  61 ++
 .../XiangshanSeriesPkg/NanhuDev/NanhuDev.dsc  | 552 ++
 .../XiangshanSeriesPkg/NanhuDev/NanhuDev.fdf  | 241 
 .../NanhuDev/NanhuDev.fdf.inc |  62 ++
 .../NanhuDev/VarStore.fdf.inc |  77 +++
 Silicon/Bosc/NanHuPkg/NanHuDevPkg.dec |  31 +
 Silicon/Bosc/NanHuPkg/NanHuPkg.uni|  13 +
 Silicon/Bosc/NanHuPkg/NanHuPkgExtra.uni   |  13 +
 8 files changed, 1050 insertions(+)
 create mode 100644 Platform/Bosc/Readme.md
 create mode 100644 Platform/Bosc/XiangshanSeriesPkg/NanhuDev/NanhuDev.dsc
 create mode 100644 Platform/Bosc/XiangshanSeriesPkg/NanhuDev/NanhuDev.fdf
 create mode 100644 Platform/Bosc/XiangshanSeriesPkg/NanhuDev/NanhuDev.fdf.inc
 create mode 100644 Platform/Bosc/XiangshanSeriesPkg/NanhuDev/VarStore.fdf.inc
 create mode 100644 Silicon/Bosc/NanHuPkg/NanHuDevPkg.dec
 create mode 100644 Silicon/Bosc/NanHuPkg/NanHuPkg.uni
 create mode 100644 Silicon/Bosc/NanHuPkg/NanHuPkgExtra.uni

diff --git a/Platform/Bosc/Readme.md b/Platform/Bosc/Readme.md
new file mode 100644
index 00..fe3304cb59
--- /dev/null
+++ b/Platform/Bosc/Readme.md
@@ -0,0 +1,61 @@
+# Introduction to BOSC Xiangshan Series Platform #
+
+This document provides guidelines for building UEFI firmware for BOSC NanhuDev.
+BOSC NanhuDev is a 64 and processor of RISC-V architecture.
+BOSC NanhuDev UEFI can currently use Opensbi+UEFI firmware+GRUB to 
successfully enter the Linux.
+
+## How to build (X86 Linux Environment)
+
+### NanhuDev EDK2 Initial Environment  ###
+
+**statement**:The operating environment of this project is deployed on the 
BOSC original environment.
+
+1. Install package on ubuntu
+
+ ```
+ sudo apt-get install autoconf automake autotools-dev curl python3 
libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf 
libtool patchutils bc zlib1g-dev libexpat-dev ninja-build uuide-dev
+ ```
+
+2. Follow edk2-platforms/Readme.md to obtaining source code, and config build 
env. For Example:
+
+   ```
+   export WORKSPACE=/work/git/tianocore
+   mkdir -p $WORKSPACE
+   cd $WORKSPACE
+   git clone https://github.com/tianocore/edk2.git
+   cd edk2
+   git submodule update --init
+   cd ..
+   git clone https://github.com/tianocore/edk2-platforms.git
+   cd edk2-platforms
+   git submodule update --init
+   cd ..
+   git clone https://github.com/tianocore/edk2-non-osi.git
+   export PACKAGES_PATH=$PWD/edk2:$PWD/edk2-platforms:$PWD/edk2-non-osi
+   ```
+
+3. Build
+
+   3.1 Using GCC toolchain
+
+   ```
+   export GCC5_RISCV64_PREFIX=riscv64-linux-gnu-
+   export PYTHON_COMMAND=python3
+   export EDK_TOOLS_PATH=$WORKSPACE/edk2/BaseTools
+   source edk2/edksetup.sh --reconfig
+   make -C edk2/BaseTools
+   source edk2/edksetup.sh BaseTools
+   build --buildtarget=DEBUG -a RISCV64 -t GCC5 -p 
Platform/Bosc/XiangshanSeriesPkg/NanhuDev/NanhuDev.dsc
+   ```
+
+   After a successful build, the resulting images can be found in 
Build/{Platform Name}/{TARGET}_{TOOL_CHAIN_TAG}/FV/NANHUDEV.fd
+
+4. When compiling Opensbi, specify that payload is NANHUDEV.fd and specify dtb 
path.
+   make -C ~/opensbi PLATFORM=generic CROSS_COMPILE=riscv64-unknown-linux-gnu- 
-j FW_PAYLOAD_PATH=$(PAYLOAD) FW_FDT_PATH=$(DTB_PATH)
+
+5. Use GRUB2 to boot linux OS
+
+   Reference: https://fedoraproject.org/wiki/Architectures/RISC-V/GRUB2
+   Copy grubriscv64.efi and Image(linux) to the root directory of the NVME 
partition.
+## Known Issues and Limitations
+This test only runs on BOSC NanhuDev with RISC-V RV64 architecture
diff --git a/Platform/Bosc/XiangshanSeriesPkg/NanhuDev/NanhuDev.dsc 
b/Platform/Bosc/XiangshanSeriesPkg/NanhuDev/NanhuDev.dsc
new file mode 100644
index 00..7dcd7c4313
--- /dev/null
+++ b/Platform/Bosc/XiangshanSeriesPkg/NanhuDev/NanhuDev.dsc
@@ -0,0 +1,552 @@
+## @file
+#  RISC-V EFI on Bosc NanHuDev RISC-V platform
+#
+#  Copyright (c) 2023, Academy of Intelligent Innovation, Shandong Universiy, 
China.P.R. All rights reserved.
+#  Copyright (c) 2024, Bosc. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+
+#
+# Defines Section - statements that will be processed to create a Makefile.
+#
+
+[Defines]
+  PLATFORM_NAME  = NanhuDev
+  PLATFORM_GUID  = 944FF6B7-B6F1-4BB2-9CF0-FDBF938B9E0B
+  PLATFORM_VERSION   = 0.1
+  DSC_SPECIFICATION  = 0x0001001c
+  

Re: [edk2-devel] [PATCH 1/3] OptionRomPkg: Update the comments of GetInformation function

2024-04-09 Thread Ni, Ray
Pedro,
I didn't notice your mail and merged the patch.:(

Your comments to the commit messages are good to me.

However, I am ok with the changes to the function header of an existing 
implementation.

Thanks,
Ray


From: Pedro Falcato 
Sent: Tuesday, April 9, 2024 10:12
To: Shang, Qingyu 
Cc: devel@edk2.groups.io ; Ni, Ray ; 
Gahan Saraiya 
Subject: Re: [PATCH 1/3] OptionRomPkg: Update the comments of GetInformation 
function

On Mon, Apr 8, 2024 at 10:48 AM Qingyu  wrote:
>
> Refer to Uefi spec 2.10 section 11.11.2, add a new retval
> EFI_NOT_FOUND to EFI_ADAPTER_INFORMATION_PROTOCOL.GetInformation().
> Reference: [mantis #1866] - GetInfo() of Adapter Information
> Protocol should have a provision for IHV to return no data.

Let's reword this commit message a bit, shall we? Something like this:

Add a new return value EFI_NOT_FOUND to
EFI_ADAPTER_INFORMATION_PROTOCOL.GetInformation(), according to UEFI
spec 2.10 section 11.11.2.
This brings the documentation up to par with UEFI 2.10.
Reference: [mantis #1866] - GetInfo() of Adapter Information
Protocol should have a provision for IHV to return no data.

I'm not sure about the commit title too, but it's late here and I
can't figure out a nice succinct description. Maybe:
"OptionRomPkg/UndiRuntimeDxe: Update UndiAipGetInfo's docs to UEFI spec 2.10"

>
> Cc: Pedro Falcato 

Why was I CC'd on this? /me is confused

> Cc: Ray Ni 
> Signed-off-by: Qingyu 
> Signed-off-by: Gahan Saraiya 
> ---
>  Drivers/OptionRomPkg/UndiRuntimeDxe/Undi32.h  | 5 -
>  Drivers/OptionRomPkg/UndiRuntimeDxe/UndiAipImpl.c | 5 -
>  2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/Drivers/OptionRomPkg/UndiRuntimeDxe/Undi32.h 
> b/Drivers/OptionRomPkg/UndiRuntimeDxe/Undi32.h
> index 31c55a8e11..665221e952 100644
> --- a/Drivers/OptionRomPkg/UndiRuntimeDxe/Undi32.h
> +++ b/Drivers/OptionRomPkg/UndiRuntimeDxe/Undi32.h
> @@ -350,7 +350,9 @@ VOID PxeUpdate (NIC_DATA_INSTANCE *NicPtr, PXE_SW_UNDI 
> *PxePtr);
>
>This function returns information of type InformationType from the adapter.
>If an adapter does not support the requested informational type, then
> -  EFI_UNSUPPORTED is returned.
> +  EFI_UNSUPPORTED is returned. If an adapter does not contain Information for
> +  the requested InformationType, it fills InformationBlockSize with 0 and
> +  returns EFI_NOT_FOUND.
>
>@param[in]  This   A pointer to the 
> EFI_ADAPTER_INFORMATION_PROTOCOL instance.
>@param[in]  InformationTypeA pointer to an EFI_GUID that defines 
> the contents of InformationBlock.
> @@ -360,6 +362,7 @@ VOID PxeUpdate (NIC_DATA_INSTANCE *NicPtr, PXE_SW_UNDI 
> *PxePtr);
>
>@retval EFI_SUCCESSThe InformationType information was 
> retrieved.
>@retval EFI_UNSUPPORTEDThe InformationType is not known.
> +  @retval EFI_NOT_FOUND  Information is not available for the 
> requested information type.
>@retval EFI_DEVICE_ERROR   The device reported an error.
>@retval EFI_OUT_OF_RESOURCES   The request could not be completed due 
> to a lack of resources.
>@retval EFI_INVALID_PARAMETER  This is NULL.
> diff --git a/Drivers/OptionRomPkg/UndiRuntimeDxe/UndiAipImpl.c 
> b/Drivers/OptionRomPkg/UndiRuntimeDxe/UndiAipImpl.c
> index 21151a076f..d80ce65da9 100644
> --- a/Drivers/OptionRomPkg/UndiRuntimeDxe/UndiAipImpl.c
> +++ b/Drivers/OptionRomPkg/UndiRuntimeDxe/UndiAipImpl.c
> @@ -18,7 +18,9 @@ EFI_GUID   mSupportedInfoTypes[] = {
>
>This function returns information of type InformationType from the adapter.
>If an adapter does not support the requested informational type, then
> -  EFI_UNSUPPORTED is returned.
> +  EFI_UNSUPPORTED is returned. If an adapter does not contain Information for
> +  the requested InformationType, it fills InformationBlockSize with 0 and
> +  returns EFI_NOT_FOUND.
>
>@param[in]  This   A pointer to the 
> EFI_ADAPTER_INFORMATION_PROTOCOL instance.
>@param[in]  InformationTypeA pointer to an EFI_GUID that defines 
> the contents of InformationBlock.
> @@ -28,6 +30,7 @@ EFI_GUID   mSupportedInfoTypes[] = {
>
>@retval EFI_SUCCESSThe InformationType information was 
> retrieved.
>@retval EFI_UNSUPPORTEDThe InformationType is not known.
> +  @retval EFI_NOT_FOUND  Information is not available for the 
> requested information type.
>@retval EFI_DEVICE_ERROR   The device reported an error.
>@retval EFI_OUT_OF_RESOURCES   The request could not be completed due 
> to a lack of resources.
>@retval EFI_INVALID_PARAMETER  This is NULL.

In any case, since I've been meaning to say this for some time: I know
this is not your fault (and this is part of some UEFI spec upgrade
goal), but changing all of these comments isn't the win you think it
is. It's very churny and gains us nothing. The function does not
return EFI_NOT_FOUND, so 

Re: [edk2-devel] [PATCH 1/3] OptionRomPkg: Update the comments of GetInformation function

2024-04-09 Thread Ni, Ray
merged.

Thanks,
Ray

From: Shang, Qingyu 
Sent: Monday, April 8, 2024 17:47
To: devel@edk2.groups.io 
Cc: Pedro Falcato ; Ni, Ray ; Gahan 
Saraiya 
Subject: [PATCH 1/3] OptionRomPkg: Update the comments of GetInformation 
function

Refer to Uefi spec 2.10 section 11.11.2, add a new retval
EFI_NOT_FOUND to EFI_ADAPTER_INFORMATION_PROTOCOL.GetInformation().
Reference: [mantis #1866] - GetInfo() of Adapter Information
Protocol should have a provision for IHV to return no data.

Cc: Pedro Falcato 
Cc: Ray Ni 
Signed-off-by: Qingyu 
Signed-off-by: Gahan Saraiya 
---
 Drivers/OptionRomPkg/UndiRuntimeDxe/Undi32.h  | 5 -
 Drivers/OptionRomPkg/UndiRuntimeDxe/UndiAipImpl.c | 5 -
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Drivers/OptionRomPkg/UndiRuntimeDxe/Undi32.h 
b/Drivers/OptionRomPkg/UndiRuntimeDxe/Undi32.h
index 31c55a8e11..665221e952 100644
--- a/Drivers/OptionRomPkg/UndiRuntimeDxe/Undi32.h
+++ b/Drivers/OptionRomPkg/UndiRuntimeDxe/Undi32.h
@@ -350,7 +350,9 @@ VOID PxeUpdate (NIC_DATA_INSTANCE *NicPtr, PXE_SW_UNDI 
*PxePtr);

   This function returns information of type InformationType from the adapter.
   If an adapter does not support the requested informational type, then
-  EFI_UNSUPPORTED is returned.
+  EFI_UNSUPPORTED is returned. If an adapter does not contain Information for
+  the requested InformationType, it fills InformationBlockSize with 0 and
+  returns EFI_NOT_FOUND.

   @param[in]  This   A pointer to the 
EFI_ADAPTER_INFORMATION_PROTOCOL instance.
   @param[in]  InformationTypeA pointer to an EFI_GUID that defines the 
contents of InformationBlock.
@@ -360,6 +362,7 @@ VOID PxeUpdate (NIC_DATA_INSTANCE *NicPtr, PXE_SW_UNDI 
*PxePtr);

   @retval EFI_SUCCESSThe InformationType information was 
retrieved.
   @retval EFI_UNSUPPORTEDThe InformationType is not known.
+  @retval EFI_NOT_FOUND  Information is not available for the 
requested information type.
   @retval EFI_DEVICE_ERROR   The device reported an error.
   @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to 
a lack of resources.
   @retval EFI_INVALID_PARAMETER  This is NULL.
diff --git a/Drivers/OptionRomPkg/UndiRuntimeDxe/UndiAipImpl.c 
b/Drivers/OptionRomPkg/UndiRuntimeDxe/UndiAipImpl.c
index 21151a076f..d80ce65da9 100644
--- a/Drivers/OptionRomPkg/UndiRuntimeDxe/UndiAipImpl.c
+++ b/Drivers/OptionRomPkg/UndiRuntimeDxe/UndiAipImpl.c
@@ -18,7 +18,9 @@ EFI_GUID   mSupportedInfoTypes[] = {

   This function returns information of type InformationType from the adapter.
   If an adapter does not support the requested informational type, then
-  EFI_UNSUPPORTED is returned.
+  EFI_UNSUPPORTED is returned. If an adapter does not contain Information for
+  the requested InformationType, it fills InformationBlockSize with 0 and
+  returns EFI_NOT_FOUND.

   @param[in]  This   A pointer to the 
EFI_ADAPTER_INFORMATION_PROTOCOL instance.
   @param[in]  InformationTypeA pointer to an EFI_GUID that defines the 
contents of InformationBlock.
@@ -28,6 +30,7 @@ EFI_GUID   mSupportedInfoTypes[] = {

   @retval EFI_SUCCESSThe InformationType information was 
retrieved.
   @retval EFI_UNSUPPORTEDThe InformationType is not known.
+  @retval EFI_NOT_FOUND  Information is not available for the 
requested information type.
   @retval EFI_DEVICE_ERROR   The device reported an error.
   @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to 
a lack of resources.
   @retval EFI_INVALID_PARAMETER  This is NULL.
--
2.39.1.windows.1



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




Re: [edk2-devel] [PATCH v5 3/3] ShellPkg: UefiShellDebug1CommandsLib: Conformance Profiles in Dmem.c

2024-04-09 Thread Gao, Zhichao
You cannot change across packages. You need to separate the MdePkg change into 
one single patch and get reviewed by the reviewer/maintainer of MdePkg.

Thanks,
Zhichao

> -Original Message-
> From: Sam Kaynor 
> Sent: Wednesday, April 10, 2024 2:53 AM
> To: devel@edk2.groups.io
> Cc: Ni, Ray ; Gao, Zhichao ;
> Kinney, Michael D ; Liming Gao
> ; Liu, Zhiguang 
> Subject: [PATCH v5 3/3] ShellPkg: UefiShellDebug1CommandsLib:
> Conformance Profiles in Dmem.c
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352
> 
> Implemented dumping of the UEFI Conformance Profiles Table using
> Dmem.c Additionally added the base support for the table with new header
> file ConformanceProfiles.h (Cc'd maintainers of MdePkg for this)
> 
> Cc: Ray Ni 
> Cc: Zhichao Gao 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Signed-off-by: Sam Kaynor 
> Tested-by: Stuart Yoder 
> Reviewed-by: Stuart Yoder 
> Reviewed-by: Zhichao Gao 
> ---
> 
> Notes:
> v5:
> - corrected style error (spaces before '(')
> v3:
> - fixed build errors
> - properly using Address variable
> - removed unecessary comment in header file
> 
>  MdePkg/MdePkg.dec  | 
>  5 ++
> 
> ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Commands
> Lib.inf |  3 +
>  MdePkg/Include/Guid/ConformanceProfiles.h  | 
> 56
> 
>  ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c | 
> 69
> 
> 
> ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Commands
> Lib.uni |  5 ++
>  5 files changed, 138 insertions(+)
> 
> diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index
> bf94549cbfbd..2c053a7459f3 100644
> --- a/MdePkg/MdePkg.dec
> +++ b/MdePkg/MdePkg.dec
> @@ -746,6 +746,11 @@ [Guids]
>## Include/Guid/DeviceAuthentication.h
>gEfiDeviceSignatureDatabaseGuid  = { 0xb9c2b4f4, 0xbf5f, 0x462d, {0x8a,
> 0xdf, 0xc5, 0xc7, 0xa, 0xc3, 0x5d, 0xad }}
> 
> +  ## Include/Guid/ConformanceProfiles.h
> +  gEfiConfProfilesTableGuid= { 0x36122546, 0xf7e7, 0x4c8f, { 0xbd, 
> 0x9b,
> 0xeb, 0x85, 0x25, 0xb5, 0x0c, 0x0b }}
> +  gEfiConfProfilesUefiSpecGuid = { 0x523c91af, 0xa195, 0x4382, { 0x81,
> 0x8d, 0x29, 0x5f, 0xe4, 0x00, 0x64, 0x65 }}
> +  gEfiConfProfilesEbbrSpecGuid = { 0xcce33c35, 0x74ac, 0x4087, { 0xbc,
> 0xe7, 0x8b, 0x29, 0xb0, 0x2e, 0xeb, 0x27 }}
> +
>#
># GUID defined in PI1.0
>#
> diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> dsLib.inf
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> dsLib.inf
> index 3741dac5d94c..172ac2862ba1 100644
> ---
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> dsLib.inf
> +++
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> d
> +++ sLib.inf
> @@ -139,3 +139,6 @@ [Guids]
>gEfiJsonConfigDataTableGuid ## SOMETIMES_CONSUMES ##
> SystemTable
>gEfiJsonCapsuleDataTableGuid## SOMETIMES_CONSUMES ##
> SystemTable
>gEfiJsonCapsuleResultTableGuid  ## SOMETIMES_CONSUMES ##
> SystemTable
> +  gEfiConfProfilesTableGuid   ## SOMETIMES_CONSUMES ## SystemTable
> +  gEfiConfProfilesUefiSpecGuid## SOMETIMES_CONSUMES ## GUID
> +  gEfiConfProfilesEbbrSpecGuid## SOMETIMES_CONSUMES ## GUID
> diff --git a/MdePkg/Include/Guid/ConformanceProfiles.h
> b/MdePkg/Include/Guid/ConformanceProfiles.h
> new file mode 100644
> index ..c6211d63d79c
> --- /dev/null
> +++ b/MdePkg/Include/Guid/ConformanceProfiles.h
> @@ -0,0 +1,56 @@
> +/** @file
> +  Legal information
> +
> +**/
> +
> +#ifndef __CONFORMANCE_PROFILES_TABLE_GUID_H__
> +#define __CONFORMANCE_PROFILES_TABLE_GUID_H__
> +
> +
> +//
> +// This table allows the platform to advertise its UEFI specification
> +conformance // in the form of pre-defined profiles. Each profile is
> +identified by a GUID, with // known profiles listed in the section below.
> +// The absence of this table shall indicate that the platform
> +implementation is // conformant with the UEFI specification requirements,
> as defined in Section 2.6.
> +// This is equivalent to publishing this configuration table with the
> +// EFI_CONFORMANCE_PROFILES_UEFI_SPEC_GUID conformance profile.
> +//
> +#define EFI_CONFORMANCE_PROFILES_TABLE_GUID \
> +  { \
> +0x36122546, 0xf7e7, 0x4c8f, { 0xbd, 0x9b, 0xeb, 0x85, 0x25, 0xb5,
> +0x0c, 0x0b } \
> +  }
> +
> +#pragma pack(1)
> +
> +typedef struct {
> +  ///
> +  /// Version of the table must be 0x1
> +  ///
> +  UINT16 Version;
> +  ///
> +  /// The number of profiles GUIDs present in ConformanceProfiles
> +  ///
> +  UINT16 NumberOfProfiles;
> +  ///
> +  /// An array of conformance profile GUIDs that are supported by this
> system.
> +  /// EFI_GUIDConformanceProfiles[];
> +  ///
> +} EFI_CONFORMANCE_PROFILES_TABLE;
> +
> +#define EFI_CONFORMANCE_PROFILES_TABLE_VERSION 0x1
> +
> +//
> +// GUID defined in spec.
> 

[edk2-devel] [PATCH] SecurityPkg/OpalPasswordDxe: Update UI according to UEFI spec

2024-04-09 Thread Cindy Kuo
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4735

Should not call HiiGetBrowserData() and HiiSetBrowserData() in FORM_OPEN
call back function.
Those APIs are called within OpalHiiSetBrowserData/OpalHiiGetBrowserData
which have been used by OpalHii.c.

1. Change callback action from FORM_OPEN to RETRIEVE.
2. Create dummy label with suppressif statement in VFR for form update
usage.
3. Add HiiUpdateForm() to force reparsing the IFR binary.

Cc: Jiewen Yao 
Cc: Rahul Kumar 
Cc: Dandan Bi 
Cc: Ming Tan 
Cc: Arthur Chen 
Cc: Xiao X Chen 
Cc: Tina Chen 
Signed-off-by: CindyX Kuo 
---
 .../Tcg/Opal/OpalPassword/OpalDriver.h|  1 +
 SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c   | 76 +--
 .../Tcg/Opal/OpalPassword/OpalHiiFormValues.h |  5 ++
 .../Tcg/Opal/OpalPassword/OpalPasswordDxe.inf |  1 +
 .../Opal/OpalPassword/OpalPasswordForm.vfr| 10 +++
 5 files changed, 86 insertions(+), 7 deletions(-)

diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.h 
b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.h
index 2089bd81b6..1a4671c602 100644
--- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.h
+++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.h
@@ -23,6 +23,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c 
b/SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c
index 8035f44ebe..b513c053b9 100644
--- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c
+++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c
@@ -40,6 +40,7 @@ EFI_HII_HANDLE  gHiiPackageListHandle = NULL;
 //
 const EFI_GUID  gHiiPackageListGuid   = PACKAGE_LIST_GUID;
 const EFI_GUID  gHiiSetupVariableGuid = SETUP_VARIABLE_GUID;
+const EFI_GUID  gOpalSetupFormSetGuid = SETUP_FORMSET_GUID;
 
 //
 // Structure that contains state of the HII
@@ -611,10 +612,15 @@ DriverCallback (
   EFI_BROWSER_ACTION_REQUEST*ActionRequest
   )
 {
-  HII_KEYHiiKey;
-  UINT8  HiiKeyId;
-  UINT32 PpRequest;
-  OPAL_DISK  *OpalDisk;
+  HII_KEY HiiKey;
+  UINT8   HiiKeyId;
+  UINT32  PpRequest;
+  OPAL_DISK   *OpalDisk;
+  EFI_STATUS  Status;
+  VOID*StartOpCodeHandle;
+  VOID*EndOpCodeHandle;
+  EFI_IFR_GUID_LABEL  *StartLabel;
+  EFI_IFR_GUID_LABEL  *EndLabel;
 
   if (ActionRequest != NULL) {
 *ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
@@ -632,16 +638,72 @@ DriverCallback (
   HiiKey.Raw = QuestionId;
   HiiKeyId   = (UINT8)HiiKey.KeyBits.Id;
 
-  if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
+  if (Action == EFI_BROWSER_ACTION_RETRIEVE) {
+//
+// Allocate space for creation of UpdateData Buffer
+//
+StartOpCodeHandle = HiiAllocateOpCodeHandle ();
+if (StartOpCodeHandle == NULL) {
+  return EFI_OUT_OF_RESOURCES;
+}
+EndOpCodeHandle = HiiAllocateOpCodeHandle ();
+if (EndOpCodeHandle == NULL) {
+  return EFI_OUT_OF_RESOURCES;
+}
+
+//
+// Create Hii Extend Label OpCode as the start opcode
+//
+StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode 
(StartOpCodeHandle, , NULL, sizeof (EFI_IFR_GUID_LABEL));
+StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
+
+//
+// Create Hii Extend Label OpCode as the end opcode
+//
+EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (EndOpCodeHandle, 
, NULL, sizeof (EFI_IFR_GUID_LABEL));
+EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
+
 switch (HiiKeyId) {
   case HII_KEY_ID_VAR_SUPPORTED_DISKS:
 DEBUG ((DEBUG_INFO, "HII_KEY_ID_VAR_SUPPORTED_DISKS\n"));
-return HiiPopulateMainMenuForm ();
+Status = HiiPopulateMainMenuForm ();
+
+StartLabel->Number = OPAL_MAIN_MENU_LABEL_START;
+EndLabel->Number   = OPAL_MAIN_MENU_LABEL_END;
+HiiUpdateForm (
+  gHiiPackageListHandle,
+  (EFI_GUID *),
+  FORMID_VALUE_MAIN_MENU,
+  StartOpCodeHandle,
+  EndOpCodeHandle
+  );
+break;
 
   case HII_KEY_ID_VAR_SELECTED_DISK_AVAILABLE_ACTIONS:
 DEBUG ((DEBUG_INFO, 
"HII_KEY_ID_VAR_SELECTED_DISK_AVAILABLE_ACTIONS\n"));
-return HiiPopulateDiskInfoForm ();
+Status = HiiPopulateDiskInfoForm ();
+
+StartLabel->Number = OPAL_DISK_INFO_LABEL_START;
+EndLabel->Number   = OPAL_DISK_INFO_LABEL_END;
+HiiUpdateForm (
+  gHiiPackageListHandle,
+  (EFI_GUID *),
+  FORMID_VALUE_DISK_INFO_FORM_MAIN,
+  StartOpCodeHandle,
+  EndOpCodeHandle
+  );
+break;
+
+  default:
+Status = EFI_UNSUPPORTED;
+break;
 }
+
+HiiFreeOpCodeHandle (StartOpCodeHandle);
+HiiFreeOpCodeHandle (EndOpCodeHandle);
+
+return Status;
+
   } else if (Action == EFI_BROWSER_ACTION_CHANGING) {
 switch (HiiKeyId) {
   case HII_KEY_ID_GOTO_DISK_INFO:
diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalHiiFormValues.h 

[edk2-devel] [PATCH v2] SecurityPkg/OpalPasswordDxe: Update UI according to UEFI spec

2024-04-09 Thread Cindy Kuo
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4735

Should not call HiiGetBrowserData() and HiiSetBrowserData() in FORM_OPEN
call back function.
Those APIs are called within OpalHiiSetBrowserData/OpalHiiGetBrowserData
which have been used by OpalHii.c.

1. Change callback action from FORM_OPEN to RETRIEVE.
2. Create dummy label with suppressif statement in VFR for form update
usage.
3. Add HiiUpdateForm() to force reparsing the IFR binary.

Cc: Jiewen Yao 
Cc: Rahul Kumar 
Cc: Dandan Bi 
Cc: Ming Tan 
Cc: Arthur Chen 
Cc: Xiao X Chen 
Cc: Tina Chen 
Signed-off-by: CindyX Kuo 
---
 .../Tcg/Opal/OpalPassword/OpalDriver.h|  1 +
 SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c   | 76 +--
 .../Tcg/Opal/OpalPassword/OpalHiiFormValues.h |  6 ++
 .../Tcg/Opal/OpalPassword/OpalPasswordDxe.inf |  1 +
 .../Opal/OpalPassword/OpalPasswordForm.vfr| 10 +++
 5 files changed, 87 insertions(+), 7 deletions(-)

diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.h 
b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.h
index 2089bd81b6..1a4671c602 100644
--- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.h
+++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.h
@@ -23,6 +23,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c 
b/SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c
index 8035f44ebe..9c9d700645 100644
--- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c
+++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalHii.c
@@ -40,6 +40,7 @@ EFI_HII_HANDLE  gHiiPackageListHandle = NULL;
 //
 const EFI_GUID  gHiiPackageListGuid   = PACKAGE_LIST_GUID;
 const EFI_GUID  gHiiSetupVariableGuid = SETUP_VARIABLE_GUID;
+const EFI_GUID  gOpalSetupFormSetGuid = SETUP_FORMSET_GUID;
 
 //
 // Structure that contains state of the HII
@@ -611,10 +612,15 @@ DriverCallback (
   EFI_BROWSER_ACTION_REQUEST*ActionRequest
   )
 {
-  HII_KEYHiiKey;
-  UINT8  HiiKeyId;
-  UINT32 PpRequest;
-  OPAL_DISK  *OpalDisk;
+  HII_KEY HiiKey;
+  UINT8   HiiKeyId;
+  UINT32  PpRequest;
+  OPAL_DISK   *OpalDisk;
+  EFI_STATUS  Status;
+  VOID*StartOpCodeHandle;
+  VOID*EndOpCodeHandle;
+  EFI_IFR_GUID_LABEL  *StartLabel;
+  EFI_IFR_GUID_LABEL  *EndLabel;
 
   if (ActionRequest != NULL) {
 *ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
@@ -632,16 +638,72 @@ DriverCallback (
   HiiKey.Raw = QuestionId;
   HiiKeyId   = (UINT8)HiiKey.KeyBits.Id;
 
-  if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
+  if (Action == EFI_BROWSER_ACTION_RETRIEVE) {
+//
+// Allocate space for creation of UpdateData Buffer
+//
+StartOpCodeHandle = HiiAllocateOpCodeHandle ();
+if (StartOpCodeHandle == NULL) {
+  return EFI_OUT_OF_RESOURCES;
+}
+
+EndOpCodeHandle = HiiAllocateOpCodeHandle ();
+if (EndOpCodeHandle == NULL) {
+  return EFI_OUT_OF_RESOURCES;
+}
+
+//
+// Create Hii Extend Label OpCode as the start opcode
+//
+StartLabel   = (EFI_IFR_GUID_LABEL *)HiiCreateGuidOpCode 
(StartOpCodeHandle, , NULL, sizeof (EFI_IFR_GUID_LABEL));
+StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
+
+//
+// Create Hii Extend Label OpCode as the end opcode
+//
+EndLabel   = (EFI_IFR_GUID_LABEL *)HiiCreateGuidOpCode 
(EndOpCodeHandle, , NULL, sizeof (EFI_IFR_GUID_LABEL));
+EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
+
 switch (HiiKeyId) {
   case HII_KEY_ID_VAR_SUPPORTED_DISKS:
 DEBUG ((DEBUG_INFO, "HII_KEY_ID_VAR_SUPPORTED_DISKS\n"));
-return HiiPopulateMainMenuForm ();
+Status = HiiPopulateMainMenuForm ();
+
+StartLabel->Number = OPAL_MAIN_MENU_LABEL_START;
+EndLabel->Number   = OPAL_MAIN_MENU_LABEL_END;
+HiiUpdateForm (
+  gHiiPackageListHandle,
+  (EFI_GUID *),
+  FORMID_VALUE_MAIN_MENU,
+  StartOpCodeHandle,
+  EndOpCodeHandle
+  );
+break;
 
   case HII_KEY_ID_VAR_SELECTED_DISK_AVAILABLE_ACTIONS:
 DEBUG ((DEBUG_INFO, 
"HII_KEY_ID_VAR_SELECTED_DISK_AVAILABLE_ACTIONS\n"));
-return HiiPopulateDiskInfoForm ();
+Status = HiiPopulateDiskInfoForm ();
+
+StartLabel->Number = OPAL_DISK_INFO_LABEL_START;
+EndLabel->Number   = OPAL_DISK_INFO_LABEL_END;
+HiiUpdateForm (
+  gHiiPackageListHandle,
+  (EFI_GUID *),
+  FORMID_VALUE_DISK_INFO_FORM_MAIN,
+  StartOpCodeHandle,
+  EndOpCodeHandle
+  );
+break;
+
+  default:
+Status = EFI_UNSUPPORTED;
+break;
 }
+
+HiiFreeOpCodeHandle (StartOpCodeHandle);
+HiiFreeOpCodeHandle (EndOpCodeHandle);
+
+return Status;
   } else if (Action == EFI_BROWSER_ACTION_CHANGING) {
 switch (HiiKeyId) {
   case HII_KEY_ID_GOTO_DISK_INFO:
diff --git 

Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/2] RedfishClientPkg/Features: release resources

2024-04-09 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Reviewed-by: Abner Chang 

> -Original Message-
> From: Nickle Wang 
> Sent: Monday, April 1, 2024 10:18 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Igor Kulchytskyy
> ; Nick Ramirez 
> Subject: [edk2-redfish-client][PATCH v2 2/2] RedfishClientPkg/Features: 
> release
> resources
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> -Release Etag and PendingSettingUri resources.
> -Update function header for GetHttpResponseEtag() and
> GetHttpResponseLocation(). Caller has to release returned
> memory buffer from these two functions.
> -Fix typo.
>
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nick Ramirez 
> ---
>  .../Features/Bios/v1_0_9/Common/BiosCommon.c  |  2 +-
>  .../Features/Bios/v1_0_9/Dxe/BiosDxe.c| 20 --
>  .../BootOption/v1_0_4/Dxe/BootOptionDxe.c | 33 -
>  .../BootOptionCollectionDxe.c |  2 +-
>  .../v1_13_0/Dxe/ComputerSystemDxe.c   | 33 -
>  .../v1_5_0/Dxe/ComputerSystemDxe.c| 33 -
>  .../ComputerSystemCollectionDxe.c |  2 +-
>  .../Features/Memory/V1_7_1/Dxe/MemoryDxe.c| 37 ++-
>  .../MemoryCollectionDxe/MemoryCollectionDxe.c |  2 +-
>  .../RedfishFeatureUtilityLib.c|  2 +
>  10 files changed, 118 insertions(+), 48 deletions(-)
>
> diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> index f40fe215a..5dc97876c 100644
> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> @@ -815,7 +815,7 @@ HandleResource (
>
>//
>// Check and see if target property exist or not even when collection 
> member
> exists.
> -  // If not, we sill do provision.
> +  // If not, we still do provision.
>//
>DEBUG ((REDFISH_DEBUG_TRACE, "%a Check for %s\n", __func__, Uri));
>Status = EdkIIRedfishResourceConfigCheck (, Uri, NULL);
> diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> index bb64ef862..5955917f2 100644
> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> @@ -158,8 +158,12 @@ RedfishResourceConsumeResource (
>//
>// Searching for etag in HTTP response header
>//
> -  Etag = NULL;
> -  GetHttpResponseEtag (ExpectedResponse, );
> +  Etag   = NULL;
> +  Status = GetHttpResponseEtag (ExpectedResponse, );
> +  if (EFI_ERROR (Status)) {
> +DEBUG ((DEBUG_ERROR, "%a, failed to get ETag from HTTP header\n",
> __func__));
> +  }
> +
>Status = RedfishConsumeResourceCommon (Private, Private->Json, Etag);
>if (EFI_ERROR (Status)) {
>  DEBUG ((DEBUG_ERROR, "%a: failed to consume resource from: %s: %r\n",
> __func__, Private->Uri, Status));
> @@ -338,8 +342,12 @@ RedfishResourceCheck (
>//
>// Find etag in HTTP response header
>//
> -  Etag = NULL;
> -  GetHttpResponseEtag (, );
> +  Etag   = NULL;
> +  Status = GetHttpResponseEtag (, );
> +  if (EFI_ERROR (Status)) {
> +DEBUG ((DEBUG_ERROR, "%a, failed to get ETag from HTTP header\n",
> __func__));
> +  }
> +
>Status = RedfishCheckResourceCommon (Private, Private->Json, Etag);
>if (EFI_ERROR (Status)) {
>  DEBUG ((DEBUG_ERROR, "%a, failed to check resource from: %s: %r\n",
> __func__, Uri, Status));
> @@ -348,6 +356,10 @@ RedfishResourceCheck (
>//
>// Release resource
>//
> +  if (Etag != NULL) {
> +FreePool (Etag);
> +  }
> +
>RedfishHttpFreeResponse ();
>Private->Payload = NULL;
>
> diff --git a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> index 5a66fe59e..1a1262403 100644
> --- a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> +++ b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> @@ -122,12 +122,13 @@ RedfishResourceConsumeResource (
>//
>// Check and see if "@Redfish.Settings" exist or not.
>//
> -  Status = GetPendingSettings (
> - Private->RedfishService,
> - Response.Payload,
> - ,
> - 
> - );
> +  PendingSettingUri = NULL;
> +  Status= GetPendingSettings (
> +Private->RedfishService,
> +Response.Payload,
> +,
> +
> +);
>if (!EFI_ERROR (Status)) {
>  DEBUG ((REDFISH_BOOT_OPTION_DEBUG_TRACE, "%a: @Redfish.Settings
> found: %s\n", __func__, PendingSettingUri));
>  SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
> @@ -147,8 +148,12 @@ RedfishResourceConsumeResource (
>//
>// Find etag in 

Re: [edk2-devel] [edk2-redfish-client][PATCH v2 1/2] RedfishClientPkg/Features: support Redfish Secure Boot

2024-04-09 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Hi Nickle,
I don't see the obvious coding error in this patch. However, I think we can 
remove HPE copyright from Redfish secure boot feature driver, as this is a new 
feature driver and HPE doesn't have contributions to these files, right? If so, 
then please remove it.

Thanks

Reviewed-by: Abner Chang 

> -Original Message-
> From: Nickle Wang 
> Sent: Monday, April 1, 2024 10:18 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Igor Kulchytskyy
> ; Nick Ramirez 
> Subject: [edk2-redfish-client][PATCH v2 1/2] RedfishClientPkg/Features:
> support Redfish Secure Boot
>
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
>
>
> Introduce SecureBoot driver to support
> /redfish/v1/Systems/SYS/SecureBoot resource.
>
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nick Ramirez 
> ---
>  .../RedfishClientComponents.dsc.inc   |   2 +
>  RedfishClientPkg/RedfishClientLibs.dsc.inc|   4 +
>  .../SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf   |  60 ++
>  .../v1_1_0/Common/SecureBootCommon.h  |  40 +
>  .../v1_1_0/Common/SecureBootCommon.c  | 765 +
>  .../SecureBoot/v1_1_0/Dxe/SecureBootDxe.c | 809 ++
>  RedfishClientPkg/RedfishClient.fdf.inc|   1 +
>  7 files changed, 1681 insertions(+)
>  create mode 100644
> RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
>  create mode 100644
> RedfishClientPkg/Features/SecureBoot/v1_1_0/Common/SecureBootCommo
> n.h
>  create mode 100644
> RedfishClientPkg/Features/SecureBoot/v1_1_0/Common/SecureBootCommo
> n.c
>  create mode 100644
> RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.c
>
> diff --git a/RedfishClientPkg/RedfishClientComponents.dsc.inc
> b/RedfishClientPkg/RedfishClientComponents.dsc.inc
> index ae2a4b025..42fc0c299 100644
> --- a/RedfishClientPkg/RedfishClientComponents.dsc.inc
> +++ b/RedfishClientPkg/RedfishClientComponents.dsc.inc
> @@ -34,6 +34,7 @@
>RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf
>
> RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.in
> f
>RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.inf
> +  RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
>
>!include RedfishClientPkg/RedfishJsonStructureDxe.dsc.inc
>
> @@ -47,3 +48,4 @@
>RedfishClientPkg/Converter/Bios/v1_0_9/RedfishBios_V1_0_9_Dxe.inf
>
> RedfishClientPkg/Converter/BootOptionCollection/RedfishBootOptionCollecti
> on_Dxe.inf
>
> RedfishClientPkg/Converter/BootOption/v1_0_4/RedfishBootOption_V1_0_4_
> Dxe.inf
> +
> RedfishClientPkg/Converter/SecureBoot/v1_1_0/RedfishSecureBoot_V1_1_0_
> Dxe.inf
> diff --git a/RedfishClientPkg/RedfishClientLibs.dsc.inc
> b/RedfishClientPkg/RedfishClientLibs.dsc.inc
> index 6599926ab..9126465df 100644
> --- a/RedfishClientPkg/RedfishClientLibs.dsc.inc
> +++ b/RedfishClientPkg/RedfishClientLibs.dsc.inc
> @@ -25,6 +25,8 @@
>
> BiosV1_0_9Lib|RedfishClientPkg/ConverterLib/edk2library/Bios/v1_0_9/Lib.in
> f
>
> BootOptionCollectionLib|RedfishClientPkg/ConverterLib/edk2library/BootOp
> tionCollection/Lib.inf
>
> BootOptionV1_0_4Lib|RedfishClientPkg/ConverterLib/edk2library/BootOptio
> n/v1_0_4/Lib.inf
> +
> SecureBootV1_1_0Lib|RedfishClientPkg/ConverterLib/edk2library/SecureBoot
> /v1_1_0/Lib.inf
> +
>#
># Above modules should be pulled in by build tool.
>#
> @@ -42,3 +44,5 @@
>
> RedfishAddendumLib|RedfishClientPkg/Library/RedfishAddendumLib/Redfis
> hAddendumLib.inf
>RedfishDebugLib|RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
>RedfishHttpLib|RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
> +
> SecureBootVariableLib|SecurityPkg/Library/SecureBootVariableLib/SecureBo
> otVariableLib.inf
> +
> PlatformPKProtectionLib|SecurityPkg/Library/PlatformPKProtectionLibVarPolic
> y/PlatformPKProtectionLibVarPolicy.inf
> diff --git
> a/RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
> b/RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
> new file mode 100644
> index 0..1ad8c623f
> --- /dev/null
> +++ b/RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
> @@ -0,0 +1,60 @@
> +## @file
> +#
> +#  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
> +#  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +
> +
> +[Defines]
> +  INF_VERSION   = 0x00010005
> +  BASE_NAME = SecureBootDxe
> +  FILE_GUID = 5E4025F8-DA42-468A-853E-6A1091D35052
> +  MODULE_TYPE   = DXE_DRIVER
> +  VERSION_STRING= 1.0
> +  ENTRY_POINT   = RedfishResourceEntryPoint
> +  UNLOAD_IMAGE  = RedfishResourceUnload
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> 

Re: [edk2-devel] [PATCH] SecurityPkg/Tcg2Config: Hide BIOS unsupported hash algorithm from UI

2024-04-09 Thread Xu, Wei6
Thanks Rahul for reviewing this patch.
I created a PR with adding Rahul's 'Reviewed-by' in the commit message: 
https://github.com/tianocore/edk2/pull/5538
Could anyone help to merge it? Thanks a lot.

BR,
Wei

>-Original Message-
>From: Kumar, Rahul R 
>Sent: Friday, March 29, 2024 11:36 AM
>To: devel@edk2.groups.io; Xu, Wei6 
>Cc: Yao, Jiewen 
>Subject: RE: [edk2-devel] [PATCH] SecurityPkg/Tcg2Config: Hide BIOS
>unsupported hash algorithm from UI
>
>Looks good.
>Reviewed-by: Rahul Kumar 
>
>-Original Message-
>From: devel@edk2.groups.io  On Behalf Of Xu, Wei6
>Sent: Monday, March 18, 2024 8:41 AM
>To: devel@edk2.groups.io
>Cc: Xu, Wei6 ; Kumar, Rahul R
>; Yao, Jiewen 
>Subject: [edk2-devel] [PATCH] SecurityPkg/Tcg2Config: Hide BIOS
>unsupported hash algorithm from UI
>
>REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4731
>
>TCG2 configuration UI shows all the hash algorithms that TPM hardware
>supports in the checkbox. If user only selects one algorithm that is supported
>by TPM hardware but not supported by BIOS and uncheck the others, the
>SyncPcrAllocationsAndPcrMask in Tcg2Pei will not be able to decide a viable
>PCR to activate, then an assert occurs.
>
>Add check against PcdTcg2HashAlgorithmBitmap when deciding whether to
>suppress the hash algorithm checkbox to avoid user to select the hash
>algorithm which may cause an assert.
>
>Cc: Rahul Kumar 
>Cc: Jiewen Yao 
>Signed-off-by: Wei6 Xu 
>---
> SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c | 61 ++---
> 1 file changed, 41 insertions(+), 20 deletions(-)
>
>diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c
>b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c
>index 6eb04c014448..39b639039525 100644
>--- a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c
>+++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c
>@@ -722,33 +722,50 @@ FillBufferWithBootHashAlg (  }
>
> /**
>-  Set ConfigInfo according to TpmAlgHash.
>+  Set ConfigInfo according to TpmAlgHash and BiosHashAlgBitmap.
>
>   @param[in,out] Tcg2ConfigInfo   TCG2 config info.
>   @param[in] TpmAlgHash   TpmAlgHash.
>+  @param[in] BiosHashAlgBitmapBios Hash Algorithm Bitmap.
>
> **/
> VOID
> SetConfigInfo (
>   IN OUT TCG2_CONFIGURATION_INFO  *Tcg2ConfigInfo,
>-  IN UINT32   TpmAlgHash
>+  IN UINT32   TpmAlgHash,
>+  IN UINT32   BiosHashAlgBitmap
>   )
> {
>   switch (TpmAlgHash) {
> case TPM_ALG_SHA1:
>-  Tcg2ConfigInfo->Sha1Supported = TRUE;
>+  if ((BiosHashAlgBitmap & HASH_ALG_SHA1) != 0) {
>+Tcg2ConfigInfo->Sha1Supported = TRUE;
>+  }
>+
>   break;
> case TPM_ALG_SHA256:
>-  Tcg2ConfigInfo->Sha256Supported = TRUE;
>+  if ((BiosHashAlgBitmap & HASH_ALG_SHA256) != 0) {
>+Tcg2ConfigInfo->Sha256Supported = TRUE;
>+  }
>+
>   break;
> case TPM_ALG_SHA384:
>-  Tcg2ConfigInfo->Sha384Supported = TRUE;
>+  if ((BiosHashAlgBitmap & HASH_ALG_SHA384) != 0) {
>+Tcg2ConfigInfo->Sha384Supported = TRUE;
>+  }
>+
>   break;
> case TPM_ALG_SHA512:
>-  Tcg2ConfigInfo->Sha512Supported = TRUE;
>+  if ((BiosHashAlgBitmap & HASH_ALG_SHA512) != 0) {
>+Tcg2ConfigInfo->Sha512Supported = TRUE;
>+  }
>+
>   break;
> case TPM_ALG_SM3_256:
>-  Tcg2ConfigInfo->Sm3Supported = TRUE;
>+  if ((BiosHashAlgBitmap & HASH_ALG_SM3_256) != 0) {
>+Tcg2ConfigInfo->Sm3Supported = TRUE;
>+  }
>+
>   break;
>   }
> }
>@@ -809,16 +826,17 @@ InstallTcg2ConfigForm (
>   IN OUT TCG2_CONFIG_PRIVATE_DATA  *PrivateData
>   )
> {
>-  EFI_STATUS  Status;
>-  EFI_HII_HANDLE  HiiHandle;
>-  EFI_HANDLE  DriverHandle;
>-  EFI_HII_CONFIG_ACCESS_PROTOCOL  *ConfigAccess;
>-  UINTN   Index;
>-  TPML_PCR_SELECTION  Pcrs;
>-  CHAR16  TempBuffer[1024];
>-  TCG2_CONFIGURATION_INFO Tcg2ConfigInfo;
>-  TPM2_PTP_INTERFACE_TYPE TpmDeviceInterfaceDetected;
>-  BOOLEAN IsCmdImp = FALSE;
>+  EFI_STATUS   Status;
>+  EFI_HII_HANDLE   HiiHandle;
>+  EFI_HANDLE   DriverHandle;
>+  EFI_HII_CONFIG_ACCESS_PROTOCOL   *ConfigAccess;
>+  UINTNIndex;
>+  TPML_PCR_SELECTION   Pcrs;
>+  CHAR16   TempBuffer[1024];
>+  TCG2_CONFIGURATION_INFO  Tcg2ConfigInfo;
>+  TPM2_PTP_INTERFACE_TYPE  TpmDeviceInterfaceDetected;
>+  BOOLEAN  IsCmdImp;
>+  EFI_TCG2_EVENT_ALGORITHM_BITMAP  BiosHashAlgorithmBitmap;
>
>   DriverHandle = NULL;
>   ConfigAccess = >ConfigAccess; @@ -879,6 +897,8 @@
>InstallTcg2ConfigForm (
>   break;
>   }
>
>+  BiosHashAlgorithmBitmap = PcdGet32 (PcdTcg2HashAlgorithmBitmap);
>+
>   ZeroMem (, sizeof (Tcg2ConfigInfo));
>   Status = Tpm2GetCapabilityPcrs ();
>   if (EFI_ERROR (Status)) {
>@@ -897,20 

Re: 回复: 回复: [edk2-devel] [PATCH v2 0/2] Update BaseTools NULL Include and Library Matching

2024-04-09 Thread Taylor Beebe

Hi Liming,

I made a mistake in patch 2 of the v2 series. In v3, lines 126 and 144 
of WorkspaceCommon.py update the check to:


`LibraryClassName[4:].isdigit()`

instead of

`LibraryClass[4:].isdigit()`

Can you re-review with this change?

-Taylor

On 4/1/2024 6:37 PM, gaoliming via groups.io wrote:

Taylor:
   Thanks for you detail information. I understand this problem. I agree your fix. 
Reviewed-by: Liming Gao 

Thanks
Liming




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




[edk2-devel] [PATCH v3 2/2] BaseTools: Use Stronger Matching for NULL Linked Libraries

2024-04-09 Thread Taylor Beebe
To prevent the possibility that a library with a name like
NULLTestLib is interpreted as a NULL linked library, use
more explicit pattern matching to ensure that the library
name follows the pattern NULL%d.

Cc: Rebecca Cran 
Cc: Liming Gao 
Cc: Bob Feng 
Cc: Yuwei Chen 

Signed-off-by: Taylor Beebe 
---
 BaseTools/Source/Python/GenFds/FfsInfStatement.py| 4 ++--
 BaseTools/Source/Python/Workspace/WorkspaceCommon.py | 8 
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py 
b/BaseTools/Source/Python/GenFds/FfsInfStatement.py
index 6550d939d4..ec9713484e 100644
--- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py
+++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py
@@ -93,7 +93,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
 
 if ModuleType != SUP_MODULE_USER_DEFINED and ModuleType != 
SUP_MODULE_HOST_APPLICATION:
 for LibraryClass in 
PlatformDataBase.LibraryClasses.GetKeys():
-if LibraryClass.startswith("NULL") and 
PlatformDataBase.LibraryClasses[LibraryClass, ModuleType]:
+if LibraryClass.startswith("NULL") and 
LibraryClass[4:].isdigit() and PlatformDataBase.LibraryClasses[LibraryClass, 
ModuleType]:
 self.InfModule.LibraryClasses[LibraryClass] = 
PlatformDataBase.LibraryClasses[LibraryClass, ModuleType]
 
 StrModule = str(self.InfModule)
@@ -101,7 +101,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
 if StrModule in PlatformDataBase.Modules:
 PlatformModule = PlatformDataBase.Modules[StrModule]
 for LibraryClass in PlatformModule.LibraryClasses:
-if LibraryClass.startswith("NULL"):
+if LibraryClass.startswith("NULL") and 
LibraryClass[4:].isdigit():
 self.InfModule.LibraryClasses[LibraryClass] = 
PlatformModule.LibraryClasses[LibraryClass]
 
 DependencyList = [self.InfModule]
diff --git a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py 
b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
index 8bb6553c6f..6ad7a3b940 100644
--- a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
+++ b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
@@ -102,12 +102,12 @@ def GetModuleLibInstances(Module, Platform, 
BuildDatabase, Arch, Target, Toolcha
 #
 if Module.ModuleType != SUP_MODULE_USER_DEFINED:
 for LibraryClass in Platform.LibraryClasses.GetKeys():
-if LibraryClass.startswith("NULL") and 
Platform.LibraryClasses[LibraryClass, Module.ModuleType]:
+if LibraryClass.startswith("NULL") and LibraryClass[4:].isdigit() 
and Platform.LibraryClasses[LibraryClass, Module.ModuleType]:
 Module.LibraryClasses[LibraryClass] = 
Platform.LibraryClasses[LibraryClass, Module.ModuleType]
 
 # add forced library instances (specified in module overrides)
 for LibraryClass in Platform.Modules[str(Module)].LibraryClasses:
-if LibraryClass.startswith("NULL"):
+if LibraryClass.startswith("NULL") and LibraryClass[4:].isdigit():
 Module.LibraryClasses[LibraryClass] = 
Platform.Modules[str(Module)].LibraryClasses[LibraryClass]
 
 # EdkII module
@@ -123,7 +123,7 @@ def GetModuleLibInstances(Module, Platform, BuildDatabase, 
Arch, Target, Toolcha
 while len(LibraryConsumerList) > 0:
 M = LibraryConsumerList.pop()
 for LibraryClassName in M.LibraryClasses:
-if LibraryClassName.startswith("NULL") and bool(M.LibraryClass):
+if LibraryClassName.startswith("NULL") and 
LibraryClassName[4:].isdigit() and bool(M.LibraryClass):
 continue
 if LibraryClassName not in LibraryInstance:
 # override library instance for this module
@@ -141,7 +141,7 @@ def GetModuleLibInstances(Module, Platform, BuildDatabase, 
Arch, Target, Toolcha
 
 LibraryModule = BuildDatabase[LibraryPath, Arch, Target, 
Toolchain]
 # for those forced library instance (NULL library), add a fake 
library class
-if LibraryClassName.startswith("NULL"):
+if LibraryClassName.startswith("NULL") and 
LibraryClassName[4:].isdigit():
 
LibraryModule.LibraryClass.append(LibraryClassObject(LibraryClassName, 
[ModuleType]))
 elif LibraryModule.LibraryClass is None \
  or len(LibraryModule.LibraryClass) == 0 \
-- 
2.40.1.vfs.0.0



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




[edk2-devel] [PATCH v3 0/2] Update BaseTools NULL Include and Library Matching

2024-04-09 Thread Taylor Beebe
v1:
  - Initial patch series
v2:
  - Simplified the check for if the currently evaluated inf is a module or 
library.
  - Added a commit to use stronger matching of NULL includes (check for pattern 
"NULL")
v3:
  - In the WorkspaceCommon.py lines 126 and 144 should check 
LibraryClassName[4:].isdigit()
instead of LibraryClass[4:].isdigit().

Taylor Beebe (2):
  BaseTools: Don't Recurse NULL Includes Not Linked to Module
  BaseTools: Use Stronger Matching for NULL Linked Libraries

 BaseTools/Source/Python/GenFds/FfsInfStatement.py| 4 ++--
 BaseTools/Source/Python/Workspace/WorkspaceCommon.py | 8 +---
 2 files changed, 7 insertions(+), 5 deletions(-)

-- 
2.40.1.vfs.0.0



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




[edk2-devel] [PATCH v3 1/2] BaseTools: Don't Recurse NULL Includes Not Linked to Module

2024-04-09 Thread Taylor Beebe
When collecting the required library instances for modules and
libraries, included libraries will be recursed to ensure the module is
built with all the libraries directly linked to it and indirectly
linked to it via included libraries.

Using the following scenario as an example:

[LibraryClasses.common.DXE_CORE]
NULL|Path/To/Library1.inf // Includes DebugLib

[LibraryClasses.common.DXE_DRIVER]
NULL|Path/To/Library2.inf // Includes DebugLib

[LibraryClasses.common.DXE_CORE, LibraryClasses.common.DXE_DRIVER]
DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf

[Components]
MdeModulePkg/Core/Dxe/DxeMain.inf // Includes DebugLib

The DXE_CORE NULL library will be assigned a fake library class like
NULL1 and the DXE_DRIVER will be assigned NULL2. The recursion logic
will see NULL1 as a directly linked and will add an instance of it to
the list of libraries which need to be included in the module. When
DebugLib is evaluated, the recursion logic will add the libraries
DebugLib depends on to the queue which includes both NULL1 and NULL2.
When NULL2 is unqueued, an instance of it will also be added to the
list of libraries needed to build DxeMain which now means that both
NULL1 and NULL2 have been linked.

NULL includes outside of module overrides are not supported according
to the spec, but we do it anyways so this seems like a case which
should be fixed. This change updates the recursion logic to skip
evaluating NULL libraries unless they are linked directly to the
module/library being evaluated.

Cc: Rebecca Cran 
Cc: Liming Gao 
Cc: Bob Feng 
Cc: Yuwei Chen 

Signed-off-by: Taylor Beebe 
Reviewed-by: Liming Gao 
---
 BaseTools/Source/Python/Workspace/WorkspaceCommon.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py 
b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
index 9e506fc646..8bb6553c6f 100644
--- a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
+++ b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py
@@ -123,6 +123,8 @@ def GetModuleLibInstances(Module, Platform, BuildDatabase, 
Arch, Target, Toolcha
 while len(LibraryConsumerList) > 0:
 M = LibraryConsumerList.pop()
 for LibraryClassName in M.LibraryClasses:
+if LibraryClassName.startswith("NULL") and bool(M.LibraryClass):
+continue
 if LibraryClassName not in LibraryInstance:
 # override library instance for this module
 LibraryPath = 
Platform.Modules[str(Module)].LibraryClasses.get(LibraryClassName,Platform.LibraryClasses[LibraryClassName,
 ModuleType])
-- 
2.40.1.vfs.0.0



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




Re: [edk2-devel] [linux-collab] [CCC][tac] [RFC PATCH] OvmfPkg/SecurityPkg: Add build option for coexistance of vTPM and RTMR.

2024-04-09 Thread qinkun Bao via groups.io
I brought the RFC into the CCC community
(https://github.com/confidential-computing/governance) and received
some comments.

Forward the email into the EDK2 dev and linux-coco.

Thanks,
Qinkun

-- Forwarded message -
From: Mingshen Sun 
Date: Thu, Apr 4, 2024 at 1:43 PM
Subject: Re: [External] Re: [linux-collab] [CCC][tac] [RFC PATCH]
OvmfPkg/SecurityPkg: Add build option for coexistance of vTPM and
RTMR.
To: 
Cc: ,



Hi Qinkun,

Thanks for bringing this to the CCC community.

I think the proposal makes sense to me. RTMR and vTPM measurements
shouldn't be mutually exclusive.

Under certain threat models (e.g., workload operator is not trusted),
both of them may be valid.
1. Measurements of RTMR and vTPM can be used for cross validation with
different root-of-trust.
2. Key sealing feature provided by vTPM is not available in the
current TEE ecosystem.

Mingshen


On Thu, Apr 4, 2024 at 12:32 PM qinkun Bao via


lists.confidentialcomputing.io
 wrote:
>
> Hello,
>
> The current TDVF implementation does not extend to the vTPM if the
> RTMR attestation is enabled. We are working on proposals to address
> the issue. We would like to get the feedback from the CCC community
> about the proposal.
>
> Thanks,
> Qinkun
>
> On Thu, Apr 4, 2024 at 12:16 PM qinkun Bao via
> lists.confidentialcomputing.io
>  wrote:
> >
> >
> >
> > -- Forwarded message -
> > From: qinkun Bao 
> > Date: Thu, Mar 21, 2024 at 9:59 AM
> > Subject: [RFC PATCH] OvmfPkg/SecurityPkg: Add build option for coexistance 
> > of vTPM and RTMR.
> > To: 
> > Cc: , Erdem Aktas , 
> > Jiewen Yao , Ard Biesheuvel , Peter 
> > Gonda , Dionna Glaze , Qinkun 
> > Bao , James Bottomley , Gerd 
> > Hoffmann , Tom Lendacky , 
> > Michael Roth 
> >
> >
> > From: Qinkun Bao 
> >
> > The UEFI v2.10 spec defines the protocol EFI_CC_MEASUREMENT_PROTOCOL
> > to enable (for example) RTMR-based boot measurement for TDX VMs.
> > With the current UEFI spec’s “should not” wording and EDK2
> > implementation, TPM measurement in TDVF is disabled when
> > RTMR measurement is enabled.
> >
> > Mutual exclusion of the CC measurement protocol and TCG measurement
> > protocol breaks backwards compatibility, which makes adoption of RTMRs
> > challenging. A virtualized TPM device (vTPM) managed by the host VMM
> > makes boot measurements visible to the VMM operator, but this is an
> > oft-requested feature that users can choose to accept.
> >
> > The TPM has been a standard for over a decade and many existing
> > applications rely on the TPM. Both inside and outside Google,
> > we have many users that require vTPM, including features that are
> > not easily available via RTMRs (e.g. sealing using keys that the
> > guest OS cannot access).
> >
> > This patch adds a non-default build option to allow the coexistence
> > of both the CC measurement and TCG protocols. Not included is a
> > vendor-specific measured event in the CC event log that indicates
> > whether a vTPM is attached or not.
> >
> > Cc: Erdem Aktas 
> > Cc: James Bottomley 
> > Cc: Jiewen Yao 
> > Cc: Gerd Hoffmann 
> > Cc: Tom Lendacky 
> > Cc: Michael Roth 
> > Signed-off-by: Qinkun Bao 
> > ---
> >  OvmfPkg/OvmfPkgX64.dsc   |  9 -
> >  .../DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c| 12 +++-
> >  .../DxeTpmMeasurementLib/DxeTpmMeasurementLib.c  |  6 ++
> >  3 files changed, 25 insertions(+), 2 deletions(-)
> >
> > diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
> > index 56c920168d..9bcee45047 100644
> > --- a/OvmfPkg/OvmfPkgX64.dsc
> > +++ b/OvmfPkg/OvmfPkgX64.dsc
> > @@ -32,7 +32,8 @@
> >DEFINE SECURE_BOOT_ENABLE  = FALSE
> >DEFINE SMM_REQUIRE = FALSE
> >DEFINE SOURCE_DEBUG_ENABLE = FALSE
> > -  DEFINE CC_MEASUREMENT_ENABLE   = FALSE
> > +  DEFINE CC_MEASUREMENT_ENABLE   = TRUE
> > +  DEFINE CC_MEASUREMENT_AND_TCG2_COEXIST  = FASLE
> >
> >  !include OvmfPkg/Include/Dsc/OvmfTpmDefines.dsc.inc
> >
> > @@ -99,6 +100,11 @@
> >INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable
> >  !endif
> >RELEASE_*_*_GENFW_FLAGS = --zero
> > +!if $(CC_MEASUREMENT_ENABLE) == TRUE && $(CC_MEASUREMENT_AND_TCG2_COEXIST) 
> > == TRUE
> > +  MSFT:*_*_*_CC_FLAGS = /D CC_MEASUREMENT_AND_TCG2_COEXIST_FEATURE
> > +  INTEL:*_*_*_CC_FLAGS = /D CC_MEASUREMENT_AND_TCG2_COEXIST_FEATURE
> > +  GCC:*_*_*_CC_FLAGS = -D CC_MEASUREMENT_AND_TCG2_COEXIST_FEATURE
> > +!endif
> >
> >#
> ># Disable deprecated APIs.
> > @@ -1045,6 +1051,7 @@
> >}
> >  !endif
> >
> > +
> >#
> ># TPM support
> >#
> > diff --git 
> > a/SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c 
> > b/SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c
> > index 73719f3b96..4c9bc8ab4a 100644
> > --- a/SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c
> > +++ b/SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c
> > @@ -325,7 +325,12 @@ Tcg2MeasureGptTable (
> >  

[edk2-devel] [PATCH v5 0/3] Adding support for verbose UEFI Table dumping to Dmem.c

2024-04-09 Thread Sam Kaynor
This adds an additional option to the dmem UEFI shell command for verbose 
dumping of a couple of UEFI tables.

The tables specified are the RT Properties Table, the Image Execution Table, 
and the Conformance Profiles table.

Supporting objects are added in the .inf and .uni files relating to Dmem.c and 
an additional header file for the Conformance Profiles table was added.

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

v4->v5:
- Coding style issues resolved
- Comment for 'GetBaseName' corrected

Cc: Ray Ni 
Cc: Zhichao Gao 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Stuart Yoder 
Signed-off-by: Sam Kaynor 

Sam Kaynor (3):
  ShellPkg: UefiShellDebug1CommandsLib: Dumping RT Properties in Dmem.c
  ShellPkg: UefiShellDebug1CommandsLib: Image Execution Table in Dmem.c
  ShellPkg: UefiShellDebug1CommandsLib: Conformance Profiles in Dmem.c

 MdePkg/MdePkg.dec  |   
5 +
 ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf |   
3 +
 MdePkg/Include/Guid/ConformanceProfiles.h  |  
56 
 ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c | 
317 ++--
 ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni |  
31 +-
 5 files changed, 385 insertions(+), 27 deletions(-)
 create mode 100644 MdePkg/Include/Guid/ConformanceProfiles.h

-- 
2.34.1



[edk2-devel] [PATCH v5 2/3] ShellPkg: UefiShellDebug1CommandsLib: Image Execution Table in Dmem.c

2024-04-09 Thread Sam Kaynor
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352

Implemented dumping of the Image Execution Table using Dmem.c

Cc: Ray Ni 
Cc: Zhichao Gao 
Signed-off-by: Sam Kaynor 
Tested-by: Stuart Yoder 
Reviewed-by: Stuart Yoder 
Reviewed-by: Zhichao Gao 
---

Notes:
v5:
- corrected comment for GetBaseName
- corrected style error (spaces before '(')
v4:
- changed Image Execution output to match spec
v3:
- fixed build erros
- added setwidth formatting to output
- properly using Address variable

 ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c | 
135 
 ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni |   
3 +
 2 files changed, 138 insertions(+)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
index 2975e21b0a42..a4f404c1cdbd 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
@@ -139,6 +139,138 @@ DisplayRtProperties (
   return (ShellStatus);
 }
 
+/**
+  Retrieve the ImageExecutionTable Entry ImageName from ImagePath
+
+  @param[in]  FilenameThe full path of the image.
+  @param[out] BasenameThe name of the image.
+**/
+EFI_STATUS
+GetBaseName (
+  IN  CHAR16  *FileName,
+  OUT CHAR16  **BaseName
+  )
+{
+  UINT32  StrLen;
+  CHAR16  *StrTail;
+
+  StrLen = StrSize (FileName);
+
+  for (StrTail = FileName + StrLen - 1; StrTail != FileName && *StrTail != 
L'\\'; StrTail--) {
+  }
+
+  if (StrTail == FileName) {
+return EFI_NOT_FOUND;
+  }
+  *BaseName = StrTail+1;
+
+  return EFI_SUCCESS;
+}
+
+/**
+  Retrieve the ImageExecutionTable entries
+
+  @param[in] AddressThe pointer to the ImageExecutionTable.
+**/
+EFI_STATUS
+GetImageExecutionInfo (
+  IN UINT64 Address
+  )
+{
+  EFI_STATUS Status;
+  EFI_IMAGE_EXECUTION_INFO_TABLE *ExecInfoTablePtr;
+  EFI_IMAGE_EXECUTION_INFO   *InfoPtr;
+  VOID   *ptr;
+  CHAR16 *ImagePath;
+  CHAR16 *ImageName;
+  UINTN  *NumberOfImages;
+  CHAR16 *ActionType;
+
+  ExecInfoTablePtr = (EFI_IMAGE_EXECUTION_INFO_TABLE *)Address;
+
+  NumberOfImages = >NumberOfImages;
+
+  ptr = (VOID *) (ExecInfoTablePtr + 1);
+
+  for (int Image = 0; Image < *NumberOfImages; Image++, ptr += 
InfoPtr->InfoSize) {
+InfoPtr = ptr;
+ImagePath = (CHAR16*) (InfoPtr + 1);
+
+GetBaseName (ImagePath,);
+
+switch (InfoPtr->Action) {
+  case EFI_IMAGE_EXECUTION_AUTHENTICATION:
+ActionType = L"AUTHENTICATION";
+break;
+  case EFI_IMAGE_EXECUTION_AUTH_UNTESTED:
+ActionType = L"AUTH_UNTESTED";
+break;
+  case EFI_IMAGE_EXECUTION_AUTH_SIG_FAILED:
+ActionType = L"AUTH_SIG_FAILED";
+break;
+  case EFI_IMAGE_EXECUTION_AUTH_SIG_PASSED:
+ActionType = L"AUTH_SIG_PASSED";
+break;
+  case EFI_IMAGE_EXECUTION_AUTH_SIG_NOT_FOUND:
+ActionType = L"AUTH_SIG_NOT_FOUND";
+break;
+  case EFI_IMAGE_EXECUTION_AUTH_SIG_FOUND:
+ActionType = L"AUTH_SIG_FOUND";
+break;
+  case EFI_IMAGE_EXECUTION_POLICY_FAILED:
+ActionType = L"POLICY_FAILED";
+break;
+  case EFI_IMAGE_EXECUTION_INITIALIZED:
+ActionType = L"INITIALIZED";
+break;
+  default:
+ActionType = L"invalid action";
+}
+
+Status = ShellPrintHiiEx (
+  -1,
+  -1,
+  NULL,
+  STRING_TOKEN (STR_DMEM_IMG_EXE_ENTRY),
+  gShellDebug1HiiHandle,
+  ImageName,
+  ActionType
+);
+  }
+
+  return Status;
+}
+
+/**
+  Display the ImageExecutionTable entries
+
+  @param[in] AddressThe pointer to the ImageExecutionTable.
+**/
+SHELL_STATUS
+DisplayImageExecutionEntries (
+  IN UINT64 Address
+  )
+{
+  SHELL_STATUSShellStatus;
+  EFI_STATUS  Status;
+
+  ShellStatus = SHELL_SUCCESS;
+
+  if (Address != 0) {
+ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_IMG_EXE_TABLE), 
gShellDebug1HiiHandle);
+Status = GetImageExecutionInfo (Address);
+if (EFI_ERROR (Status)) {
+  ShellStatus = SHELL_ABORTED;
+  ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_ERR_GET_FAIL), 
gShellDebug1HiiHandle, L"ImageExecutionTable");
+}
+  } else {
+ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_ERR_NOT_FOUND), 
gShellDebug1HiiHandle, L"ImageExecutionTable");
+  }
+  return (ShellStatus);
+}
+
+
+
 STATIC CONST SHELL_PARAM_ITEM  ParamList[] = {
   { L"-mmio", TypeFlag },
   { L"-verbose", TypeFlag },
@@ -369,6 +501,9 @@ ShellCommandRunDmem (
   if (ShellStatus == SHELL_SUCCESS) {
 ShellStatus = DisplayRtProperties (RtPropertiesTableAddress);
   }
+  if (ShellStatus == SHELL_SUCCESS) {
+ShellStatus = DisplayImageExecutionEntries 
(ImageExecutionTableAddress);
+

[edk2-devel] [PATCH v5 1/3] ShellPkg: UefiShellDebug1CommandsLib: Dumping RT Properties in Dmem.c

2024-04-09 Thread Sam Kaynor
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352

Implemented the dumping of the UEFI RT Properties Table using Dmem.c

Added new entry to the help command for the -verbose option

Cc: Ray Ni 
Cc: Zhichao Gao 
Signed-off-by: Sam Kaynor 
Tested-by: Stuart Yoder 
Reviewed-by: Stuart Yoder 
Reviewed-by: Zhichao Gao 
---

Notes:
v5:
- corrected style error (spaces before '(')
v4:
- fixed crash when RTProperties table not present
- expanded help output to include -verbose option
v3:
- fixed build errors
- properly using Address variable

 ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c | 
113 +++-
 ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni |  
23 +++-
 2 files changed, 109 insertions(+), 27 deletions(-)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
index a609971f345e..2975e21b0a42 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
@@ -34,7 +34,7 @@ MakePrintable (
   IN CONST CHAR16  Char
   )
 {
-  if (((Char < 0x20) && (Char > 0)) || (Char > 126)) {
+  if ( ( (Char < 0x20) && (Char > 0)) || (Char > 126)) {
 return (L'?');
   }
 
@@ -71,12 +71,12 @@ DisplayMmioMemory (
 return SHELL_OUT_OF_RESOURCES;
   }
 
-  Status = PciRbIo->Mem.Read (PciRbIo, EfiPciWidthUint8, 
(UINT64)(UINTN)Address, Size, Buffer);
+  Status = PciRbIo->Mem.Read (PciRbIo, EfiPciWidthUint8, (UINT64) 
(UINTN)Address, Size, Buffer);
   if (EFI_ERROR (Status)) {
 ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_ER), 
gShellDebug1HiiHandle, L"dmem");
 ShellStatus = SHELL_NOT_FOUND;
   } else {
-ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_MMIO_HEADER_ROW), 
gShellDebug1HiiHandle, (UINT64)(UINTN)Address, Size);
+ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_MMIO_HEADER_ROW), 
gShellDebug1HiiHandle, (UINT64) (UINTN)Address, Size);
 DumpHex (2, (UINTN)Address, Size, Buffer);
   }
 
@@ -84,8 +84,64 @@ DisplayMmioMemory (
   return (ShellStatus);
 }
 
+/**
+  Display the RtPropertiesTable entries
+
+  @param[in] AddressThe pointer to the RtPropertiesTable.
+**/
+SHELL_STATUS
+DisplayRtProperties (
+  IN UINT64 Address
+  )
+{
+  EFI_RT_PROPERTIES_TABLE *RtPropertiesTable;
+  UINT32  RtServices;
+  SHELL_STATUSShellStatus;
+  EFI_STATUS  Status;
+
+  ShellStatus = SHELL_SUCCESS;
+
+  if (Address != 0) {
+RtPropertiesTable = (EFI_RT_PROPERTIES_TABLE *)Address;
+
+RtServices = (UINT32)RtPropertiesTable->RuntimeServicesSupported;
+Status = ShellPrintHiiEx (
+  -1,
+  -1,
+  NULL,
+  STRING_TOKEN (STR_DMEM_RT_PROPERTIES),
+  gShellDebug1HiiHandle,
+  EFI_RT_PROPERTIES_TABLE_VERSION,
+  (RtServices & EFI_RT_SUPPORTED_GET_TIME) ? 1 : 0,
+  (RtServices & EFI_RT_SUPPORTED_SET_TIME) ? 1 : 0,
+  (RtServices & EFI_RT_SUPPORTED_GET_WAKEUP_TIME) ? 1 : 0,
+  (RtServices & EFI_RT_SUPPORTED_SET_WAKEUP_TIME) ? 1 : 0,
+  (RtServices & EFI_RT_SUPPORTED_GET_VARIABLE) ? 1 : 0,
+  (RtServices & EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME) ? 1 : 0,
+  (RtServices & EFI_RT_SUPPORTED_SET_VARIABLE) ? 1 : 0,
+  (RtServices & EFI_RT_SUPPORTED_SET_VIRTUAL_ADDRESS_MAP) ? 1 : 0,
+  (RtServices & EFI_RT_SUPPORTED_CONVERT_POINTER) ? 1 : 0,
+  (RtServices & EFI_RT_SUPPORTED_GET_NEXT_HIGH_MONOTONIC_COUNT) ? 1 : 0,
+  (RtServices & EFI_RT_SUPPORTED_RESET_SYSTEM) ? 1 : 0,
+  (RtServices & EFI_RT_SUPPORTED_UPDATE_CAPSULE) ? 1 : 0,
+  (RtServices & EFI_RT_SUPPORTED_QUERY_CAPSULE_CAPABILITIES) ? 1 : 0,
+  (RtServices & EFI_RT_SUPPORTED_QUERY_VARIABLE_INFO) ? 1 : 0
+  );
+
+if (EFI_ERROR (Status)) {
+  ShellStatus = SHELL_ABORTED;
+  ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_ERR_GET_FAIL), 
gShellDebug1HiiHandle, L"RtPropertiesTable");
+}
+  } else {
+ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_ERR_NOT_FOUND), 
gShellDebug1HiiHandle, L"RtPropertiesTable");
+  }
+
+  return (ShellStatus);
+}
+
 STATIC CONST SHELL_PARAM_ITEM  ParamList[] = {
   { L"-mmio", TypeFlag },
+  { L"-verbose", TypeFlag },
   { NULL, TypeMax  }
 };
 
@@ -147,7 +203,7 @@ ShellCommandRunDmem (
   //
   Status = ShellCommandLineParse (ParamList, , , TRUE);
   if (EFI_ERROR (Status)) {
-if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam != NULL)) {
+if ( (Status == EFI_VOLUME_CORRUPTED) && (ProblemParam != NULL)) {
   ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), 
gShellDebug1HiiHandle, L"dmem", ProblemParam);
   FreePool (ProblemParam);
   ShellStatus = SHELL_INVALID_PARAMETER;
@@ -183,7 +239,7 @@ ShellCommandRunDmem (
 
 if (ShellStatus == SHELL_SUCCESS) {
   if (!ShellCommandLineGetFlag (Package, L"-mmio")) {
-ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN 

[edk2-devel] [PATCH v5 3/3] ShellPkg: UefiShellDebug1CommandsLib: Conformance Profiles in Dmem.c

2024-04-09 Thread Sam Kaynor
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352

Implemented dumping of the UEFI Conformance Profiles Table using Dmem.c
Additionally added the base support for the table with new
header file ConformanceProfiles.h (Cc'd maintainers of MdePkg for this)

Cc: Ray Ni 
Cc: Zhichao Gao 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Signed-off-by: Sam Kaynor 
Tested-by: Stuart Yoder 
Reviewed-by: Stuart Yoder 
Reviewed-by: Zhichao Gao 
---

Notes:
v5:
- corrected style error (spaces before '(')
v3:
- fixed build errors
- properly using Address variable
- removed unecessary comment in header file

 MdePkg/MdePkg.dec  |  
5 ++
 ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf |  
3 +
 MdePkg/Include/Guid/ConformanceProfiles.h  | 
56 
 ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c | 
69 
 ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni |  
5 ++
 5 files changed, 138 insertions(+)

diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index bf94549cbfbd..2c053a7459f3 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -746,6 +746,11 @@ [Guids]
   ## Include/Guid/DeviceAuthentication.h
   gEfiDeviceSignatureDatabaseGuid  = { 0xb9c2b4f4, 0xbf5f, 0x462d, {0x8a, 
0xdf, 0xc5, 0xc7, 0xa, 0xc3, 0x5d, 0xad }}
 
+  ## Include/Guid/ConformanceProfiles.h
+  gEfiConfProfilesTableGuid= { 0x36122546, 0xf7e7, 0x4c8f, { 0xbd, 
0x9b, 0xeb, 0x85, 0x25, 0xb5, 0x0c, 0x0b }}
+  gEfiConfProfilesUefiSpecGuid = { 0x523c91af, 0xa195, 0x4382, { 0x81, 
0x8d, 0x29, 0x5f, 0xe4, 0x00, 0x64, 0x65 }}
+  gEfiConfProfilesEbbrSpecGuid = { 0xcce33c35, 0x74ac, 0x4087, { 0xbc, 
0xe7, 0x8b, 0x29, 0xb0, 0x2e, 0xeb, 0x27 }}
+
   #
   # GUID defined in PI1.0
   #
diff --git 
a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
index 3741dac5d94c..172ac2862ba1 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
@@ -139,3 +139,6 @@ [Guids]
   gEfiJsonConfigDataTableGuid ## SOMETIMES_CONSUMES ## SystemTable
   gEfiJsonCapsuleDataTableGuid## SOMETIMES_CONSUMES ## SystemTable
   gEfiJsonCapsuleResultTableGuid  ## SOMETIMES_CONSUMES ## SystemTable
+  gEfiConfProfilesTableGuid   ## SOMETIMES_CONSUMES ## SystemTable
+  gEfiConfProfilesUefiSpecGuid## SOMETIMES_CONSUMES ## GUID
+  gEfiConfProfilesEbbrSpecGuid## SOMETIMES_CONSUMES ## GUID
diff --git a/MdePkg/Include/Guid/ConformanceProfiles.h 
b/MdePkg/Include/Guid/ConformanceProfiles.h
new file mode 100644
index ..c6211d63d79c
--- /dev/null
+++ b/MdePkg/Include/Guid/ConformanceProfiles.h
@@ -0,0 +1,56 @@
+/** @file
+  Legal information
+
+**/
+
+#ifndef __CONFORMANCE_PROFILES_TABLE_GUID_H__
+#define __CONFORMANCE_PROFILES_TABLE_GUID_H__
+
+
+//
+// This table allows the platform to advertise its UEFI specification 
conformance
+// in the form of pre-defined profiles. Each profile is identified by a GUID, 
with
+// known profiles listed in the section below.
+// The absence of this table shall indicate that the platform implementation is
+// conformant with the UEFI specification requirements, as defined in Section 
2.6.
+// This is equivalent to publishing this configuration table with the
+// EFI_CONFORMANCE_PROFILES_UEFI_SPEC_GUID conformance profile.
+//
+#define EFI_CONFORMANCE_PROFILES_TABLE_GUID \
+  { \
+0x36122546, 0xf7e7, 0x4c8f, { 0xbd, 0x9b, 0xeb, 0x85, 0x25, 0xb5, 0x0c, 
0x0b } \
+  }
+
+#pragma pack(1)
+
+typedef struct {
+  ///
+  /// Version of the table must be 0x1
+  ///
+  UINT16 Version;
+  ///
+  /// The number of profiles GUIDs present in ConformanceProfiles
+  ///
+  UINT16 NumberOfProfiles;
+  ///
+  /// An array of conformance profile GUIDs that are supported by this system.
+  /// EFI_GUIDConformanceProfiles[];
+  ///
+} EFI_CONFORMANCE_PROFILES_TABLE;
+
+#define EFI_CONFORMANCE_PROFILES_TABLE_VERSION 0x1
+
+//
+// GUID defined in spec.
+//
+#define EFI_CONFORMANCE_PROFILES_UEFI_SPEC_GUID \
+{ 0x523c91af, 0xa195, 0x4382, \
+{ 0x81, 0x8d, 0x29, 0x5f, 0xe4, 0x00, 0x64, 0x65 }}
+#define EFI_CONFORMANCE_PROFILE_EBBR_2_1_GUID \
+{ 0xcce33c35, 0x74ac, 0x4087, \
+{ 0xbc, 0xe7, 0x8b, 0x29, 0xb0, 0x2e, 0xeb, 0x27 }}
+
+extern EFI_GUID  gEfiConfProfilesTableGuid;
+extern EFI_GUID  gEfiConfProfilesUefiSpecGuid;
+
+#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
index a4f404c1cdbd..53ee2b01f918 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /**
   Make a 

Re: [edk2-devel] [PATCH v2 1/1] OvmfPkg: OVMF supports USB mouses

2024-04-09 Thread Pedro Falcato
On Tue, Apr 9, 2024 at 12:56 PM Gerd Hoffmann  wrote:
>
> On Mon, Apr 08, 2024 at 08:53:10AM +0100, Phillip Tennen wrote:
> > Hi, thank you for taking a look at the patch!
> >
> > This patch can be verified to be working with this app (which was the
> > motivation for submitting this):
> > https://github.com/codyd51/uefirc/releases/tag/1.0.1.
>
> Quoting https://github.com/codyd51/uefirc:
>
> Q: Should I use this?
> A: This should not exist.
>
> Well.  This certainly one of the more interesting ways to have some fun
> and improve your rust coding skills.  But a justification to include a
> mouse driver by default which is not used by anything else?  IMHO it
> isn't.

Maybe some better reasons:

1) It has been conspicuously missing from OVMF. I've heard N questions
over the years (on the #osdev IRC, etc) regarding their mouse code not
working on OVMF, whereas you'd see that protocol in other normal
platforms
2) UsbMouseDxe is part of upstream MdeModulePkg and has no testable
upstream consumers. One needs to patch their OVMF to test this easily
(or flash it onto some other hardware, which is hard to get for most
people, except for maybe the rpi platforms).
3) I don't believe (or would hope) OVMF maintainers will have
maintenance overhead from the inclusion. One would hope UsbMouseDxe
as-is is correct, and that the QEMU USB mouse is correct (or you'd see
the problem from the guest OS's side as well).
4) Mouse support is part of the spec (if you want to argue it
shouldn't be in the spec in the first place, I'd agree)

For sure, UsbMouseDxe isn't #1 on my most desired EFI modules list
(e.g I'd love to eventually be able to consume Ext4Dxe from OVMF,
where it'd actually be useful, if I can ever ditch edk2-platforms),
but I don't really see the harm in doing it.

There's an argument in giving people a full-fledged UEFI
implementation of most protocols. OVMF is *the* platform in mainline
edk2 after all :)

-- 
Pedro


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




Re: [edk2-devel] [PATCH 0/9] Add DeviceSecurity feature based on PFP 1.06 spec

2024-04-09 Thread Michael D Kinney
+Leif

Adding a new submodule requires review by the stewards to review
the license and the health and support of the submodule project.

The top level Readme also requires updates.  It lists all the submodules
and licenses used. Please update this series with the Readme changes.

https://github.com/tianocore/edk2?tab=readme-ov-file#license-details

I also notice that libspdm has its own .gitmodules file that pulls
in more submodules.

[submodule "os_stub/openssllib/openssl"]
path = os_stub/openssllib/openssl
url = https://github.com/openssl/openssl
[submodule "os_stub/mbedtlslib/mbedtls"]
path = os_stub/mbedtlslib/mbedtls
url = https://github.com/ARMmbed/mbedtls
[submodule "unit_test/cmockalib/cmocka"]
path = unit_test/cmockalib/cmocka
url = https://git.cryptomilk.org/projects/cmocka.git


edk2 already had openssl and mbedtls as submodules, does this mean that
openssl and mbedtls will be cloned twice in 2 different locations now?

The edk2 project had issues with the stability of the cmocka server
and changed to a tianocore mirror of the cmocka submodule to improve
CI stability. This is another submodule that will be cloned twice and
may reintroduce the potential for CI stability issues.

Thanks,

Mike

> -Original Message-
> From: Hou, Wenxing 
> Sent: Monday, April 1, 2024 7:31 PM
> To: devel@edk2.groups.io
> Cc: Sean Brogan ; Joey Vagedes
> ; Kinney, Michael D
> ; Liming Gao ;
> Andrew Fish ; Liu, Zhiguang ;
> Kumar, Rahul R ; Yao, Jiewen
> 
> Subject: [PATCH 0/9] Add DeviceSecurity feature based on PFP 1.06 spec
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2479
> 
> In PFP spec 1.06, platform firmware records the device certificate and
> device measurement for each SPDM responder.
> This PATCH set implement the DeviceSecurityLib to support spdm device
> Authentication and Measurement.
> 
> Libspdm as submodule is to support DeviceSecurity feature:
> https://github.com/DMTF/libspdm
> 
> TCG PFP spec 1.06:
> https://trustedcomputinggroup.org/resource/pc-client-specific-
> platform-firmware-profile-specification/
> 
> The POC branch:
> https://github.com/tianocore/edk2-staging/tree/DeviceSecurity
> 
> And the PATCH set has passed the EDKII CI:
> https://github.com/tianocore/edk2/pull/5508
> 
> Cc: Sean Brogan 
> Cc: Joey Vagedes 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Andrew Fish 
> Cc: Zhiguang Liu 
> Cc: Rahul Kumar 
> Cc: Jiewen Yao 
> Signed-off-by: Wenxing Hou 
> 
> Wenxing Hou (9):
>   MdePkg: Add SPDM1.2 support.
>   MdePkg: Add TCG PFP 1.06 support.
>   MdePkg: Add devAuthBoot GlobalVariable
>   MdeModulePkg/Variable: Add TCG SPDM device measurement update
>   SecurityPkg: Add TCG PFP 1.06 support.
>   SecurityPkg: add DeviceSecurity support
>   .pytool/CISettings.py: add libspdm submodule.
>   .gitmodule: Add libspdm submodule for EDKII
>   SecurityPkg: Add libspdm submodule
> 
>  .gitmodules   |3 +
>  .pytool/CISettings.py |2 +
>  MdeModulePkg/MdeModulePkg.dec |5 +
>  .../Variable/RuntimeDxe/Measurement.c |   38 +-
>  .../RuntimeDxe/VariableRuntimeDxe.inf |3 +
>  .../RuntimeDxe/VariableSmmRuntimeDxe.inf  |3 +
>  MdePkg/Include/Guid/GlobalVariable.h  |8 +-
>  MdePkg/Include/Guid/ImageAuthentication.h |5 +-
>  MdePkg/Include/IndustryStandard/Spdm.h| 1112
> -
>  .../IndustryStandard/UefiTcgPlatform.h|  186 ++-
>  .../OsStub/CryptlibWrapper/CryptlibWrapper.c  |  970 ++
>  .../CryptlibWrapper/CryptlibWrapper.inf   |   38 +
>  .../OsStub/MemLibWrapper/MemLibWrapper.c  |  177 +++
>  .../OsStub/MemLibWrapper/MemLibWrapper.inf|   33 +
>  .../PlatformLibWrapper/PlatformLibWrapper.c   |   85 ++
>  .../PlatformLibWrapper/PlatformLibWrapper.inf |   33 +
>  .../SpdmLib/Include/Stub/SpdmLibStub.h|  347 +
>  .../SpdmLib/Include/hal/LibspdmStdBoolAlt.h   |   23 +
>  .../SpdmLib/Include/hal/LibspdmStdDefAlt.h|   16 +
>  .../SpdmLib/Include/hal/LibspdmStdIntAlt.h|   25 +
>  .../DeviceSecurity/SpdmLib/Include/hal/base.h |   94 ++
>  .../SpdmLib/Include/hal/library/debuglib.h|   39 +
>  .../SpdmLib/Include/library/spdm_lib_config.h |  394 ++
>  .../DeviceSecurity/SpdmLib/SpdmCommonLib.inf  |   47 +
>  .../DeviceSecurity/SpdmLib/SpdmCryptLib.inf   |   45 +
>  .../SpdmLib/SpdmDeviceSecretLibNull.inf   |   36 +
>  .../SpdmLib/SpdmRequesterLib.inf  |   59 +
>  .../SpdmLib/SpdmResponderLib.inf  |   61 +
>  .../SpdmLib/SpdmSecuredMessageLib.inf |   44 +
>  .../SpdmLib/SpdmTransportMctpLib.inf  |   38 +
>  .../SpdmLib/SpdmTransportPciDoeLib.inf|   38 +
>  SecurityPkg/DeviceSecurity/SpdmLib/libspdm|1 +
>  .../SpdmSecurityLib/SpdmAuthentication.c  |  697 +++
>  .../SpdmSecurityLib/SpdmConnectionInit.c  |  481 +++
>  .../SpdmSecurityLib/SpdmMeasurement.c |  714 +++

Re: [edk2-devel] [PATCH v5 0/6] EDK2-TEST TCG MOR Tests

2024-04-09 Thread Sunny Wang
Thanks for addressing my comments, Abhi.
https://github.com/tianocore/edk2-test/pull/90

Reviewed-by: Sunny Wang 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Abhimanyu Singh 
via groups.io
Sent: Monday, April 8, 2024 11:45 PM
To: devel@edk2.groups.io
Cc: Abhi Singh 
Subject: [edk2-devel] [PATCH v5 0/6] EDK2-TEST TCG MOR Tests

Updates after feedback from Sunny 

-updated several SCT assertion string outputs
-these were done make the assertions more descriptive
-fixed the issue in patch 5/6 that contained stray chars
 from a merge

Patch series:
These tests support platform firmware that implement
MemoryOverwriteRequestControl & MemoryOverwriteRequestControlLock
UEFI variables in accordance with TCG PC Platform Reset Attack
Mitigation Specification.

The patches are split according to the six sections
documented in the SCT spec document referenced below.

SCT spec: https://bugzilla.tianocore.org/show_bug.cgi?id=4374

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

Abhi Singh (5):
  uefi-sct/SctPkg: TCG MOR SetVariable Test
  uefi-sct/SctPkg: TCG MORLOCK SetVariable Test
  uefi-sct/SctPkg: TCG MORLOCK Unlocked State Test
  uefi-sct/SctPkg: TCG MORLOCK Locked No Key State Test
  uefi-sct/SctPkg: TCG MORLOCK Locked with Key State Test

Abhi.Singh (1):
  uefi-sct/SctPkg: TCG Platform Reset Check Test

 uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc  
|1 +
 
uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBoxTest/TCGMemoryOverwriteRequestBBTest.inf
   |   53 +
 
uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBoxTest/Guid.h
|  271 +++
 
uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBoxTest/TCGMemoryOverwriteRequestBBTestMain.h
 |  137 ++
 
uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBoxTest/Guid.c
|  127 ++
 
uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBoxTest/TCGMemoryOverwriteRequestBBTestFunction.c
 | 2390 
 
uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBoxTest/TCGMemoryOverwriteRequestBBTestMain.c
 |  115 +
 uefi-sct/SctPkg/CommonGenFramework.sh  
|1 +
 uefi-sct/SctPkg/Config/Data/Category.ini   
|7 +
 9 files changed, 3102 insertions(+)
 create mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBoxTest/TCGMemoryOverwriteRequestBBTest.inf
 create mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBoxTest/Guid.h
 create mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBoxTest/TCGMemoryOverwriteRequestBBTestMain.h
 create mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBoxTest/Guid.c
 create mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBoxTest/TCGMemoryOverwriteRequestBBTestFunction.c
 create mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBoxTest/TCGMemoryOverwriteRequestBBTestMain.c

--
2.34.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117519): https://edk2.groups.io/g/devel/message/117519
Mute This Topic: https://groups.io/mt/105416468/5985097
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [sunny.w...@arm.com]
-=-=-=-=-=-=


IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117547): https://edk2.groups.io/g/devel/message/117547
Mute This Topic: https://groups.io/mt/105416468/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 7/9] .pytool/CISettings.py: add libspdm submodule.

2024-04-09 Thread Joey Vagedes via groups.io
Reviewed-by: joey.vage...@gmail.com


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117546): https://edk2.groups.io/g/devel/message/117546
Mute This Topic: https://groups.io/mt/105394121/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] OvmfPkg: OVMF supports USB mouses

2024-04-09 Thread Ard Biesheuvel
On Tue, 9 Apr 2024 at 13:56, Gerd Hoffmann  wrote:
>
> On Mon, Apr 08, 2024 at 08:53:10AM +0100, Phillip Tennen wrote:
> > Hi, thank you for taking a look at the patch!
> >
> > This patch can be verified to be working with this app (which was the
> > motivation for submitting this):
> > https://github.com/codyd51/uefirc/releases/tag/1.0.1.
>
> Quoting https://github.com/codyd51/uefirc:
>
> Q: Should I use this?
> A: This should not exist.
>
> Well.  This certainly one of the more interesting ways to have some fun
> and improve your rust coding skills.  But a justification to include a
> mouse driver by default which is not used by anything else?  IMHO it
> isn't.
>

Agreed.

> Note that you can load drivers from efi shell with the 'load' command,
> so there is no need to have a ovmf firmware image with the mouse drivers
> included.  You can boot into efi shell and use a startup.nsh script to
> automatically load drivers needed and start the irc app.
>

startup.nsh is ignored unless you boot into the EFI shell.

UEFI supports 'driver' entries in addition to Boot entries, which
can be programmed (using efibootmgr under Linux, for instance) to
point to a UEFI driver on the ESP that needs to be loaded at boot,
before any boot options are evaluated.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117545): https://edk2.groups.io/g/devel/message/117545
Mute This Topic: https://groups.io/mt/105365480/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] OvmfPkg: OVMF supports USB mouses

2024-04-09 Thread Gerd Hoffmann
On Mon, Apr 08, 2024 at 08:53:10AM +0100, Phillip Tennen wrote:
> Hi, thank you for taking a look at the patch!
> 
> This patch can be verified to be working with this app (which was the
> motivation for submitting this):
> https://github.com/codyd51/uefirc/releases/tag/1.0.1.

Quoting https://github.com/codyd51/uefirc:

Q: Should I use this?
A: This should not exist.

Well.  This certainly one of the more interesting ways to have some fun
and improve your rust coding skills.  But a justification to include a
mouse driver by default which is not used by anything else?  IMHO it
isn't.

Note that you can load drivers from efi shell with the 'load' command,
so there is no need to have a ovmf firmware image with the mouse drivers
included.  You can boot into efi shell and use a startup.nsh script to
automatically load drivers needed and start the irc app.

HTH & take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117544): https://edk2.groups.io/g/devel/message/117544
Mute This Topic: https://groups.io/mt/105365480/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 0/3] Adding support for verbose UEFI Table dumping to Dmem.c

2024-04-09 Thread Gao, Zhichao
The function looks good to me. But still have some coding style issue: "Always 
put space before an open parenthesis"
And for patch #2, the comment of GetBaseName is incorrect.
With the coding style issue fix and comments correction, Reviewed-by: Zhichao 
Gao 

Thanks,
Zhichao

> -Original Message-
> From: Sam Kaynor 
> Sent: Thursday, April 4, 2024 5:20 AM
> To: devel@edk2.groups.io
> Cc: Ni, Ray ; Gao, Zhichao ;
> Kinney, Michael D ; Liming Gao
> ; Liu, Zhiguang ;
> Stuart Yoder 
> Subject: [PATCH v4 0/3] Adding support for verbose UEFI Table dumping to
> Dmem.c
> 
> This adds an additional option to the dmem UEFI shell command for verbose
> dumping of a couple of UEFI tables.
> 
> The tables specified are the RT Properties Table, the Image Execution Table,
> and the Conformance Profiles table.
> 
> Supporting objects are added in the .inf and .uni files relating to Dmem.c and
> an additional header file for the Conformance Profiles table was added.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352
> 
> v3->v4:
> - Resolved crash when RT Properties table isn't present
> - Added output to help command to include -verbose option
> - Changed Image Exe Table output to more closely match spec
> 
> Cc: Ray Ni 
> Cc: Zhichao Gao 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Cc: Stuart Yoder 
> Signed-off-by: Sam Kaynor 
> 
> Sam Kaynor (3):
>   ShellPkg: UefiShellDebug1CommandsLib: Dumping RT Properties in Dmem.c
>   ShellPkg: UefiShellDebug1CommandsLib: Image Execution Table in Dmem.c
>   ShellPkg: UefiShellDebug1CommandsLib: Conformance Profiles in Dmem.c
> 
>  MdePkg/MdePkg.dec  | 
>   5 +
> 
> ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Commands
> Lib.inf |   3 +
>  MdePkg/Include/Guid/ConformanceProfiles.h  | 
>  56 +
>  ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c | 
> 266
> 
> 
> ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Commands
> Lib.uni |  31 ++-
>  5 files changed, 359 insertions(+), 2 deletions(-)  create mode 100644
> MdePkg/Include/Guid/ConformanceProfiles.h
> 
> --
> 2.34.1



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




[edk2-devel] Cancelled Event: TianoCore Bug Triage - APAC / NAMO - Tuesday, April 9, 2024 #cal-cancelled

2024-04-09 Thread Group Notification
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Groups.io Inc//Groups.io Calendar//EN
METHOD:CANCEL
REFRESH-INTERVAL;VALUE=DURATION:PT1H
X-PUBLISHED-TTL:PT1H
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:America/Los_Angeles
LAST-MODIFIED:20231222T233358Z
TZURL:https://www.tzurl.org/zoneinfo-outlook/America/Los_Angeles
X-LIC-LOCATION:America/Los_Angeles
BEGIN:DAYLIGHT
TZNAME:PDT
TZOFFSETFROM:-0800
TZOFFSETTO:-0700
DTSTART:19700308T02
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:PST
TZOFFSETFROM:-0700
TZOFFSETTO:-0800
DTSTART:19701101T02
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
X-GIOIDS:Event:2159780 
UID:mlda.1580078539586725120.r...@groups.io
DTSTAMP:20240409T063004Z
ORGANIZER;CN=Liming Gao;SENT-BY="mailto:gaolim...@byosoft.com.cn":mailto:
 gaolim...@byosoft.com.cn
DTSTART:20240410T013000Z
DTEND:20240410T023000Z
SUMMARY:TianoCore Bug Triage - APAC / NAMO
DESCRIPTION:TianoCore Bug Triage - APAC / NAMO\n\nHosted by Liming Gao\n\
 n
 \n\nMicrosoft Teams meeting\n\n*Join on your computer or mobile a
 pp*\n\nClick here to join the meeting ( https://teams.microsoft.com/l/mee
 tup-join/19%3ameeting_OTk1YzJhN2UtOGQwNi00NjY4LWEwMTktY2JiODRlYTY1NmY0%40
 thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255
 d%22%2c%22Oid%22%3a%226e4ce4c4-1242-431b-9a51-92cd01a5df3c%22%7d )\n\n*Jo
 in with a video conferencing device*\n\nte...@conf.intel.com\n\nVideo Con
 ference ID: 116 062 094 0\n\nAlternate VTC dialing instructions ( https:/
 /conf.intel.com/teams/?conf=1160620940=teams=conf.intel.com=te
 st_call )\n\n*Or call in (audio only)*\n\n+1 916-245-6934\,\,77463821# ( 
 tel:+19162456934\,\,77463821# ) United States\, Sacramento\n\nPhone Confe
 rence ID: 774 638 21#\n\nFind a local number ( https://dialin.teams.micro
 soft.com/d195d438-2daa-420e-b9ea-da26f9d1d6d5?id=77463821 ) | Reset PIN (
  https://mysettings.lync.com/pstnconferencing )\n\nLearn More ( https://a
 ka.ms/JoinTeamsMeeting ) | Meeting options ( https://teams.microsoft.com/
 meetingOptions/?organizerId=b286b53a-1218-4db3-bfc9-3d4c5aa7669e
 =46c98d88-e344-4ed4-8496-4ed7712e255d=19_meeting_OTUyZTg2NjgtNDh
 lNS00ODVlLTllYTUtYzg1OTNjNjdiZjFh@thread.v2=0=en-US )
LOCATION:https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTk1YzJhN
 2UtOGQwNi00NjY4LWEwMTktY2JiODRlYTY1NmY0%40thread.v2/0?context=%7b%22Tid%2
 2%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-
 1242-431b-9a51-92cd01a5df3c%22%7d
SEQUENCE:1
STATUS:CANCELLED
END:VEVENT
END:VCALENDAR


invite.ics
Description: application/ics


[edk2-devel] [PATCH edk2-platforms 1/1] Sophgo/SG2042Pkg: Disable Svpbmt extension

2024-04-09 Thread Jingyu Li
From: "jingyu.li01" 

Disable Svpbmt extension as SG2042 does not support this feature.

Cc: Sunil V L 
Cc: USER0FISH 
Cc: caiyuqing379 
Cc: dahogn 
Cc: meng-cz 
Signed-off-by: Jingyu Li 
Reviewed-by: Sunil V L 
---
 Platform/Sophgo/SG2042_EVB_Board/SG2042.dsc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Platform/Sophgo/SG2042_EVB_Board/SG2042.dsc 
b/Platform/Sophgo/SG2042_EVB_Board/SG2042.dsc
index 127182487126..1198a30d29b8 100644
--- a/Platform/Sophgo/SG2042_EVB_Board/SG2042.dsc
+++ b/Platform/Sophgo/SG2042_EVB_Board/SG2042.dsc
@@ -265,7 +265,7 @@ [PcdsFixedAtBuild]
   gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|TRUE
   gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize|1
   gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE
-  gEfiMdePkgTokenSpaceGuid.PcdRiscVFeatureOverride|0xFFFC
+  gEfiMdePkgTokenSpaceGuid.PcdRiscVFeatureOverride|0xFFF8
   gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler|0x10
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize|0x8000
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117540): https://edk2.groups.io/g/devel/message/117540
Mute This Topic: https://groups.io/mt/105417216/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] OvmfPkg: OVMF supports USB mouses

2024-04-09 Thread Phillip Tennen
Hi, thank you for taking a look at the patch!

This patch can be verified to be working with this app (which was the
motivation for submitting this):
https://github.com/codyd51/uefirc/releases/tag/1.0.1.

I am happy to switch to a tablet device if that's a clearer choice (pending
environment setup/line ending issues on my end while generating the patch).

I am also happy to add this to other Omvf variants, but am less confident in
my ability to test those.

All the best,
Phillip

On Mon, Apr 8, 2024 at 8:35 AM Gerd Hoffmann  wrote:

> On Sat, Apr 06, 2024 at 02:41:54PM +0200, Heinrich Schuchardt wrote:
> > From: Phillip Tennen 
> >
> > From: Phillip Tennen 
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4747
> >
> > UsbMouseDxe was missing from the OVMF build description, so=20
> > the Simple Pointer Protocol wasn't usable from within QEMU.
>
> What is the use case?
>
> How can this be tested?  As far I know neither the edk2 setup utility
> (aka UiApp) nor typical OS boot loaders have mouse support ...
>
> Also note that virtual machines typically do *not* have a mouse but a
> tablet device, so UsbMouseAbsolutePointerDxe looks like the more
> sensible choice to me.
>
> >  OvmfPkg/OvmfPkgX64.dsc | 1 +
> >  OvmfPkg/OvmfPkgX64.fdf | 1 +
>
> What about the other ovmf variants?
>
> take care,
>   Gerd
>
>


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




回复: [edk2-devel] [PATCH v2 1/1] MdeModulePkg/AcpiTableDxe: PCD switch to avoid using ACPI reclaim memory

2024-04-09 Thread gaoliming via groups.io
PR https://github.com/tianocore/edk2/pull/5539 has been created.

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Aaron Li
> 发送时间: 2024年4月1日 10:32
> 收件人: devel@edk2.groups.io; Liming Gao 
> 抄送: Bi, Dandan ; Liu, Yun Y ;
> Yao, Jiewen ; Ni, Ray ; Kinney,
> Michael D ; Liu, Zhiguang
> 
> 主题: Re: [edk2-devel] [PATCH v2 1/1] MdeModulePkg/AcpiTableDxe: PCD
> switch to avoid using ACPI reclaim memory
> 
> Hi Liming,
> 
> Could you please help review and merge it? Thanks.
> 
> Best,
> Aaron
> 
> -Original Message-
> From: Liu, Zhiguang 
> Sent: Monday, April 1, 2024 10:06 AM
> To: Li, Aaron ; devel@edk2.groups.io
> Cc: Bi, Dandan ; Liming Gao
> ; Liu, Yun Y ; Yao, Jiewen
> ; Ni, Ray ; Kinney, Michael D
> 
> Subject: RE: [PATCH v2 1/1] MdeModulePkg/AcpiTableDxe: PCD switch to
> avoid using ACPI reclaim memory
> 
> Reviewed-by: Zhiguang Liu 
> 
> > -Original Message-
> > From: Li, Aaron 
> > Sent: Tuesday, March 26, 2024 3:58 PM
> > To: devel@edk2.groups.io
> > Cc: Liu, Zhiguang ; Bi, Dandan
> > ; Liming Gao ; Liu, Yun
> Y
> > ; Yao, Jiewen ; Ni, Ray
> > ; Kinney, Michael D 
> > Subject: [PATCH v2 1/1] MdeModulePkg/AcpiTableDxe: PCD switch to avoid
> > using ACPI reclaim memory
> >
> > UEFI spec defined ACPI Tables at boot time can be contained in memory of
> > type EfiACPIReclaimMemory or EfiAcpiMemoryNVS, although
> InstallAcpiTable
> > with AcpiTableProtocol will only allocate memory with type
> > EfiACPIReclaimMemory (Except FACS).
> >
> > This patch provides an optional method controlled by PCD to avoid using
> > EfiACPIReclaimMemory, by setting the PCD PcdNoACPIReclaimMemory to
> > TRUE, all ACPI allocated memory will use EfiAcpiMemoryNVS instead.
> >
> > Cc: Zhiguang Liu 
> > Cc: Dandan Bi 
> > Cc: Liming Gao 
> > Cc: Liu Yun 
> > Cc: Jiewen Yao 
> > Cc: Ray Ni 
> > Cc: Michael D Kinney 
> > Signed-off-by: Aaron Li 
> > ---
> >  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c | 37
> > +++-
> >  MdeModulePkg/MdeModulePkg.dec
> |  7 
> >  MdeModulePkg/MdeModulePkg.uni
> |  8 +
> >  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf|  1
> +
> >  4 files changed, 45 insertions(+), 8 deletions(-)
> >
> > diff --git
> a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
> > b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
> > index e09bc9b704f5..080768033cfa 100644
> > --- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
> > +++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
> > @@ -340,6 +340,7 @@ ReallocateAcpiTableBuffer (
> >EFI_ACPI_TABLE_INSTANCE  TempPrivateData;
> >EFI_STATUS   Status;
> >UINT64   CurrentData;
> > +  EFI_MEMORY_TYPE  AcpiAllocateMemoryType;
> >
> >CopyMem (, AcpiTableInstance, sizeof
> > (EFI_ACPI_TABLE_INSTANCE));
> >//
> > @@ -359,6 +360,12 @@ ReallocateAcpiTableBuffer (
> >   NewMaxTableNumber * sizeof (UINT32);
> >}
> >
> > +  if (PcdGetBool (PcdNoACPIReclaimMemory)) {
> > +AcpiAllocateMemoryType = EfiACPIMemoryNVS;  } else {
> > +AcpiAllocateMemoryType = EfiACPIReclaimMemory;  }
> > +
> >if (mAcpiTableAllocType != AllocateAnyPages) {
> >  //
> >  // Allocate memory in the lower 32 bit of address range for @@
> -372,13
> > +379,13 @@ ReallocateAcpiTableBuffer (
> >  PageAddress = 0x;
> >  Status  = gBS->AllocatePages (
> >   mAcpiTableAllocType,
> > - EfiACPIReclaimMemory,
> > + AcpiAllocateMemoryType,
> >   EFI_SIZE_TO_PAGES (TotalSize),
> >   
> >   );
> >} else {
> >  Status = gBS->AllocatePool (
> > -EfiACPIReclaimMemory,
> > +AcpiAllocateMemoryType,
> >  TotalSize,
> >  (VOID **)
> >  );
> > @@ -512,6 +519,7 @@ AddTableToList (
> >EFI_PHYSICAL_ADDRESS  AllocPhysAddress;
> >UINT64Buffer64;
> >BOOLEAN   AddToRsdt;
> > +  EFI_MEMORY_TYPE   AcpiAllocateMemoryType;
> >
> >//
> >// Check for invalid input parameters @@ -550,6 +558,12 @@
> > AddTableToList (
> >CurrentTableList->TableSize  = CurrentTableSize;
> >CurrentTableList->PoolAllocation = FALSE;
> >
> > +  if (PcdGetBool (PcdNoACPIReclaimMemory)) {
> > +AcpiAllocateMemoryType = EfiACPIMemoryNVS;  } else {
> > +AcpiAllocateMemoryType = EfiACPIReclaimMemory;  }
> > +
> >//
> >// Allocation memory type depends on the type of the table
> >//
> > @@ -585,7 +599,7 @@ AddTableToList (
> >  // such as AArch64 that allocate multiples of 64 KB
> >  //
> >  Status = gBS->AllocatePool (
> > -EfiACPIReclaimMemory,
> > +AcpiAllocateMemoryType,
> >  CurrentTableList->TableSize,
> >   

Re: [edk2-devel] [PATCH v2 00/13] Part 2 patch set to add LoongArch support into UefiCpuPkg

2024-04-09 Thread Chao Li

Hi Ray,

Ha, you mean to move the ConfigureMemoryManagementUint instance into 
some LoongArch PEIM, right? I just understood it wrong.


What I want to say is that this API can called in both virtual and 
really mechine, if it be moved into the private code, then if other 
platform want to call it, they will have to copy the same code under 
their private code. So I think it is better if this API or function is 
made public.



Thanks,
Chao
On 2024/4/9 13:27, Ni, Ray wrote:

Chao,
Current patch introduces the CpuMmuInitLib which contains 
ConfigureMemoryManagementUnit () API. You told me the API will be 
called by a PEIM.

Then, the new proposal is to move the library code into that PEIM.

I don't quite understand your needs of the new GUID to store the 
memory map resource. How is the GUID used to store the memory map 
resource?

Can the PEIM be placed in edk2-platforms repo?

Thanks,
Ray


*From:* Chao Li 
*Sent:* Tuesday, April 9, 2024 12:29
*To:* devel@edk2.groups.io ; Ni, Ray 
; Gerd Hoffmann 
*Cc:* Kumar, Rahul R ; Sami Mujawar 
; Sunil V L ; Bibo Mao 
; Dongyan Qian 
*Subject:* Re: [edk2-devel] [PATCH v2 00/13] Part 2 patch set to add 
LoongArch support into UefiCpuPkg


Hi Ray,

I'm willing change it to a PEIM if it doesn't fit as a library. I 
think if it is a PEIM, we need a new GUID to sotre the memory map 
resouce, or use an already defined GUID.


I will put it under the UefiCpuPkg, called CpuMmuInitPei, folder: 
UefiCpuPkg/CpuMmuInitPei/LoongArch64/. May I?



Thanks,
Chao
On 2024/4/9 10:06, Ni, Ray wrote:

Chao,
Sorry I missed your mail.

If ConfigureMemoryManagementUnit() is called in PEI, can you move
the logic to a LoongArch specific PEIM? My concern is we may need
more review on the lib API ConfigureMemoryManagementUnit() if we
position it as a library.

If we move the logic in a PEIM and the implementation becomes a
PEIM internal logic, we can lower the quality expectation of the
function prototype as no other module is able to call it.


Thanks,
Ray


For patches 10, 11: Can the lib be avoided if the
logic is implemented in CpuDxe driver?

This library is will be called in the PEI stage, so I
can't move it under the CpuDxe.

This library is the low-level libary of CpuMmuLib, which
will consume CpuMmuLIb to configure the MMU.

This way is suggested by Laszlo, who saied if CpuMmuLib
can not content the configure API(high-level libary is the
basecal libaray, it should not include the configure API),
we can split it into two, where the hight-livel is
CpuMmuLib, and the low-level is CpuMmuInitLib.


For patch 12(UefiCpuPkg: Add multiprocessor library
for LoongArch64): Reviewed-by: Ray Ni
 
For patch 13: Please make accordingly changes when you
address comments for patch 8.

OK.


Thanks,
Ray


*From:* Gerd Hoffmann 

*Sent:* Friday, March 22, 2024 20:39
*To:* Chao Li 

*Cc:* devel@edk2.groups.io
 
; Ni, Ray
 ; Kumar,
Rahul R 
; Sami Mujawar
 ;
Sunil V L 
; Bibo Mao
 ;
Dongyan Qian 

*Subject:* Re: [PATCH v2 00/13] Part 2 patch set to
add LoongArch support into UefiCpuPkg
On Wed, Mar 20, 2024 at 04:41:52PM +0800, Chao Li wrote:
> This patch set adjusted some order in UefiCpuPig
alphabetically, added
> LoongArch libraries and drivers into UefiCpuPkg, it
is a continuation of
> the first patch series v8 submitted at
> https://edk2.groups.io/g/devel/message/114526
.
>
> And also separated from
https://edk2.groups.io/g/devel/message/116583
.
>
> This series only contents the changes for UefiCpuPkg.
>
> Patch1-Patch4: Reorder some INF files located in
UefiCpuPkg
 

回复: [edk2-devel] [PATCH v2 3/9] MdePkg: Add devAuthBoot GlobalVariable

2024-04-09 Thread gaoliming via groups.io
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Wenxing Hou
> 发送时间: 2024年4月8日 9:47
> 收件人: devel@edk2.groups.io
> 抄送: Michael D Kinney ; Liming Gao
> ; Zhiguang Liu ; Jiewen
> Yao 
> 主题: [edk2-devel] [PATCH v2 3/9] MdePkg: Add devAuthBoot GlobalVariable
> 
> According to UEFI 2.10 spec 3.3 Globally Defined Variables section,
> add devAuthBoot GlobalVariable.
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Cc: Jiewen Yao 
> Signed-off-by: Wenxing Hou 
> ---
>  MdePkg/Include/Guid/GlobalVariable.h  | 8 +++-
>  MdePkg/Include/Guid/ImageAuthentication.h | 5 -
>  2 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/MdePkg/Include/Guid/GlobalVariable.h
> b/MdePkg/Include/Guid/GlobalVariable.h
> index eb2ce6aaf2..eb6e5a043e 100644
> --- a/MdePkg/Include/Guid/GlobalVariable.h
> +++ b/MdePkg/Include/Guid/GlobalVariable.h
> @@ -1,7 +1,7 @@
>  /** @file
> 
>GUID for EFI (NVRAM) Variables.
> 
> 
> 
> -  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> 
> +  Copyright (c) 2006 - 2024, Intel Corporation. All rights reserved.
> 
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> 
> 
>@par Revision Reference:
> 
> @@ -183,4 +183,10 @@ extern EFI_GUID  gEfiGlobalVariableGuid;
>  ///
> 
>  #define EFI_VENDOR_KEYS_VARIABLE_NAME  L"VendorKeys"
> 
> 
> 
> +///
> 
> +/// Whether the platform firmware is operating in device authentication
boot
> mode (1) or not (0).
> 
> +/// The content is UINT8.
> 
> +///
> 
> +#define EFI_DEVICE_AUTH_BOOT_MODE_NAME  L"devAuthBoot"
> 
> +
> 
>  #endif
> 
> diff --git a/MdePkg/Include/Guid/ImageAuthentication.h
> b/MdePkg/Include/Guid/ImageAuthentication.h
> index fe83596571..f95255c0fb 100644
> --- a/MdePkg/Include/Guid/ImageAuthentication.h
> +++ b/MdePkg/Include/Guid/ImageAuthentication.h
> @@ -1,7 +1,7 @@
>  /** @file
> 
>Image signature database are defined for the signed image validation.
> 
> 
> 
> -  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
> 
> +  Copyright (c) 2009 - 2024, Intel Corporation. All rights reserved.
> 
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> 
> 
>@par Revision Reference:
> 
> @@ -41,6 +41,9 @@
>  #define SETUP_MODE  1
> 
>  #define USER_MODE   0
> 
> 
> 
> +#define DEVICE_AUTH_BOOT_MODE_ENABLE   1
> 
> +#define DEVICE_AUTH_BOOT_MODE_DISABLE  0
> 
> +
> 
>  //
> **
> *
> 
>  // Signature Database
> 
>  //
> **
> *
> 
> --
> 2.26.2.windows.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#117480):
> https://edk2.groups.io/g/devel/message/117480
> Mute This Topic: https://groups.io/mt/105394115/4905953
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [gaolim...@byosoft.com.cn]
> -=-=-=-=-=-=
> 





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




[edk2-devel] 回复: [PATCH] MdePkg: Update the comments of GetInformation function

2024-04-09 Thread gaoliming via groups.io
Reviewed-by: Liming Gao 

> -邮件原件-
> 发件人: Qingyu 
> 发送时间: 2024年4月8日 17:28
> 收件人: devel@edk2.groups.io
> 抄送: Liming Gao ; Michael D Kinney
> ; Zhiguang Liu ;
> Gahan Saraiya 
> 主题: [PATCH] MdePkg: Update the comments of GetInformation function
> 
> Refer to Uefi spec 2.10 section 11.11.2, add a new retval
> EFI_NOT_FOUND to
> EFI_ADAPTER_INFORMATION_PROTOCOL.GetInformation().
> Reference: [mantis #1866] - GetInfo() of Adapter Information
> Protocol should have a provision for IHV to return no data.
> 
> Cc: Liming Gao 
> Cc: Michael D Kinney 
> Cc: Zhiguang Liu 
> Signed-off-by: Qingyu 
> Signed-off-by: Gahan Saraiya 
> ---
>  MdePkg/Include/Protocol/AdapterInformation.h | 5 -
>  MdePkg/Library/DxeHstiLib/HstiAip.c  | 5 -
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/MdePkg/Include/Protocol/AdapterInformation.h
> b/MdePkg/Include/Protocol/AdapterInformation.h
> index ed19e5736c3c..8e4448eb0f87 100644
> --- a/MdePkg/Include/Protocol/AdapterInformation.h
> +++ b/MdePkg/Include/Protocol/AdapterInformation.h
> @@ -140,7 +140,9 @@ typedef struct {
> 
>This function returns information of type InformationType from the
> adapter.
>If an adapter does not support the requested informational type, then
> -  EFI_UNSUPPORTED is returned.
> +  EFI_UNSUPPORTED is returned. If an adapter does not contain
> Information for
> +  the requested InformationType, it fills InformationBlockSize with 0 and
> +  returns EFI_NOT_FOUND.
> 
>@param[in]  This   A pointer to the
> EFI_ADAPTER_INFORMATION_PROTOCOL instance.
>@param[in]  InformationTypeA pointer to an EFI_GUID that
> defines the contents of InformationBlock.
> @@ -150,6 +152,7 @@ typedef struct {
> 
>@retval EFI_SUCCESSThe InformationType
> information was retrieved.
>@retval EFI_UNSUPPORTEDThe InformationType is not
> known.
> +  @retval EFI_NOT_FOUND  Information is not available for
> the requested information type.
>@retval EFI_DEVICE_ERROR   The device reported an error.
>@retval EFI_OUT_OF_RESOURCES   The request could not be
> completed due to a lack of resources.
>@retval EFI_INVALID_PARAMETER  This is NULL.
> diff --git a/MdePkg/Library/DxeHstiLib/HstiAip.c
> b/MdePkg/Library/DxeHstiLib/HstiAip.c
> index a2454ffeaa7a..523a712e6f6e 100644
> --- a/MdePkg/Library/DxeHstiLib/HstiAip.c
> +++ b/MdePkg/Library/DxeHstiLib/HstiAip.c
> @@ -12,7 +12,9 @@
> 
>This function returns information of type InformationType from the
> adapter.
>If an adapter does not support the requested informational type, then
> -  EFI_UNSUPPORTED is returned.
> +  EFI_UNSUPPORTED is returned. If an adapter does not contain
> Information for
> +  the requested InformationType, it fills InformationBlockSize with 0 and
> +  returns EFI_NOT_FOUND.
> 
>@param[in]  This   A pointer to the
> EFI_ADAPTER_INFORMATION_PROTOCOL instance.
>@param[in]  InformationTypeA pointer to an EFI_GUID that
> defines the contents of InformationBlock.
> @@ -22,6 +24,7 @@
> 
>@retval EFI_SUCCESSThe InformationType
> information was retrieved.
>@retval EFI_UNSUPPORTEDThe InformationType is not
> known.
> +  @retval EFI_NOT_FOUND  Information is not available for
> the requested information type.
>@retval EFI_DEVICE_ERROR   The device reported an error.
>@retval EFI_OUT_OF_RESOURCES   The request could not be
> completed due to a lack of resources.
>@retval EFI_INVALID_PARAMETER  This is NULL.
> --
> 2.39.1.windows.1





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




[edk2-devel] [PATCH] AlderlakeOpenBoardPkg: Fix BootStage 5 can't install Windows11.

2024-04-09 Thread dorax . hsueh
From: DoraX Hsueh 

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

1. Since installing windows does not meet the minimum system requirements,
   Added TPM related code to meet the requirements.
2. Remove FvAdvanced.

Cc: Sai Chaganty 
Cc: Rosen Chuang 
Cc: Saloni Kasbekar 
Cc: Haoyu Tang 
Cc: Nate DeSimone 
Signed-off-by: DoraX Hsueh 
---
 .../Include/Fdf/FlashMapInclude.fdf   | 20 +-
 .../AlderlakePRvp/OpenBoardPkg.fdf| 37 +++
 .../AlderlakePRvp/OpenBoardPkgPcd.dsc | 10 -
 .../AlderlakeOpenBoardPkg/BiosInfo/BiosInfo.c |  9 +
 .../BiosInfo/BiosInfo.inf |  2 -
 .../AlderlakeOpenBoardPkg/OpenBoardPkg.dec|  1 -
 6 files changed, 25 insertions(+), 54 deletions(-)

diff --git 
a/Platform/Intel/AlderlakeOpenBoardPkg/AlderlakePRvp/Include/Fdf/FlashMapInclude.fdf
 
b/Platform/Intel/AlderlakeOpenBoardPkg/AlderlakePRvp/Include/Fdf/FlashMapInclude.fdf
index 03c198c0..9a4ae7e8 100644
--- 
a/Platform/Intel/AlderlakeOpenBoardPkg/AlderlakePRvp/Include/Fdf/FlashMapInclude.fdf
+++ 
b/Platform/Intel/AlderlakeOpenBoardPkg/AlderlakePRvp/Include/Fdf/FlashMapInclude.fdf
@@ -25,23 +25,21 @@ SET 
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize= 0x20
 SET gMinPlatformPkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareOffset = 
0x0003  # Flash addr (0xFF03)
 SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize  = 
0x0003  #
 
-SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedOffset= 
0x000E  # Flash addr (0xFF0E)
-SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedSize  = 
0x0031  #
-SET gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalOffset   = 
0x003F  # Flash addr (0xFF40)
-SET gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalSize = 
0x0036  #
-SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityOffset= 
0x0075  # Flash addr (0xFF76)
+SET gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalOffset   = 
0x000E  # Flash addr (0xFF40)
+SET gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalSize = 
0x0065  #
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityOffset= 
0x0073  # Flash addr (0xFF76)
 SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecuritySize  = 
0x0009  #
-SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootOffset  = 
0x007E  # Flash addr (0xFF7F)
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootOffset  = 
0x007C  # Flash addr (0xFF7F)
 SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize= 
0x000A  #
-SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootOffset= 
0x0088  # Flash addr (0xFF86)
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootOffset= 
0x0086  # Flash addr (0xFF86)
 SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize  = 
0x0018  #
 
-SET gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesOffset   = 
0x00A0  # Flash addr (0xFFA0)
+SET gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesOffset   = 
0x009E  # Flash addr (0xFFA0)
 SET gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesSize = 
0x0008  # Keep 0x8 or larger
-SET gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset  = 
0x00A8  # Flash addr (0xFFA8)
+SET gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset  = 
0x00A6  # Flash addr (0xFFA8)
 SET gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize= 
0x0023  #
-SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryOffset  = 
0x00CB  # Flash addr (0xFFCB)
-SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize= 
0x0004  #
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryOffset  = 
0x00C9  # Flash addr (0xFFCB)
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize= 
0x0006  #
 SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSOffset= 
0x00CF  # Flash addr (0xFFCF)
 SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize  = 
0x000A
 SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMOffset= 
0x00D9  # Flash addr (0xFFD9)
diff --git 
a/Platform/Intel/AlderlakeOpenBoardPkg/AlderlakePRvp/OpenBoardPkg.fdf 
b/Platform/Intel/AlderlakeOpenBoardPkg/AlderlakePRvp/OpenBoardPkg.fdf
index f1ce271b..7fb6198f 100644
--- a/Platform/Intel/AlderlakeOpenBoardPkg/AlderlakePRvp/OpenBoardPkg.fdf
+++ b/Platform/Intel/AlderlakeOpenBoardPkg/AlderlakePRvp/OpenBoardPkg.fdf
@@ -113,9 +113,15 @@ DATA = {
   #Blockmap[1]: End
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   ## This is the VARIABLE_STORE_HEADER
+!if gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable == TRUE
+  #  Signature: gEfiAuthenticatedVariableGuid = { 0xaaf32c78, 0x947b, 0x439a, 
{ 0xa1, 0x80, 0x2e, 

[edk2-devel] [PATCH] AlderlakeSiliconPkg: Update for SPI2 Protocol and Identify flash regions by GUID

2024-04-09 Thread dorax . hsueh
From: DoraX Hsueh 

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

1. Updates references to the "PCH_SPI_PROTOCOL" to instead refer to 
"PCH_SPI2_PROTOCOL".
2. Updates the library to identify flash regions by GUID and internally
map the GUID entries to values specific to AlderlakeSiliconPkg.
3. Libs/modules that need to reference IntelSiliconPkg are updated.
4. Add B_TCO_IO_TCO1_CNT_TMR_HLT define.

Cc: Sai Chaganty 
Cc: Rosen Chuang 
Cc: Saloni Kasbekar 
Cc: Haoyu Tang 
Cc: Nate DeSimone 
Signed-off-by: DoraX Hsueh 
---
 .../Cpu/Include/Register/CommonMsr.h  |   4 +
 .../Fru/AdlPch/CommonLib.dsc  |   2 +-
 .../AlderlakeSiliconPkg/Fru/AdlPch/PeiLib.dsc |   2 -
 .../Include/Library/SpiAccessLib.h|  44 ++
 .../Include/Register/PttPtpRegs.h |  26 +
 .../Include/Register/TcoRegs.h|   1 +
 .../Spi/IncludePrivate/Library/SpiCommonLib.h |  60 +--
 .../Spi/IncludePrivate/Register/SpiRegs.h |   8 +-
 .../PeiDxeSmmSpiAccessLib.inf |  33 ++
 .../PeiDxeSmmSpiAccessLib/SpiAccessLib.c  |  75 +++
 .../IpBlock/Spi/Library/PeiSpiLib/PchSpi.c|   2 +-
 .../Spi/Library/PeiSpiLib/PeiSpiLib.inf   |   2 +-
 .../BaseSpiCommonLib/BaseSpiCommonLib.inf |  19 +-
 .../BaseSpiCommonLib/SpiCommon.c  | 491 --
 .../AlderlakeSiliconPkg/IpBlock/Spi/Smm/Spi.c |  30 +-
 .../IpBlock/Spi/Smm/SpiSmm.inf|   5 +-
 .../IncludePrivate/Library/SmmPchPrivateLib.h |  27 +
 .../SmmPchPrivateLib/SmmPchPrivateLib.c   |  61 +++
 .../SmmPchPrivateLib/SmmPchPrivateLib.inf |  32 ++
 .../Product/Alderlake/SiPkgDxeLib.dsc |   5 +
 Silicon/Intel/AlderlakeSiliconPkg/SiPkg.dec   |   4 +-
 21 files changed, 733 insertions(+), 200 deletions(-)
 create mode 100644 
Silicon/Intel/AlderlakeSiliconPkg/Include/Library/SpiAccessLib.h
 create mode 100644 
Silicon/Intel/AlderlakeSiliconPkg/Include/Register/PttPtpRegs.h
 create mode 100644 
Silicon/Intel/AlderlakeSiliconPkg/IpBlock/Spi/Library/PeiDxeSmmSpiAccessLib/PeiDxeSmmSpiAccessLib.inf
 create mode 100644 
Silicon/Intel/AlderlakeSiliconPkg/IpBlock/Spi/Library/PeiDxeSmmSpiAccessLib/SpiAccessLib.c
 create mode 100644 
Silicon/Intel/AlderlakeSiliconPkg/Pch/IncludePrivate/Library/SmmPchPrivateLib.h
 create mode 100644 
Silicon/Intel/AlderlakeSiliconPkg/Pch/LibraryPrivate/SmmPchPrivateLib/SmmPchPrivateLib.c
 create mode 100644 
Silicon/Intel/AlderlakeSiliconPkg/Pch/LibraryPrivate/SmmPchPrivateLib/SmmPchPrivateLib.inf

diff --git a/Silicon/Intel/AlderlakeSiliconPkg/Cpu/Include/Register/CommonMsr.h 
b/Silicon/Intel/AlderlakeSiliconPkg/Cpu/Include/Register/CommonMsr.h
index caa0e67b..44a476c0 100644
--- a/Silicon/Intel/AlderlakeSiliconPkg/Cpu/Include/Register/CommonMsr.h
+++ b/Silicon/Intel/AlderlakeSiliconPkg/Cpu/Include/Register/CommonMsr.h
@@ -56,5 +56,9 @@ typedef union {
 
 } MSR_CORE_THREAD_COUNT_REGISTER;
 
+/**
+  Special Chipset Usage MSR
+**/
+#define MSR_SPCL_CHIPSET_USAGE 0x01FE
 
 #endif /* _COMMONMSR_h */
diff --git a/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlPch/CommonLib.dsc 
b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlPch/CommonLib.dsc
index 3f508f83..ee5800a9 100644
--- a/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlPch/CommonLib.dsc
+++ b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlPch/CommonLib.dsc
@@ -11,7 +11,7 @@
 
   
EspiLib|$(PLATFORM_SI_PACKAGE)/IpBlock/Espi/Library/PeiDxeSmmEspiLib/PeiDxeSmmEspiLib.inf
 
-
+  
SpiAccessLib|$(PLATFORM_SI_PACKAGE)/IpBlock/Spi/Library/PeiDxeSmmSpiAccessLib/PeiDxeSmmSpiAccessLib.inf
   
PmcLib|$(PLATFORM_SI_PACKAGE)/IpBlock/Pmc/Library/PeiDxeSmmPmcLib/PeiDxeSmmPmcLib.inf
   
PmcPrivateLib|$(PLATFORM_SI_PACKAGE)/IpBlock/Pmc/LibraryPrivate/PeiDxeSmmPmcPrivateLib/PeiDxeSmmPmcPrivateLib.inf
   
SpiCommonLib|$(PLATFORM_SI_PACKAGE)/IpBlock/Spi/LibraryPrivate/BaseSpiCommonLib/BaseSpiCommonLib.inf
diff --git a/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlPch/PeiLib.dsc 
b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlPch/PeiLib.dsc
index ebe2bbfd..cbaf8e37 100644
--- a/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlPch/PeiLib.dsc
+++ b/Silicon/Intel/AlderlakeSiliconPkg/Fru/AdlPch/PeiLib.dsc
@@ -5,8 +5,6 @@
 #   SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
 
-  SpiLib|$(PLATFORM_SI_PACKAGE)/IpBlock/Spi/Library/PeiSpiLib/PeiSpiLib.inf
-
   
GpioHelpersLib|$(PLATFORM_SI_PACKAGE)/IpBlock/Gpio/LibraryPrivate/PeiGpioHelpersLib/PeiGpioHelpersLib.inf
 
 
diff --git a/Silicon/Intel/AlderlakeSiliconPkg/Include/Library/SpiAccessLib.h 
b/Silicon/Intel/AlderlakeSiliconPkg/Include/Library/SpiAccessLib.h
new file mode 100644
index ..6e7f48fe
--- /dev/null
+++ b/Silicon/Intel/AlderlakeSiliconPkg/Include/Library/SpiAccessLib.h
@@ -0,0 +1,44 @@
+/** @file
+  SPI library header for abstraction of SPI HW registers accesses
+
+  Copyright (c) 2023, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+#ifndef _SPI_ACCESS_LIB_H_
+#define _SPI_ACCESS_LIB_H_
+
+
+/**
+  Returns SPI BAR0 value
+
+  @retval 

[edk2-devel] [PATCH] AlderlakeOpenBoardPkg: Change MinPlatform MinDsdt and Update SpiFlashCommonLib

2024-04-09 Thread dorax . hsueh
From: DoraX Hsueh 

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

1. Change MinPlatform MinDsdt to fix hang logo issue.
2. Update SecFspWrapperPlatformSecLib for FSP use.
3. Update SpiFlashCommonLib to fix boot assert issue.
4. Create SmmLocked callback to fix assert
5. Halt the TCO timer to fix release mode hang.

Cc: Sai Chaganty 
Cc: Rosen Chuang 
Cc: Saloni Kasbekar 
Cc: Haoyu Tang 
Cc: Nate DeSimone 
Signed-off-by: DoraX Hsueh 
---
 .../Acpi/MinDsdt/MinDsdt.asl  |  68 ---
 .../Acpi/MinDsdt/MinDsdt.c| 232 ---
 .../Acpi/MinDsdt/MinDsdt.inf  |  48 ---
 .../AlderlakePRvp/OpenBoardPkg.dsc|   7 +-
 .../AlderlakePRvp/OpenBoardPkg.fdf|   2 +-
 .../AlderlakePRvp/OpenBoardPkgPcd.dsc |   8 +
 .../FspWrapperPlatformSecLib.c| 186 +
 .../SecFspWrapperPlatformSecLib/FsptCoreUpd.h | 394 ++
 .../SecFspWrapperPlatformSecLib/Ia32/Fsp.h|  42 ++
 .../Ia32/PeiCoreEntry.nasm| 130 ++
 .../Ia32/SecEntry.nasm| 361 
 .../Ia32/Stack.nasm   |  72 
 .../PlatformInit.c|  55 +++
 .../SecFspWrapperPlatformSecLib.inf   | 107 +
 .../SecGetPerformance.c   |  89 
 .../SecPlatformInformation.c  |  78 
 .../SecRamInitData.c  |  57 +++
 .../SecTempRamDone.c  |  93 +
 .../Include/Library/SpiFlashCommon.h  |  99 -
 .../SmmSpiFlashCommonLib.inf  |  49 ---
 .../SmmSpiFlashCommonLib/SpiFlashCommon.c | 215 --
 .../SpiFlashCommonSmmLib.c|  60 ---
 .../OpenBoardPlatformInitPostMem.c|  96 +
 .../OpenBoardPlatformInitPostMem.inf  |  20 -
 .../DxeSaPolicyInit.c |  71 
 .../DxeSiliconPolicyUpdateLib.inf |   2 +
 .../PeiCpuPolicyUpdatePreMem.c|   3 -
 .../PeiPolicyUpdateLib/PeiPolicyUpdateLib.inf |   3 +-
 28 files changed, 1752 insertions(+), 895 deletions(-)
 delete mode 100644 
Platform/Intel/AlderlakeOpenBoardPkg/Acpi/MinDsdt/MinDsdt.asl
 delete mode 100644 Platform/Intel/AlderlakeOpenBoardPkg/Acpi/MinDsdt/MinDsdt.c
 delete mode 100644 
Platform/Intel/AlderlakeOpenBoardPkg/Acpi/MinDsdt/MinDsdt.inf
 create mode 100644 
Platform/Intel/AlderlakeOpenBoardPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/FspWrapperPlatformSecLib.c
 create mode 100644 
Platform/Intel/AlderlakeOpenBoardPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/FsptCoreUpd.h
 create mode 100644 
Platform/Intel/AlderlakeOpenBoardPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/Ia32/Fsp.h
 create mode 100644 
Platform/Intel/AlderlakeOpenBoardPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/Ia32/PeiCoreEntry.nasm
 create mode 100644 
Platform/Intel/AlderlakeOpenBoardPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/Ia32/SecEntry.nasm
 create mode 100644 
Platform/Intel/AlderlakeOpenBoardPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/Ia32/Stack.nasm
 create mode 100644 
Platform/Intel/AlderlakeOpenBoardPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/PlatformInit.c
 create mode 100644 
Platform/Intel/AlderlakeOpenBoardPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecFspWrapperPlatformSecLib.inf
 create mode 100644 
Platform/Intel/AlderlakeOpenBoardPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecGetPerformance.c
 create mode 100644 
Platform/Intel/AlderlakeOpenBoardPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecPlatformInformation.c
 create mode 100644 
Platform/Intel/AlderlakeOpenBoardPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecRamInitData.c
 create mode 100644 
Platform/Intel/AlderlakeOpenBoardPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecTempRamDone.c
 delete mode 100644 
Platform/Intel/AlderlakeOpenBoardPkg/Include/Library/SpiFlashCommon.h
 delete mode 100644 
Platform/Intel/AlderlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf
 delete mode 100644 
Platform/Intel/AlderlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFlashCommon.c
 delete mode 100644 
Platform/Intel/AlderlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFlashCommonSmmLib.c

diff --git a/Platform/Intel/AlderlakeOpenBoardPkg/Acpi/MinDsdt/MinDsdt.asl 
b/Platform/Intel/AlderlakeOpenBoardPkg/Acpi/MinDsdt/MinDsdt.asl
deleted file mode 100644
index be110145..
--- a/Platform/Intel/AlderlakeOpenBoardPkg/Acpi/MinDsdt/MinDsdt.asl
+++ /dev/null
@@ -1,68 +0,0 @@
-/** @file
-  ACPI minimum DSDT table
-
-   Copyright (c) 2022, Intel Corporation. All rights reserved.
-   SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-DefinitionBlock (
-  "DSDT.aml",
-  "DSDT",
-  0x01, // DSDT revision.
-// A Revision field value greater than or equal to 2 signifies that 
integers
-// declared within the Definition Block are to be evaluated as 

回复: [edk2-devel] [PATCH V5 0/6] SPI NOR Flash Driver for SFDP flash device

2024-04-09 Thread gaoliming via groups.io
Abner:
  The change is good to me. Reviewed-by: Liming Gao


Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 Chang, Abner
> via groups.io
> 发送时间: 2024年4月4日 17:25
> 收件人: devel@edk2.groups.io
> 抄送: Michael D Kinney ; Liming Gao
> ; Zhiguang Liu ; Abdul
> Lateef Attar ; Hao A Wu ; Ray Ni
> ; Jian J Wang ; Brit Chesley
> 
> 主题: [edk2-devel] [PATCH V5 0/6] SPI NOR Flash Driver for SFDP flash
device
> 
> From: Abner Chang 
> 
> Sending V4 for review as SPI related ECR is approved by
> PIWG in PI spec 1.8A
> 
> In V5: Correct patch 6/6, as some source files are fixed in this patch.
> In RESEND V4: Add Cc in patch 6/6
> In V4: Enhance timeout algorithm
> In V3: Relocate GUIDs/PCDs for SPI SFDP drivers to
>MdeModulePkg.dec.
> In V2: Add maintainer entry for Bus/Spi.
> 
> This patch fixes the missing SPI defintions per to PI spec
> 1.8 errata A.
> This patch also provides the implemtation of SPI NOR flash
> driver that supports JEDEC SFDP specification.
> This driver support the flash device that has the GUID
> gEdk2JedecSfdpSpiDxeDriverGuid or gEdk2JedecSfdpSpiSmmDriverGuid
> declared in EFI_SPI_PERIPHERAL SpiPeripheralDriverGuid structure.
> 
> The driver has been verified with Macronix MX25U6435F flash device.
> 
> Signed-off-by: Abner Chang 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Cc: Abdul Lateef Attar 
> Cc: Hao A Wu 
> Cc: Ray Ni 
> Cc: Jian J Wang 
> Cc: Liming Gao 
> Cc: Brit Chesley 
> 
> Abner Chang (2):
>   MdeModulePkg: Add definitions in DEC for SPI NOR Flash SFDP driver
>   Maintainers: AMD as SPI driver stack maintainer
> 
> abnchang (4):
>   MdePkg/Include: Update definitions of SPI related header files
>   MdePkg/Include: Add SPI NOR Flash JEDEC SFDP header file
>   MdeModulePkg/SpiNorFlashJedecSfdp: SPI NOR Flash JEDEC SFDP
>   MdeModulePkg: Add SPI NOR FLash SFDP drivers to DSC
> 
>  MdeModulePkg/MdeModulePkg.dec |   28 +-
>  MdeModulePkg/MdeModulePkg.dsc |4 +-
>  .../SpiNorFlashJedecSfdpDxe.inf   |   64 +
>  .../SpiNorFlashJedecSfdpSmm.inf   |   64 +
>  .../Spi/SpiNorFlashJedecSfdp/SpiNorFlash.h|  286 +++
>  .../SpiNorFlashJedecSfdpInternal.h|  299 +++
>  .../IndustryStandard/SpiNorFlashJedecSfdp.h   |  324 +++
>  MdePkg/Include/Protocol/SpiConfiguration.h|   10 +-
>  MdePkg/Include/Protocol/SpiHc.h   |   16 +-
>  MdePkg/Include/Protocol/SpiIo.h   |   12 +-
>  .../Spi/SpiNorFlashJedecSfdp/SpiNorFlash.c| 1141 +++
>  .../SpiNorFlashJedecSfdp.c| 1780
> +
>  .../SpiNorFlashJedecSfdpDxe.c |  261 +++
>  .../SpiNorFlashJedecSfdpSmm.c |  234 +++
>  Maintainers.txt   |   11 +
>  .../SpiNorFlashJedecSfdpDxe.uni   |   13 +
>  .../SpiNorFlashJedecSfdpExtra.uni |   11 +
>  .../SpiNorFlashJedecSfdpSmm.uni   |   13 +
>  18 files changed, 4566 insertions(+), 5 deletions(-)
>  create mode 100644
> MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpDxe.inf
>  create mode 100644
> MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpSmm.in
> f
>  create mode 100644
> MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlash.h
>  create mode 100644
> MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpInternal
> .h
>  create mode 100644
> MdePkg/Include/IndustryStandard/SpiNorFlashJedecSfdp.h
>  create mode 100644
> MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlash.c
>  create mode 100644
> MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdp.c
>  create mode 100644
> MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpDxe.c
>  create mode 100644
> MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpSmm.c
>  create mode 100644
> MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpDxe.uni
>  create mode 100644
> MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpExtra.u
> ni
>  create mode 100644
> MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpSmm.u
> ni
> 
> --
> 2.37.1.windows.1
> 
> 
> 
> 
> 





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