Date   

[PATCH v1 0/3] Add function QuickSort into MdePkg/BaseLib

IanX Kuo
 

From: IanX Kuo <ianx.kuo@...>

1. MdeModulePkg/SortLib: Use QuickSort instead of QuickSortWorker
2. CryptLib/CryptLib: Remove duplicate QuickSortWorker
3. CpuCacheInfoLib: Remove MdeModulePkg dependency

IanX Kuo (3):
MdeModulePkg/SortLib: Add QuickSort function on BaseLib
CryptoPkg/CryptLib: Add QuickSort function on BaseLib
UefiCpuPkg/CpuCacheInfoLib: Add QuickSort function on BaseLib

.../Library/BaseCryptLib/SysCall/CrtWrapper.c | 92 +-------------
.../Library/BaseSortLib/BaseSortLib.c | 117 +----------------
.../Library/UefiSortLib/UefiSortLib.c | 118 +-----------------
.../Library/CpuCacheInfoLib/CpuCacheInfoLib.c | 5 +-
.../CpuCacheInfoLib/DxeCpuCacheInfoLib.inf | 2 -
.../CpuCacheInfoLib/InternalCpuCacheInfoLib.h | 1 -
.../CpuCacheInfoLib/PeiCpuCacheInfoLib.inf | 2 -
7 files changed, 16 insertions(+), 321 deletions(-)

--
2.30.0.windows.1


Re: [PATCH v2 3/8] ShellPkg: Acpiview: Abbreviate field names to preserve alignment

PierreGondois
 

Hi Sami,

The patch looks good to me:

Reviewed-by: Pierre Gondois <pierre.gondois@...>

Regards,
Pierre

On 6/17/21 10:55, Sami Mujawar via groups.io wrote:
Some field names in the IORT table parser were longer than the
OUTPUT_FIELD_COLUMN_WIDTH plus indentation, resulting in loss of
the output print alignment. Therefore, abbreviate the field names.

Signed-off-by: Sami Mujawar <sami.mujawar@...>
---

Notes:
v2:
- No code change since v1. Re-sending with v2 series. [SAMI]

ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c
index f7447947b2308d35d4d2890373778f0fd2f97f9e..fcecaff5134256497bda87241f339076897c3ece 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c
@@ -1,11 +1,14 @@
/** @file
IORT table parser

- Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.
+ Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

@par Reference(s):
- - IO Remapping Table, Platform Design Document, Revision D, March 2018
+ - IO Remapping Table, Platform Design Document, Revision D, March 2018
+
+ @par Glossary:
+ - Ref - Reference
**/

#include <IndustryStandard/IoRemappingTable.h>
@@ -144,15 +147,15 @@ STATIC CONST ACPI_PARSER IortNodeSmmuV1V2Parser[] = {
{L"Span", 8, 24, L"0x%lx", NULL, NULL, NULL, NULL},
{L"Model", 4, 32, L"%d", NULL, NULL, NULL, NULL},
{L"Flags", 4, 36, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Reference to Global Interrupt Array", 4, 40, L"0x%x", NULL, NULL, NULL,
+ {L"Global Interrupt Array Ref", 4, 40, L"0x%x", NULL, NULL, NULL,
NULL},
{L"Number of context interrupts", 4, 44, L"%d", NULL,
(VOID**)&InterruptContextCount, NULL, NULL},
- {L"Reference to Context Interrupt Array", 4, 48, L"0x%x", NULL,
+ {L"Context Interrupt Array Ref", 4, 48, L"0x%x", NULL,
(VOID**)&InterruptContextOffset, NULL, NULL},
{L"Number of PMU Interrupts", 4, 52, L"%d", NULL,
(VOID**)&PmuInterruptCount, NULL, NULL},
- {L"Reference to PMU Interrupt Array", 4, 56, L"0x%x", NULL,
+ {L"PMU Interrupt Array Ref", 4, 56, L"0x%x", NULL,
(VOID**)&PmuInterruptOffset, NULL, NULL},

// Interrupt Array


Re: [`edk2-devel][PATCH V2] UefiPayloadPkg: Fix the build issue for coreboot

Ma, Maurice <maurice.ma@...>
 

There is a typo ' failue' in the commit message. Other than that, looks good.

Reviewed-by: Maurice Ma <maurice.ma@...>

-----Original Message-----
From: Dong, Guo <guo.dong@...>
Sent: Thursday, October 14, 2021 22:08
To: devel@edk2.groups.io
Cc: Dong, Guo <guo.dong@...>; Ni, Ray <ray.ni@...>; Ma,
Maurice <maurice.ma@...>; You, Benjamin
<benjamin.you@...>
Subject: [`edk2-devel][PATCH V2] UefiPayloadPkg: Fix the build issue for
coreboot

From: Guo Dong <guo.dong@...>

V2: Fix GCC build issue.

There is typo in previous change caused coreboot build failue.
This patch fixed the build issue.

Cc: Ray Ni <ray.ni@...>
Cc: Maurice Ma <maurice.ma@...>
Cc: Benjamin You <benjamin.you@...>
Signed-off-by: Guo Dong <guo.dong@...>
---
UefiPayloadPkg/Library/CbParseLib/CbParseLib.c | 4 ++--
UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
b/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
index f81aa0f301..4be5d66ba5 100644
--- a/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
+++ b/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
@@ -194,8 +194,8 @@ GetParameterBase (
return NULL;

}



- PcdSet64S (PcdBootloaderParameter, (UINTN)CbTablePtr);

- ASSERT_EFI_STATUS (Status);

+ Status = PcdSet64S (PcdBootloaderParameter, (UINTN)CbTablePtr);

+ ASSERT_EFI_ERROR (Status);



return CbTablePtr;

}

diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
index 5a1e578668..0e6dcf10f9 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
@@ -406,7 +406,9 @@ _ModuleEntryPoint (
SERIAL_PORT_INFO SerialPortInfo;

UNIVERSAL_PAYLOAD_SERIAL_PORT_INFO *UniversalSerialPort;



- PcdSet64S (PcdBootloaderParameter, BootloaderParameter);

+ Status = PcdSet64S (PcdBootloaderParameter, BootloaderParameter);

+ ASSERT_EFI_ERROR (Status);

+

// Initialize floating point operating environment to be compliant with UEFI
spec.

InitializeFloatingPointUnits ();



--
2.32.0.windows.2


Re: [edk2-platforms][PATCH V3 0/9] Use PcdPciMmio(32)64Translation PCDs from MdePkg

Abner Chang
 

Merged.
The fastest review process I ever experienced. :-D

Thanks
Abner



From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Leif Lindholm <leif@...>
Sent: Friday, October 15, 2021 6:54 PM
To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>
Cc: devel@edk2.groups.io <devel@edk2.groups.io>; Ard Biesheuvel <ardb+tianocore@...>; Schaefer, Daniel <daniel.schaefer@...>; Thomas Abraham <thomas.abraham@...>; Sami Mujawar <sami.mujawar@...>; Graeme Gregory <graeme@...>; Radoslaw Biernacki <rad@...>; Pierre Gondois <pierre.gondois@...>; Peng Xie <xiepeng@...>; Ling Jia <jialing@...>; Yiqi Shu <shuyiqi@...>
Subject: Re: [edk2-devel] [edk2-platforms][PATCH V3 0/9] Use PcdPciMmio(32)64Translation PCDs from MdePkg
 
On Fri, Oct 15, 2021 at 15:32:56 +0800, Abner Chang wrote:
> In V3: Fix the commit message in each patch.
>        ArmVirtPkg->ArmPkg
> In V2: Fix the invalid email address.

Less haste, more speed ;)

Acked-by: Leif Lindholm <leif@...>

> This patch set fixes the build error caused by referring to
> PcdPciMmio(32)64Translation under ArmPkg. It should use the ones from
> MdePkg because of the PCD relocation (BZ:#3665).
>
> https://bugzilla.tianocore.org/show_bug.cgi?id=3665
>
> BZ:#3665 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.
> Refer to below message of the pacthes of edk2 portion.
> https://edk2.groups.io/g/devel/message/81306
>
> Below PCDs are moved to under MdePkg and leverage by RiscVVirtPkg.
> - PcdPciMmio32Translation
> - PcdPciMmio64Translation
>
> Signed-off-by: Abner Chang <abner.chang@...>
> Cc: Ard Biesheuvel <ardb+tianocore@...>
> Cc: Leif Lindholm <leif@...>
> Cc: Daniel Schaefer <daniel.schaefer@...>
> Cc: Thomas Abraham <thomas.abraham@...>
> Cc: Sami Mujawar <sami.mujawar@...>
> Cc: Graeme Gregory <graeme@...>
> Cc: Radoslaw Biernacki <rad@...>
> Cc: Pierre Gondois <pierre.gondois@...>
> Cc: Peng Xie <xiepeng@...>
> Cc: Ling Jia <jialing@...>
> Cc: Yiqi Shu <shuyiqi@...>
>
> Abner Chang (9):
>   Platform/OverdriveBoard: Use PcdPciMmio(32)64Translation PCD from
>     MdePkg
>   Platform/CelloBoard: Use PcdPciMmio(32)64Translation PCD from MdePkg
>   Platform/Overdrive1000Board: Use PcdPciMmio(32)64Translation PCD from
>     MdePkg
>   Silicon/Styx: Use PcdPciMmio(32)64Translation PCD from MdePkg
>   Platform/ARM: Use PcdPciMmio(32)64Translation PCD from MdePkg
>   Platform/SabaQemu: Use PcdPciMmio(32)64Translation PCD from MdePkg
>   Silicon/SabaQemu: Use PcdPciMmio(32)64Translation PCD from MdePkg
>   Platform/DurianPkg: Use PcdPciMmio(32)64Translation PCD from MdePkg
>   Silicon/FT2000-4Pkg: Use PcdPciMmio(32)64Translation PCD from MdePkg
>
>  Platform/ARM/SgiPkg/SgiPlatform.dsc.inc                       | 4 ++--
>  Platform/AMD/OverdriveBoard/OverdriveBoard.dsc                | 4 ++--
>  Platform/LeMaker/CelloBoard/CelloBoard.dsc                    | 4 ++--
>  Platform/Phytium/DurianPkg/DurianPkg.dsc                      | 2 +-
>  Platform/Qemu/SbsaQemu/SbsaQemu.dsc                           | 4 ++--
>  Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc   | 4 ++--
>  .../Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.inf     | 4 ++--
>  .../ARM/SgiPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf  | 2 +-
>  .../AmdStyxPciHostBridgeLib/AmdStyxPciHostBridgeLib.inf       | 4 ++--
>  .../Phytium/FT2000-4Pkg/Library/PlatformLib/PlatformLib.inf   | 2 +-
>  Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf               | 4 ++--
>  .../SbsaQemuPciHostBridgeLib/SbsaQemuPciHostBridgeLib.c       | 4 ++--
>  12 files changed, 21 insertions(+), 21 deletions(-)
>
> --
> 2.17.1
>






Re: [edk2platforms][PATCH v1 1/1] IntelSiliconPkg: Add IntelDieInfoProtocol

Maciej Czajkowski
 

Can you add some details on how a producer of this interface would know the values to be assigned here? Does this contain any sort of encoding of generation and Die specific ID in a single UINT64?
Yes, in order to have a generic field regardless of the die type and per-generation changes it will be packed into a single UINT64. Protocol will be installed by silicon code, and consumer will need to be aware of the encoding and decode it. Same applies for stepping id.
 
Any reason the die specific GUIDs are not declared in the .dec file?
I can't see any problems with that, they will be added in v2 changes.

Regards,
Maciej


Re: [edk2platforms][PATCH v1 1/1] IntelSiliconPkg: Add IntelDieInfoProtocol

Maciej Czajkowski
 

What's the difference between SOC and CPU?
SOC die differs from typical CPU die in Intel's chiplet design.
 
What the purpose of "DieIndex"?
We want to have an indication to which exactly die given protocol instance is referring to (in example in multi socket/multi PCH designs).
 
Have you considered to use data fields such as "CONST CHAR8 * DieName, Stepping, Sku" instead of the methods?
Yes, but there might be a configuration where chipset id is going to be changed during the boot. By using methods, we ensure that returned value is correct in every call.

Regards,
Maciej


Re: [edk2-platforms][PATCH V3 0/9] Use PcdPciMmio(32)64Translation PCDs from MdePkg

Leif Lindholm
 

On Fri, Oct 15, 2021 at 15:32:56 +0800, Abner Chang wrote:
In V3: Fix the commit message in each patch.
ArmVirtPkg->ArmPkg
In V2: Fix the invalid email address.
Less haste, more speed ;)

Acked-by: Leif Lindholm <leif@...>

This patch set fixes the build error caused by referring to
PcdPciMmio(32)64Translation under ArmPkg. It should use the ones from
MdePkg because of the PCD relocation (BZ:#3665).

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

BZ:#3665 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.
Refer to below message of the pacthes of edk2 portion.
https://edk2.groups.io/g/devel/message/81306

Below PCDs are moved to under MdePkg and leverage by RiscVVirtPkg.
- PcdPciMmio32Translation
- PcdPciMmio64Translation

Signed-off-by: Abner Chang <abner.chang@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Leif Lindholm <leif@...>
Cc: Daniel Schaefer <daniel.schaefer@...>
Cc: Thomas Abraham <thomas.abraham@...>
Cc: Sami Mujawar <sami.mujawar@...>
Cc: Graeme Gregory <graeme@...>
Cc: Radoslaw Biernacki <rad@...>
Cc: Pierre Gondois <pierre.gondois@...>
Cc: Peng Xie <xiepeng@...>
Cc: Ling Jia <jialing@...>
Cc: Yiqi Shu <shuyiqi@...>

Abner Chang (9):
Platform/OverdriveBoard: Use PcdPciMmio(32)64Translation PCD from
MdePkg
Platform/CelloBoard: Use PcdPciMmio(32)64Translation PCD from MdePkg
Platform/Overdrive1000Board: Use PcdPciMmio(32)64Translation PCD from
MdePkg
Silicon/Styx: Use PcdPciMmio(32)64Translation PCD from MdePkg
Platform/ARM: Use PcdPciMmio(32)64Translation PCD from MdePkg
Platform/SabaQemu: Use PcdPciMmio(32)64Translation PCD from MdePkg
Silicon/SabaQemu: Use PcdPciMmio(32)64Translation PCD from MdePkg
Platform/DurianPkg: Use PcdPciMmio(32)64Translation PCD from MdePkg
Silicon/FT2000-4Pkg: Use PcdPciMmio(32)64Translation PCD from MdePkg

Platform/ARM/SgiPkg/SgiPlatform.dsc.inc | 4 ++--
Platform/AMD/OverdriveBoard/OverdriveBoard.dsc | 4 ++--
Platform/LeMaker/CelloBoard/CelloBoard.dsc | 4 ++--
Platform/Phytium/DurianPkg/DurianPkg.dsc | 2 +-
Platform/Qemu/SbsaQemu/SbsaQemu.dsc | 4 ++--
Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc | 4 ++--
.../Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.inf | 4 ++--
.../ARM/SgiPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf | 2 +-
.../AmdStyxPciHostBridgeLib/AmdStyxPciHostBridgeLib.inf | 4 ++--
.../Phytium/FT2000-4Pkg/Library/PlatformLib/PlatformLib.inf | 2 +-
Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf | 4 ++--
.../SbsaQemuPciHostBridgeLib/SbsaQemuPciHostBridgeLib.c | 4 ++--
12 files changed, 21 insertions(+), 21 deletions(-)

--
2.17.1


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

Leif Lindholm
 

On Thu, Oct 14, 2021 at 06:05:59 -0600, Rebecca Cran wrote:
Reviewed-by: Rebecca Cran <rebecca@...>
Acked-by: Leif Lindholm <leif@...>

Merged as 7e43d3e08611.

Thanks!

/
Leif


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;


[PATCH edk2 v1 1/3] StandaloneMmPkg: Fix issue about SpPcpuSharedBufSize field

Ming Huang
 

TF-A: TrustedFirmware-A
SPM: Secure Partition Manager(MM)

In TF-A, the name of this field is sp_shared_buf_size. This field is
the size of range for transmit data from TF-A to standaloneMM when
SPM enable.

SpPcpuSharedBufSize is pass from TF-A while StandaloneMM initialize.
So, SpPcpuSharedBufSize should be rename to SpSharedBufSize and this field
should no multiply by PayloadBootInfo->NumCpus;

Signed-off-by: Ming Huang <huangming@...>
---
StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h | 2 +-
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c | 2 +-
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h b/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h
index c44f7066c6..f1683ecb61 100644
--- a/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h
+++ b/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h
@@ -41,7 +41,7 @@ typedef struct {
UINT64 SpPcpuStackSize;
UINT64 SpHeapSize;
UINT64 SpNsCommBufSize;
- UINT64 SpPcpuSharedBufSize;
+ UINT64 SpSharedBufSize;
UINT32 NumSpMemRegions;
UINT32 NumCpus;
EFI_SECURE_PARTITION_CPU_INFO *CpuInfo;
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c
index 85f8194687..93773c9fe8 100644
--- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c
+++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c
@@ -173,7 +173,7 @@ CreateHobListFromBootInfo (
// Base and size of buffer shared with privileged Secure world software
MmramRanges[1].PhysicalStart = PayloadBootInfo->SpSharedBufBase;
MmramRanges[1].CpuStart = PayloadBootInfo->SpSharedBufBase;
- MmramRanges[1].PhysicalSize = PayloadBootInfo->SpPcpuSharedBufSize * PayloadBootInfo->NumCpus;
+ MmramRanges[1].PhysicalSize = PayloadBootInfo->SpSharedBufSize;
MmramRanges[1].RegionState = EFI_CACHEABLE | EFI_ALLOCATED;

// Base and size of buffer used for synchronous communication with Normal
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c
index 49cf51a789..5db7019dda 100644
--- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c
+++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c
@@ -87,7 +87,7 @@ GetAndPrintBootinformation (
DEBUG ((DEBUG_INFO, "SpPcpuStackSize - 0x%x\n", PayloadBootInfo->SpPcpuStackSize));
DEBUG ((DEBUG_INFO, "SpHeapSize - 0x%x\n", PayloadBootInfo->SpHeapSize));
DEBUG ((DEBUG_INFO, "SpNsCommBufSize - 0x%x\n", PayloadBootInfo->SpNsCommBufSize));
- DEBUG ((DEBUG_INFO, "SpPcpuSharedBufSize - 0x%x\n", PayloadBootInfo->SpPcpuSharedBufSize));
+ DEBUG ((DEBUG_INFO, "SpSharedBufSize - 0x%x\n", PayloadBootInfo->SpSharedBufSize));

DEBUG ((DEBUG_INFO, "NumCpus - 0x%x\n", PayloadBootInfo->NumCpus));
DEBUG ((DEBUG_INFO, "CpuInfo - 0x%p\n", PayloadBootInfo->CpuInfo));
--
2.17.1


[PATCH edk2 v1 3/3] StandaloneMmPkg: Fix check buffer address failed issue from TF-A

Ming Huang
 

There are two scene communicate with StandaloneMm(MM):
1 edk2 -> TF-A -> MM, communicate MM use non-secure buffer which
specify by EFI_SECURE_PARTITION_BOOT_INFO.SpNsCommBufBase;
2 RAS scene: fiq -> TF-A -> MM, use secure buffer which
specify by EFI_SECURE_PARTITION_BOOT_INFO.SpShareBufBase;

For now, the second scene will failed because check buffer address.
This patch add CheckBufferAddr() to support check address for secure
buffer.

Signed-off-by: Ming Huang <huangming@...>
---
StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c | 70 ++++++++++++++++----
StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c | 21 ++++++
StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h | 1 +
3 files changed, 79 insertions(+), 13 deletions(-)

diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c
index 5dfaf9d751..63fab1bd78 100644
--- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c
+++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c
@@ -50,6 +50,7 @@ EFI_MM_COMMUNICATE_HEADER **PerCpuGuidedEventContext = NULL;

// Descriptor with whereabouts of memory used for communication with the normal world
EFI_MMRAM_DESCRIPTOR mNsCommBuffer;
+EFI_MMRAM_DESCRIPTOR mSCommBuffer;

MP_INFORMATION_HOB_DATA *mMpInformationHobData;

@@ -60,6 +61,58 @@ EFI_MM_CONFIGURATION_PROTOCOL mMmConfig = {

STATIC EFI_MM_ENTRY_POINT mMmEntryPoint = NULL;

+STATIC
+EFI_STATUS
+CheckBufferAddr (
+ IN UINTN CommBufferAddr
+ )
+{
+ UINTN CommBufferSize;
+ EFI_STATUS Status;
+
+ Status = EFI_SUCCESS;
+ if (CommBufferAddr < mNsCommBuffer.PhysicalStart) {
+ Status = EFI_ACCESS_DENIED;
+ }
+
+ if ((CommBufferAddr + sizeof (EFI_MM_COMMUNICATE_HEADER)) >=
+ (mNsCommBuffer.PhysicalStart + mNsCommBuffer.PhysicalSize)) {
+ Status = EFI_INVALID_PARAMETER;
+ }
+
+ // Find out the size of the buffer passed
+ CommBufferSize = ((EFI_MM_COMMUNICATE_HEADER *) CommBufferAddr)->MessageLength +
+ sizeof (EFI_MM_COMMUNICATE_HEADER);
+
+ // perform bounds check.
+ if (CommBufferAddr + CommBufferSize >=
+ mNsCommBuffer.PhysicalStart + mNsCommBuffer.PhysicalSize) {
+ Status = EFI_ACCESS_DENIED;
+ }
+
+ if (!EFI_ERROR (Status)) {
+ return EFI_SUCCESS;
+ }
+
+ Status = EFI_SUCCESS;
+ if (CommBufferAddr < mSCommBuffer.PhysicalStart) {
+ Status = EFI_ACCESS_DENIED;
+ }
+
+ if ((CommBufferAddr + sizeof (EFI_MM_COMMUNICATE_HEADER)) >=
+ (mSCommBuffer.PhysicalStart + mSCommBuffer.PhysicalSize)) {
+ Status = EFI_INVALID_PARAMETER;
+ }
+
+ // perform bounds check.
+ if (CommBufferAddr + CommBufferSize >=
+ mSCommBuffer.PhysicalStart + mSCommBuffer.PhysicalSize) {
+ Status = EFI_ACCESS_DENIED;
+ }
+
+ return Status;
+}
+
/**
The PI Standalone MM entry point for the TF-A CPU driver.

@@ -104,25 +157,16 @@ PiMmStandaloneArmTfCpuDriverEntry (
return EFI_INVALID_PARAMETER;
}

- if (NsCommBufferAddr < mNsCommBuffer.PhysicalStart) {
- return EFI_ACCESS_DENIED;
- }
-
- if ((NsCommBufferAddr + sizeof (EFI_MM_COMMUNICATE_HEADER)) >=
- (mNsCommBuffer.PhysicalStart + mNsCommBuffer.PhysicalSize)) {
- return EFI_INVALID_PARAMETER;
+ Status = CheckBufferAddr (NsCommBufferAddr);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR, "Check Buffer failed: %r\n", Status));
+ return Status;
}

// Find out the size of the buffer passed
NsCommBufferSize = ((EFI_MM_COMMUNICATE_HEADER *) NsCommBufferAddr)->MessageLength +
sizeof (EFI_MM_COMMUNICATE_HEADER);

- // perform bounds check.
- if (NsCommBufferAddr + NsCommBufferSize >=
- mNsCommBuffer.PhysicalStart + mNsCommBuffer.PhysicalSize) {
- return EFI_ACCESS_DENIED;
- }
-
GuidedEventContext = NULL;
// Now that the secure world can see the normal world buffer, allocate
// memory to copy the communication buffer to the secure world.
diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
index fd9c59b4da..96dad20dd1 100644
--- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
+++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
@@ -107,6 +107,7 @@ StandaloneMmCpuInitialize (
UINTN Index;
UINTN ArraySize;
VOID *HobStart;
+ EFI_MMRAM_HOB_DESCRIPTOR_BLOCK *MmramRangesHob;

ASSERT (SystemTable != NULL);
mMmst = SystemTable;
@@ -186,6 +187,26 @@ StandaloneMmCpuInitialize (
CopyMem (&mNsCommBuffer, NsCommBufMmramRange, sizeof(EFI_MMRAM_DESCRIPTOR));
DEBUG ((DEBUG_INFO, "mNsCommBuffer: 0x%016lx - 0x%lx\n", mNsCommBuffer.CpuStart, mNsCommBuffer.PhysicalSize));

+ Status = GetGuidedHobData (
+ HobStart,
+ &gEfiMmPeiMmramMemoryReserveGuid,
+ (VOID **) &MmramRangesHob
+ );
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR, "MmramRangesHob data extraction failed - 0x%x\n", Status));
+ return Status;
+ }
+
+ //
+ // As CreateHobListFromBootInfo(), the base and size of buffer shared with
+ // privileged Secure world software is in second one.
+ //
+ CopyMem (
+ &mSCommBuffer,
+ &MmramRangesHob->Descriptor[0] + 1,
+ sizeof(EFI_MMRAM_DESCRIPTOR)
+ );
+
//
// Extract the MP information from the Hoblist
//
diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
index 2c96439c15..2e03b20d85 100644
--- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
+++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
@@ -30,6 +30,7 @@ extern EFI_MM_CPU_PROTOCOL mMmCpuState;
//
extern EFI_MM_COMMUNICATE_HEADER **PerCpuGuidedEventContext;
extern EFI_MMRAM_DESCRIPTOR mNsCommBuffer;
+extern EFI_MMRAM_DESCRIPTOR mSCommBuffer;
extern MP_INFORMATION_HOB_DATA *mMpInformationHobData;
extern EFI_MM_CONFIGURATION_PROTOCOL mMmConfig;

--
2.17.1


[PATCH edk2 v1 2/3] StandaloneMmPkg: Replace DEBUG_INFO with DEBUG_ERROR

Ming Huang
 

DEBUG_ERROR should be used in error branch.

Signed-off-by: Ming Huang <huangming@...>
---
StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c | 6 +++---
StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c | 12 ++++++------
2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c
index 165d696f99..5dfaf9d751 100644
--- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c
+++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c
@@ -95,7 +95,7 @@ PiMmStandaloneArmTfCpuDriverEntry (
//
if ((ARM_SMC_ID_MM_COMMUNICATE != EventId) &&
(ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ != EventId)) {
- DEBUG ((DEBUG_INFO, "UnRecognized Event - 0x%x\n", EventId));
+ DEBUG ((DEBUG_ERROR, "UnRecognized Event - 0x%x\n", EventId));
return EFI_INVALID_PARAMETER;
}

@@ -133,7 +133,7 @@ PiMmStandaloneArmTfCpuDriverEntry (
);

if (Status != EFI_SUCCESS) {
- DEBUG ((DEBUG_INFO, "Mem alloc failed - 0x%x\n", EventId));
+ DEBUG ((DEBUG_ERROR, "Mem alloc failed - 0x%x\n", EventId));
return EFI_OUT_OF_RESOURCES;
}

@@ -156,7 +156,7 @@ PiMmStandaloneArmTfCpuDriverEntry (
mMmst->CpuSaveState = NULL;

if (mMmEntryPoint == NULL) {
- DEBUG ((DEBUG_INFO, "Mm Entry point Not Found\n"));
+ DEBUG ((DEBUG_ERROR, "Mm Entry point Not Found\n"));
return EFI_UNSUPPORTED;
}

diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
index 10097f792f..fd9c59b4da 100644
--- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
+++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
@@ -143,7 +143,7 @@ StandaloneMmCpuInitialize (

// Bail out if the Hoblist could not be found
if (Index >= mMmst->NumberOfTableEntries) {
- DEBUG ((DEBUG_INFO, "Hoblist not found - 0x%x\n", Index));
+ DEBUG ((DEBUG_ERROR, "Hoblist not found - 0x%x\n", Index));
return EFI_OUT_OF_RESOURCES;
}

@@ -158,7 +158,7 @@ StandaloneMmCpuInitialize (
(VOID **) &CpuDriverEntryPointDesc
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_INFO, "ArmTfCpuDriverEpDesc HOB data extraction failed - 0x%x\n", Status));
+ DEBUG ((DEBUG_ERROR, "ArmTfCpuDriverEpDesc HOB data extraction failed - 0x%x\n", Status));
return Status;
}

@@ -176,7 +176,7 @@ StandaloneMmCpuInitialize (
(VOID **) &NsCommBufMmramRange
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_INFO, "NsCommBufMmramRange HOB data extraction failed - 0x%x\n", Status));
+ DEBUG ((DEBUG_ERROR, "NsCommBufMmramRange HOB data extraction failed - 0x%x\n", Status));
return Status;
}

@@ -195,7 +195,7 @@ StandaloneMmCpuInitialize (
(VOID **) &MpInformationHobData
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_INFO, "MpInformationHob extraction failed - 0x%x\n", Status));
+ DEBUG ((DEBUG_ERROR, "MpInformationHob extraction failed - 0x%x\n", Status));
return Status;
}

@@ -213,7 +213,7 @@ StandaloneMmCpuInitialize (
(VOID **) &mMpInformationHobData
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_INFO, "mMpInformationHobData mem alloc failed - 0x%x\n", Status));
+ DEBUG ((DEBUG_ERROR, "mMpInformationHobData mem alloc failed - 0x%x\n", Status));
return Status;
}

@@ -243,7 +243,7 @@ StandaloneMmCpuInitialize (
(VOID **) &PerCpuGuidedEventContext
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_INFO, "PerCpuGuidedEventContext mem alloc failed - 0x%x\n", Status));
+ DEBUG ((DEBUG_ERROR, "PerCpuGuidedEventContext mem alloc failed - 0x%x\n", Status));
return Status;
}
return Status;
--
2.17.1


[PATCH edk2 v1 0/3] Fix several issues in StanaloneMmPkg

Ming Huang
 

Fix issues in StandaloneMmPkg for supporting communicate from
TF-A with secure buffer.

Ming Huang (3):
StandaloneMmPkg: Fix issue about SpPcpuSharedBufSize field
StandaloneMmPkg: Replace DEBUG_INFO with DEBUG_ERROR
StandaloneMmPkg: Fix check buffer address failed issue from TF-A

.../Drivers/StandaloneMmCpu/EventHandle.c | 76 +++++++++++++++----
.../Drivers/StandaloneMmCpu/StandaloneMmCpu.c | 33 ++++++--
.../Drivers/StandaloneMmCpu/StandaloneMmCpu.h | 1 +
.../Library/Arm/StandaloneMmCoreEntryPoint.h | 2 +-
.../Arm/CreateHobList.c | 2 +-
.../Arm/StandaloneMmCoreEntryPoint.c | 2 +-
6 files changed, 91 insertions(+), 25 deletions(-)

--
2.17.1


[edk2-platforms][PATCH V3 1/9] Platform/OverdriveBoard: Use PcdPciMmio(32)64Translation PCD from MdePkg

Abner Chang
 

Compliant with BZ: #3665
https://bugzilla.tianocore.org/show_bug.cgi?id=3665

PcdPciMmio(32)64Translation PCD is relocated to MdePkg that leveraged
by both ARM and RISC-V arch. This patch uses the one from MdePkg
instead the one under ArmPkg.

Signed-off-by: Abner Chang <abner.chang@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Leif Lindholm <leif@...>
Cc: Daniel Schaefer <daniel.schaefer@...>
---
Platform/AMD/OverdriveBoard/OverdriveBoard.dsc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
index 91b8c7792e..af20739120 100644
--- a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
+++ b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
@@ -403,11 +403,11 @@ DEFINE X64EMU_ENABLE = FALSE

gArmTokenSpaceGuid.PcdPciMmio32Base|0x40000000
gArmTokenSpaceGuid.PcdPciMmio32Size|0x80000000
- gArmTokenSpaceGuid.PcdPciMmio32Translation|0x0
+ gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation|0x0

gArmTokenSpaceGuid.PcdPciMmio64Base|0x100000000
gArmTokenSpaceGuid.PcdPciMmio64Size|0x7F00000000
- gArmTokenSpaceGuid.PcdPciMmio64Translation|0x0
+ gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation|0x0

## Use PCI emulation for ATA PassThru
# gEfiMdeModulePkgTokenSpaceGuid.PcdAtaPassThruPciEmulation|TRUE
--
2.17.1


[edk2-platforms][PATCH V3 9/9] Silicon/FT2000-4Pkg: Use PcdPciMmio(32)64Translation PCD from MdePkg

Abner Chang
 

Compliant with BZ: #3665
https://bugzilla.tianocore.org/show_bug.cgi?id=3665

PcdPciMmio(32)64Translation PCD is relocated to MdePkg that leveraged
by both ARM and RISC-V arch. This patch uses the one from MdePkg
instead the one under ArmPkg.

Signed-off-by: Abner Chang <abner.chang@...>
Cc: Leif Lindholm <leif@...>
Cc: Peng Xie <xiepeng@...>
Cc: Ling Jia <jialing@...>
Cc: Yiqi Shu <shuyiqi@...>
Cc: Daniel Schaefer <daniel.schaefer@...>
---
Silicon/Phytium/FT2000-4Pkg/Library/PlatformLib/PlatformLib.inf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Silicon/Phytium/FT2000-4Pkg/Library/PlatformLib/PlatformLib.inf b/Silicon/Phytium/FT2000-4Pkg/Library/PlatformLib/PlatformLib.inf
index 6d5951c62d..11134b8fc4 100644
--- a/Silicon/Phytium/FT2000-4Pkg/Library/PlatformLib/PlatformLib.inf
+++ b/Silicon/Phytium/FT2000-4Pkg/Library/PlatformLib/PlatformLib.inf
@@ -47,7 +47,7 @@
gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation
gArmTokenSpaceGuid.PcdPciMmio32Base
gArmTokenSpaceGuid.PcdPciMmio32Size
- gArmTokenSpaceGuid.PcdPciMmio32Translation
+ gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation
gArmTokenSpaceGuid.PcdPciMmio64Base
gArmTokenSpaceGuid.PcdPciMmio64Size

--
2.17.1


[edk2-platforms][PATCH V3 8/9] Platform/DurianPkg: Use PcdPciMmio(32)64Translation PCD from MdePkg

Abner Chang
 

Compliant with BZ: #3665
https://bugzilla.tianocore.org/show_bug.cgi?id=3665

PcdPciMmio(32)64Translation PCD is relocated to MdePkg that leveraged
by both ARM and RISC-V arch. This patch uses the one from MdePkg
instead the one under ArmPkg.

Signed-off-by: Abner Chang <abner.chang@...>
Cc: Leif Lindholm <leif@...>
Cc: Peng Xie <xiepeng@...>
Cc: Ling Jia <jialing@...>
Cc: Yiqi Shu <shuyiqi@...>
Cc: Daniel Schaefer <daniel.schaefer@...>
---
Platform/Phytium/DurianPkg/DurianPkg.dsc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Platform/Phytium/DurianPkg/DurianPkg.dsc b/Platform/Phytium/DurianPkg/DurianPkg.dsc
index 7df7e0f1d5..c1519070d6 100644
--- a/Platform/Phytium/DurianPkg/DurianPkg.dsc
+++ b/Platform/Phytium/DurianPkg/DurianPkg.dsc
@@ -114,7 +114,7 @@
gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x50000000
gArmTokenSpaceGuid.PcdPciMmio32Base|0x58000000
gArmTokenSpaceGuid.PcdPciMmio32Size|0x28000000
- gArmTokenSpaceGuid.PcdPciMmio32Translation|0x0
+ gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation|0x0
gArmTokenSpaceGuid.PcdPciMmio64Base|0x1000000000
gArmTokenSpaceGuid.PcdPciMmio64Size|0x1000000000
gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE
--
2.17.1


[edk2-platforms][PATCH V3 5/9] Platform/ARM: Use PcdPciMmio(32)64Translation PCD from MdePkg

Abner Chang
 

Compliant with BZ: #3665
https://bugzilla.tianocore.org/show_bug.cgi?id=3665

PcdPciMmio(32)64Translation PCD is relocated to MdePkg that leveraged
by both ARM and RISC-V arch. This patch uses the one from MdePkg
instead the one under ArmPkg.

Signed-off-by: Abner Chang <abner.chang@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Thomas Abraham <thomas.abraham@...>
Cc: Sami Mujawar <sami.mujawar@...>
Cc: Pierre Gondois <pierre.gondois@...>
Cc: Daniel Schaefer <daniel.schaefer@...>
---
Platform/ARM/SgiPkg/SgiPlatform.dsc.inc | 4 ++--
.../Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.inf | 4 ++--
.../ARM/SgiPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
index 6679939d3b..4fe3ccf9a5 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
@@ -152,8 +152,8 @@
gArmTokenSpaceGuid.PcdPciIoBase|0x0
gArmTokenSpaceGuid.PcdPciIoSize|0x00800000
gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x77800000
- gArmTokenSpaceGuid.PcdPciMmio32Translation|0x0
- gArmTokenSpaceGuid.PcdPciMmio64Translation|0x0
+ gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation|0x0
+ gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation|0x0
gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize|24

## PL011 - Serial Terminal
diff --git a/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.inf b/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.inf
index fb513d7b3d..f448803fda 100644
--- a/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.inf
+++ b/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.inf
@@ -55,10 +55,10 @@
gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation
gArmTokenSpaceGuid.PcdPciMmio32Base
gArmTokenSpaceGuid.PcdPciMmio32Size
- gArmTokenSpaceGuid.PcdPciMmio32Translation
+ gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation
gArmTokenSpaceGuid.PcdPciMmio64Base
gArmTokenSpaceGuid.PcdPciMmio64Size
- gArmTokenSpaceGuid.PcdPciMmio64Translation
+ gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation

gArmJunoTokenSpaceGuid.PcdPcieControlBaseAddress
gArmJunoTokenSpaceGuid.PcdPcieRootPortBaseAddress
diff --git a/Platform/ARM/SgiPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf b/Platform/ARM/SgiPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
index a9fdd874d0..0f53d67bc0 100644
--- a/Platform/ARM/SgiPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
+++ b/Platform/ARM/SgiPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
@@ -46,7 +46,7 @@
gArmTokenSpaceGuid.PcdPciIoSize
gArmTokenSpaceGuid.PcdPciMmio32Base
gArmTokenSpaceGuid.PcdPciMmio32Size
- gArmTokenSpaceGuid.PcdPciMmio32Translation
+ gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation
gArmTokenSpaceGuid.PcdPciMmio64Base
gArmTokenSpaceGuid.PcdPciMmio64Size

--
2.17.1


[edk2-platforms][PATCH V3 4/9] Silicon/Styx: Use PcdPciMmio(32)64Translation PCD from MdePkg

Abner Chang
 

Compliant with BZ: #3665
https://bugzilla.tianocore.org/show_bug.cgi?id=3665

PcdPciMmio(32)64Translation PCD is relocated to MdePkg that leveraged
by both ARM and RISC-V arch. This patch uses the one from MdePkg
instead the one under ArmPkg.

Signed-off-by: Abner Chang <abner.chang@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Leif Lindholm <leif@...>
Cc: Daniel Schaefer <daniel.schaefer@...>
---
.../AmdStyxPciHostBridgeLib/AmdStyxPciHostBridgeLib.inf | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Silicon/AMD/Styx/Library/AmdStyxPciHostBridgeLib/AmdStyxPciHostBridgeLib.inf b/Silicon/AMD/Styx/Library/AmdStyxPciHostBridgeLib/AmdStyxPciHostBridgeLib.inf
index 31c973cd2a..76a3b5aee2 100644
--- a/Silicon/AMD/Styx/Library/AmdStyxPciHostBridgeLib/AmdStyxPciHostBridgeLib.inf
+++ b/Silicon/AMD/Styx/Library/AmdStyxPciHostBridgeLib/AmdStyxPciHostBridgeLib.inf
@@ -43,7 +43,7 @@
gArmTokenSpaceGuid.PcdPciIoSize
gArmTokenSpaceGuid.PcdPciMmio32Base
gArmTokenSpaceGuid.PcdPciMmio32Size
- gArmTokenSpaceGuid.PcdPciMmio32Translation
+ gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation
gArmTokenSpaceGuid.PcdPciMmio64Base
gArmTokenSpaceGuid.PcdPciMmio64Size
- gArmTokenSpaceGuid.PcdPciMmio64Translation
+ gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation
--
2.17.1


[edk2-platforms][PATCH V3 7/9] Silicon/SabaQemu: Use PcdPciMmio(32)64Translation PCD from MdePkg

Abner Chang
 

Compliant with BZ: #3665
https://bugzilla.tianocore.org/show_bug.cgi?id=3665

PcdPciMmio(32)64Translation PCD is relocated to MdePkg that leveraged
by both ARM and RISC-V arch. This patch uses the one from MdePkg
instead the one under ArmPkg.

Signed-off-by: Abner Chang <abner.chang@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Leif Lindholm <leif@...>
Cc: Graeme Gregory <graeme@...>
Cc: Radoslaw Biernacki <rad@...>
Cc: Daniel Schaefer <daniel.schaefer@...>
---
Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf | 4 ++--
.../SbsaQemuPciHostBridgeLib/SbsaQemuPciHostBridgeLib.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf b/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf
index 0ad9cc7ce4..176d8fab83 100644
--- a/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf
+++ b/Silicon/Qemu/SbsaQemu/AcpiTables/AcpiTables.inf
@@ -56,12 +56,12 @@

gArmTokenSpaceGuid.PcdPciMmio32Base
gArmTokenSpaceGuid.PcdPciMmio32Size
- gArmTokenSpaceGuid.PcdPciMmio32Translation
+ gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciMmio32Limit

gArmTokenSpaceGuid.PcdPciMmio64Base
gArmTokenSpaceGuid.PcdPciMmio64Size
- gArmTokenSpaceGuid.PcdPciMmio64Translation
+ gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciMmio64Limit

gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuPciHostBridgeLib/SbsaQemuPciHostBridgeLib.c b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuPciHostBridgeLib/SbsaQemuPciHostBridgeLib.c
index 5021b096f7..9739c7500d 100644
--- a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuPciHostBridgeLib/SbsaQemuPciHostBridgeLib.c
+++ b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuPciHostBridgeLib/SbsaQemuPciHostBridgeLib.c
@@ -96,7 +96,7 @@ STATIC PCI_ROOT_BRIDGE mRootBridge = {

/* PCI_ROOT_BRIDGE_APERTURE Mem; MMIO aperture below 4GB which can be used by
the root bridge
- (gArmTokenSpaceGuid.PcdPciMmio32Translation as 0x0) */
+ (gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation as 0x0) */
{
FixedPcdGet32 (PcdPciMmio32Base),
FixedPcdGet32 (PcdPciMmio32Base) + FixedPcdGet32 (PcdPciMmio32Size) - 1,
@@ -104,7 +104,7 @@ STATIC PCI_ROOT_BRIDGE mRootBridge = {

/* PCI_ROOT_BRIDGE_APERTURE MemAbove4G; MMIO aperture above 4GB which can be
used by the root bridge.
- (gArmTokenSpaceGuid.PcdPciMmio64Translation as 0x0) */
+ (gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation as 0x0) */
{
FixedPcdGet64 (PcdPciMmio64Base),
FixedPcdGet64 (PcdPciMmio64Base) + FixedPcdGet64 (PcdPciMmio64Size) - 1
--
2.17.1


[edk2-platforms][PATCH V3 6/9] Platform/SabaQemu: Use PcdPciMmio(32)64Translation PCD from MdePkg

Abner Chang
 

Compliant with BZ: #3665
https://bugzilla.tianocore.org/show_bug.cgi?id=3665

PcdPciMmio(32)64Translation PCD is relocated to MdePkg that leveraged
by both ARM and RISC-V arch. This patch uses the one from MdePkg
instead the one under ArmPkg.

Signed-off-by: Abner Chang <abner.chang@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Leif Lindholm <leif@...>
Cc: Graeme Gregory <graeme@...>
Cc: Radoslaw Biernacki <rad@...>
Cc: Daniel Schaefer <daniel.schaefer@...>
---
Platform/Qemu/SbsaQemu/SbsaQemu.dsc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
index d404e08a67..1d1a25196e 100644
--- a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
+++ b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc
@@ -487,8 +487,8 @@ DEFINE NETWORK_HTTP_BOOT_ENABLE = FALSE
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdPciExpressBarLimit|0xFFFFFFFF

gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x7fff0000
- gArmTokenSpaceGuid.PcdPciMmio32Translation|0x0
- gArmTokenSpaceGuid.PcdPciMmio64Translation|0x0
+ gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation|0x0
+ gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation|0x0
## If TRUE, OvmfPkg/AcpiPlatformDxe will not wait for PCI
# enumeration to complete before installing ACPI tables.
gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE
--
2.17.1


[edk2-platforms][PATCH V3 3/9] Platform/Overdrive1000Board: Use PcdPciMmio(32)64Translation PCD from MdePkg

Abner Chang
 

Compliant with BZ: #3665
https://bugzilla.tianocore.org/show_bug.cgi?id=3665

PcdPciMmio(32)64Translation PCD is relocated to MdePkg that leveraged
by both ARM and RISC-V arch. This patch uses the one from MdePkg
instead the one under ArmPkg.

Signed-off-by: Abner Chang <abner.chang@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Leif Lindholm <leif@...>
Cc: Daniel Schaefer <daniel.schaefer@...>
---
Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc b/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
index 0f61665cbb..57b9e9f381 100644
--- a/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
+++ b/Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc
@@ -392,11 +392,11 @@ DEFINE NUM_CORES = 4

gArmTokenSpaceGuid.PcdPciMmio32Base|0x40000000
gArmTokenSpaceGuid.PcdPciMmio32Size|0x80000000
- gArmTokenSpaceGuid.PcdPciMmio32Translation|0x0
+ gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation|0x0

gArmTokenSpaceGuid.PcdPciMmio64Base|0x100000000
gArmTokenSpaceGuid.PcdPciMmio64Size|0x7F00000000
- gArmTokenSpaceGuid.PcdPciMmio64Translation|0x0
+ gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation|0x0

## Use PCI emulation for ATA PassThru
# gEfiMdeModulePkgTokenSpaceGuid.PcdAtaPassThruPciEmulation|TRUE
--
2.17.1

10161 - 10180 of 92219