Date   

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

Zhiguang Liu
 

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

Cc: Guo Dong <guo.dong@...>
Cc: Ray Ni <ray.ni@...>
Cc: Maurice Ma <maurice.ma@...>
Cc: Benjamin You <benjamin.you@...>
Signed-off-by: Zhiguang Liu <zhiguang.liu@...>
---
UefiPayloadPkg/UefiPayloadPkg.dsc | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

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


Re: [PATCH v2 0/6] MM communicate functionality in variable policy

Sami Mujawar
 

Hi Kun,

I will review this patch series shortly.

Regards,

Sami Mujawar

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

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

Thanks for the reminder, Rebecca.

Regards,
Kun

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


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

wenyi,xie
 

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

Thanks
Wenyi
Thanks
Abner
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*From:* Wenyi Xie <xiewenyi2@...>
*Sent:* Wednesday, January 19, 2022 2:12 PM
*To:* devel@edk2.groups.io <devel@edk2.groups.io>; Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>; Wang, Nickle (Server BIOS) <nickle.wang@...>
*Cc:* songdongkuang@... <songdongkuang@...>; xiewenyi2@... <xiewenyi2@...>
*Subject:* [PATCH EDK2 v1 0/1] RedfishPkg/RedfishRestExDxe:Simplify status check
 
Main Changes :
1.Remove redundant if statement.

Wenyi Xie (1):
  RedfishPkg/RedfishRestExDxe:Simplify status check

 RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c | 38 +++++++++-----------
 1 file changed, 17 insertions(+), 21 deletions(-)

--
2.20.1.windows.1


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

Abner Chang
 

Hi Wenyi,
May I know what is the problem you encountered and what environment causes the issue? Is that under edk2 emulation or the real Redfish service?

Thanks
Abner

From: Wenyi Xie <xiewenyi2@...>
Sent: Wednesday, January 19, 2022 2:12 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>; Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>; Wang, Nickle (Server BIOS) <nickle.wang@...>
Cc: songdongkuang@... <songdongkuang@...>; xiewenyi2@... <xiewenyi2@...>
Subject: [PATCH EDK2 v1 0/1] RedfishPkg/RedfishRestExDxe:Simplify status check
 
Main Changes :
1.Remove redundant if statement.

Wenyi Xie (1):
  RedfishPkg/RedfishRestExDxe:Simplify status check

 RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c | 38 +++++++++-----------
 1 file changed, 17 insertions(+), 21 deletions(-)

--
2.20.1.windows.1


回复: [edk2-devel] [PATCH v3 0/2] MdePkg,SecurityPkg: Add support to RngDxe and BaseRngLib for AARCH64 RNDR

gaoliming
 

Pierre:
MdePkg can provide the arch specific implementation. BaseRngLib places the arch specific code into its Arch directory. If the arch logic is generic enough, new API can be defined in BaseLib.

Thanks
Liming

-----邮件原件-----
发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表
PierreGondois
发送时间: 2022年1月18日 17:24
收件人: devel@edk2.groups.io; Jiewen Yao <jiewen.yao@...>; Jian J
Wang <jian.j.wang@...>; Michael D Kinney
<michael.d.kinney@...>; Liming Gao <gaoliming@...>;
Zhiguang Liu <zhiguang.liu@...>; Ard Biesheuvel
<ardb+tianocore@...>; Sami Mujawar <sami.mujawar@...>;
Rebecca Cran <quic_rcran@...>
主题: Re: [edk2-devel] [PATCH v3 0/2] MdePkg,SecurityPkg: Add support to
RngDxe and BaseRngLib for AARCH64 RNDR

Hello all,
I have a question about the this patch, and more generically the organization
of the MdePkg. The current organization, for the BaseRngLib, is as:
- the BaseRngLib implements the library functions of
MdePkg/Include/Library/RngLib.h
- the BaseRngLib contains Ia32, X64 and AARCH64 implementations

This means the BaseRngLib contains arch specific functions. It comes that I
would like to re-use one of these arch specific functions. My question is
then, shouldn't the BaseRngLib contains an arch agnostic implementation,
and the arch specific implementation be placed in arch specific folders
(ArmPkg for arm, I am not sure for other architectures) ?

Another possibility for me is to me is to move the function that I want
to use to the ArmPkg, but this means the MdePkg would be dependent
on the ArmPkg. Would this be a viable option ?

Regards,
Pierre

On 5/10/21 11:53 PM, Rebecca Cran via groups.io wrote:
Update MdePkg BaseRngLib and SecurityPkg RngDxe to add support for
the AARCH64 RNDR instruction.

Changes from v2 to v3:

o Fixed the default value of
gEfiSecurityPkgTokenSpaceGuid.PcdCpuRngSupportedAlgorithm
to be an empty GUID.
o Removed RNDRRS since it wasn't being used.
o Fixed the commit message to remove mention of BaseLib.

Rebecca Cran (2):
MdePkg/BaseRngLib: Add support for ARMv8.5 RNG instructions
SecurityPkg: Add support for RngDxe on AARCH64

MdePkg/MdePkg.dec
| 9 +-
SecurityPkg/SecurityPkg.dec |
2 +
MdePkg/MdePkg.dsc
| 4 +-
SecurityPkg/SecurityPkg.dsc |
11 +-
MdePkg/Library/BaseRngLib/BaseRngLib.inf |
23 ++-
SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf
| 24 ++-
MdePkg/Library/BaseRngLib/AArch64/ArmRng.h
| 43 +++++
MdePkg/Library/BaseRngLib/BaseRngLibInternals.h |
78 +++++++++
SecurityPkg/RandomNumberGenerator/RngDxe/{ => Rand}/AesCore.h |
0
SecurityPkg/RandomNumberGenerator/RngDxe/{ => Rand}/RdRand.h |
17 --
SecurityPkg/RandomNumberGenerator/RngDxe/RngDxeInternals.h |
117 ++++++++++++++
MdePkg/Library/BaseRngLib/AArch64/Rndr.c |
139 ++++++++++++++++
MdePkg/Library/BaseRngLib/BaseRng.c
| 87 +++++-----
MdePkg/Library/BaseRngLib/Rand/RdRand.c
| 131 +++++++++++++++
SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/RngDxe.c
| 127 +++++++++++++++
SecurityPkg/RandomNumberGenerator/RngDxe/{ => Rand}/AesCore.c |
0
SecurityPkg/RandomNumberGenerator/RngDxe/{ => Rand}/RdRand.c |
45 +-----
SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c
| 146 +++++++++++++++++
SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.c
| 170 ++++++++------------
MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.S |
31 ++++
MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.asm |
30 ++++
MdePkg/Library/BaseRngLib/AArch64/ArmRng.S
| 37 +++++
MdePkg/Library/BaseRngLib/AArch64/ArmRng.asm
| 39 +++++
MdePkg/Library/BaseRngLib/BaseRngLib.uni |
6 +-
24 files changed, 1086 insertions(+), 230 deletions(-)
create mode 100644 MdePkg/Library/BaseRngLib/AArch64/ArmRng.h
create mode 100644 MdePkg/Library/BaseRngLib/BaseRngLibInternals.h
rename SecurityPkg/RandomNumberGenerator/RngDxe/{ =>
Rand}/AesCore.h (100%)
rename SecurityPkg/RandomNumberGenerator/RngDxe/{ =>
Rand}/RdRand.h (72%)
create mode 100644
SecurityPkg/RandomNumberGenerator/RngDxe/RngDxeInternals.h
create mode 100644 MdePkg/Library/BaseRngLib/AArch64/Rndr.c
create mode 100644 MdePkg/Library/BaseRngLib/Rand/RdRand.c
create mode 100644
SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/RngDxe.c
rename SecurityPkg/RandomNumberGenerator/RngDxe/{ =>
Rand}/AesCore.c (100%)
rename SecurityPkg/RandomNumberGenerator/RngDxe/{ =>
Rand}/RdRand.c (71%)
create mode 100644
SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c
create mode 100644
MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.S
create mode 100644
MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.asm
create mode 100644 MdePkg/Library/BaseRngLib/AArch64/ArmRng.S
create mode 100644 MdePkg/Library/BaseRngLib/AArch64/ArmRng.asm



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

gaoliming
 

Rebecca:
It has been merged @ d9a7612f8d1da197883bd1cb9f91f229522d39b1

Thanks
Liming

-----邮件原件-----
发件人: Rebecca Cran <quic_rcran@...>
发送时间: 2022年1月19日 8:18
收件人: devel@edk2.groups.io; gaoliming@...;
kenlautner3@...
抄送: 'Jian J Wang' <jian.j.wang@...>; 'Hao A Wu'
<hao.a.wu@...>; 'Zhichao Gao' <zhichao.gao@...>; 'Ray Ni'
<ray.ni@...>
主题: Re: [edk2-devel] 回复: [PATCH v2 1/1] MdeModulePkg/BdsDxe:
Update BdsEntry to use Variable Policy

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

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


--
Rebecca Cran


On 6/16/21 18:58, gaoliming wrote:
Ken:
Thanks for your update. Please also update
MdeModulePkg\Universal\BdsDxe\Bds.h to remove #include
<Protocol/VariableLock.h>, because EDKII_VARIABLE_LOCK_PROTOCOL is
not used
any more.

Thanks
Liming
-----邮件原件-----
发件人: kenlautner3@... <kenlautner3@...>
发送时间: 2021年6月17日 6:45
收件人: devel@edk2.groups.io
抄送: Jian J Wang <jian.j.wang@...>; Hao A Wu
<hao.a.wu@...>; Zhichao Gao <zhichao.gao@...>; Ray Ni
<ray.ni@...>; Liming Gao <gaoliming@...>
主题: [PATCH v2 1/1] MdeModulePkg/BdsDxe: Update BdsEntry to use
Variable Policy

From: Ken Lautner <klautner@...>

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

Cc: Jian J Wang <jian.j.wang@...>
Cc: Hao A Wu <hao.a.wu@...>
Cc: Zhichao Gao <zhichao.gao@...>
Cc: Ray Ni <ray.ni@...>
Cc: Liming Gao <gaoliming@...>
Signed-off-by: Kenneth Lautner <kenlautner3@...>

Reviewed-by Liming Gao <gaoliming@...>
---
MdeModulePkg/Universal/BdsDxe/BdsDxe.inf | 4 +++-
MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 20
+++++++++++++++-----
2 files changed, 18 insertions(+), 6 deletions(-)

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

DebugLib

UefiBootManagerLib

+ VariablePolicyLib

+ VariablePolicyHelperLib

PlatformBootManagerLib

PcdLib

PrintLib

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

gEfiBdsArchProtocolGuid ## PRODUCES

gEfiSimpleTextInputExProtocolGuid ## CONSUMES

- gEdkiiVariableLockProtocolGuid ##
SOMETIMES_CONSUMES

+ gEdkiiVariablePolicyProtocolGuid ##
SOMETIMES_CONSUMES

gEfiDeferredImageLoadProtocolGuid ## CONSUMES



[FeaturePcd]

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

#include "Language.h"

#include "HwErrRecSupport.h"

+#include <Library/VariablePolicyHelperLib.h>



#define SET_BOOT_OPTION_SUPPORT_KEY_COUNT(a, c) { \

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

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

UINT32 BootOptionSupport;

UINT16 BootTimeOut;

- EDKII_VARIABLE_LOCK_PROTOCOL *VariableLock;

+ EDKII_VARIABLE_POLICY_PROTOCOL *VariablePolicy;

UINTN Index;

EFI_BOOT_MANAGER_LOAD_OPTION LoadOption;

UINT16 *BootNext;

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

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

//

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

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

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

+ DEBUG((DEBUG_INFO, "[BdsDxe] Locate Variable Policy protocol
- %r\n",
Status));

if (!EFI_ERROR (Status)) {

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

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

- ASSERT_EFI_ERROR (Status);

+ Status = RegisterBasicVariablePolicy(

+ VariablePolicy,

+ &gEfiGlobalVariableGuid,

+ mReadOnlyVariables[Index],

+ VARIABLE_POLICY_NO_MIN_SIZE,

+ VARIABLE_POLICY_NO_MAX_SIZE,

+ VARIABLE_POLICY_NO_MUST_ATTR,

+ VARIABLE_POLICY_NO_CANT_ATTR,

+ VARIABLE_POLICY_TYPE_LOCK_NOW

+ );

+ ASSERT_EFI_ERROR(Status);

}

}



--
2.31.1.windows.1






[PATCH EDK2 v1 0/1] RedfishPkg/RedfishRestExDxe:Simplify status check

wenyi,xie
 

Main Changes :
1.Remove redundant if statement.

Wenyi Xie (1):
RedfishPkg/RedfishRestExDxe:Simplify status check

RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c | 38 +++++++++-----------
1 file changed, 17 insertions(+), 21 deletions(-)

--
2.20.1.windows.1


[PATCH EDK2 v1 1/1] RedfishPkg/RedfishRestExDxe:Simplify status check

wenyi,xie
 

Remove redundant determine statements.
No functional change.

Cc: Abner Chang <abner.chang@...>
Cc: Nickle Wang <nickle.wang@...>
Signed-off-by: Wenyi Xie <xiewenyi2@...>
---
RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c | 38 +++++++++-----------
1 file changed, 17 insertions(+), 21 deletions(-)

diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c b/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c
index eb1d8b8fa236..ba0a42097b92 100644
--- a/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c
+++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c
@@ -44,7 +44,7 @@ ResetHttpTslSession (
}

/**
- This function check
+ This function check Http receive status

@param[in] Instance Pointer to EFI_REST_EX_PROTOCOL instance for a particular
REST service.
@@ -67,37 +67,33 @@ RedfishCheckHttpReceiveStatus (

if (!EFI_ERROR (HttpIoReceiveStatus)) {
ReturnStatus = EFI_SUCCESS;
- } else if (EFI_ERROR (HttpIoReceiveStatus) && (HttpIoReceiveStatus != EFI_CONNECTION_FIN)) {
+ } else if (HttpIoReceiveStatus != EFI_CONNECTION_FIN) {
if ((Instance->Flags & RESTEX_INSTANCE_FLAGS_TCP_ERROR_RETRY) == 0) {
DEBUG ((DEBUG_ERROR, "%a: TCP error, reset HTTP session.\n", __FUNCTION__));
Instance->Flags |= RESTEX_INSTANCE_FLAGS_TCP_ERROR_RETRY;
gBS->Stall (500);
Status = ResetHttpTslSession (Instance);
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: Reset HTTP instance fail.\n", __FUNCTION__));
- ReturnStatus = EFI_DEVICE_ERROR;
- } else {
+ if (!EFI_ERROR (Status)) {
return EFI_NOT_READY;
}
- } else {
- ReturnStatus = EFI_DEVICE_ERROR;
+ DEBUG ((DEBUG_ERROR, "%a: Reset HTTP instance fail.\n", __FUNCTION__));
}
+
+ ReturnStatus = EFI_DEVICE_ERROR;
} else {
- if (HttpIoReceiveStatus == EFI_CONNECTION_FIN) {
- if ((Instance->Flags & RESTEX_INSTANCE_FLAGS_TLS_RETRY) != 0) {
- DEBUG ((DEBUG_ERROR, "%a: REST_EX Send and receive fail even with a new TLS session.\n", __FUNCTION__));
- ReturnStatus = EFI_DEVICE_ERROR;
- }
-
- Instance->Flags |= RESTEX_INSTANCE_FLAGS_TLS_RETRY;
- Status = ResetHttpTslSession (Instance);
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: Reset HTTP instance fail.\n", __FUNCTION__));
- ReturnStatus = EFI_DEVICE_ERROR;
- }
+ if ((Instance->Flags & RESTEX_INSTANCE_FLAGS_TLS_RETRY) != 0) {
+ DEBUG ((DEBUG_ERROR, "%a: REST_EX Send and receive fail even with a new TLS session.\n", __FUNCTION__));
+ ReturnStatus = EFI_DEVICE_ERROR;
+ }

- return EFI_NOT_READY;
+ Instance->Flags |= RESTEX_INSTANCE_FLAGS_TLS_RETRY;
+ Status = ResetHttpTslSession (Instance);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR, "%a: Reset HTTP instance fail.\n", __FUNCTION__));
+ ReturnStatus = EFI_DEVICE_ERROR;
}
+
+ return EFI_NOT_READY;
}

//
--
2.20.1.windows.1


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

Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar@...>
 

[AMD Official Use Only]

Hi Zhichao Gao, Ray Ni,
Could you please review the below patches and merge the changes?
Thanks
AbduL

-----Original Message-----
From: Attar, AbdulLateef (Abdul Lateef)
Sent: 07 January 2022 08:29
To: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar@...>
Cc: Ray Ni <ray.ni@...>; Zhichao Gao <zhichao.gao@...>; Sami Mujawar <sami.mujawar@...>
Subject: RE: [edk2-devel] [PATCH v4 1/2] ShellPkg/AcpiView: Adds ACPI_PARSER bitfield parser

Gentle reminder...please review and merge the changeset.

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Abdul Lateef Attar via groups.io
Sent: 19 December 2021 20:15
To: devel@edk2.groups.io
Cc: Ray Ni <ray.ni@...>; Zhichao Gao <zhichao.gao@...>; Sami Mujawar <sami.mujawar@...>
Subject: [edk2-devel] [PATCH v4 1/2] ShellPkg/AcpiView: Adds ACPI_PARSER bitfield parser

[CAUTION: External Email]

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

Cc: Ray Ni <ray.ni@...>
Cc: Zhichao Gao <zhichao.gao@...>
Cc: Sami Mujawar <sami.mujawar@...>
Signed-off-by: Abdul Lateef Attar <abdattar@...>
---
ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h | 45 +++++ ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c | 185 ++++++++++++++++++++
2 files changed, 230 insertions(+)

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



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

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

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

**/



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

processing for formatting and representation a print formatter function

can be specified in 'PrintFormatter'.

+

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

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

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

+

The PrintFormatter function may choose to use the format string

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



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


/// The length of the field.

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

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

UINT32 Length;



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

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

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

UINT32 Offset;



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

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

);



+/**

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

+

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

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

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

+

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

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

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

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

+

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

+ table.

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

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

+ the table being parsed.

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

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

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

+ describes the table being parsed.

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

+

+ @retval Number of bits parsed.

+**/

+UINT32

+EFIAPI

+ParseAcpiBitFields (

+ IN BOOLEAN Trace,

+ IN UINT32 Indent,

+ IN CONST CHAR8 *AsciiName OPTIONAL,

+ IN UINT8 *Ptr,

+ IN UINT32 Length,

+ IN CONST ACPI_PARSER *Parser,

+ IN UINT32 ParserItems

+ );

+

/**

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



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



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

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

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

**/



#include <Uefi.h>

#include <Library/UefiLib.h>

#include <Library/UefiBootServicesTableLib.h>

+#include <Library/BaseMemoryLib.h>

#include "AcpiParser.h"

#include "AcpiView.h"

#include "AcpiViewConfig.h"

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


return BytesParsed;

}

+

+/**

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

+

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

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

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

+

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

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

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

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

+

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

+ table.

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

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

+ the table being parsed.

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

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

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

+ describes the table being parsed.

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

+

+ @retval Number of bits parsed.

+**/

+UINT32

+EFIAPI

+ParseAcpiBitFields (

+ IN BOOLEAN Trace,

+ IN UINT32 Indent,

+ IN CONST CHAR8 *AsciiName OPTIONAL,

+ IN UINT8 *Ptr,

+ IN UINT32 Length,

+ IN CONST ACPI_PARSER *Parser,

+ IN UINT32 ParserItems

+ )

+{

+ UINT32 Index;

+ UINT32 Offset;

+ BOOLEAN HighLight;

+ UINTN OriginalAttribute;

+

+ UINT64 Data;

+ UINT64 BitsData;

+

+ if ((Length == 0) || (Length > 8)) {

+ IncrementErrorCount ();

+ Print (

+ L"\nERROR: Bitfield Length(%d) is zero or exceeding the 64 bit
+ limit.\n",

+ Length

+ );

+ return 0;

+ }

+

+ //

+ // set local variables to suppress incorrect compiler/analyzer
+ warnings

+ //

+ OriginalAttribute = 0;

+ Offset = 0;

+

+ // Increment the Indent

+ gIndent += Indent;

+

+ CopyMem ((VOID *)&BitsData, (VOID *)Ptr, Length);

+ if (Trace && (AsciiName != NULL)) {

+ HighLight = GetColourHighlighting ();

+

+ if (HighLight) {

+ OriginalAttribute = gST->ConOut->Mode->Attribute;

+ gST->ConOut->SetAttribute (

+ gST->ConOut,

+ EFI_TEXT_ATTR (

+ EFI_YELLOW,

+ ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)

+ )

+ );

+ }

+

+ Print (

+ L"%*a%-*a :\n",

+ gIndent,

+ "",

+ (OUTPUT_FIELD_COLUMN_WIDTH - gIndent),

+ AsciiName

+ );

+ if (HighLight) {

+ gST->ConOut->SetAttribute (gST->ConOut, OriginalAttribute);

+ }

+ }

+

+ for (Index = 0; Index < ParserItems; Index++) {

+ if ((Offset + Parser[Index].Length) > (Length * 8)) {

+ // For fields outside the buffer length provided, reset any
+ pointers

+ // which were supposed to be updated by this function call

+ if (Parser[Index].ItemPtr != NULL) {

+ *Parser[Index].ItemPtr = NULL;

+ }

+

+ // We don't parse past the end of the max length specified

+ continue;

+ }

+

+ if (Parser[Index].Length == 0) {

+ // don't parse the bitfield whose length is zero

+ continue;

+ }

+

+ if (GetConsistencyChecking () &&

+ (Offset != Parser[Index].Offset))

+ {

+ IncrementErrorCount ();

+ Print (

+ L"\nERROR: %a: Offset Mismatch for %s\n"

+ L"CurrentOffset = %d FieldOffset = %d\n",

+ AsciiName,

+ Parser[Index].NameStr,

+ Offset,

+ Parser[Index].Offset

+ );

+ }

+

+ // extract Bitfield data for the current item

+ Data = (BitsData >> Parser[Index].Offset) & ~(~0ULL <<
+ Parser[Index].Length);

+

+ if (Trace) {

+ // if there is a Formatter function let the function handle

+ // the printing else if a Format is specified in the table use

+ // the Format for printing

+ PrintFieldName (2, Parser[Index].NameStr);

+ if (Parser[Index].PrintFormatter != NULL) {

+ Parser[Index].PrintFormatter (Parser[Index].Format, (UINT8
+ *)&Data);

+ } else if (Parser[Index].Format != NULL) {

+ // convert bit length to byte length

+ switch ((Parser[Index].Length + 7) >> 3) {

+ // print the data depends on byte size

+ case 1:

+ DumpUint8 (Parser[Index].Format, (UINT8 *)&Data);

+ break;

+ case 2:

+ DumpUint16 (Parser[Index].Format, (UINT8 *)&Data);

+ break;

+ case 3:

+ case 4:

+ DumpUint32 (Parser[Index].Format, (UINT8 *)&Data);

+ break;

+ case 5:

+ case 6:

+ case 7:

+ case 8:

+ DumpUint64 (Parser[Index].Format, (UINT8 *)&Data);

+ break;

+ default:

+ Print (

+ L"\nERROR: %a: CANNOT PARSE THIS FIELD, Field Length =
+ %d\n",

+ AsciiName,

+ Parser[Index].Length

+ );

+ } // switch

+ }

+

+ // Validating only makes sense if we are tracing

+ // the parsed table entries, to report by table name.

+ if (GetConsistencyChecking () &&

+ (Parser[Index].FieldValidator != NULL))

+ {

+ Parser[Index].FieldValidator ((UINT8 *)&Data,
+ Parser[Index].Context);

+ }

+

+ Print (L"\n");

+ } // if (Trace)

+

+ if (Parser[Index].ItemPtr != NULL) {

+ *Parser[Index].ItemPtr = (VOID *)(UINT8 *)&Data;

+ }

+

+ Offset += Parser[Index].Length;

+ } // for

+

+ // Decrement the Indent

+ gIndent -= Indent;

+ return Offset;

+}

--
2.25.1


Re: [PATCH] BaseTools/GenFw: Enhance to add export table in PE-COFF

Huang, Li-Xia <lisa.huang@...>
 

Hi Liming,

 

Thanks for your feedback.

I have added some detail in BZ. 😊

https://bugzilla.tianocore.org/show_bug.cgi?id=3802#add_comment

 

Regards,

Lisa

 

From: gaoliming <gaoliming@...>
Sent: 2022
118 13:20
To: devel@edk2.groups.io; Huang, Li-Xia <lisa.huang@...>; Feng, Bob C <bob.c.feng@...>
Cc: Chen, Christine <yuwei.chen@...>; Wu, Yidong <yidong.wu@...>; Xu, Wei6 <wei6.xu@...>; You, Benjamin <benjamin.you@...>
Subject:
回复: [edk2-devel][PATCH] BaseTools/GenFw: Enhance to add export table in PE-COFF

 

Lisa:

 Can you give more background about PRM usage? What new usage requires RPM? Can you add the detail in BZ?

 

Thanks

Liming

发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Huang, Li-Xia
发送时间: 2022117 11:09
收件人: Feng, Bob C <
bob.c.feng@...>; devel@edk2.groups.io
抄送: Gao, Liming <
gaoliming@...>; Chen, Christine <yuwei.chen@...>; Wu, Yidong <yidong.wu@...>; Xu, Wei6 <wei6.xu@...>; You, Benjamin <benjamin.you@...>
主题: Re: [edk2-devel][PATCH] BaseTools/GenFw: Enhance to add export table in PE-COFF

 

Hi Bob,

 

Thanks for your comments.

 

1.  I will add the help information for "--PRM";

2.

@@ -750,7 +818,7 @@ ScanSections64 (

     if (shdr->sh_addralign <= mCoffAlignment) {

       continue;

     }

-    if (IsTextShdr(shdr) || IsDataShdr(shdr) || IsHiiRsrcShdr(shdr)) {

+    if (IsTextShdr(shdr) || IsDataShdr(shdr) || IsHiiRsrcShdr(shdr) || IsSymbolShdr(shdr)) {

       mCoffAlignment = (UINT32)shdr->sh_addralign;

     }

   }

 

1) Above change is to Set mCoffAlignment to the maximum alignment of the input sections including symbol section.

    The symbol section will only exist with below change, so it should have no effect to other drivers.

 

build_rule.template:

    <Command.GCC>

        $(CP) ${src} $(DEBUG_DIR)(+)$(MODULE_NAME).debug

        #$(OBJCOPY) --strip-unneeded -R .eh_frame ${src}

        $(OBJCOPY) $(OBJCOPY_STRIPFLAG) ${src}

 

tools_def.template:

*_*_*_OBJCOPY_STRIPFLAG            = --strip-unneeded -R .eh_frame

 

PrmAddrTransDsm.inf:

[BuildOptions.common]

...

  GCC: *_*_*_OBJCOPY_STRIPFLAG == -R .eh_frame

 

2) For PRM driver, sh_addralign of symbol section is 8, and less than other sections such as Text and Data (sh_addralign is 4096).

 

 

Regards,

Lisa

 

-----Original Message-----
From: Feng, Bob C <bob.c.feng@...>
Sent: 2022114 14:12
To: Huang, Li-Xia <lisa.huang@...>; devel@edk2.groups.io
Cc: Gao, Liming <gaoliming@...>; Chen, Christine <yuwei.chen@...>
Subject: RE: [edk2-devel][PATCH] BaseTools/GenFw: Enhance to add export table in PE-COFF

 

Hi Lixia,

 

This patch introduce a new command line option --PRM. Could you add the help information about --PRM?

 

Could you provide more information about the below change? Would there be side-effect?

 

@@ -750,7 +818,7 @@ ScanSections64 (

     if (shdr->sh_addralign <= mCoffAlignment) {

       continue;

     }

-    if (IsTextShdr(shdr) || IsDataShdr(shdr) || IsHiiRsrcShdr(shdr)) {

+    if (IsTextShdr(shdr) || IsDataShdr(shdr) || IsHiiRsrcShdr(shdr) || IsSymbolShdr(shdr)) {

       mCoffAlignment = (UINT32)shdr->sh_addralign;

     }

   }

 

 

 

Thanks,

Bob

 

-----Original Message-----

From: Huang, Li-Xia <lisa.huang@...>

Sent: Wednesday, January 12, 2022 3:44 PM

To: devel@edk2.groups.io

Cc: Huang, Li-Xia <lisa.huang@...>; Gao, Liming <gaoliming@...>; Feng, Bob C <bob.c.feng@...>; Chen, Christine <yuwei.chen@...>

Subject: [edk2-devel][PATCH] BaseTools/GenFw: Enhance to add export table in PE-COFF

 

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

Since PRM module needs to support export table in PE-COFF, we'll enhance GenFw tool to support this.

 

Add one export flag in GenFw tool. If export flag is set:

Step1: Scan ELF symbol table based on PRM module descriptor to get descriptor offset address;

Step2: Find PRM handlers number and name in COFF file based on the address from step1;

Step3: Write PRM info such as handler name and export RVA into COFF export table.

 

Cc: Liming Gao <gaoliming@...>

Cc: Bob Feng <bob.c.feng@...>

Cc: Yuwei Chen <yuwei.chen@...>

Signed-off-by: Lixia Huang <lisa.huang@...>

---

BaseTools/Source/C/GenFw/Elf64Convert.c       | 254 +++++++++++++++++-

BaseTools/Source/C/GenFw/ElfConvert.c         |  10 +

BaseTools/Source/C/GenFw/ElfConvert.h         |  42 ++-

BaseTools/Source/C/GenFw/GenFw.c              |  11 +-

.../C/Include/IndustryStandard/PeImage.h      |   7 +

5 files changed, 318 insertions(+), 6 deletions(-)

 

diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Source/C/GenFw/Elf64Convert.c

index 0bb3ead228..0079507356 100644

--- a/BaseTools/Source/C/GenFw/Elf64Convert.c

+++ b/BaseTools/Source/C/GenFw/Elf64Convert.c

@@ -56,6 +56,18 @@ WriteDebug64 (

   VOID   ); +STATIC+VOID+ScanSymbol64 (+  VOID+  );++STATIC+VOID+WriteExport64 (+  VOID+  );+ STATIC VOID SetImageSize64 (@@ -122,7 +134,7 @@ STATIC UINT32 mDataOffset;

STATIC UINT32 mHiiRsrcOffset; STATIC UINT32 mRelocOffset; STATIC UINT32 mDebugOffset;-+STATIC UINT32 mExportOffset; // // Used for RISC-V relocations. //@@ -132,6 +144,14 @@ STATIC Elf64_Half  mRiscVPass1SymSecIndex = 0;

STATIC INT32       mRiscVPass1Offset; STATIC INT32       mRiscVPass1GotFixup; +//+// Used for Export section.+//+STATIC UINT32      mExportSize;+STATIC UINT32      mExportRVA[PRM_MODULE_EXPORT_SYMBOL_NUM];+STATIC UINT32      mExportSymNum;+STATIC CHAR8       mExportSymName[PRM_MODULE_EXPORT_SYMBOL_NUM][PRM_HANDLER_NAME_MAXIMUM_LENGTH];+ // // Initialization Function //@@ -200,6 +220,10 @@ InitializeElf64 (

   ElfFunctions->SetImageSize = SetImageSize64;   ElfFunctions->CleanUp = CleanUp64; +  if (mExportFlag) {+    ElfFunctions->ScanSymbol = ScanSymbol64;+    ElfFunctions->WriteExport = WriteExport64;+  }   return TRUE; } @@ -263,6 +287,17 @@ IsHiiRsrcShdr (

   return (BOOLEAN) (strcmp((CHAR8*)mEhdr + Namedr->sh_offset + Shdr->sh_name, ELF_HII_SECTION_NAME) == 0); } +STATIC+BOOLEAN+IsSymbolShdr (+  Elf_Shdr *Shdr+  )+{+  Elf_Shdr *Namehdr = GetShdrByIndex(mEhdr->e_shstrndx);++  return (BOOLEAN) (strcmp((CHAR8*)mEhdr + Namehdr->sh_offset + Shdr->sh_name, ELF_SYMBOL_SECTION_NAME) == 0);+}+ STATIC BOOLEAN IsDataShdr (@@ -335,6 +370,38 @@ GetSymName (

   return StrtabContents + Sym->st_name; } +//+// Get Prm Handler number and name+//+STATIC+VOID+FindPrmHandler (+  UINT64 Offset+  )+{+  PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT_HEADER *PrmExport;+  UINT32   NameOffset;+  UINT32   HandlerNum;+  UINT32   Index;+  UINT8    SymName[PRM_HANDLER_NAME_MAXIMUM_LENGTH];++  PrmExport = (PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT_HEADER*)(mCoffFile + Offset);+  NameOffset = sizeof(PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT_HEADER) + sizeof(EFI_GUID);++  for (HandlerNum = 0; HandlerNum < PrmExport->NumberPrmHandlers; HandlerNum++) {+    for (Index = 0; Index < PRM_HANDLER_NAME_MAXIMUM_LENGTH; Index++) {+      SymName[Index] = *((UINT8 *)PrmExport + NameOffset + Index);+      if (SymName[Index] == 0) {+        break;+      }+    }++    strcpy(mExportSymName[mExportSymNum], (CHAR8*)SymName);+    NameOffset += PRM_HANDLER_NAME_MAXIMUM_LENGTH + sizeof(EFI_GUID);+    mExportSymNum ++;+  }+}+ // // Find the ELF section hosting the GOT from an ELF Rva //   of a single GOT entry.  Normally, GOT is placed in@@ -717,6 +784,7 @@ ScanSections64 (

   UINT32                          CoffEntry;   UINT32                          SectionCount;   BOOLEAN                         FoundSection;+  UINT32                          Offset;    CoffEntry = 0;   mCoffOffset = 0;@@ -750,7 +818,7 @@ ScanSections64 (

     if (shdr->sh_addralign <= mCoffAlignment) {       continue;     }-    if (IsTextShdr(shdr) || IsDataShdr(shdr) || IsHiiRsrcShdr(shdr)) {+    if (IsTextShdr(shdr) || IsDataShdr(shdr) || IsHiiRsrcShdr(shdr) || IsSymbolShdr(shdr)) {       mCoffAlignment = (UINT32)shdr->sh_addralign;     }   }@@ -880,6 +948,16 @@ ScanSections64 (

     Warning (NULL, 0, 0, NULL, "Multiple sections in %s are merged into 1 data section. Source level debug might not work correctly.", mInImageName);   } +  //+  //  The Symbol sections.+  //+  if (mExportFlag) {+    mExportOffset = mCoffOffset;+    mExportSize = sizeof(EFI_IMAGE_EXPORT_DIRECTORY) + strlen(mInImageName) + 1;+    mCoffOffset += mExportSize;+    mCoffOffset = CoffAlign(mCoffOffset);+  }+   //   //  The HII resource sections.   //@@ -962,7 +1040,11 @@ ScanSections64 (

     | EFI_IMAGE_FILE_LARGE_ADDRESS_AWARE;    NtHdr->Pe32Plus.OptionalHeader.SizeOfCode = mDataOffset - mTextOffset;-  NtHdr->Pe32Plus.OptionalHeader.SizeOfInitializedData = mRelocOffset - mDataOffset;+  if(mExportFlag) {+    NtHdr->Pe32Plus.OptionalHeader.SizeOfInitializedData = mRelocOffset - mExportOffset;+  } else {+    NtHdr->Pe32Plus.OptionalHeader.SizeOfInitializedData = mRelocOffset - mDataOffset;+  }   NtHdr->Pe32Plus.OptionalHeader.SizeOfUninitializedData = 0;   NtHdr->Pe32Plus.OptionalHeader.AddressOfEntryPoint = CoffEntry; @@ -989,8 +1071,17 @@ ScanSections64 (

     NtHdr->Pe32Plus.FileHeader.NumberOfSections--;   } +  //+  // If found symbol, add edata section between data and rsrc section+  //+  if(mExportFlag) {+    Offset = mExportOffset;+  } else {+    Offset = mHiiRsrcOffset;+  }+   if ((mHiiRsrcOffset - mDataOffset) > 0) {-    CreateSectionHeader (".data", mDataOffset, mHiiRsrcOffset - mDataOffset,+    CreateSectionHeader (".data", mDataOffset, Offset - mDataOffset,             EFI_IMAGE_SCN_CNT_INITIALIZED_DATA             | EFI_IMAGE_SCN_MEM_WRITE             | EFI_IMAGE_SCN_MEM_READ);@@ -999,6 +1090,20 @@ ScanSections64 (

     NtHdr->Pe32Plus.FileHeader.NumberOfSections--;   } +  if(mExportFlag) {+    if ((mHiiRsrcOffset - mExportOffset) > 0) {+      CreateSectionHeader (".edata", mExportOffset, mHiiRsrcOffset - mExportOffset,+              EFI_IMAGE_SCN_CNT_INITIALIZED_DATA+              | EFI_IMAGE_SCN_MEM_READ);+      NtHdr->Pe32Plus.OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXPORT].Size = mHiiRsrcOffset - mExportOffset;+      NtHdr->Pe32Plus.OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress = mExportOffset;+      NtHdr->Pe32Plus.FileHeader.NumberOfSections++;+    } else {+      // Don't make a section of size 0.+      NtHdr->Pe32Plus.FileHeader.NumberOfSections--;+    }+  }+   if ((mRelocOffset - mHiiRsrcOffset) > 0) {     CreateSectionHeader (".rsrc", mHiiRsrcOffset, mRelocOffset - mHiiRsrcOffset,             EFI_IMAGE_SCN_CNT_INITIALIZED_DATA@@ -1757,4 +1862,145 @@ CleanUp64 (

   } } +STATIC+VOID+ScanSymbol64 (+  VOID+  )+{+  UINT32      shIndex;+  UINT32      SymIndex;+  Elf_Sym     *Sym;+  UINT64      SymNum;+  const UINT8 *SymName;++  for (shIndex = 0; shIndex < mEhdr->e_shnum; shIndex++) {+    //+    // Determine if this is a symbol section.+    //+    Elf_Shdr *shdr = GetShdrByIndex(shIndex);+    if (!IsSymbolShdr(shdr)) {+      continue;+    }++    UINT8    *Symtab = (UINT8*)mEhdr + shdr->sh_offset;+    SymNum = (shdr->sh_size) / (shdr->sh_entsize);++    //+    // First Get PrmModuleExportDescriptor+    //+    for (SymIndex = 0; SymIndex < SymNum; SymIndex++) {+      Sym = (Elf_Sym *)(Symtab + SymIndex * shdr->sh_entsize);+      SymName = GetSymName(Sym);+      if (SymName == NULL) {+          continue;+      }++      if (strcmp((CHAR8*)SymName, PRM_MODULE_EXPORT_DESCRIPTOR_NAME) == 0) {+        //+        // Find PrmHandler Number and Name+        //+        FindPrmHandler(Sym->st_value);++        strcpy(mExportSymName[mExportSymNum], (CHAR8*)SymName);+        mExportRVA[mExportSymNum] = (UINT32)(Sym->st_value);+        mExportSize += 2 * EFI_IMAGE_EXPORT_ADDR_SIZE + EFI_IMAGE_EXPORT_ORDINAL_SIZE + strlen((CHAR8 *)SymName) + 1;+        mExportSymNum ++;+        break;+      }+    }++    //+    // Second Get PrmHandler+    //+    for (SymIndex = 0; SymIndex < SymNum; SymIndex++) {+      UINT32   ExpIndex;+      Sym = (Elf_Sym *)(Symtab + SymIndex * shdr->sh_entsize);+      SymName = GetSymName(Sym);+      if (SymName == NULL) {+          continue;+      }++      for (ExpIndex = 0; ExpIndex < (mExportSymNum -1); ExpIndex++) {+        if (strcmp((CHAR8*)SymName, mExportSymName[ExpIndex]) != 0) {+          continue;+        }+        mExportRVA[ExpIndex] = (UINT32)(Sym->st_value);+        mExportSize += 2 * EFI_IMAGE_EXPORT_ADDR_SIZE + EFI_IMAGE_EXPORT_ORDINAL_SIZE + strlen((CHAR8 *)SymName) + 1;+      }+    }++    break;+  }+}++STATIC+VOID+WriteExport64 (+  VOID+  )+{+  EFI_IMAGE_OPTIONAL_HEADER_UNION     *NtHdr;+  EFI_IMAGE_EXPORT_DIRECTORY          *ExportDir;+  EFI_IMAGE_DATA_DIRECTORY            *DataDir;+  UINT32                              FileNameOffset;+  UINT32                              FuncOffset;+  UINT16                              Index;+  UINT8                               *Tdata = NULL;++  ExportDir = (EFI_IMAGE_EXPORT_DIRECTORY*)(mCoffFile + mExportOffset);+  ExportDir->Characteristics = 0;+  ExportDir->TimeDateStamp = 0;+  ExportDir->MajorVersion = 0;+  ExportDir->MinorVersion =0;+  ExportDir->Name = 0;+  ExportDir->NumberOfFunctions = mExportSymNum;+  ExportDir->NumberOfNames = mExportSymNum;+  ExportDir->Base = EFI_IMAGE_EXPORT_ORDINAL_BASE;+  ExportDir->AddressOfFunctions = mExportOffset + sizeof(EFI_IMAGE_EXPORT_DIRECTORY);+  ExportDir->AddressOfNames = ExportDir->AddressOfFunctions + EFI_IMAGE_EXPORT_ADDR_SIZE * mExportSymNum;+  ExportDir->AddressOfNameOrdinals = ExportDir->AddressOfNames + EFI_IMAGE_EXPORT_ADDR_SIZE * mExportSymNum;++  FileNameOffset = ExportDir->AddressOfNameOrdinals + EFI_IMAGE_EXPORT_ORDINAL_SIZE * mExportSymNum;+  FuncOffset = FileNameOffset + strlen(mInImageName) + 1;++  // Write Input image Name RVA+  Tdata = mCoffFile + 12;+  *(UINT32 *)Tdata = FileNameOffset;++  // Write Input image Name+  strcpy((char *)(mCoffFile + FileNameOffset), mInImageName);++  for (Index = 0; Index < mExportSymNum; Index++) {+    //+    // Write Export Address Table+    //+    Tdata = mCoffFile + ExportDir->AddressOfFunctions + Index * EFI_IMAGE_EXPORT_ADDR_SIZE;+    *(UINT32 *)Tdata = mExportRVA[Index];++    //+    // Write Export Name Pointer Table+    //+    Tdata = mCoffFile + ExportDir->AddressOfNames + Index * EFI_IMAGE_EXPORT_ADDR_SIZE;+    *(UINT32 *)Tdata = FuncOffset;++    //+    // Write Export Ordinal table+    //+    Tdata = mCoffFile + ExportDir->AddressOfNameOrdinals + Index * EFI_IMAGE_EXPORT_ORDINAL_SIZE;+    *(UINT16 *)Tdata = Index;++    //+    // Write Export Name Table+    //+    strcpy((char *)(mCoffFile + FuncOffset), mExportSymName[Index]);+    FuncOffset += strlen(mExportSymName[Index]) + 1;+  }++  NtHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(mCoffFile + mNtHdrOffset);+  DataDir = &NtHdr->Pe32Plus.OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXPORT];+  DataDir->VirtualAddress = mExportOffset;+  DataDir->Size = mExportSize;++} diff --git a/BaseTools/Source/C/GenFw/ElfConvert.c b/BaseTools/Source/C/GenFw/ElfConvert.c

index 7db8721167..795cdbd743 100644

--- a/BaseTools/Source/C/GenFw/ElfConvert.c

+++ b/BaseTools/Source/C/GenFw/ElfConvert.c

@@ -223,6 +223,16 @@ ConvertElf (

   VerboseMsg ("Write debug info.");   ElfFunctions.WriteDebug (); +  //+  // For PRM Driver to Write export info.+  //+  if (mExportFlag) {+    VerboseMsg ("Scan symbol info.");+    ElfFunctions.ScanSymbol ();+    VerboseMsg ("Write export info.");+    ElfFunctions.WriteExport ();+  }+   //   // Make sure image size is correct before returning the new image.   //diff --git a/BaseTools/Source/C/GenFw/ElfConvert.h b/BaseTools/Source/C/GenFw/ElfConvert.h

index 801e8de4a2..7920765fbb 100644

--- a/BaseTools/Source/C/GenFw/ElfConvert.h

+++ b/BaseTools/Source/C/GenFw/ElfConvert.h

@@ -24,6 +24,7 @@ extern UINT8  *mCoffFile;  extern UINT32 mTableOffset; extern UINT32 mOutImageType; extern UINT32 mFileBufferSize;+extern BOOLEAN mExportFlag;  // // Common EFI specific data.@@ -31,6 +32,42 @@ extern UINT32 mFileBufferSize;

#define ELF_HII_SECTION_NAME ".hii" #define ELF_STRTAB_SECTION_NAME ".strtab" #define MAX_COFF_ALIGNMENT 0x10000+#define ELF_SYMBOL_SECTION_NAME ".symtab"++//+// Platform Runtime Mechanism (PRM) specific data.+//+#define PRM_MODULE_EXPORT_SYMBOL_NUM 10+#define PRM_HANDLER_NAME_MAXIMUM_LENGTH 128++#define PRM_MODULE_EXPORT_DESCRIPTOR_NAME         "PrmModuleExportDescriptor"+#define PRM_MODULE_EXPORT_DESCRIPTOR_SIGNATURE    SIGNATURE_64 ('P', 'R', 'M', '_', 'M', 'E', 'D', 'T')+#define PRM_MODULE_EXPORT_REVISION                0x0++//+// Platform Runtime Mechanism (PRM) Export Descriptor Structures+//+#pragma pack(push, 1)++typedef struct {+  EFI_GUID                              PrmHandlerGuid;+  CHAR8                                 PrmHandlerName[PRM_HANDLER_NAME_MAXIMUM_LENGTH];+} PRM_HANDLER_EXPORT_DESCRIPTOR_STRUCT;++typedef struct {+  UINT64                                Signature;+  UINT16                                Revision;+  UINT16                                NumberPrmHandlers;+  EFI_GUID                              PlatformGuid;+  EFI_GUID                              ModuleGuid;+} PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT_HEADER;++typedef struct {+  PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT_HEADER  Header;+  PRM_HANDLER_EXPORT_DESCRIPTOR_STRUCT        PrmHandlerExportDescriptors[1];+} PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT;++#pragma pack(pop)  // // Filter Types@@ -38,7 +75,8 @@ extern UINT32 mFileBufferSize;

typedef enum {   SECTION_TEXT,   SECTION_HII,-  SECTION_DATA+  SECTION_DATA,+  SECTION_SYMBOL  } SECTION_FILTER_TYPES; @@ -50,6 +88,8 @@ typedef struct {

   BOOLEAN (*WriteSections) (SECTION_FILTER_TYPES  FilterType);   VOID    (*WriteRelocations) ();   VOID    (*WriteDebug) ();+  VOID    (*ScanSymbol) ();+  VOID    (*WriteExport) ();   VOID    (*SetImageSize) ();   VOID    (*CleanUp) (); diff --git a/BaseTools/Source/C/GenFw/GenFw.c b/BaseTools/Source/C/GenFw/GenFw.c

index 8cab70ba4d..c7de5b89d8 100644

--- a/BaseTools/Source/C/GenFw/GenFw.c

+++ b/BaseTools/Source/C/GenFw/GenFw.c

@@ -87,7 +87,7 @@ UINT32 mImageTimeStamp = 0;

UINT32 mImageSize = 0; UINT32 mOutImageType = FW_DUMMY_IMAGE; BOOLEAN mIsConvertXip = FALSE;-+BOOLEAN mExportFlag = FALSE;  STATIC EFI_STATUS@@ -1436,6 +1436,15 @@ Returns:

       continue;     } +    if (stricmp (argv[0], "--PRM") == 0) {+      if (!mExportFlag) {+        mExportFlag = TRUE;+      }+      argc --;+      argv ++;+      continue;+    }+     if (argv[0][0] == '-') {       Error (NULL, 0, 1000, "Unknown option", argv[0]);       goto Finish;diff --git a/BaseTools/Source/C/Include/IndustryStandard/PeImage.h b/BaseTools/Source/C/Include/IndustryStandard/PeImage.h

index f17b8ee19b..21c968e650 100644

--- a/BaseTools/Source/C/Include/IndustryStandard/PeImage.h

+++ b/BaseTools/Source/C/Include/IndustryStandard/PeImage.h

@@ -571,6 +571,13 @@ typedef struct {

   UINT32  AddressOfNameOrdinals; } EFI_IMAGE_EXPORT_DIRECTORY; +//+// Based export types.+//+#define EFI_IMAGE_EXPORT_ORDINAL_BASE     1+#define EFI_IMAGE_EXPORT_ADDR_SIZE        4+#define EFI_IMAGE_EXPORT_ORDINAL_SIZE     2+ /// /// DLL support. /// Import Format--

2.26.2.windows.1

 


回复: [edk2-devel] [PATCH] MdeModulePkg/HiiDatabaseDxe: Add Support for authenticated variable

gaoliming
 

Lin:

-----邮件原件-----
发件人: Chen, Lin Z <lin.z.chen@...>
发送时间: 2022年1月18日 8:42
收件人: Gao, Liming <gaoliming@...>; devel@edk2.groups.io;
Huang, Long1 <long1.huang@...>
抄送: Bi, Dandan <dandan.bi@...>; Feng, Bob C
<bob.c.feng@...>; Zhang, Di <di.zhang@...>; Li, Zhuangzhi
<zhuangzhi.li@...>
主题: RE: [edk2-devel] [PATCH] MdeModulePkg/HiiDatabaseDxe: Add
Support for authenticated variable

Hi Liming,

Pls see my comments below.

1.
PcdNvStoreDefaultValueBuffer type is DynamicEx. Its PcdGetPtr is same to
PcdGetExPtr. This change is not required.

[Lin] It'll get alignment with PEI phase reference If using PcdGetExPtr version.
Edk2/MdeModulePkg/Universal/PCD/Pei/Pcd.c#166
DataBuffer = (UINT8 *)PeiPcdGetPtrEx (&gEfiMdeModulePkgTokenSpaceGuid,
PcdToken (PcdNvStoreDefaultValueBuffer));
PcdPei is different. It is Pcd driver. It can't consume the real PcdLib. So, it doesn't use PcdLib PcdGetPtr() API.
It uses the internal function PeiPcdGetPtrEx() to get PCD value and size.

HiiDataBase is normal DXE driver. It can depend on the real PcdLib. So, it uses PcdLib PcdGetPtr() API.
Seemly, current code brings confuse. If so, I am OK to make this change. And, please also update PcdGetSize (PcdNvStoreDefaultValueBuffer) with LibPcdGetExSize()

2.
VariableStorage data buffer is from PcdNvStoreDefaultValueBuffer.
PcdNvStoreDefaultValueBuffer is auto generated by BaseTools.
By design, its data format is always normal variable storage format.
So, its value can't be auth variable format.

[Lin] BaseTools can generate authenticated variable storage format now (see
https://edk2.groups.io/g/devel/message/83329),
since previous FCE tool generates authenticated format, we want to keep
variable storage format no changes after switching to StructurePcd.
Sorry, I miss the previous change in BaseTools. Normal variable storage is enough for Tools and Code.
The default setting format can be always normal variable storage. The consumer code logic can be simple.
I don't know what purpose to keep the alignment with FCE tool behavior. Is there other tool or code to use
the generated PcdNvStoreDefaultValueBuffer?

Thanks
Liming
Thanks,
Lin

-----Original Message-----
From: gaoliming <gaoliming@...>
Sent: Monday, January 17, 2022 6:56 PM
To: devel@edk2.groups.io; Huang, Long1 <long1.huang@...>
Cc: Chen, Lin Z <lin.z.chen@...>; Bi, Dandan <dandan.bi@...>;
Feng, Bob C <bob.c.feng@...>
Subject: 回复: [edk2-devel] [PATCH] MdeModulePkg/HiiDatabaseDxe: Add
Support for authenticated variable

Long:
I add my comments below.

-----邮件原件-----
发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Long1
Huang
发送时间: 2022年1月11日 1:03
收件人: devel@edk2.groups.io
抄送: Huang Long <long1.huang@...>; Liming Gao
<gaoliming@...>; Chen Lin Z <lin.z.chen@...>; Dandan
Bi <dandan.bi@...>
主题: [edk2-devel] [PATCH] MdeModulePkg/HiiDatabaseDxe: Add Support
for
authenticated variable

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

Database.c:
1. Replace PcdGetExPtr with PcdGetExPtr.
2. Add FindAuthVariableData function to parse authenticated variable
type for getting a correct default value in PcdNvStoreDefaultValueBuffer.

Cc: Liming Gao <gaoliming@...>
Cc: Chen Lin Z <lin.z.chen@...>
Cc: Dandan Bi <dandan.bi@...>

Signed-off-by: Huang Long <long1.huang@...>
---
.../Universal/HiiDatabaseDxe/Database.c | 147
+++++++++++++-----
.../HiiDatabaseDxe/HiiDatabaseDxe.inf | 3 +
2 files changed, 114 insertions(+), 36 deletions(-)

diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
index 0b09c24d52..c055fa0f29 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c
@@ -603,6 +603,45 @@ FindVariableData (
return NULL;

}



+/**

+ Find the matched authenticated variable from the input variable
storage.

+

+ @param[in] VariableStorage Point to the variable storage header.

+ @param[in] VarGuid A unique identifier for the variable.

+ @param[in] VarAttribute The attributes bitmask for the variable.

+ @param[in] VarName A Null-terminated ascii string that is
the
name of the variable.

+

+ @return Pointer to the matched variable header or NULL if not found.

+**/

+AUTHENTICATED_VARIABLE_HEADER *

+FindAuthVariableData (

+ IN VARIABLE_STORE_HEADER *VariableStorage,

+ IN EFI_GUID *VarGuid,

+ IN UINT32 VarAttribute,

+ IN CHAR16 *VarName

+ )

+{

+ AUTHENTICATED_VARIABLE_HEADER *AuthVariableHeader;

+ AUTHENTICATED_VARIABLE_HEADER *AuthVariableEnd;

+

+ AuthVariableEnd = (AUTHENTICATED_VARIABLE_HEADER
*)((UINT8
*)VariableStorage + VariableStorage->Size);

+ AuthVariableHeader = (AUTHENTICATED_VARIABLE_HEADER
*)(VariableStorage + 1);

+ AuthVariableHeader = (AUTHENTICATED_VARIABLE_HEADER
*)HEADER_ALIGN (AuthVariableHeader);

+ while (AuthVariableHeader < AuthVariableEnd) {

+ if (CompareGuid (&AuthVariableHeader->VendorGuid, VarGuid) &&

+ (AuthVariableHeader->Attributes == VarAttribute) &&

+ (StrCmp (VarName, (CHAR16 *)(AuthVariableHeader + 1)) == 0))

+ {

+ return AuthVariableHeader;

+ }

+

+ AuthVariableHeader = (AUTHENTICATED_VARIABLE_HEADER
*)((UINT8 *)AuthVariableHeader + sizeof
(AUTHENTICATED_VARIABLE_HEADER) + AuthVariableHeader->NameSize +
AuthVariableHeader->DataSize);

+ AuthVariableHeader = (AUTHENTICATED_VARIABLE_HEADER
*)HEADER_ALIGN (AuthVariableHeader);

+ }

+

+ return NULL;

+}

+

/**

Find question default value from PcdNvStoreDefaultValueBuffer



@@ -626,25 +665,27 @@ FindQuestionDefaultSetting (
IN BOOLEAN BitFieldQuestion

)

{

- VARIABLE_HEADER *VariableHeader;

- VARIABLE_STORE_HEADER *VariableStorage;

- LIST_ENTRY *Link;

- VARSTORAGE_DEFAULT_DATA *Entry;

- VARIABLE_STORE_HEADER *NvStoreBuffer;

- UINT8 *DataBuffer;

- UINT8 *BufferEnd;

- BOOLEAN IsFound;

- UINTN Index;

- UINT32 BufferValue;

- UINT32 BitFieldVal;

- UINTN BitOffset;

- UINTN ByteOffset;

- UINTN BitWidth;

- UINTN StartBit;

- UINTN EndBit;

- PCD_DEFAULT_DATA *DataHeader;

- PCD_DEFAULT_INFO *DefaultInfo;

- PCD_DATA_DELTA *DeltaData;

+ VARIABLE_HEADER *VariableHeader;

+ AUTHENTICATED_VARIABLE_HEADER *AuthVariableHeader;

+ VARIABLE_STORE_HEADER *VariableStorage;

+ LIST_ENTRY *Link;

+ VARSTORAGE_DEFAULT_DATA *Entry;

+ VARIABLE_STORE_HEADER *NvStoreBuffer;

+ UINT8 *DataBuffer;

+ UINT8 *BufferEnd;

+ BOOLEAN AuthFormat;

+ BOOLEAN IsFound;

+ UINTN Index;

+ UINT32 BufferValue;

+ UINT32 BitFieldVal;

+ UINTN BitOffset;

+ UINTN ByteOffset;

+ UINTN BitWidth;

+ UINTN StartBit;

+ UINTN EndBit;

+ PCD_DEFAULT_DATA *DataHeader;

+ PCD_DEFAULT_INFO *DefaultInfo;

+ PCD_DATA_DELTA *DeltaData;



if (gSkuId == 0xFFFFFFFFFFFFFFFF) {

gSkuId = LibPcdGetSku ();

@@ -666,7 +707,7 @@ FindQuestionDefaultSetting (
}



if (Link == &gVarStorageList) {

- DataBuffer = (UINT8 *)PcdGetPtr
(PcdNvStoreDefaultValueBuffer);

+ DataBuffer = (UINT8 *)PcdGetExPtr
(&gEfiMdeModulePkgTokenSpaceGuid, PcdNvStoreDefaultValueBuffer);
PcdNvStoreDefaultValueBuffer type is DynamicEx. Its PcdGetPtr is same to
PcdGetExPtr. This change is not required.

gNvDefaultStoreSize =
((PCD_NV_STORE_DEFAULT_BUFFER_HEADER
*)DataBuffer)->Length;

//

// The first section data includes NV storage default setting.

@@ -750,12 +791,27 @@ FindQuestionDefaultSetting (
return EFI_NOT_FOUND;

}



+ //

+ // Judge if the variable type is authenticated, default is false

+ //

+ AuthFormat = FALSE;

+ if (CompareGuid (&VariableStorage->Signature,
&gEfiAuthenticatedVariableGuid)) {

+ AuthFormat = TRUE;

+ }

+

//

// Find the question default value from the variable storage

//

- VariableHeader = FindVariableData (VariableStorage,
&EfiVarStore->Guid,
EfiVarStore->Attributes, (CHAR16 *)EfiVarStore->Name);

- if (VariableHeader == NULL) {

- return EFI_NOT_FOUND;

+ if(AuthFormat) {

+ AuthVariableHeader = FindAuthVariableData (VariableStorage,
&EfiVarStore->Guid, EfiVarStore->Attributes, (CHAR16
*)EfiVarStore->Name);

+ if (AuthVariableHeader == NULL) {

+ return EFI_NOT_FOUND;

+ }

+ } else {

+ VariableHeader = FindVariableData (VariableStorage,
&EfiVarStore->Guid, EfiVarStore->Attributes, (CHAR16
*)EfiVarStore->Name);

+ if (VariableHeader == NULL) {

+ return EFI_NOT_FOUND;

+ }

}
VariableStorage data buffer is from PcdNvStoreDefaultValueBuffer.
PcdNvStoreDefaultValueBuffer is auto generated by BaseTools.
By design, its data format is always normal variable storage format.
So, its value can't be auth variable format.

Thanks
Liming


StartBit = 0;

@@ -770,20 +826,39 @@ FindQuestionDefaultSetting (
Width = EndBit / 8 + 1;

}



- if (VariableHeader->DataSize < ByteOffset + Width) {

- return EFI_INVALID_PARAMETER;

- }

+ if(AuthFormat) {

+ if (AuthVariableHeader->DataSize < ByteOffset + Width) {

+ return EFI_INVALID_PARAMETER;

+ }



- //

- // Copy the question value

- //

- if (ValueBuffer != NULL) {

- if (BitFieldQuestion) {

- CopyMem (&BufferValue, (UINT8 *)VariableHeader + sizeof
(VARIABLE_HEADER) + VariableHeader->NameSize + ByteOffset, Width);

- BitFieldVal = BitFieldRead32 (BufferValue, StartBit, EndBit);

- CopyMem (ValueBuffer, &BitFieldVal, Width);

- } else {

- CopyMem (ValueBuffer, (UINT8 *)VariableHeader + sizeof
(VARIABLE_HEADER) + VariableHeader->NameSize +
IfrQuestionHdr->VarStoreInfo.VarOffset, Width);

+ //

+ // Copy the question value

+ //

+ if (ValueBuffer != NULL) {

+ if (BitFieldQuestion) {

+ CopyMem (&BufferValue, (UINT8 *)AuthVariableHeader + sizeof
(AUTHENTICATED_VARIABLE_HEADER) + AuthVariableHeader->NameSize +
ByteOffset, Width);

+ BitFieldVal = BitFieldRead32 (BufferValue, StartBit, EndBit);

+ CopyMem (ValueBuffer, &BitFieldVal, Width);

+ } else {

+ CopyMem (ValueBuffer, (UINT8 *)AuthVariableHeader + sizeof
(AUTHENTICATED_VARIABLE_HEADER) + AuthVariableHeader->NameSize +
IfrQuestionHdr->VarStoreInfo.VarOffset, Width);

+ }

+ }

+ } else {

+ if (VariableHeader->DataSize < ByteOffset + Width) {

+ return EFI_INVALID_PARAMETER;

+ }

+

+ //

+ // Copy the question value

+ //

+ if (ValueBuffer != NULL) {

+ if (BitFieldQuestion) {

+ CopyMem (&BufferValue, (UINT8 *)VariableHeader + sizeof
(VARIABLE_HEADER) + VariableHeader->NameSize + ByteOffset, Width);

+ BitFieldVal = BitFieldRead32 (BufferValue, StartBit, EndBit);

+ CopyMem (ValueBuffer, &BitFieldVal, Width);

+ } else {

+ CopyMem (ValueBuffer, (UINT8 *)VariableHeader + sizeof
(VARIABLE_HEADER) + VariableHeader->NameSize +
IfrQuestionHdr->VarStoreInfo.VarOffset, Width);

+ }

}

}



diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
index 0116fb6ecb..dac4d614a8 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
@@ -86,6 +86,9 @@
gEfiHiiImageDecoderNameJpegGuid
|gEfiMdeModulePkgTokenSpaceGuid.PcdSupportHiiImageProtocol ##
SOMETIMES_CONSUMES ## GUID

gEfiHiiImageDecoderNamePngGuid
|gEfiMdeModulePkgTokenSpaceGuid.PcdSupportHiiImageProtocol ##
SOMETIMES_CONSUMES ## GUID

gEdkiiIfrBitVarstoreGuid
## SOMETIMES_CONSUMES ## GUID

+ gEfiAuthenticatedVariableGuid

+ gEfiVariableGuid

+ gEfiMdeModulePkgTokenSpaceGuid



[Depex]

TRUE

--
2.25.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#85447):
https://edk2.groups.io/g/devel/message/85447
Mute This Topic: https://groups.io/mt/88319448/4905953
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub
[gaoliming@...]
-=-=-=-=-=-=


Re: [edk2-platforms][PATCH V1 15/27] NetworkFeaturePkg: Use MinPlatformPkg build include files

Isaac Oram
 

Pushed as e69e69bdf8..d0919cab63

-----Original Message-----
From: Chaganty, Rangasai V <rangasai.v.chaganty@...>
Sent: Thursday, January 13, 2022 9:58 PM
To: Oram, Isaac W <isaac.w.oram@...>; devel@edk2.groups.io
Cc: Gao, Liming <gaoliming@...>
Subject: RE: [edk2-devel][edk2-platforms][PATCH V1 15/27] NetworkFeaturePkg: Use MinPlatformPkg build include files

Reviewed-by: Sai Chaganty <rangasai.v.chaganty@...>

-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@...>
Sent: Tuesday, January 11, 2022 6:20 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W <isaac.w.oram@...>; Chaganty, Rangasai V <rangasai.v.chaganty@...>; Gao, Liming <gaoliming@...>
Subject: [edk2-devel][edk2-platforms][PATCH V1 15/27] NetworkFeaturePkg: Use MinPlatformPkg build include files

Standalong build was not working due to missing libraries.
Leverage MinPlatformPkg common includes for core libraries.

Cc: Sai Chaganty <rangasai.v.chaganty@...>
Cc: Liming Gao <gaoliming@...>

Signed-off-by: Isaac Oram <isaac.w.oram@...>
---
Features/Intel/Network/NetworkFeaturePkg/Include/NetworkFeature.dsc | 89 ++------------------
Features/Intel/Network/NetworkFeaturePkg/NetworkFeaturePkg.dsc | 18 ++++
2 files changed, 24 insertions(+), 83 deletions(-)

diff --git a/Features/Intel/Network/NetworkFeaturePkg/Include/NetworkFeature.dsc b/Features/Intel/Network/NetworkFeaturePkg/Include/NetworkFeature.dsc
index bbc91ecbb1..ca151b4e33 100644
--- a/Features/Intel/Network/NetworkFeaturePkg/Include/NetworkFeature.dsc
+++ b/Features/Intel/Network/NetworkFeaturePkg/Include/NetworkFeature.dsc
@@ -18,12 +18,12 @@
#
################################################################################
[Defines]
-!ifndef $(PEI_ARCH)
- !error "PEI_ARCH must be specified to build this feature!"
-!endif
-!ifndef $(DXE_ARCH)
- !error "DXE_ARCH must be specified to build this feature!"
-!endif
+ !ifndef $(PEI_ARCH)
+ !error "PEI_ARCH must be specified to build this feature!"
+ !endif
+ !ifndef $(DXE_ARCH)
+ !error "DXE_ARCH must be specified to build this feature!"
+ !endif

!include NetworkPkg/NetworkDefines.dsc.inc

@@ -41,56 +41,9 @@
#
################################################################################

-!include MdePkg/MdeLibs.dsc.inc
-
[LibraryClasses]
!include NetworkPkg/NetworkLibs.dsc.inc
-
- #######################################
- # Edk2 Packages
- #######################################
- BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
- BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
- BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf
- DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
- DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
- FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
- HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
- IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
- OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
- PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
- PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
- PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
- ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
- SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
- SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf
- TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
- UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
- UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
- UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
- UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
- UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
- UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
-
-[LibraryClasses.common.SEC,LibraryClasses.common.PEI_CORE,LibraryClasses.common.PEIM]
- #######################################
- # Edk2 Packages
- #######################################
- HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
- MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
- PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
-
-[LibraryClasses.common.DXE_CORE,LibraryClasses.common.DXE_SMM_DRIVER,LibraryClasses.common.SMM_CORE,LibraryClasses.common.DXE_DRIVER,LibraryClasses.common.DXE_RUNTIME_DRIVER,LibraryClasses.common.UEFI_DRIVER,LibraryClasses.common.UEFI_APPLICATION]
- #######################################
- # Edk2 Packages
- #######################################
- DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
- DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
- HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
- MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
- PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf

################################################################################
#
@@ -106,21 +59,6 @@
# generated for it, but the binary will not be put into any firmware volume.
#
################################################################################
-#
-# Feature PEI Components
-#
-
-# @todo: Change below line to [Components.$(PEI_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308
-# is completed.
-[Components.IA32]
- #####################################
- # Network Feature Package
- #####################################
-
- # Add library instances here that are not included in package components and should be tested
- # in the package build.
-
- # Add components here that should be included in the package build.

#
# Feature DXE Components
@@ -138,18 +76,3 @@

# Add components here that should be included in the package build.
!include NetworkPkg/NetworkComponents.dsc.inc
-
-###################################################################################################
-#
-# BuildOptions Section - Define the module specific tool chain flags that should be used as
-# the default flags for a module. These flags are appended to any
-# standard flags that are defined by the build process. They can be
-# applied for any modules or only those modules with the specific
-# module style (EDK or EDKII) specified in [Components] section.
-#
-# For advanced features, it is recommended to enable [BuildOptions] in
-# the applicable INF file so it does not affect the whole board package
-# build when this DSC file is active.
-#
-###################################################################################################
-[BuildOptions]
diff --git a/Features/Intel/Network/NetworkFeaturePkg/NetworkFeaturePkg.dsc b/Features/Intel/Network/NetworkFeaturePkg/NetworkFeaturePkg.dsc
index 199686fa09..cdc5dc851d 100644
--- a/Features/Intel/Network/NetworkFeaturePkg/NetworkFeaturePkg.dsc
+++ b/Features/Intel/Network/NetworkFeaturePkg/NetworkFeaturePkg.dsc
@@ -24,6 +24,24 @@
PEI_ARCH = IA32
DXE_ARCH = X64

+[Packages]
+ MinPlatformPkg/MinPlatformPkg.dec
+
+[PcdsFeatureFlag]
+ #
+ # PCD needed for MinPlatform build includes
+ #
+ gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable |FALSE
+ gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable |FALSE
+ gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable |FALSE
+
+#
+# Include common libraries
+#
+!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
+!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
+!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
+
#
# This package always builds the feature.
#
--
2.27.0.windows.1


Re: [PATCH] MdeModulePkg/HiiDatabaseDxe: Add Support for authenticated variable

Ni, Ray
 

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Long1 Huang
Sent: Thursday, January 13, 2022 1:06 AM
To: devel@edk2.groups.io
Cc: Huang, Long1 <long1.huang@...>; Feng, Bob C <bob.c.feng@...>; Gao, Liming <gaoliming@...>; Bi, Dandan <dandan.bi@...>; Chen, Lin Z <lin.z.chen@...>; Li, Zhuangzhi <zhuangzhi.li@...>
Subject: [edk2-devel] [PATCH] MdeModulePkg/HiiDatabaseDxe: Add Support for authenticated variable

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

Database.c:
1. Replace PcdGetExPtr with PcdGetExPtr.
What does above mean? Replace <a> with <a>?


Re: [edk2-platforms][PATCH V1 08/27] SmbiosFeaturePkg: Fix all relative package paths

Isaac Oram
 

Pushed as d1864efa5b..e69e69bdf8

-----Original Message-----
From: Chaganty, Rangasai V <rangasai.v.chaganty@...>
Sent: Thursday, January 13, 2022 9:31 PM
To: Oram, Isaac W <isaac.w.oram@...>; devel@edk2.groups.io
Cc: Gao, Liming <gaoliming@...>
Subject: RE: [edk2-devel][edk2-platforms][PATCH V1 08/27] SmbiosFeaturePkg: Fix all relative package paths

Reviewed-by: Sai Chaganty <rangasai.v.chaganty@...>

-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@...>
Sent: Tuesday, January 11, 2022 6:20 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W <isaac.w.oram@...>; Chaganty, Rangasai V <rangasai.v.chaganty@...>; Gao, Liming <gaoliming@...>
Subject: [edk2-devel][edk2-platforms][PATCH V1 08/27] SmbiosFeaturePkg: Fix all relative package paths

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

Cc: Sai Chaganty <rangasai.v.chaganty@...>
Cc: Liming Gao <gaoliming@...>

Signed-off-by: Isaac Oram <isaac.w.oram@...>
---
Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf | 2 +-
Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc | 2 +-
Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf | 2 +-
Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec | 10 +++++-----
4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf
index 3ed23bd937..c3a3e81503 100644
--- a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf
+++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemo
+++ ry.fdf
@@ -7,4 +7,4 @@
#
##

- INF SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf
+ INF SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf
diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc
index 31d44b68b3..094dd957b8 100644
--- a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc
+++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFe
+++ ature.dsc
@@ -100,7 +100,7 @@
# in the package build.

# Add components here that should be included in the package build.
- SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf
+ SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf

###################################################################################################
#
diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf
index bd8736b621..8e530c4945 100644
--- a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf
+++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/S
+++ mbiosBasicDxe.inf
@@ -33,7 +33,7 @@
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
- SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec
+ SmbiosFeaturePkg/SmbiosFeaturePkg.dec

[LibraryClasses]
BaseLib
diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec
index 6170f37969..db3cdbb0d0 100644
--- a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec
+++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg
+++ .dec
@@ -38,7 +38,7 @@
IndustryStandard/SmBios.h
<Packages>
MdePkg/MdePkg.dec
- SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec
+ SmbiosFeaturePkg/SmbiosFeaturePkg.dec
}
gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.Vendor|0x1
gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosVersion|0x2
@@ -71,7 +71,7 @@
IndustryStandard/SmBios.h
<Packages>
MdePkg/MdePkg.dec
- SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec
+ SmbiosFeaturePkg/SmbiosFeaturePkg.dec
}
gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.Manufacturer|0x1
gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.ProductName|0x2
@@ -87,7 +87,7 @@
IndustryStandard/SmBios.h
<Packages>
MdePkg/MdePkg.dec
- SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec
+ SmbiosFeaturePkg/SmbiosFeaturePkg.dec
}

#
@@ -111,7 +111,7 @@
IndustryStandard/SmBios.h
<Packages>
MdePkg/MdePkg.dec
- SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec
+ SmbiosFeaturePkg/SmbiosFeaturePkg.dec
}
gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.Manufacturer|0x1
gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.Type|MiscChassisTypeRackMountChassis
@@ -131,7 +131,7 @@
IndustryStandard/SmBios.h
<Packages>
MdePkg/MdePkg.dec
- SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec
+ SmbiosFeaturePkg/SmbiosFeaturePkg.dec
}
gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType32SystemBootInformation.BootStatus|BootInformationStatusNoError

--
2.27.0.windows.1


Re: [edk2-platforms][PATCH V1 07/27] S3FeaturePkg: Use MinPlatformPkg build include files

Isaac Oram
 

Pushed as a16d6344dc..d1864efa5b

-----Original Message-----
From: Chaganty, Rangasai V <rangasai.v.chaganty@...>
Sent: Thursday, January 13, 2022 9:30 PM
To: Oram, Isaac W <isaac.w.oram@...>; devel@edk2.groups.io
Cc: Gao, Liming <gaoliming@...>
Subject: RE: [edk2-devel][edk2-platforms][PATCH V1 07/27] S3FeaturePkg: Use MinPlatformPkg build include files

Reviewed-by: Sai Chaganty <rangasai.v.chaganty@...>

-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@...>
Sent: Tuesday, January 11, 2022 6:20 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W <isaac.w.oram@...>; Chaganty, Rangasai V <rangasai.v.chaganty@...>; Gao, Liming <gaoliming@...>
Subject: [edk2-devel][edk2-platforms][PATCH V1 07/27] S3FeaturePkg: Use MinPlatformPkg build include files

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

Cc: Sai Chaganty <rangasai.v.chaganty@...>
Cc: Liming Gao <gaoliming@...>

Signed-off-by: Isaac Oram <isaac.w.oram@...>
---
Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf | 2 +- Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc | 72 ++------------------
Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc | 18 +++++
3 files changed, 26 insertions(+), 66 deletions(-)

diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf b/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf
index 34caf3dacc..fdd16a4e03 100644
--- a/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf
+++ b/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf
@@ -7,4 +7,4 @@
#
##

- INF S3FeaturePkg/S3Pei/S3Pei.inf
+INF S3FeaturePkg/S3Pei/S3Pei.inf
diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc b/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc
index f94bd2b431..cc34e78507 100644
--- a/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc
+++ b/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc
@@ -18,12 +18,12 @@
#
################################################################################
[Defines]
-!ifndef $(PEI_ARCH)
- !error "PEI_ARCH must be specified to build this feature!"
-!endif
-!ifndef $(DXE_ARCH)
- !error "DXE_ARCH must be specified to build this feature!"
-!endif
+ !ifndef $(PEI_ARCH)
+ !error "PEI_ARCH must be specified to build this feature!"
+ !endif
+ !ifndef $(DXE_ARCH)
+ !error "DXE_ARCH must be specified to build this feature!"
+ !endif

################################################################################
#
@@ -31,34 +31,7 @@
#
################################################################################

-!include MdePkg/MdeLibs.dsc.inc
-
-[LibraryClasses]
- #######################################
- # Edk2 Packages
- #######################################
- BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
- BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf
- DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
- IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
- PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf
- PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf
- PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
-
-[LibraryClasses.common.PEI_CORE,LibraryClasses.common.PEIM]
- #######################################
- # Edk2 Packages
- #######################################
- HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
- MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
- PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
- PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
- PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
- PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf
-
- #######################################
- # Silicon Initialization Package
- #######################################
+[LibraryClasses.common.PEIM]
SmmAccessLib|IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.inf

################################################################################
@@ -92,34 +65,3 @@

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

+[Packages]
+ MinPlatformPkg/MinPlatformPkg.dec
+
+[PcdsFeatureFlag]
+ #
+ # PCD needed for MinPlatform build includes
+ #
+ gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable |FALSE
+ gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable |FALSE
+ gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable |FALSE
+
+#
+# Include common libraries
+#
+!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
+!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
+!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
+
#
# This package always builds the feature.
#
--
2.27.0.windows.1


Re: [edk2-platforms][PATCH V1 06/27] S3FeaturePkg: Fix all relative package paths

Isaac Oram
 

Pushed as af5a7863ff..a16d6344dc

-----Original Message-----
From: Chaganty, Rangasai V <rangasai.v.chaganty@...>
Sent: Thursday, January 13, 2022 9:20 PM
To: Oram, Isaac W <isaac.w.oram@...>; devel@edk2.groups.io
Cc: Gao, Liming <gaoliming@...>
Subject: RE: [edk2-devel][edk2-platforms][PATCH V1 06/27] S3FeaturePkg: Fix all relative package paths

Reviewed-by: Sai Chaganty <rangasai.v.chaganty@...>

-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@...>
Sent: Tuesday, January 11, 2022 6:20 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W <isaac.w.oram@...>; Chaganty, Rangasai V <rangasai.v.chaganty@...>; Gao, Liming <gaoliming@...>
Subject: [edk2-devel][edk2-platforms][PATCH V1 06/27] S3FeaturePkg: Fix all relative package paths

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

Cc: Sai Chaganty <rangasai.v.chaganty@...>
Cc: Liming Gao <gaoliming@...>

Signed-off-by: Isaac Oram <isaac.w.oram@...>
---
Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf | 2 +- Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc | 2 +-
Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf b/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf
index 3cd5cd9628..34caf3dacc 100644
--- a/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf
+++ b/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf
@@ -7,4 +7,4 @@
#
##

- INF PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf
+ INF S3FeaturePkg/S3Pei/S3Pei.inf
diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc b/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc
index 312870981e..f94bd2b431 100644
--- a/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc
+++ b/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc
@@ -91,7 +91,7 @@
# in the package build.

# Add components here that should be included in the package build.
- PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf
+ S3FeaturePkg/S3Pei/S3Pei.inf

#
# Feature DXE Components
diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf b/Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf
index 46fbb62a46..e485eac952 100644
--- a/Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf
+++ b/Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf
@@ -23,7 +23,7 @@
[Packages]
MdePkg/MdePkg.dec
IntelSiliconPkg/IntelSiliconPkg.dec
- PowerManagement/S3FeaturePkg/S3FeaturePkg.dec
+ S3FeaturePkg/S3FeaturePkg.dec

[Sources]
S3Pei.c
--
2.27.0.windows.1


Re: [PATCH v2] MdeModulePkg: Enabling OS boot from SD card through UEFI payload

Wu, Hao A
 

Hello Aiman Rosli,

I have provided my feedbacks by replying your patch mail.
Please help to check if you received the mail.
Or you can check the feedbacks at: https://edk2.groups.io/g/devel/message/85764

Best Regards,
Hao Wu

-----Original Message-----
From: Rosli, Muhammad Aiman <muhammad.aiman.rosli@...>
Sent: Wednesday, January 19, 2022 12:26 AM
To: devel@edk2.groups.io; Wu, Hao A <hao.a.wu@...>; Gao, Zhichao
<zhichao.gao@...>; Ni, Ray <ray.ni@...>; Wang, Jian J
<jian.j.wang@...>
Subject: RE: [edk2-devel] [PATCH v2] MdeModulePkg: Enabling OS boot from
SD card through UEFI payload

Hi all,

Please review my patch, if there is no issue, can help to add push label.

Thank you.

Regards,
Aiman Rosli

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Aiman
Rosli
Sent: Monday, 17 January, 2022 8:56 PM
To: devel@edk2.groups.io
Cc: Rosli, Muhammad Aiman <muhammad.aiman.rosli@...>
Subject: [edk2-devel] [PATCH v2] MdeModulePkg: Enabling OS boot from SD
card through UEFI payload

This changes is by adding 50ms delay during voltage switching from 3.3V to
1.8V, plus adding a goto Voltage33Retry for 3.3V checking and retrying.

Signed-off-by: Aiman Rosli <muhammad.aiman.rosli@...>
---
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c | 23
++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
index 662f9f483c..527fe7dc20 100644
--- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
+++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
@@ -1213,9 +1213,14 @@ SdCardIdentification (
UINT32 PresentState;
UINT8 HostCtrl2;
UINTN Retry;
+ BOOLEAN ForceVoltage33;
+
+ ForceVoltage33 = FALSE;

PciIo = Private->PciIo;
PassThru = &Private->PassThru;
+
+Voltage33Retry:
//
// 1. Send Cmd0 to the device
//
@@ -1294,6 +1299,14 @@ SdCardIdentification (
return EFI_UNSUPPORTED;
}

+ //
+ // 1.8V had failed in the previous run, forcing a retry with 3.3V
+ instead // if (ForceVoltage33 == TRUE) {
+ S18r = FALSE;
+ ForceVoltage33 = FALSE;
+ }
+
//
// 5. Repeatly send Acmd41 with supply voltage window to the device.
// Note here we only support the cards complied with SD physical
@@ -1362,13 +1375,17 @@ SdCardIdentification (
goto Error;
}

- gBS->Stall (1000);
+ // Workaround to add a delay of 50 ms in order for clock to stabilize
before turning on the SD card again.
+ gBS->Stall (50000);

SdMmcHcRwMmio (PciIo, Slot, SD_MMC_HC_PRESENT_STATE, TRUE,
sizeof (PresentState), &PresentState);
if (((PresentState >> 20) & 0xF) != 0xF) {
DEBUG ((DEBUG_ERROR, "SdCardIdentification: SwitchVoltage fails with
PresentState = 0x%x, It should be 0xF\n", PresentState));
- Status = EFI_DEVICE_ERROR;
- goto Error;
+ Status = SdMmcHcReset (Private, Slot);
+ Status = SdMmcHcInitHost (Private, Slot);
+ ForceVoltage33 = TRUE;
+ DEBUG ((DEBUG_ERROR, "SdCardIdentification: Switching to 1.8V had
failed in the previous run, forcing a retry with 3.3V instead\n"));
+ goto Voltage33Retry;
}
}

--
2.34.1.windows.1





Re: 回复: [PATCH v2 1/1] MdeModulePkg/BdsDxe: Update BdsEntry to use Variable Policy

Rebecca Cran
 

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

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


--
Rebecca Cran

On 6/16/21 18:58, gaoliming wrote:
Ken:
Thanks for your update. Please also update
MdeModulePkg\Universal\BdsDxe\Bds.h to remove #include
<Protocol/VariableLock.h>, because EDKII_VARIABLE_LOCK_PROTOCOL is not used
any more.

Thanks
Liming
-----邮件原件-----
发件人: kenlautner3@... <kenlautner3@...>
发送时间: 2021年6月17日 6:45
收件人: devel@edk2.groups.io
抄送: Jian J Wang <jian.j.wang@...>; Hao A Wu
<hao.a.wu@...>; Zhichao Gao <zhichao.gao@...>; Ray Ni
<ray.ni@...>; Liming Gao <gaoliming@...>
主题: [PATCH v2 1/1] MdeModulePkg/BdsDxe: Update BdsEntry to use
Variable Policy

From: Ken Lautner <klautner@...>

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

Cc: Jian J Wang <jian.j.wang@...>
Cc: Hao A Wu <hao.a.wu@...>
Cc: Zhichao Gao <zhichao.gao@...>
Cc: Ray Ni <ray.ni@...>
Cc: Liming Gao <gaoliming@...>
Signed-off-by: Kenneth Lautner <kenlautner3@...>

Reviewed-by Liming Gao <gaoliming@...>
---
MdeModulePkg/Universal/BdsDxe/BdsDxe.inf | 4 +++-
MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 20 +++++++++++++++-----
2 files changed, 18 insertions(+), 6 deletions(-)

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

DebugLib

UefiBootManagerLib

+ VariablePolicyLib

+ VariablePolicyHelperLib

PlatformBootManagerLib

PcdLib

PrintLib

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

gEfiBdsArchProtocolGuid ## PRODUCES

gEfiSimpleTextInputExProtocolGuid ## CONSUMES

- gEdkiiVariableLockProtocolGuid ##
SOMETIMES_CONSUMES

+ gEdkiiVariablePolicyProtocolGuid ##
SOMETIMES_CONSUMES

gEfiDeferredImageLoadProtocolGuid ## CONSUMES



[FeaturePcd]

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

#include "Language.h"

#include "HwErrRecSupport.h"

+#include <Library/VariablePolicyHelperLib.h>



#define SET_BOOT_OPTION_SUPPORT_KEY_COUNT(a, c) { \

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

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

UINT32 BootOptionSupport;

UINT16 BootTimeOut;

- EDKII_VARIABLE_LOCK_PROTOCOL *VariableLock;

+ EDKII_VARIABLE_POLICY_PROTOCOL *VariablePolicy;

UINTN Index;

EFI_BOOT_MANAGER_LOAD_OPTION LoadOption;

UINT16 *BootNext;

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

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

//

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

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

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

+ DEBUG((DEBUG_INFO, "[BdsDxe] Locate Variable Policy protocol - %r\n",
Status));

if (!EFI_ERROR (Status)) {

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

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

- ASSERT_EFI_ERROR (Status);

+ Status = RegisterBasicVariablePolicy(

+ VariablePolicy,

+ &gEfiGlobalVariableGuid,

+ mReadOnlyVariables[Index],

+ VARIABLE_POLICY_NO_MIN_SIZE,

+ VARIABLE_POLICY_NO_MAX_SIZE,

+ VARIABLE_POLICY_NO_MUST_ATTR,

+ VARIABLE_POLICY_NO_CANT_ATTR,

+ VARIABLE_POLICY_TYPE_LOCK_NOW

+ );

+ ASSERT_EFI_ERROR(Status);

}

}



--
2.31.1.windows.1





Re: [edk2-platforms][PATCH V1 04/27] IpmiFeaturePkg: Fix all relative package paths

Isaac Oram
 

Pushed as 025d67dccc..af5a7863ff

-----Original Message-----
From: Desimone, Nathaniel L <nathaniel.l.desimone@...>
Sent: Wednesday, January 12, 2022 6:49 PM
To: Oram, Isaac W <isaac.w.oram@...>; devel@edk2.groups.io
Cc: Gao, Liming <gaoliming@...>
Subject: RE: [edk2-devel][edk2-platforms][PATCH V1 04/27] IpmiFeaturePkg: Fix all relative package paths

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@...>

-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@...>
Sent: Tuesday, January 11, 2022 6:20 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W <isaac.w.oram@...>; Gao, Liming
<gaoliming@...>; Desimone, Nathaniel L
<nathaniel.l.desimone@...>
Subject: [edk2-devel][edk2-platforms][PATCH V1 04/27] IpmiFeaturePkg:
Fix all relative package paths

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

Cc: Liming Gao <gaoliming@...>
Cc: Nate DeSimone <nathaniel.l.desimone@...>

Signed-off-by: Isaac Oram <isaac.w.oram@...>
---

Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.
inf | 2 +-

Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.i
nf | 2 +-
Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf
| 2 +-
Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf
| 2 +-

Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/
GenericIpmi.inf | 2 +-

Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/P
eiGenericIpmi.inf | 2 +-

Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Smm
/SmmGenericIpmi.inf | 2 +-

Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeatu
re.dsc | 36 ++++++++++----------

Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMem
ory.fdf | 16 ++++-----

Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemo
ry.fdf | 6 ++--

Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.in
f | 2 +-

Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiI
nit.inf | 2 +-

Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiIni
t.inf | 2 +-

Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBaseLi
b/IpmiBaseLib.inf | 2 +-

Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBaseLi
bNull/IpmiBaseLibNull.inf | 2 +-

Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiComm
andLib/IpmiCommandLib.inf | 2 +-

Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatfor
mHookLibNull/IpmiPlatformHookLibNull.inf | 2 +-

Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/PeiIpmiBas
eLib/PeiIpmiBaseLib.inf | 2 +-

Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/SmmIpmiB
aseLib/SmmIpmiBaseLib.inf | 2 +-
Features/Intel/OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.inf
| 2 +-

Features/Intel/OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatu
s.inf | 2 +-
21 files changed, 47 insertions(+), 47 deletions(-)

diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAc
pi.inf
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAc
pi.inf
index a84813f55c..7cd60e417b 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAc
pi.inf
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAc
pi.
+++ inf
@@ -22,7 +22,7 @@
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
- OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
+ IpmiFeaturePkg/IpmiFeaturePkg.dec

[LibraryClasses]
UefiBootServicesTableLib
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElo
g.inf
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElo
g.inf
index 665b3d9bda..388dd2740c 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElo
g.inf
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElo
g.
+++ inf
@@ -21,7 +21,7 @@

[Packages]
MdePkg/MdePkg.dec
- OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
+ IpmiFeaturePkg/IpmiFeaturePkg.dec

[LibraryClasses]
UefiDriverEntryPoint
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf
index 85836cd8ee..61222e0c00 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf
@@ -21,7 +21,7 @@
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
- OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
+ IpmiFeaturePkg/IpmiFeaturePkg.dec

[LibraryClasses]
UefiBootServicesTableLib
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf
index 7ad00ae574..797dbe6a07 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf
@@ -20,7 +20,7 @@

[Packages]
MdePkg/MdePkg.dec
- OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
+ IpmiFeaturePkg/IpmiFeaturePkg.dec

[LibraryClasses]
PeimEntryPoint
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dx
e/GenericIpmi.inf
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dx
e/GenericIpmi.inf
index 9881f9e3d0..8d80aeb6b5 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dx
e/GenericIpmi.inf
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dx
e/
+++ GenericIpmi.inf
@@ -36,7 +36,7 @@

[Packages]
MdePkg/MdePkg.dec
- OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
+ IpmiFeaturePkg/IpmiFeaturePkg.dec

[LibraryClasses]
MemoryAllocationLib
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei
/PeiGenericIpmi.inf
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei
/PeiGenericIpmi.inf
index 883a9168e5..a646161ce1 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei
/PeiGenericIpmi.inf
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei
/
+++ PeiGenericIpmi.inf
@@ -33,7 +33,7 @@

[Packages]
MdePkg/MdePkg.dec
- OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
+ IpmiFeaturePkg/IpmiFeaturePkg.dec

[LibraryClasses]
PeimEntryPoint
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Sm
m/SmmGenericIpmi.inf
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Sm
m/SmmGenericIpmi.inf
index a534f7dac8..f430195d1e 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Sm
m/SmmGenericIpmi.inf
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Sm
m/
+++ SmmGenericIpmi.inf
@@ -27,7 +27,7 @@

[Packages]
MdePkg/MdePkg.dec
- OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
+ IpmiFeaturePkg/IpmiFeaturePkg.dec

[LibraryClasses]
MemoryAllocationLib
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFea
ture.dsc
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFea
ture.dsc
index a6eccb428b..c1ce340da2 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFea
ture.dsc
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFea
t
+++ ure.dsc
@@ -47,8 +47,8 @@
#####################################
# IPMI Feature Package
#####################################
-
IpmiCommandLib|OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCo
mmandLib/IpmiCommandLib.inf
-
IpmiPlatformHookLib|OutOfBandManagement/IpmiFeaturePkg/Library/Ipm
iPlatformHookLibNull/IpmiPlatformHookLibNull.inf
+
+
IpmiCommandLib|IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommand
Lib.in
+ f
+
IpmiPlatformHookLib|IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/Ipm
+ iPlatformHookLibNull.inf

[LibraryClasses.common.PEI_CORE,LibraryClasses.common.PEIM]
#######################################
@@ -65,7 +65,7 @@
#####################################
# IPMI Feature Package
#####################################
-
IpmiBaseLib|OutOfBandManagement/IpmiFeaturePkg/Library/PeiIpmiBaseL
ib/PeiIpmiBaseLib.inf
+
+ IpmiBaseLib|IpmiFeaturePkg/Library/PeiIpmiBaseLib/PeiIpmiBaseLib.inf

[LibraryClasses.common.DXE_DRIVER,LibraryClasses.common.UEFI_DRIVER]
#######################################
@@ -82,7 +82,7 @@
#####################################
# IPMI Feature Package
#####################################
-
IpmiBaseLib|OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBaseLib/
IpmiBaseLib.inf
+ IpmiBaseLib|IpmiFeaturePkg/Library/IpmiBaseLib/IpmiBaseLib.inf


##########################################################
######################
#
@@ -112,14 +112,14 @@
# Add library instances here that are not included in package
components and should be tested
# in the package build.

-
OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/
IpmiPlatformHookLibNull.inf
+
+
IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull
+ .inf

#
# Add components here that should be included in the package build.
#
-
OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.i
nf
- OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf
- OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf
+ IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf
+ IpmiFeaturePkg/Frb/FrbPei.inf
+ IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf

#
# Feature DXE Components
@@ -135,20 +135,20 @@
# Add library instances here that are not included in package
components and should be tested
# in the package build.

-
OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/
IpmiPlatformHookLibNull.inf
+
+
IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull
+ .inf

#
# Add components here that should be included in the package build.
#
-
OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/GenericIpmi.inf
-
OutOfBandManagement/IpmiFeaturePkg/Library/SmmIpmiBaseLib/SmmIp
miBaseLib.inf
- OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf
- OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.inf
- OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf
- OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.inf
- OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf
- OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.inf
- OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.inf
+ IpmiFeaturePkg/GenericIpmi/Dxe/GenericIpmi.inf
+ IpmiFeaturePkg/Library/SmmIpmiBaseLib/SmmIpmiBaseLib.inf
+ IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf
+ IpmiFeaturePkg/BmcElog/BmcElog.inf
+ IpmiFeaturePkg/Frb/FrbDxe.inf
+ IpmiFeaturePkg/IpmiFru/IpmiFru.inf
+ IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf
+ IpmiFeaturePkg/OsWdt/OsWdt.inf
+ IpmiFeaturePkg/SolStatus/SolStatus.inf


##########################################################
#########################################
#
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMe
mory.fdf
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMe
mory.fdf
index cbd9453cf0..158b5455d8 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMe
mory.fdf
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMe
mo
+++ ry.fdf
@@ -7,11 +7,11 @@
#
##

- INF
OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/GenericIpmi.inf
- INF OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf
- INF RuleOverride = DRIVER_ACPITABLE
OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf
- INF OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.inf
- INF OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf
- INF OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.inf
- INF OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.inf
- INF OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.inf
+ INF IpmiFeaturePkg/GenericIpmi/Dxe/GenericIpmi.inf
+ INF IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf
+ INF RuleOverride = DRIVER_ACPITABLE
+ IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf
+ INF IpmiFeaturePkg/BmcElog/BmcElog.inf
+ INF IpmiFeaturePkg/Frb/FrbDxe.inf
+ INF IpmiFeaturePkg/IpmiFru/IpmiFru.inf
+ INF IpmiFeaturePkg/OsWdt/OsWdt.inf
+ INF IpmiFeaturePkg/SolStatus/SolStatus.inf
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMe
mory.fdf
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMe
mory.fdf
index 826490952b..d214988bd1 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMe
mory.fdf
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMe
mor
+++ y.fdf
@@ -7,6 +7,6 @@
#
##

-INF
OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.i
nf
-INF OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf
-INF OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf
+INF IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf
+INF IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf
+INF IpmiFeaturePkg/Frb/FrbPei.inf
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru
.inf
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru
.inf
index 0778b221c1..322f061a0f 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru
.inf
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru
.
+++ inf
@@ -21,7 +21,7 @@

[Packages]
MdePkg/MdePkg.dec
- OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
+ IpmiFeaturePkg/IpmiFeaturePkg.dec

[LibraryClasses]
UefiDriverEntryPoint
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpm
iInit.inf
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpm
iInit.inf
index 831bfb0b5e..8236fe4842 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpm
iInit.inf
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpm
i
+++ Init.inf
@@ -21,7 +21,7 @@
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
- OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
+ IpmiFeaturePkg/IpmiFeaturePkg.dec

[LibraryClasses]
UefiBootServicesTableLib
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmi
Init.inf
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmi
Init.inf
index 607a185eb6..3fb31c729a 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmi
Init.inf
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmi
+++ Init.inf
@@ -21,7 +21,7 @@
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
- OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
+ IpmiFeaturePkg/IpmiFeaturePkg.dec

[LibraryClasses]
PeimEntryPoint
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBas
eLib/IpmiBaseLib.inf
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBas
eLib/IpmiBaseLib.inf
index 86df943560..72ca3495fb 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBas
eLib/IpmiBaseLib.inf
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBas
e
+++ Lib/IpmiBaseLib.inf
@@ -18,7 +18,7 @@

[Packages]
MdePkg/MdePkg.dec
- OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
+ IpmiFeaturePkg/IpmiFeaturePkg.dec

[LibraryClasses]
UefiBootServicesTableLib
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBas
eLibNull/IpmiBaseLibNull.inf
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBas
eLibNull/IpmiBaseLibNull.inf
index 5478f9842b..52f8863032 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBas
eLibNull/IpmiBaseLibNull.inf
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBas
e
+++ LibNull/IpmiBaseLibNull.inf
@@ -24,7 +24,7 @@

[Packages]
MdePkg/MdePkg.dec
- OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
+ IpmiFeaturePkg/IpmiFeaturePkg.dec

[LibraryClasses]
BaseLib
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCom
mandLib/IpmiCommandLib.inf
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCo
mmandLib/IpmiCommandLib.inf
index f8e7ba5a8f..d5c14ff2a4 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCom
mandLib/IpmiCommandLib.inf
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCo
mm
+++ andLib/IpmiCommandLib.inf
@@ -24,7 +24,7 @@
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
- OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
+ IpmiFeaturePkg/IpmiFeaturePkg.dec

[LibraryClasses]
BaseMemoryLib
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatf
ormHookLibNull/IpmiPlatformHookLibNull.inf
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlat
formHookLibNull/IpmiPlatformHookLibNull.inf
index ab270079aa..8e472ebdad 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatf
ormHookLibNull/IpmiPlatformHookLibNull.inf
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlat
+++ formHookLibNull/IpmiPlatformHookLibNull.inf
@@ -20,7 +20,7 @@

[Packages]
MdePkg/MdePkg.dec
- OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
+ IpmiFeaturePkg/IpmiFeaturePkg.dec

[LibraryClasses]
DebugLib
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/PeiIpmiB
aseLib/PeiIpmiBaseLib.inf
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/PeiIpmiB
aseLib/PeiIpmiBaseLib.inf
index 9a2c87873f..234492db65 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/PeiIpmiB
aseLib/PeiIpmiBaseLib.inf
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/PeiIpmiB
+++ aseLib/PeiIpmiBaseLib.inf
@@ -18,7 +18,7 @@

[Packages]
MdePkg/MdePkg.dec
- OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
+ IpmiFeaturePkg/IpmiFeaturePkg.dec

[LibraryClasses]
DebugLib
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/SmmIpm
iBaseLib/SmmIpmiBaseLib.inf
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/SmmIp
miBaseLib/SmmIpmiBaseLib.inf
index bb1ccf1ca2..7ea688fc16 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/SmmIpm
iBaseLib/SmmIpmiBaseLib.inf
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/SmmIp
miB
+++ aseLib/SmmIpmiBaseLib.inf
@@ -18,7 +18,7 @@

[Packages]
MdePkg/MdePkg.dec
- OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
+ IpmiFeaturePkg/IpmiFeaturePkg.dec

[LibraryClasses]
UefiBootServicesTableLib
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.i
nf
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.i
nf
index 7e7d2826cb..3fd1078271 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.i
nf
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.i
nf
@@ -20,7 +20,7 @@

[Packages]
MdePkg/MdePkg.dec
- OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
+ IpmiFeaturePkg/IpmiFeaturePkg.dec

[LibraryClasses]
UefiDriverEntryPoint
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolSta
tus.inf
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolSta
tus.inf
index 826144e537..9019b849ac 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolSta
tus.inf
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolSta
+++ tus.inf
@@ -21,7 +21,7 @@

[Packages]
MdePkg/MdePkg.dec
- OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec
+ IpmiFeaturePkg/IpmiFeaturePkg.dec

[Pcd]
gIpmiFeaturePkgTokenSpaceGuid.PcdMaxSOLChannels
--
2.27.0.windows.1


Re: [edk2-platforms][PATCH V1 05/27] IpmiFeaturePkg: Fix build errors

Isaac Oram
 

Pushed as d8232e8816..025d67dccc

-----Original Message-----
From: Desimone, Nathaniel L <nathaniel.l.desimone@...>
Sent: Wednesday, January 12, 2022 6:49 PM
To: Oram, Isaac W <isaac.w.oram@...>; devel@edk2.groups.io
Cc: Gao, Liming <gaoliming@...>
Subject: RE: [edk2-devel][edk2-platforms][PATCH V1 05/27] IpmiFeaturePkg: Fix build errors

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@...>

-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@...>
Sent: Tuesday, January 11, 2022 6:20 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W <isaac.w.oram@...>; Desimone, Nathaniel L
<nathaniel.l.desimone@...>; Gao, Liming
<gaoliming@...>
Subject: [edk2-devel][edk2-platforms][PATCH V1 05/27] IpmiFeaturePkg:
Fix build errors

Fix build issues with standalone build.
Switch to using MinPlatformPkg common core include for common modules.

Cc: Nate DeSimone <nathaniel.l.desimone@...>
Cc: Liming Gao <gaoliming@...>

Signed-off-by: Isaac Oram <isaac.w.oram@...>
---

Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeatu
re.dsc | 54 --------------------
Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMem
ory.fdf | 16 +++---

Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.ds
c | 18 +++++++
3 files changed, 26 insertions(+), 62 deletions(-)

diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFea
ture.dsc
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFea
ture.dsc
index c1ce340da2..237a4fc006 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFea
ture.dsc
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFea
t
+++ ure.dsc
@@ -34,54 +34,15 @@
!include MdePkg/MdeLibs.dsc.inc

[LibraryClasses]
- #######################################
- # Edk2 Packages
- #######################################
- BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
-
BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibR
epStr.inf
- DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
- PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
-
TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTem
plate.inf

- #####################################
- # IPMI Feature Package
- #####################################

IpmiCommandLib|IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommand
Lib.inf

IpmiPlatformHookLib|IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/Ipm
iPlatformHookLibNull.inf

[LibraryClasses.common.PEI_CORE,LibraryClasses.common.PEIM]
- #######################################
- # Edk2 Packages
- #######################################
- HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
-
MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemory
AllocationLib.inf
- PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
- PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
- PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
-
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibId
PeiServicesTablePointerLib|t/P
eiServicesTablePointerLibIdt.inf
-
ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiR
eportStatusCodeLib.inf
-
- #####################################
- # IPMI Feature Package
- #####################################

IpmiBaseLib|IpmiFeaturePkg/Library/PeiIpmiBaseLib/PeiIpmiBaseLib.inf

[LibraryClasses.common.DXE_DRIVER,LibraryClasses.common.UEFI_DRIVER]
- #######################################
- # Edk2 Packages
- #######################################
-
DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
-
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemo
ryAllocationLib.inf
- PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
-
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiB
UefiBootServicesTableLib|o
otServicesTableLib.inf
-
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEnt
UefiDriverEntryPoint|ry
Point.inf
- UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
-
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib
/UefiRuntimeServicesTableLib.inf
-
- #####################################
- # IPMI Feature Package
- #####################################
IpmiBaseLib|IpmiFeaturePkg/Library/IpmiBaseLib/IpmiBaseLib.inf


##########################################################
######################
@@ -149,18 +110,3 @@
IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf
IpmiFeaturePkg/OsWdt/OsWdt.inf
IpmiFeaturePkg/SolStatus/SolStatus.inf
-
-
##########################################################
#########################################
-#
-# BuildOptions Section - Define the module specific tool chain flags
that should be used as
-# the default flags for a module. These flags are appended to any
-# standard flags that are defined by the build process. They can
be
-# applied for any modules or only those modules with the
specific
-# module style (EDK or EDKII) specified in [Components] section.
-#
-# For advanced features, it is recommended to enable
[BuildOptions] in
-# the applicable INF file so it does not affect the whole board
package
-# build when this DSC file is active.
-#
-
##########################################################
#########################################
-[BuildOptions]
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMe
mory.fdf
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMe
mory.fdf
index 158b5455d8..e0f3bbe158 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMe
mory.fdf
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMe
mo
+++ ry.fdf
@@ -7,11 +7,11 @@
#
##

- INF IpmiFeaturePkg/GenericIpmi/Dxe/GenericIpmi.inf
- INF IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf
- INF RuleOverride = DRIVER_ACPITABLE
IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf
- INF IpmiFeaturePkg/BmcElog/BmcElog.inf
- INF IpmiFeaturePkg/Frb/FrbDxe.inf
- INF IpmiFeaturePkg/IpmiFru/IpmiFru.inf
- INF IpmiFeaturePkg/OsWdt/OsWdt.inf
- INF IpmiFeaturePkg/SolStatus/SolStatus.inf
+INF IpmiFeaturePkg/GenericIpmi/Dxe/GenericIpmi.inf
+INF IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf
+INF RuleOverride = DRIVER_ACPITABLE
IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf
+INF IpmiFeaturePkg/BmcElog/BmcElog.inf
+INF IpmiFeaturePkg/Frb/FrbDxe.inf
+INF IpmiFeaturePkg/IpmiFru/IpmiFru.inf
+INF IpmiFeaturePkg/OsWdt/OsWdt.inf
+INF IpmiFeaturePkg/SolStatus/SolStatus.inf
diff --git
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.
dsc
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.
dsc
index 6a3eed0882..c35e1e174e 100644
---
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.
dsc
+++
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.
d
+++ sc
@@ -25,6 +25,24 @@
PEI_ARCH = IA32
DXE_ARCH = X64

+[Packages]
+ MinPlatformPkg/MinPlatformPkg.dec
+
+[PcdsFeatureFlag]
+ #
+ # PCD needed for MinPlatform build includes
+ #
+ gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable
|FALSE
+ gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable
|FALSE
+ gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable
|FALSE
+
+#
+# Include common libraries
+#
+!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
+!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
+!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
+
#
# This package always builds the feature.
#
--
2.27.0.windows.1

10821 - 10840 of 96543