Date   

[PATCH 4/5] OvmfPkg/Microvm/virtio: add virtio-mmio support

Gerd Hoffmann
 

Add virtio-mmio support (VirtioMmioDeviceLib and VirtioFdtDxe).

https://bugzilla.tianocore.org/show_bug.cgi?id=3689
Signed-off-by: Gerd Hoffmann <kraxel@...>
---
OvmfPkg/Microvm/MicrovmX64.dsc | 2 ++
OvmfPkg/Microvm/MicrovmX64.fdf | 1 +
2 files changed, 3 insertions(+)

diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc
index 27d2024266c2..85afdca9beba 100644
--- a/OvmfPkg/Microvm/MicrovmX64.dsc
+++ b/OvmfPkg/Microvm/MicrovmX64.dsc
@@ -233,6 +233,7 @@ [LibraryClasses.common]
SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf
PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.inf
FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf
+ VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf

[LibraryClasses.common.SEC]
QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf
@@ -743,6 +744,7 @@ [Components]
# device tree
#
EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
+ OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf

#
# SMBIOS Support
diff --git a/OvmfPkg/Microvm/MicrovmX64.fdf b/OvmfPkg/Microvm/MicrovmX64.fdf
index cc8892a459ee..0bf20a702764 100644
--- a/OvmfPkg/Microvm/MicrovmX64.fdf
+++ b/OvmfPkg/Microvm/MicrovmX64.fdf
@@ -278,6 +278,7 @@ [FV.DXEFV]
INF OvmfPkg/VirtioFsDxe/VirtioFsDxe.inf

INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
+INF OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf

!if $(TOOL_CHAIN_TAG) != "XCODE5"
INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
--
2.31.1


[PATCH 3/5] OvmfPkg/Microvm/fdt: add empty fdt

Gerd Hoffmann
 

FdtClient is unhappy without a device tree, so add an empty fdt
which we can use in case etc/fdt is not present in fw_cfg.

https://bugzilla.tianocore.org/show_bug.cgi?id=3689
Signed-off-by: Gerd Hoffmann <kraxel@...>
---
OvmfPkg/PlatformPei/Platform.c | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
index 3c0cdba67c83..5071389c1fb4 100644
--- a/OvmfPkg/PlatformPei/Platform.c
+++ b/OvmfPkg/PlatformPei/Platform.c
@@ -16,6 +16,7 @@
//
// The Library classes this module consumes
//
+#include <Library/BaseMemoryLib.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/HobLib.h>
@@ -321,6 +322,18 @@ PciExBarInitialization (
);
}

+static const UINT8 EmptyFdt[] = {
+ 0xd0, 0x0d, 0xfe, 0xed, 0x00, 0x00, 0x00, 0x48,
+ 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x48,
+ 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x11,
+ 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09,
+};
+
VOID
MicrovmInitialization (
VOID
@@ -335,8 +348,9 @@ MicrovmInitialization (

Status = QemuFwCfgFindFile ("etc/fdt", &FdtItem, &FdtSize);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_INFO, "%a: no etc/fdt found in fw_cfg\n", __FUNCTION__));
- return;
+ DEBUG ((DEBUG_INFO, "%a: no etc/fdt found in fw_cfg, using dummy\n", __FUNCTION__));
+ FdtItem = 0;
+ FdtSize = sizeof(EmptyFdt);
}

FdtPages = EFI_SIZE_TO_PAGES (FdtSize);
@@ -346,8 +360,12 @@ MicrovmInitialization (
return;
}

- QemuFwCfgSelectItem (FdtItem);
- QemuFwCfgReadBytes (FdtSize, NewBase);
+ if (FdtItem) {
+ QemuFwCfgSelectItem (FdtItem);
+ QemuFwCfgReadBytes (FdtSize, NewBase);
+ } else {
+ CopyMem(NewBase, EmptyFdt, FdtSize);
+ }

FdtHobData = BuildGuidHob (&gFdtHobGuid, sizeof (*FdtHobData));
if (FdtHobData == NULL) {
--
2.31.1


[PATCH 1/5] OvmfPkg/Microvm/fdt: add device tree support

Gerd Hoffmann
 

Add fdt parser from EmbeddedPkg (FdtLib and FdtClientDxe) to MicrovmX64.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3689
Signed-off-by: Gerd Hoffmann <kraxel@...>
---
OvmfPkg/Microvm/MicrovmX64.dsc | 6 ++++++
OvmfPkg/Microvm/MicrovmX64.fdf | 2 ++
2 files changed, 8 insertions(+)

diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc
index 617f92539518..27d2024266c2 100644
--- a/OvmfPkg/Microvm/MicrovmX64.dsc
+++ b/OvmfPkg/Microvm/MicrovmX64.dsc
@@ -232,6 +232,7 @@ [LibraryClasses.common]
VmgExitLib|OvmfPkg/Library/VmgExitLib/VmgExitLib.inf
SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf
PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.inf
+ FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf

[LibraryClasses.common.SEC]
QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf
@@ -738,6 +739,11 @@ [Components]
#
MdeModulePkg/Universal/SerialDxe/SerialDxe.inf

+ #
+ # device tree
+ #
+ EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
+
#
# SMBIOS Support
#
diff --git a/OvmfPkg/Microvm/MicrovmX64.fdf b/OvmfPkg/Microvm/MicrovmX64.fdf
index 6314014f3de7..cc8892a459ee 100644
--- a/OvmfPkg/Microvm/MicrovmX64.fdf
+++ b/OvmfPkg/Microvm/MicrovmX64.fdf
@@ -277,6 +277,8 @@ [FV.DXEFV]
INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
INF OvmfPkg/VirtioFsDxe/VirtioFsDxe.inf

+INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf
+
!if $(TOOL_CHAIN_TAG) != "XCODE5"
INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
INF ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf
--
2.31.1


[PATCH 2/5] OvmfPkg/Microvm/fdt: load fdt from fw_cfg

Gerd Hoffmann
 

Needed for hardware detection: virtio-mmio devices for now,
later also pcie root bridge.

Depends on patched qemu which actually provides an fdt:
https://gitlab.com/kraxel/qemu/-/commits/sirius/microvm-device-tree

https://bugzilla.tianocore.org/show_bug.cgi?id=3689
Signed-off-by: Gerd Hoffmann <kraxel@...>
---
OvmfPkg/PlatformPei/PlatformPei.inf | 1 +
OvmfPkg/PlatformPei/Platform.c | 40 +++++++++++++++++++++++++++++
2 files changed, 41 insertions(+)

diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/PlatformPei.inf
index 67eb7aa7166b..56876184b17a 100644
--- a/OvmfPkg/PlatformPei/PlatformPei.inf
+++ b/OvmfPkg/PlatformPei/PlatformPei.inf
@@ -44,6 +44,7 @@ [Packages]

[Guids]
gEfiMemoryTypeInformationGuid
+ gFdtHobGuid

[LibraryClasses]
BaseLib
diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
index df2d9ad015aa..3c0cdba67c83 100644
--- a/OvmfPkg/PlatformPei/Platform.c
+++ b/OvmfPkg/PlatformPei/Platform.c
@@ -321,6 +321,45 @@ PciExBarInitialization (
);
}

+VOID
+MicrovmInitialization (
+ VOID
+ )
+{
+ FIRMWARE_CONFIG_ITEM FdtItem;
+ UINTN FdtSize;
+ UINTN FdtPages;
+ EFI_STATUS Status;
+ UINT64 *FdtHobData;
+ VOID *NewBase;
+
+ Status = QemuFwCfgFindFile ("etc/fdt", &FdtItem, &FdtSize);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_INFO, "%a: no etc/fdt found in fw_cfg\n", __FUNCTION__));
+ return;
+ }
+
+ FdtPages = EFI_SIZE_TO_PAGES (FdtSize);
+ NewBase = AllocatePages (FdtPages);
+ if (NewBase == NULL) {
+ DEBUG ((DEBUG_INFO, "%a: AllocatePages failed\n", __FUNCTION__));
+ return;
+ }
+
+ QemuFwCfgSelectItem (FdtItem);
+ QemuFwCfgReadBytes (FdtSize, NewBase);
+
+ FdtHobData = BuildGuidHob (&gFdtHobGuid, sizeof (*FdtHobData));
+ if (FdtHobData == NULL) {
+ DEBUG ((DEBUG_INFO, "%a: BuildGuidHob failed\n", __FUNCTION__));
+ return;
+ }
+
+ DEBUG ((DEBUG_INFO, "%a: fdt at 0x%x (size %d)\n", __FUNCTION__,
+ NewBase, FdtSize));
+ *FdtHobData = (UINTN)NewBase;
+}
+
VOID
MiscInitialization (
VOID
@@ -368,6 +407,7 @@ MiscInitialization (
break;
case 0xffff: /* microvm */
DEBUG ((DEBUG_INFO, "%a: microvm\n", __FUNCTION__));
+ MicrovmInitialization();
PcdStatus = PcdSet16S (PcdOvmfHostBridgePciDevId,
MICROVM_PSEUDO_DEVICE_ID);
ASSERT_RETURN_ERROR (PcdStatus);
--
2.31.1


[PATCH 0/5] [RfC] OvmfPkg/Microvm: second batch of microvm patches

Gerd Hoffmann
 

Adds support for virtio-mmio devices to microvm.

Needs patched qemu, so posting this only for review.
Actual merge should wait until the host side changes
are accepted to qemu.

While being at it also add the README, the
patch somehow disappeared from the first batch.

Gerd Hoffmann (5):
OvmfPkg/Microvm/fdt: add device tree support
OvmfPkg/Microvm/fdt: load fdt from fw_cfg
OvmfPkg/Microvm/fdt: add empty fdt
OvmfPkg/Microvm/virtio: add virtio-mmio support
OvmfPkg/Microvm: add README

OvmfPkg/Microvm/MicrovmX64.dsc | 8 ++++
OvmfPkg/Microvm/MicrovmX64.fdf | 3 ++
OvmfPkg/PlatformPei/PlatformPei.inf | 1 +
OvmfPkg/PlatformPei/Platform.c | 58 +++++++++++++++++++++++++++++
OvmfPkg/Microvm/README | 50 +++++++++++++++++++++++++
5 files changed, 120 insertions(+)
create mode 100644 OvmfPkg/Microvm/README

--
2.31.1


[PATCH 1/1] DynamicTablesPkg: Fix void pointer arithmetic

PierreGondois
 

From: Pierre Gondois <Pierre.Gondois@...>

Building the DynamicTablesPkg with the additional
-Wpointer-arith flag triggers the following error:
"pointer of type ‘void *’ used in arithmetic
[-Werror=pointer-arith]"

Cast the void pointer to fix the error.

Signed-off-by: Pierre Gondois <Pierre.Gondois@...>
---
.../Common/TableHelperLib/ConfigurationManagerObjectParser.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
index 2337d47e3fb3..0bdbfbb99c33 100644
--- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
+++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.c
@@ -641,7 +641,7 @@ PrintCmObjDesc (
));
}
DEBUG ((DEBUG_ERROR, "\n"));
- Data += Parser[Index].Length;
+ Data = (UINT8*)Data + Parser[Index].Length;
} // for
}

--
2.17.1


Re: [edk2-platforms: PATCH v5 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.

Oram, Isaac W
 

Series Reviewed-by: Isaac Oram <isaac.w.oram@...>

-----Original Message-----
From: Chiu, Chasel <chasel.chiu@...>
Sent: Thursday, October 14, 2021 2:16 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@...>; Oram, Isaac W <isaac.w.oram@...>; Desimone, Nathaniel L <nathaniel.l.desimone@...>; Luo, Heng <heng.luo@...>; Jeremy Soller <jeremy@...>; Benjamin Doron <benjamin.doron00@...>; Chaganty, Rangasai V <rangasai.v.chaganty@...>; Kethi Reddy, Deepika <deepika.kethi.reddy@...>; Esakkithevar, Kathappan <kathappan.esakkithevar@...>; Liming Gao <gaoliming@...>; Dong, Eric <eric.dong@...>
Subject: [edk2-platforms: PATCH v5 0/9] MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.

V5:
Fix GCC build failure in LargeVariableWriteLib.c

V4:
. Switched to LargeVariableRead(Write)Lib in SaveMemoryConfig driver
. Fixed tailing white space issue in PeiLib.c/.h
. Updated function descriptions for PeiGetVariable() and PeiGetLargeVariable()
. Added VariableReadLib to CorePeiLib.dsc for all platforms
. Fixed white space issue in GalagoPro3/.../PeiFspMiscUpdUpdateLib.c

V3:
Fix another GCC build failure.

V2:
Fix GCC build failures.

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

Implementation should search FSP_NON_VOLATILE_STORAGE_HOB2 firstly and only search FSP_NON_VOLATILE_STORAGE_HOB when former one is not found.

Also added PeiGetLargeVariable () to support the scenarios where the variable data size is bigger than a single variable size limit.

Cc: Isaac Oram <isaac.w.oram@...>
Cc: Nate DeSimone <nathaniel.l.desimone@...>
Cc: Heng Luo <heng.luo@...>
Cc: Jeremy Soller <jeremy@...>
Cc: Benjamin Doron <benjamin.doron00@...>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@...>
Cc: Deepika Kethi Reddy <deepika.kethi.reddy@...>
Cc: Kathappan Esakkithevar <kathappan.esakkithevar@...>
Cc: Liming Gao <gaoliming@...>
Cc: Eric Dong <eric.dong@...>
Signed-off-by: Chasel Chiu <chasel.chiu@...>

Chasel Chiu (9):
MinPlatformPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.
CometlakeOpenBoardPkg: Use same variable name for FspNvsHob.
KabylakeOpenBoardPkg/AspireVn7Dash572G:Use same variable name for
FspNvsHob
KabylakeOpenBoardPkg/GalagoPro3: Use same variable name for FspNvsHob.
KabylakeOpenBoardPkg/KabylakeRvp3: Use same variable name for
FspNvsHob.
TigerlakeOpenBoardPkg: Use same variable name for FspNvsHob.
WhiskeylakeOpenBoardPkg: Use same variable name for FspNvsHob.
WhitleyOpenBoardPkg: Support FSP 2.3 FSP_NON_VOLATILE_STORAGE_HOB2.
WhitleySiliconPkg: Use same variable name for FspNvsHob.

Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63 ++++++++++++++-------------------------------------------------
Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 24 ++++++++++--------------
Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c | 23 +++++++++--------------
Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 25 +++++++++++--------------
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 25 ++++++++++---------------
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.c | 23 +++++++++--------------
Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------
Platform/Intel/MinPlatformPkg/Library/BaseLargeVariableLib/LargeVariableWriteLib.c | 2 +-
Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------
Platform/Intel/MinPlatformPkg/Library/PeiVariableReadLib/PeiVariableReadLib.c | 4 ++--
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.c | 21 ++++++++++++++++++---
Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63 ++++++++++++---------------------------------------------------
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c | 63 ++++++++++++---------------------------------------------------
Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSave.c | 29 +++++++++++++++++++++++------
Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPlatformLib.c | 35 +++++++++--------------------------
Platform/Intel/CometlakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 7 ++++---
Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf | 2 +-
Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSiliconPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf | 2 +-
Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.inf | 8 ++++++--
Platform/Intel/MinPlatformPkg/Include/Dsc/CorePeiLib.dsc | 1 +
Platform/Intel/MinPlatformPkg/Include/Library/PeiLib.h | 40 +++++++++++++++++++++++++++++++++++-----
Platform/Intel/MinPlatformPkg/Library/PeiLib/PeiLib.inf | 4 +++-
Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec | 1 +
Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf | 1 +
Platform/Intel/WhiskeylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 5 ++---
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf | 4 ++--
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/FlashMapInclude.fdf | 18 +++++++++---------
Platform/Intel/WhitleyOpenBoardPkg/Platform/Dxe/S3NvramSave/S3NvramSave.inf | 4 +++-
Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc | 1 +
Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPlatformLib.inf | 3 ++-
33 files changed, 345 insertions(+), 369 deletions(-)

--
2.28.0.windows.1


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

Leif Lindholm
 

On Mon, Oct 11, 2021 at 21:52:13 +0000, Samer El-Haj-Mahmoud wrote:
For the RFC itself, I personally do not have any objection, and
welcome the addition of this protocol to AARCH64, as long as it
utilizes the PSCI services to achieve the OS boot requirements.

It may be worth getting feedback from Sami since he is the EDK2 maintainer for Arm platforms.
Sami, any comments on this set?

In fact ... we could use more help on ArmPkg in general. Would you be
up for becoming an additional Maintainer or Reviewer?

/
Leif


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

Rebecca Cran <rebecca@...>
 

On 9/28/21 5:14 AM, Leif Lindholm wrote:

On Fri, Sep 24, 2021 at 20:17:50 -0600, Rebecca Cran wrote:
I'd like to propose adding EFI_MP_SERVICES_PROTOCOL support for
AARCH64 systems. I've attached two patches to implement support for it
in the DXE phase, based on code in EmulatorPkg and UefiCpuPkg. It's added
under ArmPkg for now, but longer term it should probably be moved into
UefiCpuPkg.

Patch 1/2 is the start of addressing the issue that the Aff0 field of
the MPIDR is no longer guaranteed to be the core, and should be referred
to in a more generic way: for example it could be the thread, with Aff1
being the core and Aff2 the cluster. Clearly much more work is needed
to fully remove that assumption.
Just to add to this:
Aff0 was never defined by the architecture to be the "core", it was
just the smallest schedulable entity. The intent being that whether
you had multiple hardware threads per core or not, you could just use
the affinity to determine whether
There is also a bit in the MPIDR to indicate whether the core *had*
multiple hardware threads.

In recent processors (without any change to the architecture), ARM
thought it would be beneficial to keep software developers on their
toes by starting to use the hyperthreading layout even for processors
without hyperthreading support. I.e. Aff0 is always 0 even though MT
is 0:
https://developer.arm.com/documentation/100798/0301/Register-descriptions/AArch64-system-registers/MPIDR-EL1--Multiprocessor-Affinity-Register--EL1
The justification being that an SoC might contain both processors
with and without multiple hardware threads per core.

Anyway, the point is that from at least Cortex-A76 onwards, Aff0 no
longer maps to CoreId universally, and Aff1 no longer maps to
ClusterId, for all non-threaded implementations.
So we need to start cleaning up this use.
This will possibly break some out-of-tree platforms, but I figure
we're far enough from next stable tag for that not to matter too
much.
This patch will also break out-of-tree platforms because it causes ArmPkg/Drivers/CpuDxe to gain a dependency on MpInitLib.


--
Rebecca Cran


Cancelled Event: TianoCore Design Meeting - APAC/NAMO - Friday, October 15, 2021 #cal-cancelled

devel@edk2.groups.io Calendar <noreply@...>
 

Cancelled: TianoCore Design Meeting - APAC/NAMO

This event has been cancelled.

When:
Friday, October 15, 2021
9:30am to 10:30am
(UTC+08:00) Asia/Shanghai

Where:
Microsoft Teams

Organizer: Ray Ni ray.ni@...

Description:

TOPIC

  1. NA

For more info, see here: https://www.tianocore.org/design-meeting/


Microsoft Teams meeting

Join on your computer or mobile app

Click here to join the meeting

Join with a video conferencing device

teams@...

Video Conference ID: 119 715 416 0

Alternate VTC dialing instructions

Learn More | Meeting options


Re: [PATCH v1] ArmPkg/Smbios: Fix max cache size 2 wrong issue

Rebecca Cran <rebecca@...>
 

Reviewed-by: Rebecca Cran <rebecca@...>

On 10/14/21 1:23 AM, Ming Huang wrote:
As SMBIOS spec, bit-31 of maximum cache size 2 should be 1
for 64K granularity.

Signed-off-by: Ming Huang <huangming@...>
---
ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
index fb484086a4..4b409ff745 100644
--- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
+++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
@@ -219,7 +219,7 @@ ConfigureCacheArchitectureInformation (
CacheSize32 = CacheSize16;
} else if ((CacheSize64 / 64) < MAX_INT16) {
CacheSize16 = (1 << 15) | (CacheSize64 / 64);
- CacheSize32 = CacheSize16;
+ CacheSize32 = (1 << 31) | (CacheSize64 / 64);
} else {
if ((CacheSize64 / 1024) <= 2047) {
CacheSize32 = CacheSize64;


Re: [PATCH V2 0/3] Introduce TdProtocol into EDK2

Yao, Jiewen
 

Hi Sami
I am not sure if I can understand your comment -
"Some interfaces may need to use an architecture specific library, and some configuration options would need to be defined using PCDs."

Would you please be more specific?

Thank you
Yao Jiewen

-----Original Message-----
From: Xu, Min M <min.m.xu@...>
Sent: Thursday, October 14, 2021 1:41 PM
To: Sami Mujawar <Sami.Mujawar@...>; devel@edk2.groups.io; Yao,
Jiewen <jiewen.yao@...>
Cc: Kinney, Michael D <michael.d.kinney@...>; Liming Gao
<gaoliming@...>; Liu, Zhiguang <zhiguang.liu@...>; Wang,
Jian J <jian.j.wang@...>; Lu, Ken <ken.lu@...>; nd <nd@...>
Subject: RE: [edk2-devel] [PATCH V2 0/3] Introduce TdProtocol into EDK2

On October 12, 2021 11:27 PM, Sami Mujawar wrote:
Hi Min,

Thank you for this patch.

I think it would greatly help if the EFI_TD_PROTOCOL is changed to something
more architecture neutral. As I understand, this patch series is removing the
dependency on TPM for measurement and is instead providing a lightweight
interface for extending measurements for Confidential Compute Architecture
(CCA) guests.

Considering this, it would be good to generalise EFI_TD_PROTOCOL as a
Confidential Compute Architecture Measurement (CCAM) protocol.
In fact, your v2 series demonstrates this need with the introduction of
MEASURE_BOOT_PROTOCOLS in "[PATCH V2 2/3] SecurityPkg: Support
TdProtocol in DxeTpm2MeasureBootLib
[https://edk2.groups.io/g/devel/message/81651]".

As it stands, I feel most of the code can be reused/common. Some interfaces
may need to use an architecture specific library, and some configuration
options would need to be defined using PCDs.

Kindly let me know your thoughts.
Thanks for your comments. Let me first discuss your feedback with our
architecture. We will reply to your proposal a bit later.

Thanks.
Min


Re: [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg

Ard Biesheuvel
 

On Thu, 14 Oct 2021 at 12:14, Chang, Abner (HPS SW/FW Technologist)
<abner.chang@...> wrote:

Hi Are, I am so sorry about that I just merged it two hours ago. Any process needed if we want to change the commit messages for adding your review tag?
Don't worry about it.


________________________________
From: Ard Biesheuvel <ardb@...>
Sent: Thursday, October 14, 2021 5:51:56 PM
To: edk2-devel-groups-io <devel@edk2.groups.io>; Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>
Cc: gaoliming <gaoliming@...>; Ard Biesheuvel <ardb+tianocore@...>; Leif Lindholm <leif@...>; Sami Mujawar <sami.mujawar@...>; Jiewen Yao <jiewen.yao@...>; Jordan Justen <jordan.l.justen@...>; Gerd Hoffmann <kraxel@...>; Schaefer, Daniel <daniel.schaefer@...>; Sunil V L <sunilvl@...>; Zhiguang Liu <zhiguang.liu@...>; Michael D Kinney <michael.d.kinney@...>
Subject: Re: [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg

On Tue, 12 Oct 2021 at 06:17, Abner Chang <abner.chang@...> wrote:

Hi package maintainers,

The review process of this patch set is almost done and please allow me to merge it because the corresponding changes on edk2-platform is also required to merge.



Ard and Leif, do I need the Reviewed-by or Acked-by from either of you? Or I can just proceed the merge process as Ard has no problem with this patch set?

Hi Abner,

Where needed

Acked-by: Ard Biesheuvel <ardb@...>

Feel free to merge it whenever convenient for you.



From: gaoliming [mailto:gaoliming@...]
Sent: Monday, October 11, 2021 9:22 AM
To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>; ardb@...
Cc: 'Ard Biesheuvel' <ardb+tianocore@...>; 'Leif Lindholm' <leif@...>; 'Sami Mujawar' <sami.mujawar@...>; 'Jiewen Yao' <jiewen.yao@...>; 'Jordan Justen' <jordan.l.justen@...>; 'Gerd Hoffmann' <kraxel@...>; Schaefer, Daniel <daniel.schaefer@...>; 'Sunil V L' <sunilvl@...>; 'Zhiguang Liu' <zhiguang.liu@...>; 'Michael D Kinney' <michael.d.kinney@...>
Subject: 回复: [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg



The change in MdePkg is good to me. Reviewed-by: Liming Gao <gaoliming@...>



发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Abner Chang
发送时间: 2021年10月8日 11:39
收件人: devel@edk2.groups.io; gaoliming@...; ardb@...
抄送: 'Ard Biesheuvel' <ardb+tianocore@...>; 'Leif Lindholm' <leif@...>; 'Sami Mujawar' <sami.mujawar@...>; 'Jiewen Yao' <jiewen.yao@...>; 'Jordan Justen' <jordan.l.justen@...>; 'Gerd Hoffmann' <kraxel@...>; Schaefer, Daniel <daniel.schaefer@...>; 'Sunil V L' <sunilvl@...>; 'Zhiguang Liu' <zhiguang.liu@...>; 'Michael D Kinney' <michael.d.kinney@...>
主题: Re: [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg



Thanks Liming, could you please also give the reviewed-by.



Hi Ard, also need your reviewed-by for ArmPkg. Then this changes could be upstream and finished.

Thanks

Abner





From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of gaoliming
Sent: Friday, October 8, 2021 11:14 AM
To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>; 'edk2-devel-groups-io' <devel@edk2.groups.io>; ardb@...
Cc: 'Ard Biesheuvel' <ardb+tianocore@...>; 'Leif Lindholm' <leif@...>; 'Sami Mujawar' <sami.mujawar@...>; 'Jiewen Yao' <jiewen.yao@...>; 'Jordan Justen' <jordan.l.justen@...>; 'Gerd Hoffmann' <kraxel@...>; Schaefer, Daniel <daniel.schaefer@...>; 'Sunil V L' <sunilvl@...>; 'Zhiguang Liu' <zhiguang.liu@...>; 'Michael D Kinney' <michael.d.kinney@...>
Subject: 回复: [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg



Ard and Abner:

I am OK to add these three PCDs PcdPciMmio32Translation, PcdPciMmio64Translation, PcdPciIoTranslation to MdePkg.



Thanks

Liming

发件人: Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>
发送时间: 2021年10月6日 17:27
收件人: edk2-devel-groups-io <devel@edk2.groups.io>; ardb@...; Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>
抄送: Ard Biesheuvel <ardb+tianocore@...>; Leif Lindholm <leif@...>; Sami Mujawar <sami.mujawar@...>; Jiewen Yao <jiewen.yao@...>; Jordan Justen <jordan.l.justen@...>; Gerd Hoffmann <kraxel@...>; Schaefer, Daniel <daniel.schaefer@...>; Sunil V L <sunilvl@...>; Liming Gao <gaoliming@...>; Zhiguang Liu <zhiguang.liu@...>; Michael D Kinney <michael.d.kinney@...>
主题: Re: [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg



Hi Ard,

I realized there is a problem if we duplicate ArmPkg defined PCD to under OvmfPkg (e.g. PcdPciIoTranslate PCD) when I was duplicating this PCD to OvmfPkg.

FdtPciProducerLib is relocated to OvmfPkg/Fdt and uses PcdPciIoTranslate PCD declared with OvmfPkg namespace. FdtPciProducerLib is also used by both ArmVirtPkg and RiscVVirtPkg.

ArmVirtPkg uses ArmPciCpuIoDxe provided by ArmPkg however PcdPciIoTranslate used by ArmPciCpuIoDxe is declared with ArmPkg namespace.

I think this results in the problem because PcdPciIoTranslate(s) that are referred by ArmPkg and ArmVirtPkg come from two different namespaces, right? Unless ArmPciCpuIoDxe uses the one declared in OvmfPkg, but I don't think we want to do this.

Thought? Otherwise, we should still keep the original patch that relocates these PCDs under MdePkg.



Thanks

Abner





________________________________

From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Abner Chang <abner.chang@...>
Sent: Tuesday, October 5, 2021 11:00 PM
To: edk2-devel-groups-io <devel@edk2.groups.io>; ardb@... <ardb@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>; Leif Lindholm <leif@...>; Sami Mujawar <sami.mujawar@...>; Jiewen Yao <jiewen.yao@...>; Jordan Justen <jordan.l.justen@...>; Gerd Hoffmann <kraxel@...>; Schaefer, Daniel <daniel.schaefer@...>; Sunil V L <sunilvl@...>; Liming Gao <gaoliming@...>; Zhiguang Liu <zhiguang.liu@...>; Michael D Kinney <michael.d.kinney@...>
Subject: Re: [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg



Hi Ard,

This way reduces the impact of MdePkg. We can try it.



Thanks

Abner



________________________________

From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Ard Biesheuvel <ardb@...>
Sent: Tuesday, October 5, 2021 5:30 PM
To: edk2-devel-groups-io <devel@edk2.groups.io>; Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>; Leif Lindholm <leif@...>; Sami Mujawar <sami.mujawar@...>; Jiewen Yao <jiewen.yao@...>; Jordan Justen <jordan.l.justen@...>; Gerd Hoffmann <kraxel@...>; Schaefer, Daniel <daniel.schaefer@...>; Sunil V L <sunilvl@...>; Liming Gao <gaoliming@...>; Zhiguang Liu <zhiguang.liu@...>; Michael D Kinney <michael.d.kinney@...>
Subject: Re: [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg



On Thu, 30 Sept 2021 at 03:43, Abner Chang <abner.chang@...> wrote:

In V3: Address comments on V2.
In V2: Remove HPE license on the files that just moved around or
the changes in the file are just code removal.

edk2 BZ #: 3665
edk2 platform corresponding changes will be submitted after
this pactch set is reviewed.

This pacthes set is to migrate some modules from ArmVirtPkg
to under OvmfPkg for the upcoming RiscVVirtPkg that can leverage
those modules without the dependency with Arm*Pkg.

The modules moved from ArmVirtPkg to OvmfPkg are,
- FdtClientDxe
- PciPcdProducerLib
- HighMemDxe
- QemuFwCfgLib
- FdtPciHostBridgeLib
- VirtioFdtDxe

Below PCDs are moved to under MdePkg and leverage by RiscVVirtPkg.
This change also remove the dependency on ArmPkg of OvmfPkg.
- PcdPciIoTranslation
- PcdPciIoTranslation
- PcdPciMmio32(64)Translation

Signed-off-by: Abner Chang <abner.chang@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Leif Lindholm <leif@...>
Cc: Sami Mujawar <sami.mujawar@...>
Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jordan Justen <jordan.l.justen@...>
Cc: Gerd Hoffmann <kraxel@...>
Cc: Daniel Schaefer <daniel.schaefer@...>
Cc: Sunil V L <sunilvl@...>
Cc: Liming Gao <gaoliming@...>
Cc: Zhiguang Liu <zhiguang.liu@...>
Cc: Michael D Kinney <michael.d.kinney@...>

Abner Chang (12):
ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg
MdePkg: Add PcdPciIoTranslation PCD
ArmPkg: Use PcdPciIoTranslation PCD from MdePkg
ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to OvmfPkg
ArmVirtPkg/HighMemDxe: Relocate HighMemDxe to OvmfPkg
OvmfPkg/HighMemDxe: Add RISC-V in the supported arch.
ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg
OvmfPkg/QemuFwCfgLibMMIO: Add RISC-V arch support
MdePkg: Add PcdPciMmio32(64)Translation PCDs
ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to
OvmfPkg/Fdt
OvmfPkg/FdtPciHostBridgeLib: Add RISC-V in the supported arch.
ArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe to OvmfPkg/Fdt
Hello all,

These patches look ok to me, but I wonder if the MdePkg maintainers
are happy taking these PCD declaration changes. Translations for PCIe
are typically defined per host bridge, and I would rather move away
from using PCDs for this entirely than 'promote' them by carrying them
in MdePkg.

As this issue is somewhat orthogonal to what Abner is trying to fix,
perhaps it is better to avoid MdePkg changes for now, and just
duplicate these PCDs into OvmfPkg. This is reasonable, given that we
know that QEMU only exposes a single host bridge.

The one in ArmPkg can hopefully be removed and replaced with something
that is more appropriate.


ArmPkg/ArmPkg.dec | 15 ++++++--------
ArmVirtPkg/ArmVirtPkg.dec | 3 ---
EmbeddedPkg/EmbeddedPkg.dec | 1 +
MdePkg/MdePkg.dec | 12 +++++++++++
ArmVirtPkg/ArmVirtCloudHv.dsc | 18 ++++++++---------
ArmVirtPkg/ArmVirtKvmTool.dsc | 18 ++++++++---------
ArmVirtPkg/ArmVirtQemu.dsc | 20 +++++++++----------
ArmVirtPkg/ArmVirtQemuKernel.dsc | 20 +++++++++----------
ArmVirtPkg/ArmVirtXen.dsc | 2 +-
EmbeddedPkg/EmbeddedPkg.dsc | 1 +
ArmVirtPkg/ArmVirtCloudHv.fdf | 6 +++---
ArmVirtPkg/ArmVirtKvmTool.fdf | 6 +++---
ArmVirtPkg/ArmVirtXen.fdf | 2 +-
ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 6 +++---
.../ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf | 2 +-
.../ArmVirtGicArchLib/ArmVirtGicArchLib.inf | 1 +
.../ArmVirtPL031FdtClientLib.inf | 1 +
.../ArmVirtPsciResetSystemLib.inf | 1 +
.../ArmVirtTimerFdtClientLib.inf | 1 +
.../KvmtoolRtcFdtClientLib.inf | 1 +
.../NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf | 1 +
.../NorFlashQemuLib/NorFlashQemuLib.inf | 1 +
.../XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf | 1 +
ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf | 1 +
.../Drivers}/FdtClientDxe/FdtClientDxe.inf | 1 -
.../FdtPciHostBridgeLib.inf | 11 +++++-----
.../FdtPciPcdProducerLib.inf | 5 ++---
.../Fdt}/HighMemDxe/HighMemDxe.inf | 7 ++++---
.../Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf | 2 +-
.../Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf | 6 +++---
.../Include/Protocol/FdtClient.h | 0
.../Drivers}/FdtClientDxe/FdtClientDxe.c | 0
.../FdtPciHostBridgeLib/FdtPciHostBridgeLib.c | 0
.../FdtPciPcdProducerLib.c | 0
.../Fdt}/HighMemDxe/HighMemDxe.c | 3 ++-
.../Fdt}/VirtioFdtDxe/VirtioFdtDxe.c | 0
.../Library/QemuFwCfgLib/QemuFwCfgLibMmio.c | 7 ++++---
Maintainers.txt | 6 ++++++
38 files changed, 106 insertions(+), 83 deletions(-)
rename {ArmVirtPkg => EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.inf (92%)
rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf (77%)
rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf (87%)
rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.inf (83%)
rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf (92%)
rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf => OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf (86%)
rename {ArmVirtPkg => EmbeddedPkg}/Include/Protocol/FdtClient.h (100%)
rename {ArmVirtPkg => EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.c (100%)
rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c (100%)
rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c (100%)
rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.c (95%)
rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.c (100%)
rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c => OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.c (93%)

--
2.17.1






Re: [PATCH v2 1/1] SecurityPkg/Library: Add Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib

Yao, Jiewen
 

Hi Bret
I saw PR failure - https://github.com/tianocore/edk2/pull/2066

Thank you

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Bret
Barkelew
Sent: Thursday, October 14, 2021 1:33 AM
To: devel@edk2.groups.io
Cc: Yao, Jiewen <jiewen.yao@...>; Wang, Jian J <jian.j.wang@...>;
Zhang, Qi1 <qi1.zhang@...>; Kumar, Rahul1 <rahul1.kumar@...>
Subject: [edk2-devel] [PATCH v2 1/1] SecurityPkg/Library: Add
Tpm2NvUndefineSpaceSpecial to Tpm2CommandLib

Used to provision and maintain certain HW-defined NV spaces.

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

Signed-off-by: Bret Barkelew <bret.barkelew@...>
Reviewed-by: Jiewen Yao <jiewen.yao@...>
Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jian J Wang <jian.j.wang@...>
Cc: Qi Zhang <qi1.zhang@...>
Cc: Rahul Kumar <rahul1.kumar@...>
---
SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c | 122
++++++++++++++++++++
SecurityPkg/Include/Library/Tpm2CommandLib.h | 22 ++++
2 files changed, 144 insertions(+)

diff --git a/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c
b/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c
index 87572de20164..275cb1683f51 100644
--- a/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c
+++ b/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c
@@ -24,6 +24,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#define RC_NV_UndefineSpace_authHandle (TPM_RC_H + TPM_RC_1)

#define RC_NV_UndefineSpace_nvIndex (TPM_RC_H + TPM_RC_2)



+#define RC_NV_UndefineSpaceSpecial_nvIndex (TPM_RC_H + TPM_RC_1)

+

#define RC_NV_Read_authHandle (TPM_RC_H + TPM_RC_1)

#define RC_NV_Read_nvIndex (TPM_RC_H + TPM_RC_2)

#define RC_NV_Read_size (TPM_RC_P + TPM_RC_1)

@@ -74,6 +76,20 @@ typedef struct {
TPMS_AUTH_RESPONSE AuthSession;

} TPM2_NV_UNDEFINESPACE_RESPONSE;



+typedef struct {

+ TPM2_COMMAND_HEADER Header;

+ TPMI_RH_NV_INDEX NvIndex;

+ TPMI_RH_PLATFORM Platform;

+ UINT32 AuthSessionSize;

+ TPMS_AUTH_COMMAND AuthSession;

+} TPM2_NV_UNDEFINESPACESPECIAL_COMMAND;

+

+typedef struct {

+ TPM2_RESPONSE_HEADER Header;

+ UINT32 AuthSessionSize;

+ TPMS_AUTH_RESPONSE AuthSession;

+} TPM2_NV_UNDEFINESPACESPECIAL_RESPONSE;

+

typedef struct {

TPM2_COMMAND_HEADER Header;

TPMI_RH_NV_AUTH AuthHandle;

@@ -506,6 +522,112 @@ Done:
return Status;

}



+/**

+ This command allows removal of a platform-created NV Index that has
TPMA_NV_POLICY_DELETE SET.

+

+ @param[in] NvIndex The NV Index.

+ @param[in] IndexAuthSession Auth session context for the Index
auth/policy

+ @param[in] PlatAuthSession Auth session context for the Platform
auth/policy

+

+ @retval EFI_SUCCESS Operation completed successfully.

+ @retval EFI_NOT_FOUND The command was returned successfully, but
NvIndex is not found.

+ @retval EFI_UNSUPPORTED Selected NvIndex does not support deletion
through this call.

+ @retval EFI_SECURITY_VIOLATION Deletion is not authorized by current
policy session.

+ @retval EFI_INVALID_PARAMETER The command was unsuccessful.

+ @retval EFI_DEVICE_ERROR The command was unsuccessful.

+**/

+EFI_STATUS

+EFIAPI

+Tpm2NvUndefineSpaceSpecial (

+ IN TPMI_RH_NV_INDEX NvIndex,

+ IN TPMS_AUTH_COMMAND *IndexAuthSession OPTIONAL,

+ IN TPMS_AUTH_COMMAND *PlatAuthSession OPTIONAL

+ )

+{

+ EFI_STATUS Status;

+ TPM2_NV_UNDEFINESPACESPECIAL_COMMAND SendBuffer;

+ TPM2_NV_UNDEFINESPACESPECIAL_RESPONSE RecvBuffer;

+ UINT32 SendBufferSize;

+ UINT32 RecvBufferSize;

+ UINT8 *Buffer;

+ UINT32 IndexAuthSize, PlatAuthSize;

+ TPM_RC ResponseCode;

+

+ //

+ // Construct command

+ //

+ SendBuffer.Header.tag = SwapBytes16(TPM_ST_SESSIONS);

+ SendBuffer.Header.commandCode =
SwapBytes32(TPM_CC_NV_UndefineSpaceSpecial);

+

+ SendBuffer.NvIndex = SwapBytes32 (NvIndex);

+ SendBuffer.Platform = SwapBytes32 (TPM_RH_PLATFORM);

+

+ //

+ // Marshall the Auth Sessions for the two handles.

+ Buffer = (UINT8 *)&SendBuffer.AuthSession;

+ // IndexAuthSession

+ IndexAuthSize = CopyAuthSessionCommand (IndexAuthSession, Buffer);

+ Buffer += IndexAuthSize;

+ // PlatAuthSession

+ PlatAuthSize = CopyAuthSessionCommand (PlatAuthSession, Buffer);

+ Buffer += PlatAuthSize;

+ // AuthSessionSize

+ SendBuffer.AuthSessionSize = SwapBytes32(IndexAuthSize + PlatAuthSize);

+

+ // Update total command size.

+ SendBufferSize = (UINT32)(Buffer - (UINT8 *)&SendBuffer);

+ SendBuffer.Header.paramSize = SwapBytes32 (SendBufferSize);

+

+ //

+ // send Tpm command

+ //

+ RecvBufferSize = sizeof (RecvBuffer);

+ Status = Tpm2SubmitCommand (SendBufferSize, (UINT8 *)&SendBuffer,
&RecvBufferSize, (UINT8 *)&RecvBuffer);

+ if (EFI_ERROR (Status)) {

+ goto Done;

+ }

+

+ if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER)) {

+ DEBUG ((EFI_D_ERROR, "Tpm2NvUndefineSpaceSpecial - RecvBufferSize
Error - %x\n", RecvBufferSize));

+ Status = EFI_DEVICE_ERROR;

+ goto Done;

+ }

+

+ ResponseCode = SwapBytes32(RecvBuffer.Header.responseCode);

+ if (ResponseCode != TPM_RC_SUCCESS) {

+ DEBUG ((EFI_D_ERROR, "Tpm2NvUndefineSpaceSpecial - responseCode -
%x\n", SwapBytes32(RecvBuffer.Header.responseCode)));

+ }

+ switch (ResponseCode) {

+ case TPM_RC_SUCCESS:

+ // return data

+ break;

+ case TPM_RC_ATTRIBUTES:

+ case TPM_RC_ATTRIBUTES + RC_NV_UndefineSpaceSpecial_nvIndex:

+ Status = EFI_UNSUPPORTED;

+ break;

+ case TPM_RC_NV_AUTHORIZATION:

+ Status = EFI_SECURITY_VIOLATION;

+ break;

+ case TPM_RC_HANDLE + RC_NV_UndefineSpaceSpecial_nvIndex: //
TPM_RC_NV_DEFINED:

+ Status = EFI_NOT_FOUND;

+ break;

+ case TPM_RC_VALUE + RC_NV_UndefineSpace_nvIndex:

+ Status = EFI_INVALID_PARAMETER;

+ break;

+ default:

+ Status = EFI_DEVICE_ERROR;

+ break;

+ }

+

+Done:

+ //

+ // Clear AuthSession Content

+ //

+ ZeroMem (&SendBuffer, sizeof(SendBuffer));

+ ZeroMem (&RecvBuffer, sizeof(RecvBuffer));

+ return Status;

+}

+

/**

This command reads a value from an area in NV memory previously defined by
TPM2_NV_DefineSpace().



diff --git a/SecurityPkg/Include/Library/Tpm2CommandLib.h
b/SecurityPkg/Include/Library/Tpm2CommandLib.h
index ee8eb622951c..92967662ce96 100644
--- a/SecurityPkg/Include/Library/Tpm2CommandLib.h
+++ b/SecurityPkg/Include/Library/Tpm2CommandLib.h
@@ -364,6 +364,28 @@ Tpm2NvUndefineSpace (
IN TPMS_AUTH_COMMAND *AuthSession OPTIONAL

);



+/**

+ This command allows removal of a platform-created NV Index that has
TPMA_NV_POLICY_DELETE SET.

+

+ @param[in] NvIndex The NV Index.

+ @param[in] IndexAuthSession Auth session context for the Index
auth/policy

+ @param[in] PlatAuthSession Auth session context for the Platform
auth/policy

+

+ @retval EFI_SUCCESS Operation completed successfully.

+ @retval EFI_NOT_FOUND The command was returned successfully, but
NvIndex is not found.

+ @retval EFI_UNSUPPORTED Selected NvIndex does not support deletion
through this call.

+ @retval EFI_SECURITY_VIOLATION Deletion is not authorized by current
policy session.

+ @retval EFI_INVALID_PARAMETER The command was unsuccessful.

+ @retval EFI_DEVICE_ERROR The command was unsuccessful.

+**/

+EFI_STATUS

+EFIAPI

+Tpm2NvUndefineSpaceSpecial (

+ IN TPMI_RH_NV_INDEX NvIndex,

+ IN TPMS_AUTH_COMMAND *IndexAuthSession OPTIONAL,

+ IN TPMS_AUTH_COMMAND *PlatAuthSession OPTIONAL

+ );

+

/**

This command reads a value from an area in NV memory previously defined by
TPM2_NV_DefineSpace().



--
2.31.1.windows.1



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


Re: [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg

Abner Chang
 

Hi Are, I am so sorry about that I just merged it two hours ago. Any process needed if we want to change the commit messages for adding your review tag?

Abner


From: Ard Biesheuvel <ardb@...>
Sent: Thursday, October 14, 2021 5:51:56 PM
To: edk2-devel-groups-io <devel@edk2.groups.io>; Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>
Cc: gaoliming <gaoliming@...>; Ard Biesheuvel <ardb+tianocore@...>; Leif Lindholm <leif@...>; Sami Mujawar <sami.mujawar@...>; Jiewen Yao <jiewen.yao@...>; Jordan Justen <jordan.l.justen@...>; Gerd Hoffmann <kraxel@...>; Schaefer, Daniel <daniel.schaefer@...>; Sunil V L <sunilvl@...>; Zhiguang Liu <zhiguang.liu@...>; Michael D Kinney <michael.d.kinney@...>
Subject: Re: [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg
 
On Tue, 12 Oct 2021 at 06:17, Abner Chang <abner.chang@...> wrote:
>
> Hi package maintainers,
>
> The review process of this patch set is almost done and please allow me to merge it because the corresponding changes on edk2-platform is also required to merge.
>
>
>
> Ard and Leif, do I need the Reviewed-by or Acked-by from either of you? Or I can just proceed the merge process as Ard has no problem with this patch set?
>
>

Hi Abner,

Where needed

Acked-by: Ard Biesheuvel <ardb@...>

Feel free to merge it whenever convenient for you.


>
> From: gaoliming [mailto:gaoliming@...]
> Sent: Monday, October 11, 2021 9:22 AM
> To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>; ardb@...
> Cc: 'Ard Biesheuvel' <ardb+tianocore@...>; 'Leif Lindholm' <leif@...>; 'Sami Mujawar' <sami.mujawar@...>; 'Jiewen Yao' <jiewen.yao@...>; 'Jordan Justen' <jordan.l.justen@...>; 'Gerd Hoffmann' <kraxel@...>; Schaefer, Daniel <daniel.schaefer@...>; 'Sunil V L' <sunilvl@...>; 'Zhiguang Liu' <zhiguang.liu@...>; 'Michael D Kinney' <michael.d.kinney@...>
> Subject: 回复: [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg
>
>
>
> The change in MdePkg is good to me. Reviewed-by: Liming Gao <gaoliming@...>
>
>
>
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Abner Chang
> 发送时间: 2021年10月8日 11:39
> 收件人: devel@edk2.groups.io; gaoliming@...; ardb@...
> 抄送: 'Ard Biesheuvel' <ardb+tianocore@...>; 'Leif Lindholm' <leif@...>; 'Sami Mujawar' <sami.mujawar@...>; 'Jiewen Yao' <jiewen.yao@...>; 'Jordan Justen' <jordan.l.justen@...>; 'Gerd Hoffmann' <kraxel@...>; Schaefer, Daniel <daniel.schaefer@...>; 'Sunil V L' <sunilvl@...>; 'Zhiguang Liu' <zhiguang.liu@...>; 'Michael D Kinney' <michael.d.kinney@...>
> 主题: Re: [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg
>
>
>
> Thanks Liming, could you please also give the reviewed-by.
>
>
>
> Hi Ard, also need your reviewed-by for ArmPkg. Then this changes could be upstream and finished.
>
> Thanks
>
> Abner
>
>
>
>
>
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of gaoliming
> Sent: Friday, October 8, 2021 11:14 AM
> To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>; 'edk2-devel-groups-io' <devel@edk2.groups.io>; ardb@...
> Cc: 'Ard Biesheuvel' <ardb+tianocore@...>; 'Leif Lindholm' <leif@...>; 'Sami Mujawar' <sami.mujawar@...>; 'Jiewen Yao' <jiewen.yao@...>; 'Jordan Justen' <jordan.l.justen@...>; 'Gerd Hoffmann' <kraxel@...>; Schaefer, Daniel <daniel.schaefer@...>; 'Sunil V L' <sunilvl@...>; 'Zhiguang Liu' <zhiguang.liu@...>; 'Michael D Kinney' <michael.d.kinney@...>
> Subject: 回复: [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg
>
>
>
> Ard and Abner:
>
>  I am OK to add these three PCDs PcdPciMmio32Translation, PcdPciMmio64Translation, PcdPciIoTranslation to MdePkg.
>
>
>
> Thanks
>
> Liming
>
> 发件人: Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>
> 发送时间: 2021年10月6日 17:27
> 收件人: edk2-devel-groups-io <devel@edk2.groups.io>; ardb@...; Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>
> 抄送: Ard Biesheuvel <ardb+tianocore@...>; Leif Lindholm <leif@...>; Sami Mujawar <sami.mujawar@...>; Jiewen Yao <jiewen.yao@...>; Jordan Justen <jordan.l.justen@...>; Gerd Hoffmann <kraxel@...>; Schaefer, Daniel <daniel.schaefer@...>; Sunil V L <sunilvl@...>; Liming Gao <gaoliming@...>; Zhiguang Liu <zhiguang.liu@...>; Michael D Kinney <michael.d.kinney@...>
> 主题: Re: [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg
>
>
>
> Hi Ard,
>
> I realized there is a problem if we duplicate ArmPkg defined PCD to under OvmfPkg (e.g. PcdPciIoTranslate PCD) when I was duplicating this PCD to OvmfPkg.
>
> FdtPciProducerLib is relocated to OvmfPkg/Fdt and uses PcdPciIoTranslate PCD declared with OvmfPkg namespace. FdtPciProducerLib is also used by both ArmVirtPkg  and RiscVVirtPkg.
>
> ArmVirtPkg uses ArmPciCpuIoDxe provided by ArmPkg however PcdPciIoTranslate used by ArmPciCpuIoDxe  is declared with ArmPkg namespace.
>
> I think this results in the problem because PcdPciIoTranslate(s) that are referred by ArmPkg and ArmVirtPkg come from two different namespaces, right? Unless ArmPciCpuIoDxe uses the one declared in OvmfPkg, but I don't think we want to do this.
>
> Thought? Otherwise, we should still keep the original patch that relocates these PCDs under MdePkg.
>
>
>
> Thanks
>
> Abner
>
>
>
>
>
> ________________________________
>
> From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Abner Chang <abner.chang@...>
> Sent: Tuesday, October 5, 2021 11:00 PM
> To: edk2-devel-groups-io <devel@edk2.groups.io>; ardb@... <ardb@...>
> Cc: Ard Biesheuvel <ardb+tianocore@...>; Leif Lindholm <leif@...>; Sami Mujawar <sami.mujawar@...>; Jiewen Yao <jiewen.yao@...>; Jordan Justen <jordan.l.justen@...>; Gerd Hoffmann <kraxel@...>; Schaefer, Daniel <daniel.schaefer@...>; Sunil V L <sunilvl@...>; Liming Gao <gaoliming@...>; Zhiguang Liu <zhiguang.liu@...>; Michael D Kinney <michael.d.kinney@...>
> Subject: Re: [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg
>
>
>
> Hi Ard,
>
> This way reduces the impact of MdePkg. We can try it.
>
>
>
> Thanks
>
> Abner
>
>
>
> ________________________________
>
> From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Ard Biesheuvel <ardb@...>
> Sent: Tuesday, October 5, 2021 5:30 PM
> To: edk2-devel-groups-io <devel@edk2.groups.io>; Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>
> Cc: Ard Biesheuvel <ardb+tianocore@...>; Leif Lindholm <leif@...>; Sami Mujawar <sami.mujawar@...>; Jiewen Yao <jiewen.yao@...>; Jordan Justen <jordan.l.justen@...>; Gerd Hoffmann <kraxel@...>; Schaefer, Daniel <daniel.schaefer@...>; Sunil V L <sunilvl@...>; Liming Gao <gaoliming@...>; Zhiguang Liu <zhiguang.liu@...>; Michael D Kinney <michael.d.kinney@...>
> Subject: Re: [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg
>
>
>
> On Thu, 30 Sept 2021 at 03:43, Abner Chang <abner.chang@...> wrote:
> >
> > In V3: Address comments on V2.
> > In V2: Remove HPE license on the files that just moved around or
> >        the changes in the file are just code removal.
> >
> > edk2 BZ #: 3665
> > edk2 platform corresponding changes will be submitted after
> > this pactch set is reviewed.
> >
> > This pacthes set is to migrate some modules from ArmVirtPkg
> > to under OvmfPkg for the upcoming RiscVVirtPkg that can leverage
> > those modules without the dependency with Arm*Pkg.
> >
> > The modules moved from ArmVirtPkg to OvmfPkg are,
> > - FdtClientDxe
> > - PciPcdProducerLib
> > - HighMemDxe
> > - QemuFwCfgLib
> > - FdtPciHostBridgeLib
> > - VirtioFdtDxe
> >
> > Below PCDs are moved to under MdePkg and leverage by RiscVVirtPkg.
> > This change also remove the dependency on ArmPkg of OvmfPkg.
> > - PcdPciIoTranslation
> > - PcdPciIoTranslation
> > - PcdPciMmio32(64)Translation
> >
> > Signed-off-by: Abner Chang <abner.chang@...>
> > Cc: Ard Biesheuvel <ardb+tianocore@...>
> > Cc: Leif Lindholm <leif@...>
> > Cc: Sami Mujawar <sami.mujawar@...>
> > Cc: Jiewen Yao <jiewen.yao@...>
> > Cc: Jordan Justen <jordan.l.justen@...>
> > Cc: Gerd Hoffmann <kraxel@...>
> > Cc: Daniel Schaefer <daniel.schaefer@...>
> > Cc: Sunil V L <sunilvl@...>
> > Cc: Liming Gao <gaoliming@...>
> > Cc: Zhiguang Liu <zhiguang.liu@...>
> > Cc: Michael D Kinney <michael.d.kinney@...>
> >
> > Abner Chang (12):
> >   ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg
> >   MdePkg: Add PcdPciIoTranslation PCD
> >   ArmPkg: Use PcdPciIoTranslation PCD from MdePkg
> >   ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to OvmfPkg
> >   ArmVirtPkg/HighMemDxe: Relocate HighMemDxe to OvmfPkg
> >   OvmfPkg/HighMemDxe: Add RISC-V in the supported arch.
> >   ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg
> >   OvmfPkg/QemuFwCfgLibMMIO: Add RISC-V arch support
> >   MdePkg: Add PcdPciMmio32(64)Translation PCDs
> >   ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to
> >     OvmfPkg/Fdt
> >   OvmfPkg/FdtPciHostBridgeLib: Add RISC-V in the supported arch.
> >   ArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe to OvmfPkg/Fdt
> >
>
> Hello all,
>
> These patches look ok to me, but I wonder if the MdePkg maintainers
> are happy taking these PCD declaration changes. Translations for PCIe
> are typically defined per host bridge, and I would rather move away
> from using PCDs for this entirely than 'promote' them by carrying them
> in MdePkg.
>
> As this issue is somewhat orthogonal to what Abner is trying to fix,
> perhaps it is better to avoid MdePkg changes for now, and just
> duplicate these PCDs into OvmfPkg. This is reasonable, given that we
> know that QEMU only exposes a single host bridge.
>
> The one in ArmPkg can hopefully be removed and replaced with something
> that is more appropriate.
>
>
> >  ArmPkg/ArmPkg.dec                             | 15 ++++++--------
> >  ArmVirtPkg/ArmVirtPkg.dec                     |  3 ---
> >  EmbeddedPkg/EmbeddedPkg.dec                   |  1 +
> >  MdePkg/MdePkg.dec                             | 12 +++++++++++
> >  ArmVirtPkg/ArmVirtCloudHv.dsc                 | 18 ++++++++---------
> >  ArmVirtPkg/ArmVirtKvmTool.dsc                 | 18 ++++++++---------
> >  ArmVirtPkg/ArmVirtQemu.dsc                    | 20 +++++++++----------
> >  ArmVirtPkg/ArmVirtQemuKernel.dsc              | 20 +++++++++----------
> >  ArmVirtPkg/ArmVirtXen.dsc                     |  2 +-
> >  EmbeddedPkg/EmbeddedPkg.dsc                   |  1 +
> >  ArmVirtPkg/ArmVirtCloudHv.fdf                 |  6 +++---
> >  ArmVirtPkg/ArmVirtKvmTool.fdf                 |  6 +++---
> >  ArmVirtPkg/ArmVirtXen.fdf                     |  2 +-
> >  ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc          |  6 +++---
> >  .../ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf       |  2 +-
> >  .../ArmVirtGicArchLib/ArmVirtGicArchLib.inf   |  1 +
> >  .../ArmVirtPL031FdtClientLib.inf              |  1 +
> >  .../ArmVirtPsciResetSystemLib.inf             |  1 +
> >  .../ArmVirtTimerFdtClientLib.inf              |  1 +
> >  .../KvmtoolRtcFdtClientLib.inf                |  1 +
> >  .../NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf |  1 +
> >  .../NorFlashQemuLib/NorFlashQemuLib.inf       |  1 +
> >  .../XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf |  1 +
> >  ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf        |  1 +
> >  .../Drivers}/FdtClientDxe/FdtClientDxe.inf    |  1 -
> >  .../FdtPciHostBridgeLib.inf                   | 11 +++++-----
> >  .../FdtPciPcdProducerLib.inf                  |  5 ++---
> >  .../Fdt}/HighMemDxe/HighMemDxe.inf            |  7 ++++---
> >  .../Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf        |  2 +-
> >  .../Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf |  6 +++---
> >  .../Include/Protocol/FdtClient.h              |  0
> >  .../Drivers}/FdtClientDxe/FdtClientDxe.c      |  0
> >  .../FdtPciHostBridgeLib/FdtPciHostBridgeLib.c |  0
> >  .../FdtPciPcdProducerLib.c                    |  0
> >  .../Fdt}/HighMemDxe/HighMemDxe.c              |  3 ++-
> >  .../Fdt}/VirtioFdtDxe/VirtioFdtDxe.c          |  0
> >  .../Library/QemuFwCfgLib/QemuFwCfgLibMmio.c   |  7 ++++---
> >  Maintainers.txt                               |  6 ++++++
> >  38 files changed, 106 insertions(+), 83 deletions(-)
> >  rename {ArmVirtPkg => EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.inf (92%)
> >  rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf (77%)
> >  rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf (87%)
> >  rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.inf (83%)
> >  rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf (92%)
> >  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf => OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf (86%)
> >  rename {ArmVirtPkg => EmbeddedPkg}/Include/Protocol/FdtClient.h (100%)
> >  rename {ArmVirtPkg => EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.c (100%)
> >  rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c (100%)
> >  rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c (100%)
> >  rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.c (95%)
> >  rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.c (100%)
> >  rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c => OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.c (93%)
> >
> > --
> > 2.17.1
> >
> >
> >
> >
> >
> >
>


Re: [PATCH v1] ArmPkg/Smbios: Fix max cache size 2 wrong issue

Leif Lindholm
 

+Rebecca

On Thu, Oct 14, 2021 at 15:23:14 +0800, Ming Huang wrote:
As SMBIOS spec, bit-31 of maximum cache size 2 should be 1
for 64K granularity.

Signed-off-by: Ming Huang <huangming@...>
---
ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
index fb484086a4..4b409ff745 100644
--- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
+++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
@@ -219,7 +219,7 @@ ConfigureCacheArchitectureInformation (
CacheSize32 = CacheSize16;
} else if ((CacheSize64 / 64) < MAX_INT16) {
CacheSize16 = (1 << 15) | (CacheSize64 / 64);
- CacheSize32 = CacheSize16;
+ CacheSize32 = (1 << 31) | (CacheSize64 / 64);
} else {
if ((CacheSize64 / 1024) <= 2047) {
CacheSize32 = CacheSize64;
--
2.17.1






Re: [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg

Ard Biesheuvel
 

On Tue, 12 Oct 2021 at 06:17, Abner Chang <abner.chang@...> wrote:

Hi package maintainers,

The review process of this patch set is almost done and please allow me to merge it because the corresponding changes on edk2-platform is also required to merge.



Ard and Leif, do I need the Reviewed-by or Acked-by from either of you? Or I can just proceed the merge process as Ard has no problem with this patch set?

Hi Abner,

Where needed

Acked-by: Ard Biesheuvel <ardb@...>

Feel free to merge it whenever convenient for you.



From: gaoliming [mailto:gaoliming@...]
Sent: Monday, October 11, 2021 9:22 AM
To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>; ardb@...
Cc: 'Ard Biesheuvel' <ardb+tianocore@...>; 'Leif Lindholm' <leif@...>; 'Sami Mujawar' <sami.mujawar@...>; 'Jiewen Yao' <jiewen.yao@...>; 'Jordan Justen' <jordan.l.justen@...>; 'Gerd Hoffmann' <kraxel@...>; Schaefer, Daniel <daniel.schaefer@...>; 'Sunil V L' <sunilvl@...>; 'Zhiguang Liu' <zhiguang.liu@...>; 'Michael D Kinney' <michael.d.kinney@...>
Subject: 回复: [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg



The change in MdePkg is good to me. Reviewed-by: Liming Gao <gaoliming@...>



发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Abner Chang
发送时间: 2021年10月8日 11:39
收件人: devel@edk2.groups.io; gaoliming@...; ardb@...
抄送: 'Ard Biesheuvel' <ardb+tianocore@...>; 'Leif Lindholm' <leif@...>; 'Sami Mujawar' <sami.mujawar@...>; 'Jiewen Yao' <jiewen.yao@...>; 'Jordan Justen' <jordan.l.justen@...>; 'Gerd Hoffmann' <kraxel@...>; Schaefer, Daniel <daniel.schaefer@...>; 'Sunil V L' <sunilvl@...>; 'Zhiguang Liu' <zhiguang.liu@...>; 'Michael D Kinney' <michael.d.kinney@...>
主题: Re: [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg



Thanks Liming, could you please also give the reviewed-by.



Hi Ard, also need your reviewed-by for ArmPkg. Then this changes could be upstream and finished.

Thanks

Abner





From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of gaoliming
Sent: Friday, October 8, 2021 11:14 AM
To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>; 'edk2-devel-groups-io' <devel@edk2.groups.io>; ardb@...
Cc: 'Ard Biesheuvel' <ardb+tianocore@...>; 'Leif Lindholm' <leif@...>; 'Sami Mujawar' <sami.mujawar@...>; 'Jiewen Yao' <jiewen.yao@...>; 'Jordan Justen' <jordan.l.justen@...>; 'Gerd Hoffmann' <kraxel@...>; Schaefer, Daniel <daniel.schaefer@...>; 'Sunil V L' <sunilvl@...>; 'Zhiguang Liu' <zhiguang.liu@...>; 'Michael D Kinney' <michael.d.kinney@...>
Subject: 回复: [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg



Ard and Abner:

I am OK to add these three PCDs PcdPciMmio32Translation, PcdPciMmio64Translation, PcdPciIoTranslation to MdePkg.



Thanks

Liming

发件人: Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>
发送时间: 2021年10月6日 17:27
收件人: edk2-devel-groups-io <devel@edk2.groups.io>; ardb@...; Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>
抄送: Ard Biesheuvel <ardb+tianocore@...>; Leif Lindholm <leif@...>; Sami Mujawar <sami.mujawar@...>; Jiewen Yao <jiewen.yao@...>; Jordan Justen <jordan.l.justen@...>; Gerd Hoffmann <kraxel@...>; Schaefer, Daniel <daniel.schaefer@...>; Sunil V L <sunilvl@...>; Liming Gao <gaoliming@...>; Zhiguang Liu <zhiguang.liu@...>; Michael D Kinney <michael.d.kinney@...>
主题: Re: [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg



Hi Ard,

I realized there is a problem if we duplicate ArmPkg defined PCD to under OvmfPkg (e.g. PcdPciIoTranslate PCD) when I was duplicating this PCD to OvmfPkg.

FdtPciProducerLib is relocated to OvmfPkg/Fdt and uses PcdPciIoTranslate PCD declared with OvmfPkg namespace. FdtPciProducerLib is also used by both ArmVirtPkg and RiscVVirtPkg.

ArmVirtPkg uses ArmPciCpuIoDxe provided by ArmPkg however PcdPciIoTranslate used by ArmPciCpuIoDxe is declared with ArmPkg namespace.

I think this results in the problem because PcdPciIoTranslate(s) that are referred by ArmPkg and ArmVirtPkg come from two different namespaces, right? Unless ArmPciCpuIoDxe uses the one declared in OvmfPkg, but I don't think we want to do this.

Thought? Otherwise, we should still keep the original patch that relocates these PCDs under MdePkg.



Thanks

Abner





________________________________

From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Abner Chang <abner.chang@...>
Sent: Tuesday, October 5, 2021 11:00 PM
To: edk2-devel-groups-io <devel@edk2.groups.io>; ardb@... <ardb@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>; Leif Lindholm <leif@...>; Sami Mujawar <sami.mujawar@...>; Jiewen Yao <jiewen.yao@...>; Jordan Justen <jordan.l.justen@...>; Gerd Hoffmann <kraxel@...>; Schaefer, Daniel <daniel.schaefer@...>; Sunil V L <sunilvl@...>; Liming Gao <gaoliming@...>; Zhiguang Liu <zhiguang.liu@...>; Michael D Kinney <michael.d.kinney@...>
Subject: Re: [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg



Hi Ard,

This way reduces the impact of MdePkg. We can try it.



Thanks

Abner



________________________________

From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Ard Biesheuvel <ardb@...>
Sent: Tuesday, October 5, 2021 5:30 PM
To: edk2-devel-groups-io <devel@edk2.groups.io>; Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>; Leif Lindholm <leif@...>; Sami Mujawar <sami.mujawar@...>; Jiewen Yao <jiewen.yao@...>; Jordan Justen <jordan.l.justen@...>; Gerd Hoffmann <kraxel@...>; Schaefer, Daniel <daniel.schaefer@...>; Sunil V L <sunilvl@...>; Liming Gao <gaoliming@...>; Zhiguang Liu <zhiguang.liu@...>; Michael D Kinney <michael.d.kinney@...>
Subject: Re: [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg



On Thu, 30 Sept 2021 at 03:43, Abner Chang <abner.chang@...> wrote:

In V3: Address comments on V2.
In V2: Remove HPE license on the files that just moved around or
the changes in the file are just code removal.

edk2 BZ #: 3665
edk2 platform corresponding changes will be submitted after
this pactch set is reviewed.

This pacthes set is to migrate some modules from ArmVirtPkg
to under OvmfPkg for the upcoming RiscVVirtPkg that can leverage
those modules without the dependency with Arm*Pkg.

The modules moved from ArmVirtPkg to OvmfPkg are,
- FdtClientDxe
- PciPcdProducerLib
- HighMemDxe
- QemuFwCfgLib
- FdtPciHostBridgeLib
- VirtioFdtDxe

Below PCDs are moved to under MdePkg and leverage by RiscVVirtPkg.
This change also remove the dependency on ArmPkg of OvmfPkg.
- PcdPciIoTranslation
- PcdPciIoTranslation
- PcdPciMmio32(64)Translation

Signed-off-by: Abner Chang <abner.chang@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Leif Lindholm <leif@...>
Cc: Sami Mujawar <sami.mujawar@...>
Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jordan Justen <jordan.l.justen@...>
Cc: Gerd Hoffmann <kraxel@...>
Cc: Daniel Schaefer <daniel.schaefer@...>
Cc: Sunil V L <sunilvl@...>
Cc: Liming Gao <gaoliming@...>
Cc: Zhiguang Liu <zhiguang.liu@...>
Cc: Michael D Kinney <michael.d.kinney@...>

Abner Chang (12):
ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg
MdePkg: Add PcdPciIoTranslation PCD
ArmPkg: Use PcdPciIoTranslation PCD from MdePkg
ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to OvmfPkg
ArmVirtPkg/HighMemDxe: Relocate HighMemDxe to OvmfPkg
OvmfPkg/HighMemDxe: Add RISC-V in the supported arch.
ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg
OvmfPkg/QemuFwCfgLibMMIO: Add RISC-V arch support
MdePkg: Add PcdPciMmio32(64)Translation PCDs
ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to
OvmfPkg/Fdt
OvmfPkg/FdtPciHostBridgeLib: Add RISC-V in the supported arch.
ArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe to OvmfPkg/Fdt
Hello all,

These patches look ok to me, but I wonder if the MdePkg maintainers
are happy taking these PCD declaration changes. Translations for PCIe
are typically defined per host bridge, and I would rather move away
from using PCDs for this entirely than 'promote' them by carrying them
in MdePkg.

As this issue is somewhat orthogonal to what Abner is trying to fix,
perhaps it is better to avoid MdePkg changes for now, and just
duplicate these PCDs into OvmfPkg. This is reasonable, given that we
know that QEMU only exposes a single host bridge.

The one in ArmPkg can hopefully be removed and replaced with something
that is more appropriate.


ArmPkg/ArmPkg.dec | 15 ++++++--------
ArmVirtPkg/ArmVirtPkg.dec | 3 ---
EmbeddedPkg/EmbeddedPkg.dec | 1 +
MdePkg/MdePkg.dec | 12 +++++++++++
ArmVirtPkg/ArmVirtCloudHv.dsc | 18 ++++++++---------
ArmVirtPkg/ArmVirtKvmTool.dsc | 18 ++++++++---------
ArmVirtPkg/ArmVirtQemu.dsc | 20 +++++++++----------
ArmVirtPkg/ArmVirtQemuKernel.dsc | 20 +++++++++----------
ArmVirtPkg/ArmVirtXen.dsc | 2 +-
EmbeddedPkg/EmbeddedPkg.dsc | 1 +
ArmVirtPkg/ArmVirtCloudHv.fdf | 6 +++---
ArmVirtPkg/ArmVirtKvmTool.fdf | 6 +++---
ArmVirtPkg/ArmVirtXen.fdf | 2 +-
ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 6 +++---
.../ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf | 2 +-
.../ArmVirtGicArchLib/ArmVirtGicArchLib.inf | 1 +
.../ArmVirtPL031FdtClientLib.inf | 1 +
.../ArmVirtPsciResetSystemLib.inf | 1 +
.../ArmVirtTimerFdtClientLib.inf | 1 +
.../KvmtoolRtcFdtClientLib.inf | 1 +
.../NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf | 1 +
.../NorFlashQemuLib/NorFlashQemuLib.inf | 1 +
.../XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf | 1 +
ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf | 1 +
.../Drivers}/FdtClientDxe/FdtClientDxe.inf | 1 -
.../FdtPciHostBridgeLib.inf | 11 +++++-----
.../FdtPciPcdProducerLib.inf | 5 ++---
.../Fdt}/HighMemDxe/HighMemDxe.inf | 7 ++++---
.../Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf | 2 +-
.../Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf | 6 +++---
.../Include/Protocol/FdtClient.h | 0
.../Drivers}/FdtClientDxe/FdtClientDxe.c | 0
.../FdtPciHostBridgeLib/FdtPciHostBridgeLib.c | 0
.../FdtPciPcdProducerLib.c | 0
.../Fdt}/HighMemDxe/HighMemDxe.c | 3 ++-
.../Fdt}/VirtioFdtDxe/VirtioFdtDxe.c | 0
.../Library/QemuFwCfgLib/QemuFwCfgLibMmio.c | 7 ++++---
Maintainers.txt | 6 ++++++
38 files changed, 106 insertions(+), 83 deletions(-)
rename {ArmVirtPkg => EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.inf (92%)
rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf (77%)
rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf (87%)
rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.inf (83%)
rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf (92%)
rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf => OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf (86%)
rename {ArmVirtPkg => EmbeddedPkg}/Include/Protocol/FdtClient.h (100%)
rename {ArmVirtPkg => EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.c (100%)
rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c (100%)
rename {ArmVirtPkg/Library => OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c (100%)
rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.c (95%)
rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.c (100%)
rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c => OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmio.c (93%)

--
2.17.1






Re: [PATCH] OvmfPkg/Bhyve: Use QemuFwCfg over BhyveFwCtl

Yao, Jiewen
 

Acked-by: Jiewen Yao <Jiewen.yao@...>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Gerd
Hoffmann
Sent: Thursday, October 14, 2021 1:12 PM
To: Köhne, Corvin <c.koehne@...>
Cc: Corvin Köhne <CorvinK@...>; Ard Biesheuvel
<ardb+tianocore@...>; Yao, Jiewen <jiewen.yao@...>; Justen,
Jordan L <jordan.l.justen@...>; Rebecca Cran <rebecca@...>;
Peter Grehan <grehan@...>; devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH] OvmfPkg/Bhyve: Use QemuFwCfg over
BhyveFwCtl

On Wed, Oct 13, 2021 at 11:26:23AM +0200, Corvin Köhne wrote:
From: Corvin Köhne <CorvinK@...>

QemuFwCfg is more powerful and has more use cases than BhyveFwCtl. Try
to use QemuFwCfg in first place. If that fails, fall back to
BhyveFwCtl.
Does bhyve implement the qemu fwcfg interface?

Acked-by: Gerd Hoffmann <kraxel@...>

take care,
Gerd





Re: [PATCH] OvmfPkg/BhyveBhfPkg: install bhyve's ACPI tables

Yao, Jiewen
 

Acked-by: Jiewen Yao <Jiewen.yao@...>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Peter
Grehan
Sent: Thursday, October 14, 2021 1:42 PM
To: Köhne, Corvin <c.koehne@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>; Yao, Jiewen
<jiewen.yao@...>; Justen, Jordan L <jordan.l.justen@...>; Gerd
Hoffmann <kraxel@...>; Rebecca Cran <rebecca@...>;
devel@edk2.groups.io; Kinney, Michael D <michael.d.kinney@...>;
Liming Gao <gaoliming@...>; Liu, Zhiguang
<zhiguang.liu@...>
Subject: Re: [edk2-devel] [PATCH] OvmfPkg/BhyveBhfPkg: install bhyve's ACPI
tables

It's much easier to create configuration dependend ACPI tables for > bhyve
than for OVMF. For this reason, don't use the statically>
created ACPI tables provided by OVMF. Instead use the dynamically>
created ACPI tables of bhyve. If bhyve provides no ACPI tables or> we
are unable to detect those, fall back to OVMF tables.
This looks fine though bhyve will need to generate MCFG to get to full
parity.

I've requested in the past that you do this so I'll request again:
please discuss these changes on the freebsd-virtualization list before
sending patches outside of the project.

Acked-by: Peter Grehan <grehan@...>

later,

Peter.




[edk2-platforms: PATCH v5 9/9] WhitleySiliconPkg: Use same variable name for FspNvsHob.

Chiu, Chasel
 

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

To simplify the implementation the variable Name/GUID has been
changed to "FspNvsBuffer" and gFspNvsBufferVariableGuid
regardless it stores the data from FSP_NON_VOLATILE_STORAGE_HOB2
or FSP_NON_VOLATILE_STORAGE_HOB.

Cc: Isaac Oram <isaac.w.oram@...>
Cc: Nate DeSimone <nathaniel.l.desimone@...>
Signed-off-by: Chasel Chiu <chasel.chiu@...>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@...>
---
Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPl=
atformLib.c | 35 +++++++++--------------------------
Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrapperPl=
atformLib.inf | 3 ++-
2 files changed, 11 insertions(+), 27 deletions(-)

diff --git a/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/=
FspWrapperPlatformLib.c b/Silicon/Intel/WhitleySiliconPkg/Library/FspWrappe=
rPlatformLib/FspWrapperPlatformLib.c
index a6196a78b0..95a1f2a33c 100644
--- a/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrap=
perPlatformLib.c
+++ b/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrap=
perPlatformLib.c
@@ -13,7 +13,7 @@
#include <Library/HobLib.h>=0D
#include <Library/MemoryAllocationLib.h>=0D
#include <Library/LargeVariableReadLib.h>=0D
-=0D
+#include <Library/PeiLib.h>=0D
#include <FspmUpd.h>=0D
#include <Guid/PlatformInfo.h>=0D
#include <Ppi/UpiPolicyPpi.h>=0D
@@ -24,39 +24,22 @@ GetFspNvsBuffer (
)=0D
{=0D
EFI_STATUS Status;=0D
- UINTN FspNvsBufferSize;=0D
- VOID *FspNvsBufferPtr;=0D
+ UINTN FspNvsBufferSize;=0D
+ VOID *FspNvsBufferPtr;=0D
=0D
FspNvsBufferPtr =3D NULL;=0D
FspNvsBufferSize =3D 0;=0D
- Status =3D GetLargeVariable (L"FspNvsBuffer", &gFspNonVolatileStorageHob=
Guid, &FspNvsBufferSize, NULL);=0D
- if (Status =3D=3D EFI_BUFFER_TOO_SMALL) {=0D
- DEBUG ((DEBUG_INFO, "FspNvsBuffer Size =3D %d\n", FspNvsBufferSize));=
=0D
- FspNvsBufferPtr =3D AllocateZeroPool (FspNvsBufferSize);=0D
- if (FspNvsBufferPtr =3D=3D NULL) {=0D
- DEBUG ((DEBUG_ERROR, "Error: Cannot create FspNvsBuffer, out of memo=
ry!\n"));=0D
- ASSERT (FALSE);=0D
- return NULL;=0D
- }=0D
- Status =3D GetLargeVariable (L"FspNvsBuffer", &gFspNonVolatileStorageH=
obGuid, &FspNvsBufferSize, FspNvsBufferPtr);=0D
- if (EFI_ERROR (Status)) {=0D
- DEBUG ((DEBUG_ERROR, "Error: Unable to read FspNvsBuffer UEFI variab=
le Status: %r\n", Status));=0D
- ASSERT_EFI_ERROR (Status);=0D
- return NULL;=0D
- }=0D
-=0D
+ Status =3D PeiGetLargeVariable (L"FspNvsBuffer", &gFspNvsBufferVariableG=
uid, &FspNvsBufferPtr, &FspNvsBufferSize);=0D
+ if (Status =3D=3D EFI_SUCCESS) {=0D
return FspNvsBufferPtr;=0D
-=0D
- } else if (Status =3D=3D EFI_NOT_FOUND) {=0D
- DEBUG ((DEBUG_INFO, "Cannot create FSP NVS Buffer, UEFI variable does =
not exist (this is likely a first boot)\n"));=0D
} else {=0D
- DEBUG ((DEBUG_ERROR, "Error: Unable to read FspNvsBuffer UEFI variable=
Status: %r\n", Status));=0D
- ASSERT_EFI_ERROR (Status);=0D
- }=0D
-=0D
+ DEBUG ((DEBUG_INFO, "Cannot create FSP NVS Buffer, UEFI variable does =
not exist (this is likely a first boot)\n"));=0D
return NULL;=0D
}=0D
=0D
+=0D
+}=0D
+=0D
VOID=0D
EFIAPI=0D
UpdateFspmUpdData (=0D
diff --git a/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/=
FspWrapperPlatformLib.inf b/Silicon/Intel/WhitleySiliconPkg/Library/FspWrap=
perPlatformLib/FspWrapperPlatformLib.inf
index 3e80ea670c..6ee15ea55f 100644
--- a/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrap=
perPlatformLib.inf
+++ b/Silicon/Intel/WhitleySiliconPkg/Library/FspWrapperPlatformLib/FspWrap=
perPlatformLib.inf
@@ -58,11 +58,12 @@
=0D
[Guids]=0D
gEfiPlatformInfoGuid=0D
- gFspNonVolatileStorageHobGuid=0D
+ gFspNvsBufferVariableGuid # CONSUMES=0D
=0D
[LibraryClasses]=0D
PeiServicesLib=0D
LargeVariableReadLib=0D
+ PeiLib=0D
=0D
[Pcd]=0D
gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase ## CONSUMES=0D
--=20
2.28.0.windows.1

8961 - 8980 of 90922