Date   

[PATCH v8 04/32] OvmfPkg/ResetVector: introduce metadata descriptor for VMM use

Brijesh Singh
 

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

The OvmfPkgX86 build reserves memory regions in MEMFD. The memory regions
get accessed in the SEC phase. Both Intel TDX and AMD SEV-SNP require
that the guest's private memory be accepted or validated before access.

Introduce a Guided metadata structure that describes the reserved memory
regions. The VMM can locate the metadata structure by iterating through
the reset vector guid and process the areas based on the platform
specific requirements.

Min Xu introduced the metadata structure conceptin the TDX patch
series [1].

[1] https://www.mail-archive.com/devel@edk2.groups.io/msg33605.html

Cc: Michael Roth <michael.roth@...>
Cc: James Bottomley <jejb@...>
Cc: Min Xu <min.m.xu@...>
Cc: Jiewen Yao <jiewen.yao@...>
Cc: Tom Lendacky <thomas.lendacky@...>
Cc: Jordan Justen <jordan.l.justen@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Erdem Aktas <erdemaktas@...>
Cc: Gerd Hoffmann <kraxel@...>
Suggested-by: Gerd Hoffmann <kraxel@...>
Signed-off-by: Brijesh Singh <brijesh.singh@...>
---
OvmfPkg/ResetVector/Ia16/ResetVectorVtf0.asm | 17 ++++++++
OvmfPkg/ResetVector/ResetVector.nasmb | 1 +
OvmfPkg/ResetVector/X64/OvmfMetadata.asm | 45 ++++++++++++++++++++
3 files changed, 63 insertions(+)
create mode 100644 OvmfPkg/ResetVector/X64/OvmfMetadata.asm

diff --git a/OvmfPkg/ResetVector/Ia16/ResetVectorVtf0.asm b/OvmfPkg/ResetVector/Ia16/ResetVectorVtf0.asm
index 7ec3c6e980c3..f0e509d0672e 100644
--- a/OvmfPkg/ResetVector/Ia16/ResetVectorVtf0.asm
+++ b/OvmfPkg/ResetVector/Ia16/ResetVectorVtf0.asm
@@ -47,6 +47,23 @@ TIMES (15 - ((guidedStructureEnd - guidedStructureStart + 15) % 16)) DB 0
;
guidedStructureStart:

+%ifdef ARCH_X64
+;
+; OVMF metadata descriptor for the TDX and SEV-SNP
+;
+; Provide the start offset of the metadata blob within the OVMF binary.
+
+; GUID : e47a6535-984a-4798-865e-4685a7bf8ec2
+;
+OvmfMetadataOffsetStart:
+ DD (fourGigabytes - OvmfMetadataGuid - 16)
+ DW OvmfMetadataOffsetEnd - OvmfMetadataOffsetStart
+ DB 0x35, 0x65, 0x7a, 0xe4, 0x4a, 0x98, 0x98, 0x47
+ DB 0x86, 0x5e, 0x46, 0x85, 0xa7, 0xbf, 0x8e, 0xc2
+OvmfMetadataOffsetEnd:
+
+%endif
+
; SEV Hash Table Block
;
; This describes the guest ram area where the hypervisor should
diff --git a/OvmfPkg/ResetVector/ResetVector.nasmb b/OvmfPkg/ResetVector/ResetVector.nasmb
index d1d800c56745..bc61b1d05a24 100644
--- a/OvmfPkg/ResetVector/ResetVector.nasmb
+++ b/OvmfPkg/ResetVector/ResetVector.nasmb
@@ -80,6 +80,7 @@
%include "Ia32/Flat32ToFlat64.asm"
%include "Ia32/AmdSev.asm"
%include "Ia32/PageTables64.asm"
+%include "X64/OvmfMetadata.asm"
%endif

%include "Ia16/Real16ToFlat32.asm"
diff --git a/OvmfPkg/ResetVector/X64/OvmfMetadata.asm b/OvmfPkg/ResetVector/X64/OvmfMetadata.asm
new file mode 100644
index 000000000000..a1260a1ed029
--- /dev/null
+++ b/OvmfPkg/ResetVector/X64/OvmfMetadata.asm
@@ -0,0 +1,45 @@
+;-----------------------------------------------------------------------------
+; @file
+; OVMF metadata for the confidential computing guests (TDX and SEV-SNP)
+;
+; Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+; Copyright (c) 2021, AMD Inc. All rights reserved.<BR>
+;
+; SPDX-License-Identifier: BSD-2-Clause-Patent
+;-----------------------------------------------------------------------------
+
+BITS 64
+
+%define OVMF_METADATA_VERSION 1
+
+%define OVMF_SECTION_TYPE_UNDEFINED 0
+
+;The section contains the code
+%define OVMF_SECTION_TYPE_CODE 0x100
+
+; The section contains the varaibles
+%define OVMF_SECTION_TYPE_VARS 0x101
+
+; The section must be accepted or validated by the VMM before the boot
+%define OVMF_SECTION_TYPE_SEC_MEM 0x102
+
+ALIGN 16
+
+TIMES (15 - ((OvmfGuidedStructureEnd - OvmfGuidedStructureStart + 15) % 16)) DB 0
+
+OvmfGuidedStructureStart:
+;
+; Ovmf metadata descriptor
+;
+OvmfMetadataGuid:
+ DB 0xf3, 0xf9, 0xea, 0xe9, 0x8e, 0x16, 0xd5, 0x44
+ DB 0xa8, 0xeb, 0x7f, 0x4d, 0x87, 0x38, 0xf6, 0xae
+
+_Descriptor:
+ DB 'O','V','M','F' ; Signature
+ DD OvmfGuidedStructureEnd - _Descriptor ; Length
+ DD OVMF_METADATA_VERSION ; Version
+ DD (OvmfGuidedStructureEnd - _Descriptor - 16) / 12 ; Number of sections
+
+OvmfGuidedStructureEnd:
+ ALIGN 16
--
2.25.1


[PATCH v8 03/32] OvmfPkg/ResetVector: move clearing GHCB in SecMain

Brijesh Singh
 

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

In preparation for SEV-SNP support move clearing of the GHCB memory from
the ResetVector/AmdSev.asm to SecMain/AmdSev.c. The GHCB page is not
accessed until SevEsProtocolCheck() switch to full GHCB. So, the move
does not make any changes in the code flow or logic. The move will
simplify the SEV-SNP support.

Cc: Michael Roth <michael.roth@...>
Cc: James Bottomley <jejb@...>
Cc: Min Xu <min.m.xu@...>
Cc: Jiewen Yao <jiewen.yao@...>
Cc: Tom Lendacky <thomas.lendacky@...>
Cc: Jordan Justen <jordan.l.justen@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Erdem Aktas <erdemaktas@...>
Cc: Gerd Hoffmann <kraxel@...>
Signed-off-by: Brijesh Singh <brijesh.singh@...>
---
OvmfPkg/Sec/AmdSev.c | 2 +-
OvmfPkg/ResetVector/Ia32/AmdSev.asm | 6 ------
2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/OvmfPkg/Sec/AmdSev.c b/OvmfPkg/Sec/AmdSev.c
index 3b4adaae32c7..7f74e8bfe88e 100644
--- a/OvmfPkg/Sec/AmdSev.c
+++ b/OvmfPkg/Sec/AmdSev.c
@@ -95,7 +95,7 @@ SevEsProtocolCheck (
AsmWriteMsr64 (MSR_SEV_ES_GHCB, Msr.GhcbPhysicalAddress);

Ghcb = Msr.Ghcb;
- SetMem (Ghcb, sizeof (*Ghcb), 0);
+ SetMem (Ghcb, FixedPcdGet32 (PcdOvmfSecGhcbSize), 0);

//
// Set the version to the maximum that can be supported
diff --git a/OvmfPkg/ResetVector/Ia32/AmdSev.asm b/OvmfPkg/ResetVector/Ia32/AmdSev.asm
index 250ac8d8b180..48d9178168b0 100644
--- a/OvmfPkg/ResetVector/Ia32/AmdSev.asm
+++ b/OvmfPkg/ResetVector/Ia32/AmdSev.asm
@@ -177,12 +177,6 @@ pageTableEntries4kLoop:
mov ecx, (GHCB_BASE & 0x1F_FFFF) >> 12
mov [ecx * 8 + GHCB_PT_ADDR + 4], strict dword 0

- mov ecx, GHCB_SIZE / 4
- xor eax, eax
-clearGhcbMemoryLoop:
- mov dword[ecx * 4 + GHCB_BASE - 4], eax
- loop clearGhcbMemoryLoop
-
SevClearPageEncMaskForGhcbPageExit:
OneTimeCallRet SevClearPageEncMaskForGhcbPage

--
2.25.1


[PATCH v8 02/32] UefiCpuPkg/MpInitLib: move SEV specific routines in AmdSev.c

Brijesh Singh
 

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

Move all the SEV specific function in AmdSev.c.

No functional change intended.

Cc: Eric Dong <eric.dong@...>
Cc: Ray Ni <ray.ni@...>
Cc: Rahul Kumar <rahul1.kumar@...>
Cc: Michael Roth <michael.roth@...>
Cc: James Bottomley <jejb@...>
Cc: Min Xu <min.m.xu@...>
Cc: Jiewen Yao <jiewen.yao@...>
Cc: Tom Lendacky <thomas.lendacky@...>
Cc: Jordan Justen <jordan.l.justen@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Erdem Aktas <erdemaktas@...>
Cc: Gerd Hoffmann <kraxel@...>
Suggested-by: Jiewen Yao <Jiewen.yao@...>
Signed-off-by: Brijesh Singh <brijesh.singh@...>
---
UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 1 +
UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf | 1 +
UefiCpuPkg/Library/MpInitLib/MpLib.h | 33 +++
UefiCpuPkg/Library/MpInitLib/AmdSev.c | 239 ++++++++++++++++++
UefiCpuPkg/Library/MpInitLib/MpLib.c | 218 +---------------
UefiCpuPkg/Library/MpInitLib/X64/AmdSev.nasm | 119 +++++++++
UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 100 ++------
7 files changed, 413 insertions(+), 298 deletions(-)
create mode 100644 UefiCpuPkg/Library/MpInitLib/AmdSev.c
create mode 100644 UefiCpuPkg/Library/MpInitLib/X64/AmdSev.nasm

diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
index d34419c2a524..6e510aa89120 100644
--- a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
+++ b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
@@ -28,6 +28,7 @@ [Sources.X64]
X64/MpFuncs.nasm

[Sources.common]
+ AmdSev.c
MpEqu.inc
DxeMpLib.c
MpLib.c
diff --git a/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf b/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf
index 36fcb96b5852..2cbd9b8b8acc 100644
--- a/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf
+++ b/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf
@@ -28,6 +28,7 @@ [Sources.X64]
X64/MpFuncs.nasm

[Sources.common]
+ AmdSev.c
MpEqu.inc
PeiMpLib.c
MpLib.c
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.h b/UefiCpuPkg/Library/MpInitLib/MpLib.h
index e88a5355c983..3d4446df8ce6 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.h
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.h
@@ -34,6 +34,9 @@
#include <Library/PcdLib.h>
#include <Library/MicrocodeLib.h>

+#include <Register/Amd/Fam17Msr.h>
+#include <Register/Amd/Ghcb.h>
+
#include <Guid/MicrocodePatchHob.h>

#define WAKEUP_AP_SIGNAL SIGNATURE_32 ('S', 'T', 'A', 'P')
@@ -741,5 +744,35 @@ PlatformShadowMicrocode (
IN OUT CPU_MP_DATA *CpuMpData
);

+/**
+ Allocate the SEV-ES AP jump table buffer.
+
+ @param[in, out] CpuMpData The pointer to CPU MP Data structure.
+**/
+VOID
+AllocateSevEsAPMemory (
+ IN OUT CPU_MP_DATA *CpuMpData
+ );
+
+/**
+ Program the SEV-ES AP jump table buffer.
+
+ @param[in] SipiVector The SIPI vector used for the AP Reset
+**/
+VOID
+SetSevEsJumpTable (
+ IN UINTN SipiVector
+ );
+
+/**
+ The function puts the AP in halt loop.
+
+ @param[in] CpuMpData The pointer to CPU MP Data structure.
+**/
+VOID
+SevEsPlaceApHlt (
+ CPU_MP_DATA *CpuMpData
+ );
+
#endif

diff --git a/UefiCpuPkg/Library/MpInitLib/AmdSev.c b/UefiCpuPkg/Library/MpInitLib/AmdSev.c
new file mode 100644
index 000000000000..7dbf117c2b71
--- /dev/null
+++ b/UefiCpuPkg/Library/MpInitLib/AmdSev.c
@@ -0,0 +1,239 @@
+/** @file
+ CPU MP Initialize helper function for AMD SEV.
+
+ Copyright (c) 2021, AMD Inc. All rights reserved.<BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include "MpLib.h"
+#include <Library/VmgExitLib.h>
+
+/**
+ Get Protected mode code segment with 16-bit default addressing
+ from current GDT table.
+
+ @return Protected mode 16-bit code segment value.
+**/
+STATIC
+UINT16
+GetProtectedMode16CS (
+ VOID
+ )
+{
+ IA32_DESCRIPTOR GdtrDesc;
+ IA32_SEGMENT_DESCRIPTOR *GdtEntry;
+ UINTN GdtEntryCount;
+ UINT16 Index;
+
+ Index = (UINT16) -1;
+ AsmReadGdtr (&GdtrDesc);
+ GdtEntryCount = (GdtrDesc.Limit + 1) / sizeof (IA32_SEGMENT_DESCRIPTOR);
+ GdtEntry = (IA32_SEGMENT_DESCRIPTOR *) GdtrDesc.Base;
+ for (Index = 0; Index < GdtEntryCount; Index++) {
+ if (GdtEntry->Bits.L == 0 &&
+ GdtEntry->Bits.DB == 0 &&
+ GdtEntry->Bits.Type > 8) {
+ break;
+ }
+ GdtEntry++;
+ }
+ ASSERT (Index != GdtEntryCount);
+ return Index * 8;
+}
+
+/**
+ Get Protected mode code segment with 32-bit default addressing
+ from current GDT table.
+
+ @return Protected mode 32-bit code segment value.
+**/
+STATIC
+UINT16
+GetProtectedMode32CS (
+ VOID
+ )
+{
+ IA32_DESCRIPTOR GdtrDesc;
+ IA32_SEGMENT_DESCRIPTOR *GdtEntry;
+ UINTN GdtEntryCount;
+ UINT16 Index;
+
+ Index = (UINT16) -1;
+ AsmReadGdtr (&GdtrDesc);
+ GdtEntryCount = (GdtrDesc.Limit + 1) / sizeof (IA32_SEGMENT_DESCRIPTOR);
+ GdtEntry = (IA32_SEGMENT_DESCRIPTOR *) GdtrDesc.Base;
+ for (Index = 0; Index < GdtEntryCount; Index++) {
+ if (GdtEntry->Bits.L == 0 &&
+ GdtEntry->Bits.DB == 1 &&
+ GdtEntry->Bits.Type > 8) {
+ break;
+ }
+ GdtEntry++;
+ }
+ ASSERT (Index != GdtEntryCount);
+ return Index * 8;
+}
+
+/**
+ Reset an AP when in SEV-ES mode.
+
+ If successful, this function never returns.
+
+ @param[in] Ghcb Pointer to the GHCB
+ @param[in] CpuMpData Pointer to CPU MP Data
+
+**/
+VOID
+MpInitLibSevEsAPReset (
+ IN GHCB *Ghcb,
+ IN CPU_MP_DATA *CpuMpData
+ )
+{
+ EFI_STATUS Status;
+ UINTN ProcessorNumber;
+ UINT16 Code16, Code32;
+ AP_RESET *APResetFn;
+ UINTN BufferStart;
+ UINTN StackStart;
+
+ Status = GetProcessorNumber (CpuMpData, &ProcessorNumber);
+ ASSERT_EFI_ERROR (Status);
+
+ Code16 = GetProtectedMode16CS ();
+ Code32 = GetProtectedMode32CS ();
+
+ if (CpuMpData->WakeupBufferHigh != 0) {
+ APResetFn = (AP_RESET *) (CpuMpData->WakeupBufferHigh + CpuMpData->AddressMap.SwitchToRealNoNxOffset);
+ } else {
+ APResetFn = (AP_RESET *) (CpuMpData->MpCpuExchangeInfo->BufferStart + CpuMpData->AddressMap.SwitchToRealOffset);
+ }
+
+ BufferStart = CpuMpData->MpCpuExchangeInfo->BufferStart;
+ StackStart = CpuMpData->SevEsAPResetStackStart -
+ (AP_RESET_STACK_SIZE * ProcessorNumber);
+
+ //
+ // This call never returns.
+ //
+ APResetFn (BufferStart, Code16, Code32, StackStart);
+}
+
+/**
+ Allocate the SEV-ES AP jump table buffer.
+
+ @param[in, out] CpuMpData The pointer to CPU MP Data structure.
+**/
+VOID
+AllocateSevEsAPMemory (
+ IN OUT CPU_MP_DATA *CpuMpData
+ )
+{
+ if (CpuMpData->SevEsAPBuffer == (UINTN) -1) {
+ CpuMpData->SevEsAPBuffer =
+ CpuMpData->SevEsIsEnabled ? GetSevEsAPMemory () : 0;
+ }
+}
+
+/**
+ Program the SEV-ES AP jump table buffer.
+
+ @param[in] SipiVector The SIPI vector used for the AP Reset
+**/
+VOID
+SetSevEsJumpTable (
+ IN UINTN SipiVector
+ )
+{
+ SEV_ES_AP_JMP_FAR *JmpFar;
+ UINT32 Offset, InsnByte;
+ UINT8 LoNib, HiNib;
+
+ JmpFar = (SEV_ES_AP_JMP_FAR *) (UINTN) FixedPcdGet32 (PcdSevEsWorkAreaBase);
+ ASSERT (JmpFar != NULL);
+
+ //
+ // Obtain the address of the Segment/Rip location in the workarea.
+ // This will be set to a value derived from the SIPI vector and will
+ // be the memory address used for the far jump below.
+ //
+ Offset = FixedPcdGet32 (PcdSevEsWorkAreaBase);
+ Offset += sizeof (JmpFar->InsnBuffer);
+ LoNib = (UINT8) Offset;
+ HiNib = (UINT8) (Offset >> 8);
+
+ //
+ // Program the workarea (which is the initial AP boot address) with
+ // far jump to the SIPI vector (where XX and YY represent the
+ // address of where the SIPI vector is stored.
+ //
+ // JMP FAR [CS:XXYY] => 2E FF 2E YY XX
+ //
+ InsnByte = 0;
+ JmpFar->InsnBuffer[InsnByte++] = 0x2E; // CS override prefix
+ JmpFar->InsnBuffer[InsnByte++] = 0xFF; // JMP (FAR)
+ JmpFar->InsnBuffer[InsnByte++] = 0x2E; // ModRM (JMP memory location)
+ JmpFar->InsnBuffer[InsnByte++] = LoNib; // YY offset ...
+ JmpFar->InsnBuffer[InsnByte++] = HiNib; // XX offset ...
+
+ //
+ // Program the Segment/Rip based on the SIPI vector (always at least
+ // 16-byte aligned, so Rip is set to 0).
+ //
+ JmpFar->Rip = 0;
+ JmpFar->Segment = (UINT16) (SipiVector >> 4);
+}
+
+/**
+ The function puts the AP in halt loop.
+
+ @param[in] CpuMpData The pointer to CPU MP Data structure.
+**/
+VOID
+SevEsPlaceApHlt (
+ CPU_MP_DATA *CpuMpData
+ )
+{
+ MSR_SEV_ES_GHCB_REGISTER Msr;
+ GHCB *Ghcb;
+ UINT64 Status;
+ BOOLEAN DoDecrement;
+ BOOLEAN InterruptState;
+
+ DoDecrement = (BOOLEAN) (CpuMpData->InitFlag == ApInitConfig);
+
+ while (TRUE) {
+ Msr.GhcbPhysicalAddress = AsmReadMsr64 (MSR_SEV_ES_GHCB);
+ Ghcb = Msr.Ghcb;
+
+ VmgInit (Ghcb, &InterruptState);
+
+ if (DoDecrement) {
+ DoDecrement = FALSE;
+
+ //
+ // Perform the delayed decrement just before issuing the first
+ // VMGEXIT with AP_RESET_HOLD.
+ //
+ InterlockedDecrement ((UINT32 *) &CpuMpData->MpCpuExchangeInfo->NumApsExecuting);
+ }
+
+ Status = VmgExit (Ghcb, SVM_EXIT_AP_RESET_HOLD, 0, 0);
+ if ((Status == 0) && (Ghcb->SaveArea.SwExitInfo2 != 0)) {
+ VmgDone (Ghcb, InterruptState);
+ break;
+ }
+
+ VmgDone (Ghcb, InterruptState);
+ }
+
+ //
+ // Awakened in a new phase? Use the new CpuMpData
+ //
+ if (CpuMpData->NewCpuMpData != NULL) {
+ CpuMpData = CpuMpData->NewCpuMpData;
+ }
+
+ MpInitLibSevEsAPReset (Ghcb, CpuMpData);
+}
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
index b9a06747edbf..890945bc5994 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -596,117 +596,6 @@ InitializeApData (
SetApState (&CpuMpData->CpuData[ProcessorNumber], CpuStateIdle);
}

-/**
- Get Protected mode code segment with 16-bit default addressing
- from current GDT table.
-
- @return Protected mode 16-bit code segment value.
-**/
-STATIC
-UINT16
-GetProtectedMode16CS (
- VOID
- )
-{
- IA32_DESCRIPTOR GdtrDesc;
- IA32_SEGMENT_DESCRIPTOR *GdtEntry;
- UINTN GdtEntryCount;
- UINT16 Index;
-
- Index = (UINT16) -1;
- AsmReadGdtr (&GdtrDesc);
- GdtEntryCount = (GdtrDesc.Limit + 1) / sizeof (IA32_SEGMENT_DESCRIPTOR);
- GdtEntry = (IA32_SEGMENT_DESCRIPTOR *) GdtrDesc.Base;
- for (Index = 0; Index < GdtEntryCount; Index++) {
- if (GdtEntry->Bits.L == 0 &&
- GdtEntry->Bits.DB == 0 &&
- GdtEntry->Bits.Type > 8) {
- break;
- }
- GdtEntry++;
- }
- ASSERT (Index != GdtEntryCount);
- return Index * 8;
-}
-
-/**
- Get Protected mode code segment with 32-bit default addressing
- from current GDT table.
-
- @return Protected mode 32-bit code segment value.
-**/
-STATIC
-UINT16
-GetProtectedMode32CS (
- VOID
- )
-{
- IA32_DESCRIPTOR GdtrDesc;
- IA32_SEGMENT_DESCRIPTOR *GdtEntry;
- UINTN GdtEntryCount;
- UINT16 Index;
-
- Index = (UINT16) -1;
- AsmReadGdtr (&GdtrDesc);
- GdtEntryCount = (GdtrDesc.Limit + 1) / sizeof (IA32_SEGMENT_DESCRIPTOR);
- GdtEntry = (IA32_SEGMENT_DESCRIPTOR *) GdtrDesc.Base;
- for (Index = 0; Index < GdtEntryCount; Index++) {
- if (GdtEntry->Bits.L == 0 &&
- GdtEntry->Bits.DB == 1 &&
- GdtEntry->Bits.Type > 8) {
- break;
- }
- GdtEntry++;
- }
- ASSERT (Index != GdtEntryCount);
- return Index * 8;
-}
-
-/**
- Reset an AP when in SEV-ES mode.
-
- If successful, this function never returns.
-
- @param[in] Ghcb Pointer to the GHCB
- @param[in] CpuMpData Pointer to CPU MP Data
-
-**/
-STATIC
-VOID
-MpInitLibSevEsAPReset (
- IN GHCB *Ghcb,
- IN CPU_MP_DATA *CpuMpData
- )
-{
- EFI_STATUS Status;
- UINTN ProcessorNumber;
- UINT16 Code16, Code32;
- AP_RESET *APResetFn;
- UINTN BufferStart;
- UINTN StackStart;
-
- Status = GetProcessorNumber (CpuMpData, &ProcessorNumber);
- ASSERT_EFI_ERROR (Status);
-
- Code16 = GetProtectedMode16CS ();
- Code32 = GetProtectedMode32CS ();
-
- if (CpuMpData->WakeupBufferHigh != 0) {
- APResetFn = (AP_RESET *) (CpuMpData->WakeupBufferHigh + CpuMpData->AddressMap.SwitchToRealNoNxOffset);
- } else {
- APResetFn = (AP_RESET *) (CpuMpData->MpCpuExchangeInfo->BufferStart + CpuMpData->AddressMap.SwitchToRealOffset);
- }
-
- BufferStart = CpuMpData->MpCpuExchangeInfo->BufferStart;
- StackStart = CpuMpData->SevEsAPResetStackStart -
- (AP_RESET_STACK_SIZE * ProcessorNumber);
-
- //
- // This call never returns.
- //
- APResetFn (BufferStart, Code16, Code32, StackStart);
-}
-
/**
This function will be called from AP reset code if BSP uses WakeUpAP.

@@ -884,47 +773,7 @@ ApWakeupFunction (
while (TRUE) {
DisableInterrupts ();
if (CpuMpData->SevEsIsEnabled) {
- MSR_SEV_ES_GHCB_REGISTER Msr;
- GHCB *Ghcb;
- UINT64 Status;
- BOOLEAN DoDecrement;
- BOOLEAN InterruptState;
-
- DoDecrement = (BOOLEAN) (CpuMpData->InitFlag == ApInitConfig);
-
- while (TRUE) {
- Msr.GhcbPhysicalAddress = AsmReadMsr64 (MSR_SEV_ES_GHCB);
- Ghcb = Msr.Ghcb;
-
- VmgInit (Ghcb, &InterruptState);
-
- if (DoDecrement) {
- DoDecrement = FALSE;
-
- //
- // Perform the delayed decrement just before issuing the first
- // VMGEXIT with AP_RESET_HOLD.
- //
- InterlockedDecrement ((UINT32 *) &CpuMpData->MpCpuExchangeInfo->NumApsExecuting);
- }
-
- Status = VmgExit (Ghcb, SVM_EXIT_AP_RESET_HOLD, 0, 0);
- if ((Status == 0) && (Ghcb->SaveArea.SwExitInfo2 != 0)) {
- VmgDone (Ghcb, InterruptState);
- break;
- }
-
- VmgDone (Ghcb, InterruptState);
- }
-
- //
- // Awakened in a new phase? Use the new CpuMpData
- //
- if (CpuMpData->NewCpuMpData != NULL) {
- CpuMpData = CpuMpData->NewCpuMpData;
- }
-
- MpInitLibSevEsAPReset (Ghcb, CpuMpData);
+ SevEsPlaceApHlt (CpuMpData);
} else {
CpuSleep ();
}
@@ -1252,71 +1101,6 @@ FreeResetVector (
}
}

-/**
- Allocate the SEV-ES AP jump table buffer.
-
- @param[in, out] CpuMpData The pointer to CPU MP Data structure.
-**/
-VOID
-AllocateSevEsAPMemory (
- IN OUT CPU_MP_DATA *CpuMpData
- )
-{
- if (CpuMpData->SevEsAPBuffer == (UINTN) -1) {
- CpuMpData->SevEsAPBuffer =
- CpuMpData->SevEsIsEnabled ? GetSevEsAPMemory () : 0;
- }
-}
-
-/**
- Program the SEV-ES AP jump table buffer.
-
- @param[in] SipiVector The SIPI vector used for the AP Reset
-**/
-VOID
-SetSevEsJumpTable (
- IN UINTN SipiVector
- )
-{
- SEV_ES_AP_JMP_FAR *JmpFar;
- UINT32 Offset, InsnByte;
- UINT8 LoNib, HiNib;
-
- JmpFar = (SEV_ES_AP_JMP_FAR *) (UINTN) FixedPcdGet32 (PcdSevEsWorkAreaBase);
- ASSERT (JmpFar != NULL);
-
- //
- // Obtain the address of the Segment/Rip location in the workarea.
- // This will be set to a value derived from the SIPI vector and will
- // be the memory address used for the far jump below.
- //
- Offset = FixedPcdGet32 (PcdSevEsWorkAreaBase);
- Offset += sizeof (JmpFar->InsnBuffer);
- LoNib = (UINT8) Offset;
- HiNib = (UINT8) (Offset >> 8);
-
- //
- // Program the workarea (which is the initial AP boot address) with
- // far jump to the SIPI vector (where XX and YY represent the
- // address of where the SIPI vector is stored.
- //
- // JMP FAR [CS:XXYY] => 2E FF 2E YY XX
- //
- InsnByte = 0;
- JmpFar->InsnBuffer[InsnByte++] = 0x2E; // CS override prefix
- JmpFar->InsnBuffer[InsnByte++] = 0xFF; // JMP (FAR)
- JmpFar->InsnBuffer[InsnByte++] = 0x2E; // ModRM (JMP memory location)
- JmpFar->InsnBuffer[InsnByte++] = LoNib; // YY offset ...
- JmpFar->InsnBuffer[InsnByte++] = HiNib; // XX offset ...
-
- //
- // Program the Segment/Rip based on the SIPI vector (always at least
- // 16-byte aligned, so Rip is set to 0).
- //
- JmpFar->Rip = 0;
- JmpFar->Segment = (UINT16) (SipiVector >> 4);
-}
-
/**
This function will be called by BSP to wakeup AP.

diff --git a/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.nasm b/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.nasm
new file mode 100644
index 000000000000..0ccafe25eca4
--- /dev/null
+++ b/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.nasm
@@ -0,0 +1,119 @@
+;------------------------------------------------------------------------------ ;
+; Copyright (c) 2021, AMD Inc. All rights reserved.<BR>
+; SPDX-License-Identifier: BSD-2-Clause-Patent
+;
+; Module Name:
+;
+; AmdSev.nasm
+;
+; Abstract:
+;
+; This provides helper used by the MpFunc.nasm. If AMD SEV-ES is active
+; then helpers perform the additional setups (such as GHCB).
+;
+;-------------------------------------------------------------------------------
+
+%define SIZE_4KB 0x1000
+
+;
+; The function checks whether SEV-ES is enabled, if enabled
+; then setup the GHCB page.
+;
+SevEsSetupGhcb:
+ lea edi, [esi + MP_CPU_EXCHANGE_INFO_FIELD (SevEsIsEnabled)]
+ cmp byte [edi], 1 ; SevEsIsEnabled
+ jne SevEsSetupGhcbExit
+
+ ;
+ ; program GHCB
+ ; Each page after the GHCB is a per-CPU page, so the calculation programs
+ ; a GHCB to be every 8KB.
+ ;
+ mov eax, SIZE_4KB
+ shl eax, 1 ; EAX = SIZE_4K * 2
+ mov ecx, ebx
+ mul ecx ; EAX = SIZE_4K * 2 * CpuNumber
+ mov edi, esi
+ add edi, MP_CPU_EXCHANGE_INFO_FIELD (GhcbBase)
+ add rax, qword [edi]
+ mov rdx, rax
+ shr rdx, 32
+ mov rcx, 0xc0010130
+ wrmsr
+
+SevEsSetupGhcbExit:
+ OneTimeCallRet SevEsSetupGhcb
+
+;
+; The function checks whether SEV-ES is enabled, if enabled, use
+; the GHCB
+;
+SevEsGetApicId:
+ lea edi, [esi + MP_CPU_EXCHANGE_INFO_FIELD (SevEsIsEnabled)]
+ cmp byte [edi], 1 ; SevEsIsEnabled
+ jne SevEsGetApicIdExit
+
+ ;
+ ; Since we don't have a stack yet, we can't take a #VC
+ ; exception. Use the GHCB protocol to perform the CPUID
+ ; calls.
+ ;
+ mov rcx, 0xc0010130
+ rdmsr
+ shl rdx, 32
+ or rax, rdx
+ mov rdi, rax ; RDI now holds the original GHCB GPA
+
+ mov rdx, 0 ; CPUID function 0
+ mov rax, 0 ; RAX register requested
+ or rax, 4
+ wrmsr
+ rep vmmcall
+ rdmsr
+ cmp edx, 0bh
+ jb NoX2ApicSevEs ; CPUID level below CPUID_EXTENDED_TOPOLOGY
+
+ mov rdx, 0bh ; CPUID function 0x0b
+ mov rax, 040000000h ; RBX register requested
+ or rax, 4
+ wrmsr
+ rep vmmcall
+ rdmsr
+ test edx, 0ffffh
+ jz NoX2ApicSevEs ; CPUID.0BH:EBX[15:0] is zero
+
+ mov rdx, 0bh ; CPUID function 0x0b
+ mov rax, 0c0000000h ; RDX register requested
+ or rax, 4
+ wrmsr
+ rep vmmcall
+ rdmsr
+
+ ; Processor is x2APIC capable; 32-bit x2APIC ID is now in EDX
+ jmp RestoreGhcb
+
+NoX2ApicSevEs:
+ ; Processor is not x2APIC capable, so get 8-bit APIC ID
+ mov rdx, 1 ; CPUID function 1
+ mov rax, 040000000h ; RBX register requested
+ or rax, 4
+ wrmsr
+ rep vmmcall
+ rdmsr
+ shr edx, 24
+
+RestoreGhcb:
+ mov rbx, rdx ; Save x2APIC/APIC ID
+
+ mov rdx, rdi ; RDI holds the saved GHCB GPA
+ shr rdx, 32
+ mov eax, edi
+ wrmsr
+
+ mov rdx, rbx
+
+ ; x2APIC ID or APIC ID is in EDX
+ jmp GetProcessorNumber
+
+SevEsGetApicIdExit:
+ OneTimeCallRet SevEsGetApicId
diff --git a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm
index 50df802d1fca..f7f2937fafad 100644
--- a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm
+++ b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm
@@ -15,6 +15,15 @@
%include "MpEqu.inc"
extern ASM_PFX(InitializeFloatingPointUnits)

+%macro OneTimeCall 1
+ jmp %1
+%1 %+ OneTimerCallReturn:
+%endmacro
+
+%macro OneTimeCallRet 1
+ jmp %1 %+ OneTimerCallReturn
+%endmacro
+
DEFAULT REL

SECTION .text
@@ -144,6 +153,12 @@ SkipEnable5LevelPaging:
jmp far [edi]

BITS 64
+
+;
+; Required for the AMD SEV helper functions
+;
+%include "AmdSev.nasm"
+
LongModeStart:
mov esi, ebx
lea edi, [esi + MP_CPU_EXCHANGE_INFO_FIELD (InitFlag)]
@@ -175,94 +190,17 @@ LongModeStart:
add rax, qword [edi]
mov rsp, rax

- lea edi, [esi + MP_CPU_EXCHANGE_INFO_FIELD (SevEsIsEnabled)]
- cmp byte [edi], 1 ; SevEsIsEnabled
- jne CProcedureInvoke
-
;
- ; program GHCB
- ; Each page after the GHCB is a per-CPU page, so the calculation programs
- ; a GHCB to be every 8KB.
+ ; Setup the GHCB when AMD SEV-ES active.
;
- mov eax, SIZE_4KB
- shl eax, 1 ; EAX = SIZE_4K * 2
- mov ecx, ebx
- mul ecx ; EAX = SIZE_4K * 2 * CpuNumber
- mov edi, esi
- add edi, MP_CPU_EXCHANGE_INFO_FIELD (GhcbBase)
- add rax, qword [edi]
- mov rdx, rax
- shr rdx, 32
- mov rcx, 0xc0010130
- wrmsr
+ OneTimeCall SevEsSetupGhcb
jmp CProcedureInvoke

GetApicId:
- lea edi, [esi + MP_CPU_EXCHANGE_INFO_FIELD (SevEsIsEnabled)]
- cmp byte [edi], 1 ; SevEsIsEnabled
- jne DoCpuid
-
;
- ; Since we don't have a stack yet, we can't take a #VC
- ; exception. Use the GHCB protocol to perform the CPUID
- ; calls.
+ ; Use the GHCB protocol to get the ApicId when SEV-ES is active.
;
- mov rcx, 0xc0010130
- rdmsr
- shl rdx, 32
- or rax, rdx
- mov rdi, rax ; RDI now holds the original GHCB GPA
-
- mov rdx, 0 ; CPUID function 0
- mov rax, 0 ; RAX register requested
- or rax, 4
- wrmsr
- rep vmmcall
- rdmsr
- cmp edx, 0bh
- jb NoX2ApicSevEs ; CPUID level below CPUID_EXTENDED_TOPOLOGY
-
- mov rdx, 0bh ; CPUID function 0x0b
- mov rax, 040000000h ; RBX register requested
- or rax, 4
- wrmsr
- rep vmmcall
- rdmsr
- test edx, 0ffffh
- jz NoX2ApicSevEs ; CPUID.0BH:EBX[15:0] is zero
-
- mov rdx, 0bh ; CPUID function 0x0b
- mov rax, 0c0000000h ; RDX register requested
- or rax, 4
- wrmsr
- rep vmmcall
- rdmsr
-
- ; Processor is x2APIC capable; 32-bit x2APIC ID is now in EDX
- jmp RestoreGhcb
-
-NoX2ApicSevEs:
- ; Processor is not x2APIC capable, so get 8-bit APIC ID
- mov rdx, 1 ; CPUID function 1
- mov rax, 040000000h ; RBX register requested
- or rax, 4
- wrmsr
- rep vmmcall
- rdmsr
- shr edx, 24
-
-RestoreGhcb:
- mov rbx, rdx ; Save x2APIC/APIC ID
-
- mov rdx, rdi ; RDI holds the saved GHCB GPA
- shr rdx, 32
- mov eax, edi
- wrmsr
-
- mov rdx, rbx
-
- ; x2APIC ID or APIC ID is in EDX
- jmp GetProcessorNumber
+ OneTimeCall SevEsGetApicId

DoCpuid:
mov eax, 0
--
2.25.1


[PATCH v8 01/32] OvmfPkg/SecMain: move SEV specific routines in AmdSev.c

Brijesh Singh
 

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

Move all the SEV specific function in AmdSev.c.

No functional change intended.

Cc: Michael Roth <michael.roth@...>
Cc: James Bottomley <jejb@...>
Cc: Min Xu <min.m.xu@...>
Cc: Jiewen Yao <jiewen.yao@...>
Cc: Tom Lendacky <thomas.lendacky@...>
Cc: Jordan Justen <jordan.l.justen@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Erdem Aktas <erdemaktas@...>
Cc: Gerd Hoffmann <kraxel@...>
Acked-by: Jiewen Yao <Jiewen.yao@...>
Signed-off-by: Brijesh Singh <brijesh.singh@...>
---
OvmfPkg/Sec/SecMain.inf | 1 +
OvmfPkg/Sec/AmdSev.h | 72 ++++++++++++++++++
OvmfPkg/Sec/AmdSev.c | 161 ++++++++++++++++++++++++++++++++++++++++
OvmfPkg/Sec/SecMain.c | 153 +-------------------------------------
4 files changed, 236 insertions(+), 151 deletions(-)
create mode 100644 OvmfPkg/Sec/AmdSev.h
create mode 100644 OvmfPkg/Sec/AmdSev.c

diff --git a/OvmfPkg/Sec/SecMain.inf b/OvmfPkg/Sec/SecMain.inf
index ea4b9611f52d..9523a8ea6c8f 100644
--- a/OvmfPkg/Sec/SecMain.inf
+++ b/OvmfPkg/Sec/SecMain.inf
@@ -23,6 +23,7 @@ [Defines]

[Sources]
SecMain.c
+ AmdSev.c

[Sources.IA32]
Ia32/SecEntry.nasm
diff --git a/OvmfPkg/Sec/AmdSev.h b/OvmfPkg/Sec/AmdSev.h
new file mode 100644
index 000000000000..adad96d23189
--- /dev/null
+++ b/OvmfPkg/Sec/AmdSev.h
@@ -0,0 +1,72 @@
+/** @file
+ File defines the Sec routines for the AMD SEV
+
+ Copyright (c) 2021, Advanced Micro Devices, Inc. All rights reserved.<BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef _AMD_SEV_SEC_INTERNAL_H__
+#define _AMD_SEV_SEC_INTERNAL_H__
+
+/**
+ Handle an SEV-ES/GHCB protocol check failure.
+
+ Notify the hypervisor using the VMGEXIT instruction that the SEV-ES guest
+ wishes to be terminated.
+
+ @param[in] ReasonCode Reason code to provide to the hypervisor for the
+ termination request.
+
+**/
+VOID
+SevEsProtocolFailure (
+ IN UINT8 ReasonCode
+ );
+
+
+/**
+ Validate the SEV-ES/GHCB protocol level.
+
+ Verify that the level of SEV-ES/GHCB protocol supported by the hypervisor
+ and the guest intersect. If they don't intersect, request termination.
+
+**/
+VOID
+SevEsProtocolCheck (
+ VOID
+ );
+
+/**
+ Determine if the SEV is active.
+
+ During the early booting, GuestType is set in the work area. Verify that it
+ is an SEV guest.
+
+ @retval TRUE SEV is enabled
+ @retval FALSE SEV is not enabled
+
+**/
+BOOLEAN
+IsSevGuest (
+ VOID
+ );
+
+/**
+ Determine if SEV-ES is active.
+
+ During early booting, SEV-ES support code will set a flag to indicate that
+ SEV-ES is enabled. Return the value of this flag as an indicator that SEV-ES
+ is enabled.
+
+ @retval TRUE SEV-ES is enabled
+ @retval FALSE SEV-ES is not enabled
+
+**/
+BOOLEAN
+SevEsIsEnabled (
+ VOID
+ );
+
+#endif
diff --git a/OvmfPkg/Sec/AmdSev.c b/OvmfPkg/Sec/AmdSev.c
new file mode 100644
index 000000000000..3b4adaae32c7
--- /dev/null
+++ b/OvmfPkg/Sec/AmdSev.c
@@ -0,0 +1,161 @@
+/** @file
+ File defines the Sec routines for the AMD SEV
+
+ Copyright (c) 2021, Advanced Micro Devices, Inc. All rights reserved.<BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Library/BaseLib.h>
+#include <Library/DebugLib.h>
+#include <Library/MemEncryptSevLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Register/Amd/Ghcb.h>
+#include <Register/Amd/Msr.h>
+
+#include "AmdSev.h"
+
+/**
+ Handle an SEV-ES/GHCB protocol check failure.
+
+ Notify the hypervisor using the VMGEXIT instruction that the SEV-ES guest
+ wishes to be terminated.
+
+ @param[in] ReasonCode Reason code to provide to the hypervisor for the
+ termination request.
+
+**/
+VOID
+SevEsProtocolFailure (
+ IN UINT8 ReasonCode
+ )
+{
+ MSR_SEV_ES_GHCB_REGISTER Msr;
+
+ //
+ // Use the GHCB MSR Protocol to request termination by the hypervisor
+ //
+ Msr.GhcbPhysicalAddress = 0;
+ Msr.GhcbTerminate.Function = GHCB_INFO_TERMINATE_REQUEST;
+ Msr.GhcbTerminate.ReasonCodeSet = GHCB_TERMINATE_GHCB;
+ Msr.GhcbTerminate.ReasonCode = ReasonCode;
+ AsmWriteMsr64 (MSR_SEV_ES_GHCB, Msr.GhcbPhysicalAddress);
+
+ AsmVmgExit ();
+
+ ASSERT (FALSE);
+ CpuDeadLoop ();
+}
+
+/**
+ Validate the SEV-ES/GHCB protocol level.
+
+ Verify that the level of SEV-ES/GHCB protocol supported by the hypervisor
+ and the guest intersect. If they don't intersect, request termination.
+
+**/
+VOID
+SevEsProtocolCheck (
+ VOID
+ )
+{
+ MSR_SEV_ES_GHCB_REGISTER Msr;
+ GHCB *Ghcb;
+
+ //
+ // Use the GHCB MSR Protocol to obtain the GHCB SEV-ES Information for
+ // protocol checking
+ //
+ Msr.GhcbPhysicalAddress = 0;
+ Msr.GhcbInfo.Function = GHCB_INFO_SEV_INFO_GET;
+ AsmWriteMsr64 (MSR_SEV_ES_GHCB, Msr.GhcbPhysicalAddress);
+
+ AsmVmgExit ();
+
+ Msr.GhcbPhysicalAddress = AsmReadMsr64 (MSR_SEV_ES_GHCB);
+
+ if (Msr.GhcbInfo.Function != GHCB_INFO_SEV_INFO) {
+ SevEsProtocolFailure (GHCB_TERMINATE_GHCB_GENERAL);
+ }
+
+ if (Msr.GhcbProtocol.SevEsProtocolMin > Msr.GhcbProtocol.SevEsProtocolMax) {
+ SevEsProtocolFailure (GHCB_TERMINATE_GHCB_PROTOCOL);
+ }
+
+ if ((Msr.GhcbProtocol.SevEsProtocolMin > GHCB_VERSION_MAX) ||
+ (Msr.GhcbProtocol.SevEsProtocolMax < GHCB_VERSION_MIN)) {
+ SevEsProtocolFailure (GHCB_TERMINATE_GHCB_PROTOCOL);
+ }
+
+ //
+ // SEV-ES protocol checking succeeded, set the initial GHCB address
+ //
+ Msr.GhcbPhysicalAddress = FixedPcdGet32 (PcdOvmfSecGhcbBase);
+ AsmWriteMsr64 (MSR_SEV_ES_GHCB, Msr.GhcbPhysicalAddress);
+
+ Ghcb = Msr.Ghcb;
+ SetMem (Ghcb, sizeof (*Ghcb), 0);
+
+ //
+ // Set the version to the maximum that can be supported
+ //
+ Ghcb->ProtocolVersion = MIN (Msr.GhcbProtocol.SevEsProtocolMax, GHCB_VERSION_MAX);
+ Ghcb->GhcbUsage = GHCB_STANDARD_USAGE;
+}
+
+/**
+ Determine if the SEV is active.
+
+ During the early booting, GuestType is set in the work area. Verify that it
+ is an SEV guest.
+
+ @retval TRUE SEV is enabled
+ @retval FALSE SEV is not enabled
+
+**/
+BOOLEAN
+IsSevGuest (
+ VOID
+ )
+{
+ OVMF_WORK_AREA *WorkArea;
+
+ //
+ // Ensure that the size of the Confidential Computing work area header
+ // is same as what is provided through a fixed PCD.
+ //
+ ASSERT ((UINTN) FixedPcdGet32 (PcdOvmfConfidentialComputingWorkAreaHeader) ==
+ sizeof(CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER));
+
+ WorkArea = (OVMF_WORK_AREA *) FixedPcdGet32 (PcdOvmfWorkAreaBase);
+
+ return ((WorkArea != NULL) && (WorkArea->Header.GuestType == GUEST_TYPE_AMD_SEV));
+}
+
+/**
+ Determine if SEV-ES is active.
+
+ During early booting, SEV-ES support code will set a flag to indicate that
+ SEV-ES is enabled. Return the value of this flag as an indicator that SEV-ES
+ is enabled.
+
+ @retval TRUE SEV-ES is enabled
+ @retval FALSE SEV-ES is not enabled
+
+**/
+BOOLEAN
+SevEsIsEnabled (
+ VOID
+ )
+{
+ SEC_SEV_ES_WORK_AREA *SevEsWorkArea;
+
+ if (!IsSevGuest()) {
+ return FALSE;
+ }
+
+ SevEsWorkArea = (SEC_SEV_ES_WORK_AREA *) FixedPcdGet32 (PcdSevEsWorkAreaBase);
+
+ return (SevEsWorkArea->SevEsEnabled != 0);
+}
diff --git a/OvmfPkg/Sec/SecMain.c b/OvmfPkg/Sec/SecMain.c
index 707b0d4bbff4..406e3a25d0cd 100644
--- a/OvmfPkg/Sec/SecMain.c
+++ b/OvmfPkg/Sec/SecMain.c
@@ -26,12 +26,11 @@
#include <Library/ExtractGuidedSectionLib.h>
#include <Library/LocalApicLib.h>
#include <Library/CpuExceptionHandlerLib.h>
-#include <Library/MemEncryptSevLib.h>
-#include <Register/Amd/Ghcb.h>
-#include <Register/Amd/Msr.h>

#include <Ppi/TemporaryRamSupport.h>

+#include "AmdSev.h"
+
#define SEC_IDT_ENTRY_COUNT 34

typedef struct _SEC_IDT_TABLE {
@@ -717,154 +716,6 @@ FindAndReportEntryPoints (
return;
}

-/**
- Handle an SEV-ES/GHCB protocol check failure.
-
- Notify the hypervisor using the VMGEXIT instruction that the SEV-ES guest
- wishes to be terminated.
-
- @param[in] ReasonCode Reason code to provide to the hypervisor for the
- termination request.
-
-**/
-STATIC
-VOID
-SevEsProtocolFailure (
- IN UINT8 ReasonCode
- )
-{
- MSR_SEV_ES_GHCB_REGISTER Msr;
-
- //
- // Use the GHCB MSR Protocol to request termination by the hypervisor
- //
- Msr.GhcbPhysicalAddress = 0;
- Msr.GhcbTerminate.Function = GHCB_INFO_TERMINATE_REQUEST;
- Msr.GhcbTerminate.ReasonCodeSet = GHCB_TERMINATE_GHCB;
- Msr.GhcbTerminate.ReasonCode = ReasonCode;
- AsmWriteMsr64 (MSR_SEV_ES_GHCB, Msr.GhcbPhysicalAddress);
-
- AsmVmgExit ();
-
- ASSERT (FALSE);
- CpuDeadLoop ();
-}
-
-/**
- Validate the SEV-ES/GHCB protocol level.
-
- Verify that the level of SEV-ES/GHCB protocol supported by the hypervisor
- and the guest intersect. If they don't intersect, request termination.
-
-**/
-STATIC
-VOID
-SevEsProtocolCheck (
- VOID
- )
-{
- MSR_SEV_ES_GHCB_REGISTER Msr;
- GHCB *Ghcb;
-
- //
- // Use the GHCB MSR Protocol to obtain the GHCB SEV-ES Information for
- // protocol checking
- //
- Msr.GhcbPhysicalAddress = 0;
- Msr.GhcbInfo.Function = GHCB_INFO_SEV_INFO_GET;
- AsmWriteMsr64 (MSR_SEV_ES_GHCB, Msr.GhcbPhysicalAddress);
-
- AsmVmgExit ();
-
- Msr.GhcbPhysicalAddress = AsmReadMsr64 (MSR_SEV_ES_GHCB);
-
- if (Msr.GhcbInfo.Function != GHCB_INFO_SEV_INFO) {
- SevEsProtocolFailure (GHCB_TERMINATE_GHCB_GENERAL);
- }
-
- if (Msr.GhcbProtocol.SevEsProtocolMin > Msr.GhcbProtocol.SevEsProtocolMax) {
- SevEsProtocolFailure (GHCB_TERMINATE_GHCB_PROTOCOL);
- }
-
- if ((Msr.GhcbProtocol.SevEsProtocolMin > GHCB_VERSION_MAX) ||
- (Msr.GhcbProtocol.SevEsProtocolMax < GHCB_VERSION_MIN)) {
- SevEsProtocolFailure (GHCB_TERMINATE_GHCB_PROTOCOL);
- }
-
- //
- // SEV-ES protocol checking succeeded, set the initial GHCB address
- //
- Msr.GhcbPhysicalAddress = FixedPcdGet32 (PcdOvmfSecGhcbBase);
- AsmWriteMsr64 (MSR_SEV_ES_GHCB, Msr.GhcbPhysicalAddress);
-
- Ghcb = Msr.Ghcb;
- SetMem (Ghcb, sizeof (*Ghcb), 0);
-
- //
- // Set the version to the maximum that can be supported
- //
- Ghcb->ProtocolVersion = MIN (Msr.GhcbProtocol.SevEsProtocolMax, GHCB_VERSION_MAX);
- Ghcb->GhcbUsage = GHCB_STANDARD_USAGE;
-}
-
-/**
- Determine if the SEV is active.
-
- During the early booting, GuestType is set in the work area. Verify that it
- is an SEV guest.
-
- @retval TRUE SEV is enabled
- @retval FALSE SEV is not enabled
-
-**/
-STATIC
-BOOLEAN
-IsSevGuest (
- VOID
- )
-{
- OVMF_WORK_AREA *WorkArea;
-
- //
- // Ensure that the size of the Confidential Computing work area header
- // is same as what is provided through a fixed PCD.
- //
- ASSERT ((UINTN) FixedPcdGet32 (PcdOvmfConfidentialComputingWorkAreaHeader) ==
- sizeof(CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER));
-
- WorkArea = (OVMF_WORK_AREA *) FixedPcdGet32 (PcdOvmfWorkAreaBase);
-
- return ((WorkArea != NULL) && (WorkArea->Header.GuestType == GUEST_TYPE_AMD_SEV));
-}
-
-/**
- Determine if SEV-ES is active.
-
- During early booting, SEV-ES support code will set a flag to indicate that
- SEV-ES is enabled. Return the value of this flag as an indicator that SEV-ES
- is enabled.
-
- @retval TRUE SEV-ES is enabled
- @retval FALSE SEV-ES is not enabled
-
-**/
-STATIC
-BOOLEAN
-SevEsIsEnabled (
- VOID
- )
-{
- SEC_SEV_ES_WORK_AREA *SevEsWorkArea;
-
- if (!IsSevGuest()) {
- return FALSE;
- }
-
- SevEsWorkArea = (SEC_SEV_ES_WORK_AREA *) FixedPcdGet32 (PcdSevEsWorkAreaBase);
-
- return (SevEsWorkArea->SevEsEnabled != 0);
-}
-
VOID
EFIAPI
SecCoreStartupWithStack (
--
2.25.1


[PATCH v8 00/32] Add AMD Secure Nested Paging (SEV-SNP) support

Brijesh Singh
 

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

SEV-SNP builds upon existing SEV and SEV-ES functionality while adding
new hardware-based memory protections. SEV-SNP adds strong memory integrity
protection to help prevent malicious hypervisor-based attacks like data
replay, memory re-mapping and more in order to create an isolated memory
encryption environment.

This series provides the basic building blocks to support booting the SEV-SNP
VMs, it does not cover all the security enhancement introduced by the SEV-SNP
such as interrupt protection.

Many of the integrity guarantees of SEV-SNP are enforced through a new
structure called the Reverse Map Table (RMP). Adding a new page to SEV-SNP
VM requires a 2-step process. First, the hypervisor assigns a page to the
guest using the new RMPUPDATE instruction. This transitions the page to
guest-invalid. Second, the guest validates the page using the new PVALIDATE
instruction. The SEV-SNP VMs can use the new "Page State Change Request NAE"
defined in the GHCB specification to ask hypervisor to add or remove page
from the RMP table.

Each page assigned to the SEV-SNP VM can either be validated or unvalidated,
as indicated by the Validated flag in the page's RMP entry. There are two
approaches that can be taken for the page validation: Pre-validation and
Lazy Validation.

Under pre-validation, the pages are validated prior to first use. And under
lazy validation, pages are validated when first accessed. An access to a
unvalidated page results in a #VC exception, at which time the exception
handler may validate the page. Lazy validation requires careful tracking of
the validated pages to avoid validating the same GPA more than once. The
recently introduced "Unaccepted" memory type can be used to communicate the
unvalidated memory ranges to the Guest OS.

At this time we only support the pre-validation. OVMF detects all the available
system RAM in the PEI phase. When SEV-SNP is enabled, the memory is validated
before it is made available to the EDK2 core.

Now that series contains all the basic support required to launch SEV-SNP
guest. We are still missing the Interrupt security feature provided by the
SNP. The feature will be added after the base support is accepted.

Additional resources
---------------------
SEV-SNP whitepaper
https://www.amd.com/system/files/TechDocs/SEV-SNP-strengthening-vm-isolation-with-integrity-protection-and-more.pdf

APM 2: https://www.amd.com/system/files/TechDocs/24593.pdf (section 15.36)

The complete source is available at
https://github.com/AMDESE/ovmf/tree/snp-v8

GHCB spec:
https://developer.amd.com/wp-content/resources/56421.pdf

SEV-SNP firmware specification:
https://www.amd.com/system/files/TechDocs/56860.pdf

Changes since v7:
* Move SEV specific changes in MpLib in AmdSev file
* Update the GHCB register function to not restore the GHCB MSR because
we were already in the MSR protocol mode.
* Drop the SNP name from PcdSnpSecPreValidate.
* Add new section for GHCB memory in the OVMF metadata.

Change since v6:
* Drop the SNP boot block GUID and switch to using the Metadata guided structure
proposed by Min in TDX series.
* Exclude the GHCB page from the pre-validated region. It simplifies the reset
vector code where we do not need to unvalidate the GHCB page.
* Now that GHCB page is not validated so move the VMPL check from reset vector
code to the MemEncryptSevLib on the first page validation.
* Introduce the ConfidentialComputingGuestAttr PCD to communicate which
memory encryption is active so that MpInitLib can make use of it.
* Drop the SEVES specific PCD as the information can be communicated via
the ConfidentialComputingGuestAttr.
* Move the SNP specific AP creation function in AmdSev.c.
* Define the SNP Blob GUID in a new file.

Change since v5:
* When possible use the CPUID value from CPUID page
* Move the SEV specific functions from SecMain.c in AmdSev.c
* Rebase to the latest code
* Add the review feedback from Yao.

Change since v4:
* Use the correct MSR for the SEV_STATUS
* Add VMPL-0 check

Change since v3:
* ResetVector: move all SEV specific code in AmdSev.asm and add macros to keep
the code readable.
* Drop extending the EsWorkArea to contain SNP specific state.
* Drop the GhcbGpa library and call the VmgExit directly to register GHCB GPA.
* Install the CC blob config table from AmdSevDxe instead of extending the
AmdSev/SecretsDxe for it.
* Add the separate PCDs for the SNP Secrets.

Changes since v2:
* Add support for the AP creation.
* Use the module-scoping override to make AmdSevDxe use the IO port for PCI reads.
* Use the reserved memory type for CPUID and Secrets page.
*
Changes since v1:
* Drop the interval tree support to detect the pre-validated overlap region.
* Use an array to keep track of pre-validated regions.
* Add support to query the Hypervisor feature and verify that SNP feature is supported.
* Introduce MemEncryptSevClearMmioPageEncMask() to clear the C-bit from MMIO ranges.
* Pull the SevSecretDxe and SevSecretPei into OVMF package build.
* Extend the SevSecretDxe to expose confidential computing blob location through
EFI configuration table.

Brijesh Singh (28):
OvmfPkg/SecMain: move SEV specific routines in AmdSev.c
UefiCpuPkg/MpInitLib: move SEV specific routines in AmdSev.c
OvmfPkg/ResetVector: move clearing GHCB in SecMain
OvmfPkg/ResetVector: introduce metadata descriptor for VMM use
OvmfPkg: reserve SNP secrets page
OvmfPkg: reserve CPUID page
OvmfPkg/ResetVector: pre-validate the data pages used in SEC phase
OvmfPkg/MemEncryptSevLib: add MemEncryptSevSnpEnabled()
OvmfPkg/SecMain: register GHCB gpa for the SEV-SNP guest
OvmfPkg/PlatformPei: register GHCB gpa for the SEV-SNP guest
OvmfPkg/AmdSevDxe: do not use extended PCI config space
OvmfPkg/MemEncryptSevLib: add support to validate system RAM
OvmfPkg/MemEncryptSevLib: add function to check the VMPL0
OvmfPkg/BaseMemEncryptSevLib: skip the pre-validated system RAM
OvmfPkg/MemEncryptSevLib: add support to validate > 4GB memory in PEI
phase
OvmfPkg/SecMain: validate the memory used for decompressing Fv
OvmfPkg/PlatformPei: validate the system RAM when SNP is active
UefiCpuPkg: Define ConfidentialComputingGuestAttr
OvmfPkg/PlatformPei: set PcdConfidentialComputingAttr when SEV is
active
UefiCpuPkg/MpInitLib: use PcdConfidentialComputingAttr to check SEV
status
UefiCpuPkg: add PcdGhcbHypervisorFeatures
OvmfPkg/PlatformPei: set the Hypervisor Features PCD
MdePkg/GHCB: increase the GHCB protocol max version
UefiCpuPkg/MpLib: add support to register GHCB GPA when SEV-SNP is
enabled
OvmfPkg/MemEncryptSevLib: change the page state in the RMP table
OvmfPkg/MemEncryptSevLib: skip page state change for Mmio address
OvmfPkg/PlatformPei: mark cpuid and secrets memory reserved in EFI map
OvmfPkg/AmdSev: expose the SNP reserved pages through configuration
table

Michael Roth (3):
OvmfPkg/ResetVector: use SEV-SNP-validated CPUID values
OvmfPkg/VmgExitLib: use SEV-SNP-validated CPUID values
UefiCpuPkg/MpInitLib: use BSP to do extended topology check

Tom Lendacky (1):
UefiCpuPkg/MpInitLib: Use SEV-SNP AP Creation NAE event to launch APs

OvmfPkg/OvmfPkg.dec | 18 +
UefiCpuPkg/UefiCpuPkg.dec | 9 +
OvmfPkg/AmdSev/AmdSevX64.dsc | 5 +-
OvmfPkg/Bhyve/BhyveX64.dsc | 5 +-
OvmfPkg/OvmfPkgIa32.dsc | 1 +
OvmfPkg/OvmfPkgIa32X64.dsc | 6 +-
OvmfPkg/OvmfPkgX64.dsc | 5 +-
OvmfPkg/OvmfXen.dsc | 5 +-
OvmfPkg/OvmfPkgX64.fdf | 6 +
OvmfPkg/AmdSevDxe/AmdSevDxe.inf | 7 +
.../DxeMemEncryptSevLib.inf | 3 +
.../PeiMemEncryptSevLib.inf | 25 +
.../SecMemEncryptSevLib.inf | 3 +
OvmfPkg/Library/VmgExitLib/SecVmgExitLib.inf | 2 +
OvmfPkg/Library/VmgExitLib/VmgExitLib.inf | 3 +
OvmfPkg/PlatformPei/PlatformPei.inf | 8 +
OvmfPkg/ResetVector/ResetVector.inf | 11 +
OvmfPkg/Sec/SecMain.inf | 4 +
UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 6 +-
UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf | 6 +-
MdePkg/Include/Register/Amd/Ghcb.h | 2 +-
.../Guid/ConfidentialComputingSevSnpBlob.h | 33 ++
OvmfPkg/Include/Library/MemEncryptSevLib.h | 26 +
.../X64/SnpPageStateChange.h | 36 ++
.../BaseMemEncryptSevLib/X64/VirtualMemory.h | 19 +
OvmfPkg/PlatformPei/Platform.h | 5 +
OvmfPkg/Sec/AmdSev.h | 95 ++++
.../Include/ConfidentialComputingGuestAttr.h | 25 +
UefiCpuPkg/Library/MpInitLib/MpLib.h | 93 ++++
OvmfPkg/AmdSevDxe/AmdSevDxe.c | 23 +
.../DxeMemEncryptSevLibInternal.c | 27 ++
.../Ia32/MemEncryptSevLib.c | 17 +
.../PeiMemEncryptSevLibInternal.c | 27 ++
.../SecMemEncryptSevLibInternal.c | 19 +
.../X64/DxeSnpSystemRamValidate.c | 40 ++
.../X64/PeiDxeVirtualMemory.c | 167 ++++++-
.../X64/PeiSnpSystemRamValidate.c | 163 +++++++
.../X64/SecSnpSystemRamValidate.c | 82 ++++
.../X64/SnpPageStateChangeInternal.c | 294 ++++++++++++
OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c | 444 ++++++++++++++++--
OvmfPkg/PlatformPei/AmdSev.c | 235 +++++++++
OvmfPkg/PlatformPei/MemDetect.c | 2 +
OvmfPkg/Sec/AmdSev.c | 299 ++++++++++++
OvmfPkg/Sec/SecMain.c | 158 +------
UefiCpuPkg/Library/MpInitLib/AmdSev.c | 239 ++++++++++
UefiCpuPkg/Library/MpInitLib/DxeMpLib.c | 16 +-
UefiCpuPkg/Library/MpInitLib/Ia32/AmdSev.c | 70 +++
UefiCpuPkg/Library/MpInitLib/MpLib.c | 338 ++++---------
UefiCpuPkg/Library/MpInitLib/PeiMpLib.c | 4 +-
UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c | 261 ++++++++++
OvmfPkg/FvmainCompactScratchEnd.fdf.inc | 5 +
OvmfPkg/ResetVector/Ia16/ResetVectorVtf0.asm | 17 +
OvmfPkg/ResetVector/Ia32/AmdSev.asm | 86 +++-
OvmfPkg/ResetVector/ResetVector.nasmb | 35 ++
OvmfPkg/ResetVector/X64/OvmfMetadata.asm | 123 +++++
UefiCpuPkg/Library/MpInitLib/MpEqu.inc | 2 +
UefiCpuPkg/Library/MpInitLib/X64/AmdSev.nasm | 200 ++++++++
UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 100 +---
58 files changed, 3437 insertions(+), 528 deletions(-)
create mode 100644 OvmfPkg/Include/Guid/ConfidentialComputingSevSnpBlob.h
create mode 100644 OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChange.h
create mode 100644 OvmfPkg/Sec/AmdSev.h
create mode 100644 UefiCpuPkg/Include/ConfidentialComputingGuestAttr.h
create mode 100644 OvmfPkg/Library/BaseMemEncryptSevLib/X64/DxeSnpSystemRamValidate.c
create mode 100644 OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiSnpSystemRamValidate.c
create mode 100644 OvmfPkg/Library/BaseMemEncryptSevLib/X64/SecSnpSystemRamValidate.c
create mode 100644 OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c
create mode 100644 OvmfPkg/Sec/AmdSev.c
create mode 100644 UefiCpuPkg/Library/MpInitLib/AmdSev.c
create mode 100644 UefiCpuPkg/Library/MpInitLib/Ia32/AmdSev.c
create mode 100644 UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c
create mode 100644 OvmfPkg/ResetVector/X64/OvmfMetadata.asm
create mode 100644 UefiCpuPkg/Library/MpInitLib/X64/AmdSev.nasm

--
2.25.1


Re: [edk2-platforms][PATCH V1 1/1] WhitleyOpenBoardPkg/Build: Reduce debug output for default boot.

Oram, Isaac W
 

It is a noticeable impact on performance. At some point we need to build out more optimal options for DEBUG and RELEASE but the server code isn't really built that way currently as very often people want the logs all the time and choose verbosity over the infrequent boot performance impact. A lot of the code could be productively refactored to leverage message levels towards common debug scenarios. For now, I just want to reduce the volume of output to a good default level that indicates the system is progressing through boot and let people customize the level for their debug activity.

Regards,
Isaac

-----Original Message-----
From: Desimone, Nathaniel L <nathaniel.l.desimone@...>
Sent: Thursday, September 16, 2021 2:09 PM
To: Oram, Isaac W <isaac.w.oram@...>; devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@...>
Subject: RE: [edk2-devel][edk2-platforms][PATCH V1 1/1] WhitleyOpenBoardPkg/Build: Reduce debug output for default boot.

Is it a big increase in messages to have both INFO and LOAD?

-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@...>
Sent: Wednesday, September 8, 2021 3:35 PM
To: devel@edk2.groups.io
Cc: Desimone, Nathaniel L <nathaniel.l.desimone@...>; Chiu, Chasel <chasel.chiu@...>
Subject: [edk2-devel][edk2-platforms][PATCH V1 1/1] WhitleyOpenBoardPkg/Build: Reduce debug output for default boot.

Replace Info with Load, so we still get component loading details

Cc: Isaac Oram <isaac.w.oram@...>
Cc: Nate DeSimone <nathaniel.l.desimone@...>
Cc: Chasel Chiu <chasel.chiu@...>
Signed-off-by: Isaac Oram <isaac.w.oram@...>
---
Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
index fa41ae923d..64ba4a4dae 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
+++ b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
@@ -365,7 +365,7 @@
#

gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07 # Enable status codes for debug, progress, and errors
- gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000042 # Displayed messages: Error, Info, warn
+ gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000006 # Displayed messages: Error, Load, Warn

gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0x80000000
gUefiCpuPkgTokenSpaceGuid.PcdCpuNumberOfReservedVariableMtrrs|0
--
2.27.0.windows.1


Re: [PATCH] MdeModulePkg/PciBusDxe: Enumerator to check for RCiEP before looking for RP

Bassa, Damian <damian.bassa@...>
 

Thank you for input. Submitted V2.

 

Damian

 

From: Ni, Ray <ray.ni@...>
Sent: Friday, September 17, 2021 6:31 PM
To: Bassa, Damian <damian.bassa@...>; Wu, Hao A <hao.a.wu@...>; devel@edk2.groups.io
Cc: Kolakowski, Jacek <Jacek.Kolakowski@...>
Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to check for RCiEP before looking for RP

 

If a device is a RCiEP, PciIoDev->Parent points to a virtual PCI_IO_DEVICE for the RootComplex.

The PCI_IO_EVICE.Parent equals to NULL for RootComplex.

 

Which means, we can create a helper function

BOOLEAN IsRootBridge(PciIo) { return (BOOLEAN) (PciIo->Parent == NULL); }

 

your code can call this helper function.

 

From: Bassa, Damian <damian.bassa@...>
Sent: Friday, September 17, 2021 12:02 AM
To: Ni, Ray <ray.ni@...>; Wu, Hao A <hao.a.wu@...>; devel@edk2.groups.io
Cc: Kolakowski, Jacek <Jacek.Kolakowski@...>
Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to check for RCiEP before looking for RP

 

I was looking for anything that wouldn’t include reading register but only thing that distinguish device PCI_IO_DEVICE instances with root bridge instances is population of BusNumberRanges structure.

This technically could be used since this is populated only for root bridges and not devices but using this would be just confusing since there is no self-explanatory field there.

For my knowledge this is best way to tackle this issue. Please let me know if there are have some other worth exploring ideas.

 

Damian

 

From: Ni, Ray <ray.ni@...>
Sent: Wednesday, September 15, 2021 3:21 PM
To: Bassa, Damian <damian.bassa@...>; Wu, Hao A <hao.a.wu@...>; devel@edk2.groups.io
Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to check for RCiEP before looking for RP

 

Extending PciBus to support such case is valid.

 

But can you check if there is other pure software way to detect whether it’s an ECiEP?

 

From: Bassa, Damian <damian.bassa@...>
Sent: Wednesday, September 15, 2021 7:54 PM
To: Wu, Hao A <hao.a.wu@...>; devel@edk2.groups.io; Ni, Ray <ray.ni@...>
Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to check for RCiEP before looking for RP

 

Should we consider this workaround? I’m having issues interpreting this part of PCIe spec.

My understanding of this quote is that this capability can exist in but it shouldn’t be considered.

I would assume it’s possible option that it needs to be considered? Is that wrong?

 

Damian

 

 

From: Wu, Hao A <hao.a.wu@...>
Sent: Wednesday, September 8, 2021 9:17 AM
To: Bassa, Damian <damian.bassa@...>; devel@edk2.groups.io; Ni, Ray <ray.ni@...>
Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to check for RCiEP before looking for RP

 

Really sorry for the late response.

 

So this is a workaround for RCiEP device that is not compliant to the PCIe spec:

|>  ARI is an optional capability. This capability must be implemented by each

|>  Function in an ARI Device. It is not applicable to a Root Port, a Switch

|>  Downstream Port, an RCiEP, or a Root Complex Event Collector.

 

If this the case, could you help to:

* Add a comment that briefly describe this workaround before the newly added code

* Also mention this workaround information in the commit log message.

* Send out a V2 version of the patch?

Thanks in advance.

 

Hello Ray, please help to raise if you have concern on this.

 

Best Regards,

Hao Wu

 

From: Bassa, Damian <damian.bassa@...>
Sent: Wednesday, September 1, 2021 1:45 AM
To: Wu, Hao A <hao.a.wu@...>; devel@edk2.groups.io; Ni, Ray <ray.ni@...>
Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to check for RCiEP before looking for RP

 

It refers to access to the root port device that doesn’t exist in case we are dealing with RCiEP device.

There can be specific case where RCiEP device has ARI extended capability ID (even though it’s unsupported in this case).

In such a case PciSearchDevice goes to CreatePciIoDevice through GatherDeviceInfo. And in this case parent is PCI_IO_DEVICE instance created from CreateRootBridge function, which isn’t valid PCIe device and doesn’t have specific bus, only a range of buses. In that case enumerator tries to use this instance to read operation using default 0 bus number, which isn’t correct.

 

Damian

 

From: Wu, Hao A <hao.a.wu@...>
Sent: Tuesday, August 31, 2021 6:28 AM
To: devel@edk2.groups.io; Wu, Hao A <hao.a.wu@...>; Bassa, Damian <damian.bassa@...>; Ni, Ray <ray.ni@...>
Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to check for RCiEP before looking for RP

 

From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Wu, Hao A
Sent: Tuesday, August 31, 2021 12:25 PM
To: devel@edk2.groups.io; Bassa, Damian <damian.bassa@...>
Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to check for RCiEP before looking for RP

 

Really sorry,

 

Could you help to provide more information on the below statement?

“undefined parent register accesses”

 

Thanks in advance.

 

Best Regards,

Hao Wu

 

From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Bassa, Damian
Sent: Tuesday, August 24, 2021 11:15 PM
To: devel@edk2.groups.io
Subject: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Enumerator to check for RCiEP before looking for RP

 

Before trying to access parent root port to check ARI capabilities,

enumerator should see if Endpoint device is not Root Complex integrated

to avoid undefined parent register accesses in these cases.

 

Signed-off-by: Damian Bassa damian.bassa@...

 

---

.../Bus/Pci/PciBusDxe/PciEnumeratorSupport.c         | 12 +++++++++++-

1 file changed, 11 insertions(+), 1 deletion(-)

 

diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c

index db1b35f8ef..6451fb8af9 100644

--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c

+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c

@@ -2153,6 +2153,7 @@ CreatePciIoDevice (

   PCI_IO_DEVICE        *PciIoDevice;

   EFI_PCI_IO_PROTOCOL  *PciIo;

   EFI_STATUS           Status;

+  PCI_REG_PCIE_CAPABILITY Capability;

 

   PciIoDevice = AllocateZeroPool (sizeof (PCI_IO_DEVICE));

   if (PciIoDevice == NULL) {

@@ -2229,7 +2230,16 @@ CreatePciIoDevice (

     return NULL;

   }

 

-  if (PcdGetBool (PcdAriSupport)) {

+  PciIo->Pci.Read (

+                PciIo,

+                EfiPciIoWidthUint16,

+                PciIoDevice->PciExpressCapabilityOffset + OFFSET_OF (PCI_CAPABILITY_PCIEXP, Capability),

+                1,

+                &Capability.Uint16

+                );

+

+  if (PcdGetBool (PcdAriSupport) &&

+    Capability.Bits.DevicePortType != PCIE_DEVICE_PORT_TYPE_ROOT_COMPLEX_INTEGRATED_ENDPOINT) {

     //

     // Check if the device is an ARI device.

     //

--

2.27.0.windows.1

 


Intel Technology Poland sp. z o.o.
ul. Słowackiego 173 | 80-298 Gdańsk | Sąd Rejonowy Gdańsk Północ | VII Wydział Gospodarczy Krajowego Rejestru Sądowego - KRS 101882 | NIP 957-07-52-316 | Kapitał zakładowy 200.000 PLN.

Ta wiadomość wraz z załącznikami jest przeznaczona dla określonego adresata i może zawierać informacje poufne. W razie przypadkowego otrzymania tej wiadomości, prosimy o powiadomienie nadawcy oraz trwałe jej usunięcie; jakiekolwiek przeglądanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.

 


Intel Technology Poland sp. z o.o.
ul. Słowackiego 173 | 80-298 Gdańsk | Sąd Rejonowy Gdańsk Północ | VII Wydział Gospodarczy Krajowego Rejestru Sądowego - KRS 101882 | NIP 957-07-52-316 | Kapitał zakładowy 200.000 PLN.

Ta wiadomość wraz z załącznikami jest przeznaczona dla określonego adresata i może zawierać informacje poufne. W razie przypadkowego otrzymania tej wiadomości, prosimy o powiadomienie nadawcy oraz trwałe jej usunięcie; jakiekolwiek przeglądanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.


[PATCH V2] MdeModulePkg/PciBusDxe: Enumerator to check for RCiEP before looking for RP

Bassa, Damian <damian.bassa@...>
 

Before trying to access parent root port to check ARI capabilities,

enumerator should see if Endpoint device is not Root Complex integrated

to avoid undefined parent register accesses.

 

Signed-off-by: Damian Bassa damian.bassa@...

 

Change-Id: Ib782a9d73daab9164d4189a50e06273660400695

---

.../Bus/Pci/PciBusDxe/PciEnumeratorSupport.c  | 26 ++++++++++++++++++-

1 file changed, 25 insertions(+), 1 deletion(-)

 

diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c

index db1b35f8ef..687d055f49 100644

--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c

+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c

@@ -2128,6 +2128,27 @@ AuthenticatePciDevice (

   return EFI_SUCCESS;

}

+/**

+  Checks if PCI device is Root Bridge

+

+  @param Bridge            Instance of PCI device

+

+  @retval TRUE             Device is Root Bridge

+  @return FALSE            Device is not Root Bridge

+

+**/

+BOOLEAN

+IsRootBridge (

+  IN PCI_IO_DEVICE                    *PciIoDevice

+  )

+{

+  if (PciIoDevice->Parent == NULL) {

+    return TRUE;

+  } else {

+    return FALSE;

+  }

+}

+

/**

   Create and initialize general PCI I/O device instance for

   PCI device/bridge device/hotplug bridge device.

@@ -2229,7 +2250,10 @@ CreatePciIoDevice (

     return NULL;

   }

-  if (PcdGetBool (PcdAriSupport)) {

+  //

+  // Check if device's parent is not Root Bridge

+  //

+  if (PcdGetBool (PcdAriSupport) && !IsRootBridge(Bridge)) {

     //

     // Check if the device is an ARI device.

     //

--


Intel Technology Poland sp. z o.o.
ul. Słowackiego 173 | 80-298 Gdańsk | Sąd Rejonowy Gdańsk Północ | VII Wydział Gospodarczy Krajowego Rejestru Sądowego - KRS 101882 | NIP 957-07-52-316 | Kapitał zakładowy 200.000 PLN.

Ta wiadomość wraz z załącznikami jest przeznaczona dla określonego adresata i może zawierać informacje poufne. W razie przypadkowego otrzymania tej wiadomości, prosimy o powiadomienie nadawcy oraz trwałe jej usunięcie; jakiekolwiek przeglądanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.


Re: [PATCH] UefiCpuPkg: Fix CPU stack guard support by aligning GDT buffer

Vitaly Cheptsov
 

Just to make it clear, this is an immediate solution that is good enough to fix the bug. However, a more proper solution would be to introduce the _Alignas concept to EDK II. I would suggest the following macro in Base.h:

/**
  Enforce custom alignment for a variable definition.
  Similar to C11 alignas macro from stdalign.h, except it must be functional to support MSVC.

  @param  Alignment  Numeric alignment to require.
**/
#ifdef _MSC_EXTENSIONS
  #define ALIGNAS(Alignment) __declspec(align(Alignment))
#else
  #define ALIGNAS(Alignment) _Alignas(Alignment)
#endif

If there is no disagreement on this, I can imagine submitting an update after this patch is merged.



Re: [PATCH V6 1/1] OvmfPkg: Enable TDX in ResetVector

Brijesh Singh
 

On 9/18/21 10:14 PM, Xu, Min M wrote:
Hi, Brijesh
On September 18, 2021 7:30 PM, Brijesh Singh wrote:
Hi Min,

On 9/18/21 12:16 AM, Xu, Min M wrote:
Hi, Brijesh

On September 17, 2021 11:52 PM, Brijesh Singh wrote:
Hi Min,

On 9/17/21 7:55 AM, Xu, Min M wrote:
...

As I mentioned in my last mail, in the beginning I missed the
limitation of
smsw.
So I update the code (ResetVectorVtf0.asm) as below using mov CRx.
<1> BITS 16
176 00000800 0F20C0 <1> mov eax, cr0 <-- previously it
was smsw
177 00000803 A801 <1> test al, 1
178 00000805 7405 <1> jz .Real
179 <1> BITS 32
180 00000807 E951FFFFFF <1> jmp Main32
181 <1> BITS 16
182 <1> .Real:
183 0000080C E939FF <1> jmp EarlyBspInitReal16

I test the code in a AMD SEV server and try to launch a SEV guest.
This time
it stuck at the *mov eax, cr0*.
I am curious if *mov eax, cr0* works in real mode in a SEV guest?
I also test the code in a legacy vm guest and td guest, all passed.
Did I miss something?
Hmm, I am not aware of any limitation w.r.t encrypted VMs. I just
added the below code in my branch and I do not see any issues, my
SEV, SEV-ES and SEV-SNP all are able to boot fine. And KVM trace
confirms that code it read

diff --git a/OvmfPkg/ResetVector/Ia16/ResetVectorVtf0.asm
b/OvmfPkg/ResetVector/Ia16/ResetVectorVtf0.asm
index f0e509d0672e..98e34332b04c 100644
--- a/OvmfPkg/ResetVector/Ia16/ResetVectorVtf0.asm
+++ b/OvmfPkg/ResetVector/Ia16/ResetVectorVtf0.asm
@@ -175,9 +175,21 @@ resetVector:
;
; This is where the processor will begin execution
;
+%ifdef ARCH_IA32
nop
nop
jmp EarlyBspInitReal16
+%else
+ mov eax, cr0
+ test al, 1
+ jz .Real
+BITS 32
+ hlt
+ ;jmp Main32
+BITS 16
+.Real:
+ jmp EarlyBspInitReal16
+%endif

ALIGN 16


And KVM trace:

kvm_exit: vcpu 0 reason npf rip 0xfff0 info1 0x0000000500000014 info2
0x00000000fffff000 intr_info 0x00000000 error_code 0x00000000
kvm_page_fault: address fffff000 error_code 500000014
kvm_entry: vcpu 0, rip 0xfff0
kvm_exit: vcpu 0 reason read_cr0 rip 0xfff0 info1 0x8000000000000000
info2 0x0000000000000000 intr_info 0x00000000 error_code 0x00000000
kvm_cr: cr_read 0 = 0x60000010
kvm_entry: vcpu 0, rip 0xfff3

As we can see from the kvm trace, the first instruction here is the
Cr0 read and it was successfully intercepted and rip moved to next
instruction.

Can you please provide me KVM trace for your failure case ? Also,
provide me the output of "lscpu" and "dmesg" from the host.
The OVMF image you tested is built with GCC tool chain, right?
Yes, we have been using the GCC tool chain only.
Is VS Tool chain (VS2017, VS2019, etc) supported by AMD SEV in OVMF?
I am a little nervous when the Ovmf img failed to be launched in AMD SEV
server after my TDX patch is applied.


I usually do the development in windows and build the OVMF image with
VS2019.
If the new feature works, then I cherry-pick the patch-sets to code
base in ubuntu
18.04 and build/test the new feature.

The weird thing is that, with VS2019, even the OVMF image is built
from edk2-master, such image doesn't work on AMD SEV server either.
But if the image is built by Ubuntu 18.04, it does work on AMD SEV server.
This seems very strange that we are failing to execute the hand written
assembly code.
Actually even the OvmfPkg from edk2-master (without any changes) cannot be
launched on AMD SEV server if it is built with VS2019 tool chain.
This is the qemu-kvm used:
$/usr/libexec/qemu-kvm --version
QEMU emulator version 4.2.0 (qemu-kvm-4.2.0-48.module_el8.4.0+885+5e18b468.3)
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers
This is the launch scripts.
QEMU=/usr/libexec/qemu-kvm
DRIVE=rhel-8.qcow2
${QEMU} \
-enable-kvm -cpu EPYC -machine q35 \
-smp 4,maxcpus=64 \
-m 4096M,slots=5,maxmem=30G \
-drive if=pflash,format=raw,unit=0,file=OVMF_CODE.fd,readonly \
-drive if=pflash,format=raw,unit=1,file=OVMF_VARS.fd \
-netdev user,id=vmnic \
-device e1000,netdev=vmnic,romfile= \
-drive file=${DRIVE},if=none,id=disk0,format=qcow2 \
-device virtio-scsi-pci,id=scsi,disable-legacy=on,iommu_platform=true \
-device scsi-hd,drive=disk0 \
-object sev-guest,id=sev0,cbitpos=47,reduced-phys-bits=1 \
-machine memory-encryption=sev0 \
-nographic

I am wondering if somehow the VS compiler is generating a
wrong byte code and thus causing a trap on KVM that requires emulation.
Since the guest memory is encrypted, so KVM emulation code will not be
able to decode the instruction bytes and thus leading in repetitive nested
fault. Only way I could verify my theory is if I can get a KVM trace or an OVMF
binary. If you have have KVM trace or OVMF_CODE.fd handy then please
share.
The OVMF_CODE.fd and OVMF_VARS.fd are attached.
The code base is :
ac6388add4 2021-09-15 (HEAD -> master, origin/master, origin/HEAD) ArmPkg/ProcessorSubClassDxe: Fix the format of ProcessorId
This is the build command:
build -p OvmfPkgX64.dsc -a X64 -t VS2019

Actually, I am not able to boot a non SEV guest with your attached binary. It appears that sometime during an easy boot, we are getting a triple fault (maybe guest is accessing invalid memory) and thus KVM issues a SHUTDOWN. The same is seen with the SEV guest.

I don't know what VS compiler is doing to cause this.

-Brijesh


[PATCH v2 1/1] MdeModulePkg: Add MpServicesTest application to exercise MP Services

Rebecca Cran <rebecca@...>
 

Add a new MpServicesTest application under MdeModulePkg/Application that
exercises the EFI_MP_SERVICES_PROTOCOL.

Signed-off-by: Rebecca Cran <rebecca@...>
---
MdeModulePkg/Application/MpServicesTest/MpServicesTest.c | 433 ++++++++++++++++++++
MdeModulePkg/Application/MpServicesTest/MpServicesTest.inf | 38 ++
MdeModulePkg/MdeModulePkg.dsc | 2 +
3 files changed, 473 insertions(+)

diff --git a/MdeModulePkg/Application/MpServicesTest/MpServicesTest.c b/MdeModulePkg/Application/MpServicesTest/MpServicesTest.c
new file mode 100644
index 000000000000..4eb06e6b7cbd
--- /dev/null
+++ b/MdeModulePkg/Application/MpServicesTest/MpServicesTest.c
@@ -0,0 +1,433 @@
+/** @file
+
+ Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <Uefi.h>
+#include <Library/DebugLib.h>
+#include <Library/RngLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/UefiLib.h>
+#include <Pi/PiMultiPhase.h>
+#include <Protocol/MpService.h>
+
+#define MAX_RANDOM_PROCESSOR_RETRIES 10
+
+#define AP_STARTUP_TEST_TIMEOUT_US 50000
+#define INFINITE_TIMEOUT 0
+
+#define RETURN_IF_EFI_ERROR(x) \
+ if (EFI_ERROR (x)) { \
+ Print (L"failed: %r\n", x); \
+ return; \
+ } \
+ else { \
+ Print (L"done.\n"); \
+ }
+
+/** The procedure to run with the MP Services interface.
+
+ @param Buffer The procedure argument.
+
+**/
+STATIC
+VOID
+EFIAPI
+ApFunction (
+ IN OUT VOID *Buffer
+ )
+{
+}
+
+/** Displays information returned from MP Services Protocol.
+
+ @param Mp The MP Services Protocol
+
+ @return The number of CPUs in the system.
+
+**/
+STATIC
+UINTN
+PrintProcessorInformation (
+ IN EFI_MP_SERVICES_PROTOCOL *Mp
+ )
+{
+ EFI_STATUS Status;
+ EFI_PROCESSOR_INFORMATION CpuInfo;
+ UINTN Index;
+ UINTN NumCpu;
+ UINTN NumEnabledCpu;
+
+ Status = Mp->GetNumberOfProcessors (Mp, &NumCpu, &NumEnabledCpu);
+ if (EFI_ERROR (Status)) {
+ Print (L"GetNumberOfProcessors failed: %r\n", Status);
+ } else {
+ Print (L"Number of CPUs: %ld, Enabled: %d\n", NumCpu, NumEnabledCpu);
+ }
+
+ for (Index = 0; Index < NumCpu; Index++) {
+ Status = Mp->GetProcessorInfo (Mp, CPU_V2_EXTENDED_TOPOLOGY | Index, &CpuInfo);
+ if (EFI_ERROR (Status)) {
+ Print (L"GetProcessorInfo for Processor %d failed: %r\n", Index, Status);
+ } else {
+ Print (
+ L"Processor %d:\n"
+ L"\tID: %016lx\n"
+ L"\tStatus: %s | ",
+ Index,
+ CpuInfo.ProcessorId,
+ (CpuInfo.StatusFlag & PROCESSOR_AS_BSP_BIT) ? L"BSP" : L"AP"
+ );
+
+ Print (L"%s | ", (CpuInfo.StatusFlag & PROCESSOR_ENABLED_BIT) ? L"Enabled" : L"Disabled");
+ Print (L"%s\n", (CpuInfo.StatusFlag & PROCESSOR_HEALTH_STATUS_BIT) ? L"Healthy" : L"Faulted");
+
+ Print (
+ L"\tLocation: Package %d, Core %d, Thread %d\n"
+ L"\tExtended Information: Package %d, Module %d, Tile %d, Die %d, Core %d, Thread %d\n\n",
+ CpuInfo.Location.Package,
+ CpuInfo.Location.Core,
+ CpuInfo.Location.Thread,
+ CpuInfo.ExtendedInformation.Location2.Package,
+ CpuInfo.ExtendedInformation.Location2.Module,
+ CpuInfo.ExtendedInformation.Location2.Tile,
+ CpuInfo.ExtendedInformation.Location2.Die,
+ CpuInfo.ExtendedInformation.Location2.Core,
+ CpuInfo.ExtendedInformation.Location2.Thread
+ );
+ }
+ }
+
+ return NumCpu;
+}
+
+/** Returns the index of an enabled AP selected at random.
+
+ @param Mp The MP Services Protocol.
+ @param ProcessorIndex The index of a random enabled AP.
+
+ @retval EFI_SUCCESS An enabled processor was found and returned.
+ @retval EFI_NOT_FOUND A processor was unable to be selected.
+
+**/
+STATIC
+EFI_STATUS
+GetRandomEnabledProcessorIndex (
+ IN EFI_MP_SERVICES_PROTOCOL *Mp,
+ OUT UINTN *ProcessorIndex
+ )
+{
+ UINTN Index;
+ UINTN IndexOfEnabledCpu;
+ UINTN NumCpus;
+ UINTN NumEnabledCpus;
+ UINTN IndexOfEnabledCpuToUse;
+ UINT16 RandomNumber;
+ BOOLEAN Success;
+ EFI_STATUS Status;
+ EFI_PROCESSOR_INFORMATION CpuInfo;
+
+ IndexOfEnabledCpu = 0;
+
+ Success = GetRandomNumber16 (&RandomNumber);
+ ASSERT (Success == TRUE);
+
+ Status = Mp->GetNumberOfProcessors (Mp, &NumCpus, &NumEnabledCpus);
+ ASSERT_EFI_ERROR (Status);
+
+ if (NumEnabledCpus == 1) {
+ Print (L"All APs are disabled\n");
+ return EFI_NOT_FOUND;
+ }
+
+ IndexOfEnabledCpuToUse = RandomNumber % NumEnabledCpus;
+
+ for (Index = 0; Index < NumCpus; Index++) {
+ Status = Mp->GetProcessorInfo (Mp, Index, &CpuInfo);
+ ASSERT_EFI_ERROR (Status);
+ if ((CpuInfo.StatusFlag & PROCESSOR_ENABLED_BIT) &&
+ !(CpuInfo.StatusFlag & PROCESSOR_AS_BSP_BIT)) {
+ if (IndexOfEnabledCpuToUse == IndexOfEnabledCpu) {
+ *ProcessorIndex = Index;
+ Status = EFI_SUCCESS;
+ break;
+ }
+
+ IndexOfEnabledCpu++;
+ }
+ }
+
+ if (Index == NumCpus) {
+ Status = EFI_NOT_FOUND;
+ }
+
+ return Status;
+}
+
+/** Tests for the StartupThisAP function.
+
+ @param Mp The MP Services Protocol.
+
+**/
+STATIC
+VOID
+StartupThisApTests (
+ IN EFI_MP_SERVICES_PROTOCOL *Mp
+ )
+{
+ EFI_STATUS Status;
+ UINTN ProcessorIndex;
+ UINT32 Retries;
+
+ Retries = 0;
+
+ do {
+ Status = GetRandomEnabledProcessorIndex (Mp, &ProcessorIndex);
+ } while (EFI_ERROR (Status) && Retries++ < MAX_RANDOM_PROCESSOR_RETRIES);
+
+ if (EFI_ERROR (Status)) {
+ return;
+ }
+
+ Print (
+ L"StartupThisAP on Processor %d with 0 (infinite) timeout...",
+ ProcessorIndex
+ );
+
+ Status = Mp->StartupThisAP (
+ Mp,
+ ApFunction,
+ ProcessorIndex,
+ NULL,
+ INFINITE_TIMEOUT,
+ NULL,
+ NULL
+ );
+
+ RETURN_IF_EFI_ERROR (Status);
+
+ Retries = 0;
+
+ do {
+ Status = GetRandomEnabledProcessorIndex (Mp, &ProcessorIndex);
+ } while (EFI_ERROR (Status) && Retries++ < MAX_RANDOM_PROCESSOR_RETRIES);
+
+ if (EFI_ERROR (Status)) {
+ return;
+ }
+
+ Print (
+ L"StartupThisAP on Processor %d with %dms timeout...",
+ ProcessorIndex,
+ AP_STARTUP_TEST_TIMEOUT_US / 1000
+ );
+ Status = Mp->StartupThisAP (
+ Mp,
+ ApFunction,
+ ProcessorIndex,
+ NULL,
+ AP_STARTUP_TEST_TIMEOUT_US,
+ NULL,
+ NULL
+ );
+ RETURN_IF_EFI_ERROR (Status);
+}
+
+/** Tests for the StartupAllAPs function.
+
+ @param Mp The MP Services Protocol.
+ @param NumCpus The number of CPUs in the system.
+
+**/
+STATIC
+VOID
+StartupAllAPsTests (
+ IN EFI_MP_SERVICES_PROTOCOL *Mp,
+ IN UINTN NumCpus
+ )
+{
+ EFI_STATUS Status;
+ UINTN Timeout;
+
+ Print (L"Running with SingleThread FALSE, 0 (infinite) timeout...");
+ Status = Mp->StartupAllAPs (Mp, ApFunction, FALSE, NULL, INFINITE_TIMEOUT, NULL, NULL);
+ RETURN_IF_EFI_ERROR (Status);
+
+ Timeout = NumCpus * AP_STARTUP_TEST_TIMEOUT_US;
+
+ Print (L"Running with SingleThread TRUE, %dms timeout...", Timeout / 1000);
+ Status = Mp->StartupAllAPs (
+ Mp,
+ ApFunction,
+ TRUE,
+ NULL,
+ Timeout,
+ NULL,
+ NULL
+ );
+ RETURN_IF_EFI_ERROR (Status);
+}
+
+/** Tests for the EnableDisableAP function.
+
+ @param Mp The MP Services Protocol.
+ @param NumCpus The number of CPUs in the system.
+
+**/
+STATIC
+VOID
+EnableDisableAPTests (
+ IN EFI_MP_SERVICES_PROTOCOL *Mp,
+ IN UINTN NumCpus
+ )
+{
+ EFI_STATUS Status;
+ UINTN Index;
+ UINT32 HealthFlag;
+
+ HealthFlag = 0;
+
+ for (Index = 1; Index < NumCpus; Index++) {
+ Print (L"Disabling Processor %d with HealthFlag faulted...", Index);
+ Status = Mp->EnableDisableAP (Mp, Index, FALSE, &HealthFlag);
+ RETURN_IF_EFI_ERROR (Status);
+ }
+
+ HealthFlag = PROCESSOR_HEALTH_STATUS_BIT;
+
+ for (Index = 1; Index < NumCpus; Index++) {
+ Print (L"Enabling Processor %d with HealthFlag healthy...", Index);
+ Status = Mp->EnableDisableAP (Mp, Index, TRUE, &HealthFlag);
+ RETURN_IF_EFI_ERROR (Status);
+ }
+}
+
+/** Tests for the SwitchBSP function.
+
+ @param Mp The MP Services Protocol.
+ @param NumCpus The number of CPUs in the system.
+
+**/
+STATIC
+VOID
+SwitchBSPTests (
+ IN EFI_MP_SERVICES_PROTOCOL *Mp,
+ IN UINTN NumCpus
+ )
+{
+ EFI_STATUS Status;
+ UINTN Index;
+
+ for (Index = 1; Index < NumCpus; Index++) {
+ Print (L"Switching BSP to Processor %d with EnableOldBSP FALSE...", Index);
+ Status = Mp->SwitchBSP (Mp, Index, FALSE);
+ RETURN_IF_EFI_ERROR (Status);
+ }
+
+ for (Index = 0; Index < NumCpus; Index++) {
+ Print (L"Switching BSP to Processor %d with EnableOldBSP TRUE...", Index);
+ Status = Mp->SwitchBSP (Mp, Index, TRUE);
+ RETURN_IF_EFI_ERROR (Status);
+ }
+}
+
+/**
+ The user Entry Point for Application. The user code starts with this function
+ as the real entry point for the application.
+
+ @param[in] ImageHandle The firmware allocated handle for the EFI image.
+ @param[in] SystemTable A pointer to the EFI System Table.
+
+ @retval EFI_SUCCESS The entry point is executed successfully.
+ @retval other Some error occurs when executing this entry point.
+
+**/
+EFI_STATUS
+EFIAPI
+UefiMain (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ EFI_STATUS Status;
+ EFI_MP_SERVICES_PROTOCOL *Mp;
+ EFI_HANDLE *pHandle;
+ UINTN HandleCount;
+ UINTN BspId;
+ UINTN NumCpus;
+ UINTN Index;
+
+ pHandle = NULL;
+ HandleCount = 0;
+ BspId = 0;
+
+ Status = gBS->LocateHandleBuffer (
+ ByProtocol,
+ &gEfiMpServiceProtocolGuid,
+ NULL,
+ &HandleCount,
+ &pHandle
+ );
+
+ if (EFI_ERROR (Status)) {
+ Print (L"Failed to locate EFI_MP_SERVICES_PROTOCOL (%r). Not installed on platform?\n", Status);
+ return EFI_NOT_FOUND;
+ }
+
+ for (Index = 0; Index < HandleCount; Index++) {
+ Status = gBS->OpenProtocol (
+ *pHandle,
+ &gEfiMpServiceProtocolGuid,
+ (VOID **)&Mp,
+ NULL,
+ gImageHandle,
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL
+ );
+
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ pHandle++;
+ }
+
+ Print (L"Exercising WhoAmI\n\n");
+ Status = Mp->WhoAmI (Mp, &BspId);
+ if (EFI_ERROR (Status)) {
+ Print (L"WhoAmI failed: %r\n", Status);
+ return Status;
+ } else {
+ Print (L"WhoAmI: %016lx\n", BspId);
+ }
+
+ Print (L"\n");
+ Print (
+ L"Exercising GetNumberOfProcessors and GetProcessorInformation with "
+ L"CPU_V2_EXTENDED_TOPOLOGY\n\n"
+ );
+ NumCpus = PrintProcessorInformation (Mp);
+ if (NumCpus < 2) {
+ Print (L"UP system found. Not running further tests.\n");
+ return EFI_INVALID_PARAMETER;
+ }
+
+ Print (L"\n");
+ Print (L"Exercising StartupThisAP:\n\n");
+ StartupThisApTests (Mp);
+
+ Print (L"\n");
+ Print (L"Exercising StartupAllAPs:\n\n");
+ StartupAllAPsTests (Mp, NumCpus);
+
+ Print (L"\n");
+ Print (L"Exercising EnableDisableAP:\n\n");
+ EnableDisableAPTests (Mp, NumCpus);
+
+ Print (L"\n");
+ Print (L"Exercising SwitchBSP\n\n");
+ SwitchBSPTests (Mp, NumCpus);
+
+ gBS->CloseProtocol (pHandle, &gEfiMpServiceProtocolGuid, gImageHandle, NULL);
+ return EFI_SUCCESS;
+}
diff --git a/MdeModulePkg/Application/MpServicesTest/MpServicesTest.inf b/MdeModulePkg/Application/MpServicesTest/MpServicesTest.inf
new file mode 100644
index 000000000000..8a21ca70d8fa
--- /dev/null
+++ b/MdeModulePkg/Application/MpServicesTest/MpServicesTest.inf
@@ -0,0 +1,38 @@
+## @file
+# UEFI Application to exercise EFI_MP_SERVICES_PROTOCOL.
+#
+# Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+ INF_VERSION = 1.29
+ BASE_NAME = MpServicesTest
+ FILE_GUID = 43e9defa-7209-4b0d-b136-cc4ca02cb469
+ MODULE_TYPE = UEFI_APPLICATION
+ VERSION_STRING = 0.1
+ ENTRY_POINT = UefiMain
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES = IA32 X64 AARCH64
+#
+
+[Sources]
+ MpServicesTest.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+
+[LibraryClasses]
+ BaseLib
+ RngLib
+ UefiApplicationEntryPoint
+ UefiLib
+
+[Protocols]
+ gEfiMpServiceProtocolGuid ## CONSUMES
+
diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index b1d83461865e..1cf5ccd30d40 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -164,6 +164,7 @@
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
DebugLib|MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf
FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
+ RngLib|MdePkg/Library/DxeRngLib/DxeRngLib.inf

[LibraryClasses.common.MM_STANDALONE]
HobLib|MdeModulePkg/Library/BaseHobLibNull/BaseHobLibNull.inf
@@ -215,6 +216,7 @@
MdeModulePkg/Application/HelloWorld/HelloWorld.inf
MdeModulePkg/Application/DumpDynPcd/DumpDynPcd.inf
MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.inf
+ MdeModulePkg/Application/MpServicesTest/MpServicesTest.inf

MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf
MdeModulePkg/Logo/Logo.inf
--
2.31.1


[PATCH v2 0/1] MdeModulePkg: Add MpServicesTest.efi to exercise EFI_MP_SERVICES_PROTOCOL

Rebecca Cran <rebecca@...>
 

Add a new application to MdeModulePkg to exercise
EFI_MP_SERVICES_PROTOCOL.

Changes from v1 to v2:

Added Doxygen comments to the functions.

Rebecca Cran (1):
MdeModulePkg: Add MpServicesTest application to exercise MP Services

MdeModulePkg/Application/MpServicesTest/MpServicesTest.c | 433 ++++++++++++++++++++
MdeModulePkg/Application/MpServicesTest/MpServicesTest.inf | 38 ++
MdeModulePkg/MdeModulePkg.dsc | 2 +
3 files changed, 473 insertions(+)
create mode 100644 MdeModulePkg/Application/MpServicesTest/MpServicesTest.c
create mode 100644 MdeModulePkg/Application/MpServicesTest/MpServicesTest.inf

--
2.31.1


Re: 回复: [PATCH] [edk2-devel] RecordAssertion function parameter issue.

G Edhaya Chandran
 

The patch is upstreamed through the commit: https://github.com/tianocore/edk2-test/commit/92a0343c1553342c53fae9d9d646b763add232c0


Re: [PATCH] UefiPayloadPkg: Add Macro to enable or diable some drivers.

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

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

-----Original Message-----
From: Liu, Zhiguang <zhiguang.liu@...>
Sent: Saturday, September 18, 2021 0:49
To: devel@edk2.groups.io
Cc: Dong, Guo <guo.dong@...>; Ni, Ray <ray.ni@...>; Ma,
Maurice <maurice.ma@...>; You, Benjamin
<benjamin.you@...>
Subject: [PATCH] UefiPayloadPkg: Add Macro to enable or diable some
drivers.

Add Macro to enable or diable RamDiskDxe and SioBusDxe drivers.

Cc: Guo Dong <guo.dong@...>
Cc: Ray Ni <ray.ni@...>
Cc: Maurice Ma <maurice.ma@...>
Cc: Benjamin You <benjamin.you@...>

Signed-off-by: Zhiguang Liu <zhiguang.liu@...>
---
UefiPayloadPkg/UefiPayloadPkg.dsc | 10 ++++++++--
UefiPayloadPkg/UefiPayloadPkg.fdf | 7 +++++--
2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 9d7f311343..fb805dc772 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -28,6 +28,8 @@
DEFINE SOURCE_DEBUG_ENABLE = FALSE DEFINE
PS2_KEYBOARD_ENABLE = FALSE+ DEFINE RAM_DISK_ENABLE =
FALSE+ DEFINE SIO_BUS_ENABLE = FALSE DEFINE
UNIVERSAL_PAYLOAD = FALSE #@@ -536,8 +538,10 @@
MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf-
MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf +!if
$(RAM_DISK_ENABLE) == TRUE+
MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf+!endif # #
SD/eMMC Support #@@ -562,8 +566,10 @@
!if $(SERIAL_DRIVER_ENABLE) == TRUE
MdeModulePkg/Universal/SerialDxe/SerialDxe.inf !endif-!if
$(PS2_KEYBOARD_ENABLE) == TRUE+!if $(SIO_BUS_ENABLE) == TRUE
OvmfPkg/SioBusDxe/SioBusDxe.inf+!endif+!if $(PS2_KEYBOARD_ENABLE)
== TRUE
MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf !endif
MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2MouseDxe.infdiff --git
a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayloadPkg.fdf
index 6caa134081..6b48bfc869 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.fdf
+++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
@@ -142,8 +142,10 @@ INF
MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
!if $(SERIAL_DRIVER_ENABLE) == TRUE INF
MdeModulePkg/Universal/SerialDxe/SerialDxe.inf !endif-!if
$(PS2_KEYBOARD_ENABLE) == TRUE+!if $(SIO_BUS_ENABLE) == TRUE INF
OvmfPkg/SioBusDxe/SioBusDxe.inf+!endif+!if $(PS2_KEYBOARD_ENABLE)
== TRUE INF
MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf !endif INF
MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2MouseDxe.inf@@ -171,8 +173,9
@@ INF MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf INF
MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf INF
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf+!if
$(RAM_DISK_ENABLE) == TRUE INF
MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf-+!endif INF
FatPkg/EnhancedFatDxe/Fat.inf #--
2.32.0.windows.2


[PATCH] UefiCpuPkg: Fix CPU stack guard support by aligning GDT buffer

Vitaly Cheptsov
 

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

Cc: Jiewen Yao <jiewen.yao@...>
Cc: Eric Dong <eric.dong@...>
Cc: Michael Kinney <michael.d.kinney@...>
Cc: Jian J Wang <jian.j.wang@...>
Cc: Jeff Fan <vanjeff_919@...>
Cc: Mikhail Krichanov <krichanov@...>
Cc: Marvin Häuser <mhaeuser@...>
Signed-off-by: Vitaly Cheptsov <cheptsov@...>
---
.../Library/CpuExceptionHandlerLib/DxeException.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c
index fd59f09ecd..12874811e1 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c
@@ -22,7 +22,7 @@ EXCEPTION_HANDLER_DATA mExceptionHandlerData;

UINT8 mNewStack[CPU_STACK_SWITCH_EXCEPTION_NUMBER *
CPU_KNOWN_GOOD_STACK_SIZE];
-UINT8 mNewGdt[CPU_TSS_GDT_SIZE];
+UINT8 mNewGdt[CPU_TSS_GDT_SIZE + IA32_GDT_ALIGNMENT];

/**
Common exception handler.
@@ -238,6 +238,7 @@ InitializeCpuExceptionHandlersEx (
CPU_EXCEPTION_INIT_DATA EssData;
IA32_DESCRIPTOR Idtr;
IA32_DESCRIPTOR Gdtr;
+ UINT8 *Gdt;

//
// To avoid repeat initialization of default handlers, the caller should pass
@@ -259,6 +260,7 @@ InitializeCpuExceptionHandlersEx (
if (PcdGetBool (PcdCpuStackGuard)) {
if (InitData == NULL) {
SetMem (mNewGdt, sizeof (mNewGdt), 0);
+ Gdt = ALIGN_POINTER (mNewGdt, IA32_GDT_ALIGNMENT);

AsmReadIdtr (&Idtr);
AsmReadGdtr (&Gdtr);
@@ -270,11 +272,11 @@ InitializeCpuExceptionHandlersEx (
EssData.X64.StackSwitchExceptionNumber = CPU_STACK_SWITCH_EXCEPTION_NUMBER;
EssData.X64.IdtTable = (VOID *)Idtr.Base;
EssData.X64.IdtTableSize = Idtr.Limit + 1;
- EssData.X64.GdtTable = mNewGdt;
- EssData.X64.GdtTableSize = sizeof (mNewGdt);
- EssData.X64.ExceptionTssDesc = mNewGdt + Gdtr.Limit + 1;
+ EssData.X64.GdtTable = Gdt;
+ EssData.X64.GdtTableSize = CPU_TSS_GDT_SIZE;
+ EssData.X64.ExceptionTssDesc = Gdt + Gdtr.Limit + 1;
EssData.X64.ExceptionTssDescSize = CPU_TSS_DESC_SIZE;
- EssData.X64.ExceptionTss = mNewGdt + Gdtr.Limit + 1 + CPU_TSS_DESC_SIZE;
+ EssData.X64.ExceptionTss = Gdt + Gdtr.Limit + 1 + CPU_TSS_DESC_SIZE;
EssData.X64.ExceptionTssSize = CPU_TSS_SIZE;

InitData = &EssData;
--
2.30.1 (Apple Git-130)


[RFC PATCH edk2-platforms v1 7/7] Platform/ARM: Alphabetically order sections in inf files

PierreGondois
 

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

Removing the "Platform/ARM/" prefix changes the order of
alphabetically ordered files in the "Package" section of inf files.
Re-order them.

Also to re-order the "LibraryClasses" and "Sources" sections when
necessary.

Bugzilla: 3264 (https://bugzilla.tianocore.org/show_bug.cgi?id=3264)
Signed-off-by: Pierre Gondois <Pierre.Gondois@...>
---
.../ARM/ArmCommonPkg/Drivers/BootMonFs/BootMonFs.inf | 8 ++++----
.../Drivers/FdtPlatformDxe/FdtPlatformDxe.inf | 2 +-
.../Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf | 10 +++++-----
Platform/ARM/ArmCommonPkg/Library/BdsLib/BdsLib.inf | 4 ++--
Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf | 10 +++++-----
.../ConfigurationManagerDxe.inf | 4 ++--
Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf | 10 +++++-----
.../JunoPkg/Drivers/SataSiI3132Dxe/SataSiI3132Dxe.inf | 2 +-
Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoLib.inf | 8 ++++----
.../JunoPkg/Library/ArmJunoMtlLib/ArmJunoMtlLib.inf | 2 +-
.../Library/HdLcdArmJunoLib/HdLcdArmJunoLib.inf | 2 +-
.../JunoPciHostBridgeLib/JunoPciHostBridgeLib.inf | 2 +-
.../Library/NorFlashJunoLib/NorFlashJunoLib.inf | 2 +-
.../JunoPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf | 4 ++--
.../ARM/Morello/Drivers/PlatformDxe/PlatformDxeFvp.inf | 2 +-
Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf | 2 +-
Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf | 2 +-
.../ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf | 2 +-
Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf | 2 +-
Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf | 2 +-
Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf | 2 +-
Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf | 2 +-
Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf | 2 +-
.../Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf | 8 ++++----
.../Library/PciHostBridgeLib/PciHostBridgeLib.inf | 4 ++--
.../ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf | 2 +-
.../ConfigurationManagerDxe.inf | 2 +-
.../VExpressPkg/Drivers/ArmVExpressDxe/ArmFvpDxe.inf | 6 +++---
.../VExpressPkg/Drivers/ArmVExpressDxe/ArmHwDxe.inf | 2 +-
.../ArmVExpressFastBootDxe/ArmVExpressFastBootDxe.inf | 6 +++---
.../Drivers/Isp1761UsbDxe/Isp1761UsbDxe.inf | 2 +-
.../ARM/VExpressPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf | 10 +++++-----
.../VExpressPkg/Drivers/PL180MciDxe/PL180MciDxe.inf | 6 +++---
.../ArmVExpressDtPlatformDtbLoaderLib.inf | 2 +-
.../Library/ArmVExpressLibCTA15-A7/ArmVExpressLib.inf | 4 ++--
.../Library/ArmVExpressLibRTSM/ArmVExpressLib.inf | 10 +++++-----
.../Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf | 10 +++++-----
.../NorFlashArmVExpressLib/NorFlashArmVExpressLib.inf | 2 +-
.../Library/ResetSystemLib/ResetSystemLib.inf | 2 +-
39 files changed, 83 insertions(+), 83 deletions(-)

diff --git a/Platform/ARM/ArmCommonPkg/Drivers/BootMonFs/BootMonFs.inf b/Platform/ARM/ArmCommonPkg/Drivers/BootMonFs/BootMonFs.inf
index 258eaf1204c0..04560a7c1911 100644
--- a/Platform/ARM/ArmCommonPkg/Drivers/BootMonFs/BootMonFs.inf
+++ b/Platform/ARM/ArmCommonPkg/Drivers/BootMonFs/BootMonFs.inf
@@ -17,18 +17,18 @@ [Defines]
ENTRY_POINT = BootMonFsEntryPoint

[Sources]
- BootMonFsEntryPoint.c
- BootMonFsOpenClose.c
BootMonFsDir.c
+ BootMonFsEntryPoint.c
BootMonFsImages.c
+ BootMonFsOpenClose.c
BootMonFsReadWrite.c
BootMonFsUnsupported.c

[Packages]
+ ArmCommonPkg/ArmCommonPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
- MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
- ArmCommonPkg/ArmCommonPkg.dec
+ MdePkg/MdePkg.dec

[LibraryClasses]
BaseLib
diff --git a/Platform/ARM/ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf b/Platform/ARM/ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
index 7f0beb100cce..e7b68356585e 100644
--- a/Platform/ARM/ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
+++ b/Platform/ARM/ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
@@ -22,10 +22,10 @@ [Sources.common]
ShellSetFdt.c

[Packages]
+ ArmCommonPkg/ArmCommonPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- ArmCommonPkg/ArmCommonPkg.dec
ShellPkg/ShellPkg.dec

[LibraryClasses]
diff --git a/Platform/ARM/ArmCommonPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf b/Platform/ARM/ArmCommonPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf
index 52d6bce28ecc..fdd238f5b621 100644
--- a/Platform/ARM/ArmCommonPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf
+++ b/Platform/ARM/ArmCommonPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf
@@ -17,15 +17,15 @@ [Defines]
[Sources.common]
ArmShellCmdRunAxf.c
ArmShellCmdRunAxf.uni
- RunAxf.c
- BootMonFsLoader.h
BootMonFsLoader.c
- ElfLoader.h
+ BootMonFsLoader.h
ElfLoader.c
+ ElfLoader.h
+ RunAxf.c
# ELF definitions taken from BaseTools
+ elf_common.h
elf32.h
elf64.h
- elf_common.h

[Sources.AARCH64]
AArch64/Pivot.S
@@ -34,10 +34,10 @@ [Sources.ARM]
Arm/Pivot.S

[Packages]
+ ArmCommonPkg/ArmCommonPkg.dec
ArmPkg/ArmPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- ArmCommonPkg/ArmCommonPkg.dec
ShellPkg/ShellPkg.dec

[LibraryClasses]
diff --git a/Platform/ARM/ArmCommonPkg/Library/BdsLib/BdsLib.inf b/Platform/ARM/ArmCommonPkg/Library/BdsLib/BdsLib.inf
index 4157a598cc6e..cb734c08fc4d 100644
--- a/Platform/ARM/ArmCommonPkg/Library/BdsLib/BdsLib.inf
+++ b/Platform/ARM/ArmCommonPkg/Library/BdsLib/BdsLib.inf
@@ -19,11 +19,11 @@ [Sources.common]
BdsHelper.c

[Packages]
+ ArmCommonPkg/ArmCommonPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
NetworkPkg/NetworkPkg.dec
- ArmCommonPkg/ArmCommonPkg.dec

[LibraryClasses]
ArmLib
@@ -31,8 +31,8 @@ [LibraryClasses]
DebugLib
DevicePathLib
HobLib
- PcdLib
NetLib
+ PcdLib

[Guids]
gEfiFileInfoGuid
diff --git a/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf b/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
index 20030a5e54fb..a7353238128f 100644
--- a/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
+++ b/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
@@ -16,21 +16,21 @@ [Defines]
VERSION_STRING = 1.0

[Sources]
- Dsdt.asl
+ AcpiSsdtRootPci.asl # Juno R1 specific
Dbg2.aslc
- Spcr.aslc
+ Dsdt.asl
Fadt.aslc
Gtdt.aslc
Madt.aslc
- AcpiSsdtRootPci.asl # Juno R1 specific
+ Spcr.aslc

[Packages]
ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
JunoPkg/ArmJuno.dec
+ MdeModulePkg/MdeModulePkg.dec
+ MdePkg/MdePkg.dec

[FixedPcd]
gArmPlatformTokenSpaceGuid.PcdCoreCount
diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
index b496756295bd..0323240355de 100644
--- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
+++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
@@ -21,18 +21,18 @@ [Defines]
#

[Sources]
- ConfigurationManager.c
AslTables/Dsdt.asl
AslTables/SsdtJunoUsb.asl
AslTables/SsdtPci.asl
+ ConfigurationManager.c

[Packages]
ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
DynamicTablesPkg/DynamicTablesPkg.dec
+ JunoPkg/ArmJuno.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- JunoPkg/ArmJuno.dec

[LibraryClasses]
ArmPlatformLib
diff --git a/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf b/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf
index 3d14332b3ea0..1f14edf9a900 100644
--- a/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf
+++ b/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf
@@ -17,13 +17,13 @@ [Sources.common]
ArmJunoDxe.c

[Packages]
+ ArmCommonPkg/ArmCommonPkg.dec
ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
- ArmCommonPkg/ArmCommonPkg.dec
JunoPkg/ArmJuno.dec
+ MdeModulePkg/MdeModulePkg.dec
+ MdePkg/MdePkg.dec

[LibraryClasses]
AcpiLib
@@ -38,9 +38,9 @@ [LibraryClasses]
PrintLib
SerialPortLib
UefiBootServicesTableLib
- UefiRuntimeServicesTableLib
- UefiLib
UefiDriverEntryPoint
+ UefiLib
+ UefiRuntimeServicesTableLib

[Guids]
gEfiFileInfoGuid
diff --git a/Platform/ARM/JunoPkg/Drivers/SataSiI3132Dxe/SataSiI3132Dxe.inf b/Platform/ARM/JunoPkg/Drivers/SataSiI3132Dxe/SataSiI3132Dxe.inf
index be9c08bc5f88..5174ff9501d8 100644
--- a/Platform/ARM/JunoPkg/Drivers/SataSiI3132Dxe/SataSiI3132Dxe.inf
+++ b/Platform/ARM/JunoPkg/Drivers/SataSiI3132Dxe/SataSiI3132Dxe.inf
@@ -23,8 +23,8 @@ [Defines]
ENTRY_POINT = InitializeSataSiI3132

[Packages]
- MdePkg/MdePkg.dec
JunoPkg/ArmJuno.dec
+ MdePkg/MdePkg.dec

[LibraryClasses]
MemoryAllocationLib
diff --git a/Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoLib.inf b/Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoLib.inf
index cc24f5e895ce..3923b6ffba47 100644
--- a/Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoLib.inf
+++ b/Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoLib.inf
@@ -13,17 +13,17 @@ [Defines]
LIBRARY_CLASS = ArmPlatformLib

[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
- EmbeddedPkg/EmbeddedPkg.dec
ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
+ EmbeddedPkg/EmbeddedPkg.dec
JunoPkg/ArmJuno.dec
+ MdeModulePkg/MdeModulePkg.dec
+ MdePkg/MdePkg.dec

[LibraryClasses]
- IoLib
ArmLib
HobLib
+ IoLib
MemoryAllocationLib
SerialPortLib

diff --git a/Platform/ARM/JunoPkg/Library/ArmJunoMtlLib/ArmJunoMtlLib.inf b/Platform/ARM/JunoPkg/Library/ArmJunoMtlLib/ArmJunoMtlLib.inf
index 55a18031df3f..8b833ba57da9 100644
--- a/Platform/ARM/JunoPkg/Library/ArmJunoMtlLib/ArmJunoMtlLib.inf
+++ b/Platform/ARM/JunoPkg/Library/ArmJunoMtlLib/ArmJunoMtlLib.inf
@@ -18,8 +18,8 @@ [Sources.common]
[Packages]
ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
- MdePkg/MdePkg.dec
JunoPkg/ArmJuno.dec
+ MdePkg/MdePkg.dec

[LibraryClasses]
ArmLib
diff --git a/Platform/ARM/JunoPkg/Library/HdLcdArmJunoLib/HdLcdArmJunoLib.inf b/Platform/ARM/JunoPkg/Library/HdLcdArmJunoLib/HdLcdArmJunoLib.inf
index a34dceb7bdc0..fe9b666a4c45 100644
--- a/Platform/ARM/JunoPkg/Library/HdLcdArmJunoLib/HdLcdArmJunoLib.inf
+++ b/Platform/ARM/JunoPkg/Library/HdLcdArmJunoLib/HdLcdArmJunoLib.inf
@@ -22,8 +22,8 @@ [Sources.common]
[Packages]
ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
- MdePkg/MdePkg.dec
JunoPkg/ArmJuno.dec
+ MdePkg/MdePkg.dec

[LibraryClasses]
BaseLib
diff --git a/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.inf b/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.inf
index 4f3f3c708715..7f52562e7e98 100644
--- a/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.inf
+++ b/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.inf
@@ -30,9 +30,9 @@ [Sources]

[Packages]
ArmPkg/ArmPkg.dec
+ JunoPkg/ArmJuno.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- JunoPkg/ArmJuno.dec

[LibraryClasses]
BaseLib
diff --git a/Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJunoLib.inf b/Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJunoLib.inf
index 5064409173b1..2d654cc7758f 100644
--- a/Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJunoLib.inf
+++ b/Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJunoLib.inf
@@ -18,8 +18,8 @@ [Sources.common]

[Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
- MdePkg/MdePkg.dec
JunoPkg/ArmJuno.dec
+ MdePkg/MdePkg.dec

[LibraryClasses]
BaseLib
diff --git a/Platform/ARM/JunoPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf b/Platform/ARM/JunoPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
index 8f0231314678..d18a561fbab1 100644
--- a/Platform/ARM/JunoPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
+++ b/Platform/ARM/JunoPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
@@ -30,14 +30,14 @@ [Sources]
[Packages]
ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
+ JunoPkg/ArmJuno.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- JunoPkg/ArmJuno.dec

[LibraryClasses]
ArmLib
- BaseMemoryLib
BaseLib
+ BaseMemoryLib
DebugLib
HobLib
IoLib
diff --git a/Platform/ARM/Morello/Drivers/PlatformDxe/PlatformDxeFvp.inf b/Platform/ARM/Morello/Drivers/PlatformDxe/PlatformDxeFvp.inf
index 5e773543b39d..a4428f382e49 100644
--- a/Platform/ARM/Morello/Drivers/PlatformDxe/PlatformDxeFvp.inf
+++ b/Platform/ARM/Morello/Drivers/PlatformDxe/PlatformDxeFvp.inf
@@ -21,8 +21,8 @@ [Sources.common]

[Packages]
MdePkg/MdePkg.dec
- OvmfPkg/OvmfPkg.dec
Morello/MorelloPlatform.dec
+ OvmfPkg/OvmfPkg.dec

[LibraryClasses]
UefiDriverEntryPoint
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
index 409d3aa5ccbc..0a1503884db3 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
@@ -16,7 +16,6 @@ [Defines]

[Sources]
Dbg2.aslc
- SsdtRos.asl
Fadt.aslc
Gtdt.aslc
Iort.aslc
@@ -27,6 +26,7 @@ [Sources]
Spcr.aslc
Ssdt.asl
SsdtEvents.asl
+ SsdtRos.asl

[Packages]
ArmPkg/ArmPkg.dec
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
index c74685bec7b2..767073ff8a0c 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
@@ -16,7 +16,6 @@ [Defines]

[Sources]
Dbg2.aslc
- SsdtRos.asl
Fadt.aslc
Gtdt.aslc
Iort.aslc
@@ -27,6 +26,7 @@ [Sources]
Spcr.aslc
Ssdt.asl
SsdtEvents.asl
+ SsdtRos.asl

[Packages]
ArmPkg/ArmPkg.dec
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
index 1ad34860fa7b..c4e29a485f44 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
@@ -16,7 +16,6 @@ [Defines]

[Sources]
Dbg2.aslc
- SsdtRos.asl
Fadt.aslc
Gtdt.aslc
Iort.aslc
@@ -29,6 +28,7 @@ [Sources]
Spcr.aslc
Ssdt.asl
SsdtEvents.asl
+ SsdtRos.asl

[Packages]
ArmPkg/ArmPkg.dec
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
index c136ea4320e0..60ef6744294f 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
@@ -25,8 +25,8 @@ [Sources]
RdN2/Pptt.aslc
Spcr.aslc
Ssdt.asl
- SsdtRos.asl
SsdtEvents.asl
+ SsdtRos.asl

[Packages]
ArmPkg/ArmPkg.dec
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf
index 36bc95615f86..574f332985d6 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf
@@ -25,8 +25,8 @@ [Sources]
RdN2Cfg1/Pptt.aslc
Spcr.aslc
Ssdt.asl
- SsdtRos.asl
SsdtEvents.asl
+ SsdtRos.asl

[Packages]
ArmPkg/ArmPkg.dec
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf
index d5b6479e4f44..808033405512 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf
@@ -16,7 +16,6 @@ [Defines]

[Sources]
Dbg2.aslc
- SsdtRos.asl
Fadt.aslc
Gtdt.aslc
Iort.aslc
@@ -27,6 +26,7 @@ [Sources]
Spcr.aslc
Ssdt.asl
SsdtEvents.asl
+ SsdtRos.asl

[Packages]
ArmPkg/ArmPkg.dec
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf
index 3863237d2a0c..86c8257c9bcd 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf
@@ -16,7 +16,6 @@ [Defines]

[Sources]
Dbg2.aslc
- SsdtRos.asl
Fadt.aslc
Gtdt.aslc
Iort.aslc
@@ -29,6 +28,7 @@ [Sources]
Spcr.aslc
Ssdt.asl
SsdtEvents.asl
+ SsdtRos.asl

[Packages]
ArmPkg/ArmPkg.dec
diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
index 7b536e823869..e6ae131aba3c 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
@@ -25,8 +25,8 @@ [Sources]
Sgi575/Pptt.aslc
Spcr.aslc
Ssdt.asl
- SsdtRos.asl
SsdtEvents.asl
+ SsdtRos.asl

[Packages]
ArmPkg/ArmPkg.dec
diff --git a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
index 3ed6def28003..08241b85590e 100644
--- a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
+++ b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
@@ -16,14 +16,14 @@ [Defines]
[Sources]
SmbiosPlatformDxe.c
Type0BiosInformation.c
- Type1SystemInformation.c
- Type3SystemEnclosure.c
- Type4ProcessorInformation.c
- Type7CacheInformation.c
Type16PhysicalMemoryArray.c
Type17MemoryDevice.c
Type19MemoryArrayMappedAddress.c
+ Type1SystemInformation.c
Type32SystemBootInformation.c
+ Type3SystemEnclosure.c
+ Type4ProcessorInformation.c
+ Type7CacheInformation.c

[Packages]
ArmPkg/ArmPkg.dec
diff --git a/Platform/ARM/SgiPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf b/Platform/ARM/SgiPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
index a9fdd874d049..17c2bb01b821 100644
--- a/Platform/ARM/SgiPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
+++ b/Platform/ARM/SgiPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
@@ -27,9 +27,9 @@ [Sources]
PciHostBridgeLib.c

[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
ArmPkg/ArmPkg.dec
+ MdeModulePkg/MdeModulePkg.dec
+ MdePkg/MdePkg.dec

[LibraryClasses]
BaseLib
diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
index f86167cccd70..00452b678c72 100644
--- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
+++ b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
@@ -30,8 +30,8 @@ [LibraryClasses]
SerialPortLib

[Sources.common]
- PlatformLibMem.c
PlatformLib.c
+ PlatformLibMem.c

[Sources.AARCH64]
AArch64/Helper.S | GCC
diff --git a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
index bbb3dd02ef8d..477b16852156 100644
--- a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
+++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
@@ -21,9 +21,9 @@ [Defines]
#

[Sources]
- ConfigurationManager.c
AslTables/Dsdt.asl
AslTables/SsdtPci.asl
+ ConfigurationManager.c

[Packages]
ArmPkg/ArmPkg.dec
diff --git a/Platform/ARM/VExpressPkg/Drivers/ArmVExpressDxe/ArmFvpDxe.inf b/Platform/ARM/VExpressPkg/Drivers/ArmVExpressDxe/ArmFvpDxe.inf
index 26798cdfb22c..d2dce0058bd4 100644
--- a/Platform/ARM/VExpressPkg/Drivers/ArmVExpressDxe/ArmFvpDxe.inf
+++ b/Platform/ARM/VExpressPkg/Drivers/ArmVExpressDxe/ArmFvpDxe.inf
@@ -18,11 +18,11 @@ [Sources.common]
ArmFvpDxe.c

[Packages]
- MdePkg/MdePkg.dec
+ ArmCommonPkg/ArmCommonPkg.dec
ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
+ MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
- ArmCommonPkg/ArmCommonPkg.dec
VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
@@ -30,7 +30,7 @@ [LibraryClasses]
BaseMemoryLib
IoLib
TimerLib
- UefiDriverEntryPoint
UefiBootServicesTableLib
+ UefiDriverEntryPoint
VirtioMmioDeviceLib

diff --git a/Platform/ARM/VExpressPkg/Drivers/ArmVExpressDxe/ArmHwDxe.inf b/Platform/ARM/VExpressPkg/Drivers/ArmVExpressDxe/ArmHwDxe.inf
index 93a51de12368..a2ebd3b10099 100644
--- a/Platform/ARM/VExpressPkg/Drivers/ArmVExpressDxe/ArmHwDxe.inf
+++ b/Platform/ARM/VExpressPkg/Drivers/ArmVExpressDxe/ArmHwDxe.inf
@@ -18,9 +18,9 @@ [Sources.common]
ArmHwDxe.c

[Packages]
+ ArmCommonPkg/ArmCommonPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
MdePkg/MdePkg.dec
- ArmCommonPkg/ArmCommonPkg.dec

[LibraryClasses]
ArmShellCmdRunAxfLib
diff --git a/Platform/ARM/VExpressPkg/Drivers/ArmVExpressFastBootDxe/ArmVExpressFastBootDxe.inf b/Platform/ARM/VExpressPkg/Drivers/ArmVExpressFastBootDxe/ArmVExpressFastBootDxe.inf
index 5121177324d5..ba30409a50c0 100644
--- a/Platform/ARM/VExpressPkg/Drivers/ArmVExpressFastBootDxe/ArmVExpressFastBootDxe.inf
+++ b/Platform/ARM/VExpressPkg/Drivers/ArmVExpressFastBootDxe/ArmVExpressFastBootDxe.inf
@@ -34,11 +34,11 @@ [Protocols]
gEfiDiskIoProtocolGuid

[Packages]
+ ArmPkg/ArmPkg.dec
+ ArmPlatformPkg/ArmPlatformPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
- MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
- ArmPlatformPkg/ArmPlatformPkg.dec
- ArmPkg/ArmPkg.dec
+ MdePkg/MdePkg.dec
VExpressPkg/ArmVExpressPkg.dec

[Pcd]
diff --git a/Platform/ARM/VExpressPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.inf b/Platform/ARM/VExpressPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.inf
index 2ebcf910ed2d..7a1aa87ba86e 100644
--- a/Platform/ARM/VExpressPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.inf
+++ b/Platform/ARM/VExpressPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.inf
@@ -38,8 +38,8 @@ [Protocols]

[Packages]
EmbeddedPkg/EmbeddedPkg.dec
- MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
+ MdePkg/MdePkg.dec
VExpressPkg/ArmVExpressPkg.dec

[Pcd]
diff --git a/Platform/ARM/VExpressPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf b/Platform/ARM/VExpressPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf
index 988eb4a23ea0..6b8e5d75a89e 100644
--- a/Platform/ARM/VExpressPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf
+++ b/Platform/ARM/VExpressPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf
@@ -28,19 +28,19 @@ [Sources.common]
Lan9118Dxe.h

[Packages]
- NetworkPkg/NetworkPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
+ NetworkPkg/NetworkPkg.dec
VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
BaseLib
- UefiLib
- NetLib
- UefiDriverEntryPoint
BaseMemoryLib
- IoLib
DevicePathLib
+ IoLib
+ NetLib
+ UefiDriverEntryPoint
+ UefiLib

[Protocols]
gEfiSimpleNetworkProtocolGuid
diff --git a/Platform/ARM/VExpressPkg/Drivers/PL180MciDxe/PL180MciDxe.inf b/Platform/ARM/VExpressPkg/Drivers/PL180MciDxe/PL180MciDxe.inf
index ff1407aefd4e..d07954df1b3a 100644
--- a/Platform/ARM/VExpressPkg/Drivers/PL180MciDxe/PL180MciDxe.inf
+++ b/Platform/ARM/VExpressPkg/Drivers/PL180MciDxe/PL180MciDxe.inf
@@ -32,13 +32,13 @@ [Packages]
VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
+ ArmLib
BaseLib
- UefiLib
- UefiDriverEntryPoint
BaseMemoryLib
- ArmLib
IoLib
TimerLib
+ UefiDriverEntryPoint
+ UefiLib

[Protocols]
gEfiCpuArchProtocolGuid
diff --git a/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf b/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
index 823233a4153b..488d5175015f 100644
--- a/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
+++ b/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
@@ -19,9 +19,9 @@ [Sources]

[Packages]
ArmPkg/ArmPkg.dec
+ EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec
VExpressPkg/ArmVExpressPkg.dec
- EmbeddedPkg/EmbeddedPkg.dec

[LibraryClasses]
ArmGicLib
diff --git a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibCTA15-A7/ArmVExpressLib.inf b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibCTA15-A7/ArmVExpressLib.inf
index d2bf15aa405e..8c56cac09603 100644
--- a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibCTA15-A7/ArmVExpressLib.inf
+++ b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibCTA15-A7/ArmVExpressLib.inf
@@ -15,16 +15,16 @@ [Defines]
LIBRARY_CLASS = ArmPlatformLib

[Packages]
- ArmPlatformPkg/ArmPlatformPkg.dec
ArmPkg/ArmPkg.dec
+ ArmPlatformPkg/ArmPlatformPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
- IoLib
ArmLib
+ IoLib
MemoryAllocationLib
SerialPortLib

diff --git a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLib.inf b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLib.inf
index 8ff24785939a..f54ff376c775 100644
--- a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLib.inf
+++ b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLib.inf
@@ -14,19 +14,19 @@ [Defines]
LIBRARY_CLASS = ArmPlatformLib

[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
- EmbeddedPkg/EmbeddedPkg.dec
ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
+ EmbeddedPkg/EmbeddedPkg.dec
+ MdeModulePkg/MdeModulePkg.dec
+ MdePkg/MdePkg.dec
VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
- IoLib
ArmLib
+ HobLib
+ IoLib
MemoryAllocationLib
SerialPortLib
- HobLib

[Sources.common]
RTSM.c
diff --git a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf
index 7271ff5ab298..28bf8f05db33 100644
--- a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf
+++ b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf
@@ -14,16 +14,16 @@ [Defines]
LIBRARY_CLASS = ArmPlatformLib

[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
- VExpressPkg/ArmVExpressPkg.dec
- EmbeddedPkg/EmbeddedPkg.dec
ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
+ EmbeddedPkg/EmbeddedPkg.dec
+ MdeModulePkg/MdeModulePkg.dec
+ MdePkg/MdePkg.dec
+ VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
- IoLib
ArmLib
+ IoLib
SerialPortLib

[Sources.common]
diff --git a/Platform/ARM/VExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpressLib.inf b/Platform/ARM/VExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpressLib.inf
index 736230e53160..b171d1f92096 100644
--- a/Platform/ARM/VExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpressLib.inf
+++ b/Platform/ARM/VExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpressLib.inf
@@ -17,8 +17,8 @@ [Sources.common]
NorFlashArmVExpress.c

[Packages]
- MdePkg/MdePkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
+ MdePkg/MdePkg.dec
VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
diff --git a/Platform/ARM/VExpressPkg/Library/ResetSystemLib/ResetSystemLib.inf b/Platform/ARM/VExpressPkg/Library/ResetSystemLib/ResetSystemLib.inf
index 37e00bd5bc60..332156d71eb5 100644
--- a/Platform/ARM/VExpressPkg/Library/ResetSystemLib/ResetSystemLib.inf
+++ b/Platform/ARM/VExpressPkg/Library/ResetSystemLib/ResetSystemLib.inf
@@ -27,5 +27,5 @@ [Packages]
VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
- DebugLib
ArmPlatformSysConfigLib
+ DebugLib
--
2.17.1


[RFC PATCH edk2-platforms v1 6/7] Platform/ARM: Remove Platform/ARM prefix

PierreGondois
 

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

Some modules/configuration files are referenced from the
edk2-repository/ folder, e.g. Platform/ARM/.../module.inf.

Reasons to remove the Platform/ARM prefix are:
- The prefix implies conserving the folder structure when building Arm
platforms and makes modules/packages exportation difficult.
E.g., the JunoPkg must be in a Platform/ARM/ folder.
- Removing the Platform/ARM prefix would allow to make Modules/Packages
self-contained entities. If there is a module/package dependency,
the build system should be able to resolve it without having a file
path out of the module/package.

This patch removes this Platform/ARM prefix. This implies that
edk2-platforms/Platform/ARM must be added to the PACKAGES_PATH
environment variable.

Bugzilla: 3264 (https://bugzilla.tianocore.org/show_bug.cgi?id=3264)
Signed-off-by: Pierre Gondois <Pierre.Gondois@...>
---
.../Drivers/BootMonFs/BootMonFs.inf | 2 +-
.../Drivers/FdtPlatformDxe/FdtPlatformDxe.inf | 2 +-
.../ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf | 2 +-
.../ArmCommonPkg/Library/BdsLib/BdsLib.inf | 2 +-
.../ARM/JunoPkg/AcpiTables/AcpiTables.inf | 2 +-
Platform/ARM/JunoPkg/ArmJuno.dsc | 26 ++++++++--------
Platform/ARM/JunoPkg/ArmJuno.fdf | 14 ++++-----
.../ConfigurationManager.dsc.inc | 2 +-
.../ConfigurationManagerDxe.inf | 2 +-
.../JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf | 2 +-
.../Drivers/SataSiI3132Dxe/SataSiI3132Dxe.inf | 2 +-
.../JunoPkg/Library/ArmJunoLib/ArmJunoLib.inf | 2 +-
.../Library/ArmJunoMtlLib/ArmJunoMtlLib.inf | 2 +-
.../HdLcdArmJunoLib/HdLcdArmJunoLib.inf | 2 +-
.../JunoPciHostBridgeLib.inf | 2 +-
.../NorFlashJunoLib/NorFlashJunoLib.inf | 2 +-
.../SmbiosPlatformDxe/SmbiosPlatformDxe.inf | 2 +-
.../ConfigurationManagerDxeFvp.inf | 2 +-
.../ConfigurationManagerFvp.dsc.inc | 2 +-
.../Drivers/PlatformDxe/PlatformDxeFvp.inf | 2 +-
.../PciHostBridgeLib/PciHostBridgeLibFvp.inf | 2 +-
.../Library/PlatformLib/PlatformLib.inf | 2 +-
Platform/ARM/Morello/MorelloPlatform.dsc.inc | 2 +-
Platform/ARM/Morello/MorelloPlatformFvp.dsc | 12 ++++----
Platform/ARM/Morello/MorelloPlatformFvp.fdf | 4 +--
Platform/ARM/Morello/Readme.md | 2 +-
Platform/ARM/N1Sdp/N1SdpPlatform.dsc | 4 +--
Platform/ARM/Readme.md | 2 +-
.../SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf | 2 +-
.../SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf | 2 +-
.../AcpiTables/RdN1EdgeX2AcpiTables.inf | 2 +-
.../ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf | 2 +-
.../SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf | 2 +-
.../ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf | 2 +-
.../SgiPkg/AcpiTables/RdV1McAcpiTables.inf | 2 +-
.../SgiPkg/AcpiTables/Sgi575AcpiTables.inf | 2 +-
.../Drivers/PlatformDxe/PlatformDxe.inf | 2 +-
.../SmbiosPlatformDxe/SmbiosPlatformDxe.inf | 2 +-
.../Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf | 2 +-
.../Library/NorFlashLib/NorFlashLib.inf | 2 +-
.../NorFlashLib/StandaloneMmNorFlashLib.inf | 2 +-
.../Library/PlatformLib/PlatformLib.inf | 2 +-
.../Library/SgiPlatformPei/SgiPlatformPei.inf | 2 +-
Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc | 4 +--
Platform/ARM/SgiPkg/PlatformStandaloneMm2.dsc | 4 +--
Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.dsc | 10 +++----
Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.fdf.inc | 2 +-
Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.dsc | 10 +++----
Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.fdf.inc | 2 +-
Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.dsc | 10 +++----
.../ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.fdf.inc | 2 +-
Platform/ARM/SgiPkg/RdN2/RdN2.dsc | 10 +++----
Platform/ARM/SgiPkg/RdN2/RdN2.fdf.inc | 2 +-
Platform/ARM/SgiPkg/RdN2Cfg1/RdN2Cfg1.dsc | 10 +++----
Platform/ARM/SgiPkg/RdN2Cfg1/RdN2Cfg1.fdf.inc | 2 +-
Platform/ARM/SgiPkg/RdV1/RdV1.dsc | 10 +++----
Platform/ARM/SgiPkg/RdV1/RdV1.fdf.inc | 2 +-
Platform/ARM/SgiPkg/RdV1Mc/RdV1Mc.dsc | 10 +++----
Platform/ARM/SgiPkg/RdV1Mc/RdV1Mc.fdf.inc | 2 +-
Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc | 10 +++----
Platform/ARM/SgiPkg/Sgi575/Sgi575.fdf.inc | 2 +-
Platform/ARM/SgiPkg/SgiPlatform.dsc.inc | 18 +++++------
Platform/ARM/SgiPkg/SgiPlatform.fdf | 6 ++--
Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc | 2 +-
.../ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc | 30 +++++++++----------
.../ARM/VExpressPkg/ArmVExpress-CTA15-A7.fdf | 14 ++++-----
.../VExpressPkg/ArmVExpress-FVP-AArch64.dsc | 28 ++++++++---------
.../VExpressPkg/ArmVExpress-FVP-AArch64.fdf | 22 +++++++-------
Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc | 10 +++----
.../ConfigurationManagerDxe.inf | 2 +-
.../Drivers/ArmVExpressDxe/ArmFvpDxe.inf | 2 +-
.../ArmVExpressFastBootDxe.inf | 2 +-
.../Drivers/Isp1761UsbDxe/Isp1761UsbDxe.inf | 2 +-
.../Drivers/Lan9118Dxe/Lan9118Dxe.inf | 2 +-
.../Drivers/Lan91xDxe/Lan91xDxe.inf | 2 +-
.../Drivers/PL180MciDxe/PL180MciDxe.inf | 2 +-
.../Library/ArmMaliDpLib/ArmMaliDpLib.inf | 2 +-
.../ArmVExpressDtPlatformDtbLoaderLib.inf | 2 +-
.../ArmVExpressLibCTA15-A7/ArmVExpressLib.inf | 2 +-
.../ArmVExpressLibRTSM/ArmVExpressLib.inf | 2 +-
.../ArmVExpressLibRTSM/ArmVExpressLibSec.inf | 2 +-
.../ArmVExpressPciHostBridgeLib.inf | 2 +-
.../ArmVExpressSysConfigLib.inf | 2 +-
.../ArmVExpressSysConfigRuntimeLib.inf | 2 +-
.../HdLcdArmVExpressLib.inf | 2 +-
.../NorFlashArmVExpressLib.inf | 2 +-
.../PL111LcdArmVExpressLib.inf | 2 +-
.../Library/ResetSystemLib/ResetSystemLib.inf | 2 +-
Platform/Comcast/RDKQemu/RDKQemu.fdf | 2 +-
Readme.md | 2 +-
90 files changed, 206 insertions(+), 206 deletions(-)

diff --git a/Platform/ARM/ArmCommonPkg/Drivers/BootMonFs/BootMonFs.inf b/Platform/ARM/ArmCommonPkg/Drivers/BootMonFs/BootMonFs.inf
index 791e6fae0126..258eaf1204c0 100644
--- a/Platform/ARM/ArmCommonPkg/Drivers/BootMonFs/BootMonFs.inf
+++ b/Platform/ARM/ArmCommonPkg/Drivers/BootMonFs/BootMonFs.inf
@@ -28,7 +28,7 @@ [Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
- Platform/ARM/ArmCommonPkg/ArmCommonPkg.dec
+ ArmCommonPkg/ArmCommonPkg.dec

[LibraryClasses]
BaseLib
diff --git a/Platform/ARM/ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf b/Platform/ARM/ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
index 471efb51afd0..7f0beb100cce 100644
--- a/Platform/ARM/ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
+++ b/Platform/ARM/ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
@@ -25,7 +25,7 @@ [Packages]
EmbeddedPkg/EmbeddedPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/ArmCommonPkg/ArmCommonPkg.dec
+ ArmCommonPkg/ArmCommonPkg.dec
ShellPkg/ShellPkg.dec

[LibraryClasses]
diff --git a/Platform/ARM/ArmCommonPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf b/Platform/ARM/ArmCommonPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf
index 22926f4f2314..52d6bce28ecc 100644
--- a/Platform/ARM/ArmCommonPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf
+++ b/Platform/ARM/ArmCommonPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf
@@ -37,7 +37,7 @@ [Packages]
ArmPkg/ArmPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/ArmCommonPkg/ArmCommonPkg.dec
+ ArmCommonPkg/ArmCommonPkg.dec
ShellPkg/ShellPkg.dec

[LibraryClasses]
diff --git a/Platform/ARM/ArmCommonPkg/Library/BdsLib/BdsLib.inf b/Platform/ARM/ArmCommonPkg/Library/BdsLib/BdsLib.inf
index b7248624659c..4157a598cc6e 100644
--- a/Platform/ARM/ArmCommonPkg/Library/BdsLib/BdsLib.inf
+++ b/Platform/ARM/ArmCommonPkg/Library/BdsLib/BdsLib.inf
@@ -23,7 +23,7 @@ [Packages]
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
NetworkPkg/NetworkPkg.dec
- Platform/ARM/ArmCommonPkg/ArmCommonPkg.dec
+ ArmCommonPkg/ArmCommonPkg.dec

[LibraryClasses]
ArmLib
diff --git a/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf b/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
index f140febc4ad4..20030a5e54fb 100644
--- a/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
+++ b/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
@@ -30,7 +30,7 @@ [Packages]
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
- Platform/ARM/JunoPkg/ArmJuno.dec
+ JunoPkg/ArmJuno.dec

[FixedPcd]
gArmPlatformTokenSpaceGuid.PcdCoreCount
diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
index c208415f3602..935ddcbed70b 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.dsc
+++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
@@ -22,24 +22,24 @@ [Defines]
SUPPORTED_ARCHITECTURES = AARCH64|ARM
BUILD_TARGETS = DEBUG|RELEASE
SKUID_IDENTIFIER = DEFAULT
- FLASH_DEFINITION = Platform/ARM/JunoPkg/ArmJuno.fdf
+ FLASH_DEFINITION = JunoPkg/ArmJuno.fdf

# On RTSM, most peripherals are VExpress Motherboard peripherals
-!include Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
+!include VExpressPkg/ArmVExpress.dsc.inc
!include MdePkg/MdeLibs.dsc.inc

!ifdef DYNAMIC_TABLES_FRAMEWORK
!include DynamicTablesPkg/DynamicTables.dsc.inc
-!include Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc
+!include JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc
!endif

[LibraryClasses.common]
ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
- ArmPlatformLib|Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoLib.inf
+ ArmPlatformLib|JunoPkg/Library/ArmJunoLib/ArmJunoLib.inf
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf

- NorFlashPlatformLib|Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJunoLib.inf
+ NorFlashPlatformLib|JunoPkg/Library/NorFlashJunoLib/NorFlashJunoLib.inf

CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
@@ -48,10 +48,10 @@ [LibraryClasses.common]
UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf

# SCMI Mailbox Transport Layer
- ArmMtlLib|Platform/ARM/JunoPkg/Library/ArmJunoMtlLib/ArmJunoMtlLib.inf
+ ArmMtlLib|JunoPkg/Library/ArmJunoMtlLib/ArmJunoMtlLib.inf

!ifndef HEADLESS_PLATFORM
- LcdPlatformLib|Platform/ARM/JunoPkg/Library/HdLcdArmJunoLib/HdLcdArmJunoLib.inf
+ LcdPlatformLib|JunoPkg/Library/HdLcdArmJunoLib/HdLcdArmJunoLib.inf
LcdHwLib|ArmPlatformPkg/Library/HdLcd/HdLcd.inf
!endif

@@ -71,7 +71,7 @@ [LibraryClasses.common.SEC, LibraryClasses.common.PEIM]
[LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION, LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.DXE_DRIVER]
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
NonDiscoverableDeviceRegistrationLib|MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.inf
- PciHostBridgeLib|Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.inf
+ PciHostBridgeLib|JunoPkg/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.inf
PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf
PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf
@@ -271,7 +271,7 @@ [Components.common]
#
MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
!ifndef DYNAMIC_TABLES_FRAMEWORK
- Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
+ JunoPkg/AcpiTables/AcpiTables.inf
!endif
MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf

@@ -315,7 +315,7 @@ [Components.common]
# SATA Controller
#
MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
- Platform/ARM/JunoPkg/Drivers/SataSiI3132Dxe/SataSiI3132Dxe.inf
+ JunoPkg/Drivers/SataSiI3132Dxe/SataSiI3132Dxe.inf

#
# NVMe boot devices
@@ -325,7 +325,7 @@ [Components.common]
#
# Networking stack
#
- Platform/ARM/VExpressPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf
+ VExpressPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf
!if 0
OptionRomPkg/MarvellYukonDxe/MarvellYukonDxe.inf
!endif
@@ -350,13 +350,13 @@ [Components.common]
#
# Juno platform driver
#
- Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf
+ JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf

#
# SMBIOS/DMI
#
MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
- Platform/ARM/JunoPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
+ JunoPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf

#
# Bds
diff --git a/Platform/ARM/JunoPkg/ArmJuno.fdf b/Platform/ARM/JunoPkg/ArmJuno.fdf
index 01c7edb08661..f7a1e3302287 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.fdf
+++ b/Platform/ARM/JunoPkg/ArmJuno.fdf
@@ -109,10 +109,10 @@ [FV.FvMain]
#
INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
!ifndef DYNAMIC_TABLES_FRAMEWORK
- INF RuleOverride=ACPITABLE Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
+ INF RuleOverride=ACPITABLE JunoPkg/AcpiTables/AcpiTables.inf
!else
# Configuration Manager
- INF Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
+ INF JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf

#
# Dynamic Table fdf
@@ -184,7 +184,7 @@ [FV.FvMain]
# SATA Controller
#
INF MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
- INF Platform/ARM/JunoPkg/Drivers/SataSiI3132Dxe/SataSiI3132Dxe.inf
+ INF JunoPkg/Drivers/SataSiI3132Dxe/SataSiI3132Dxe.inf

#
# NVMe boot devices
@@ -194,9 +194,9 @@ [FV.FvMain]
#
# Networking stack
#
-!include Platform/ARM/VExpressPkg/ArmVExpress-networking.fdf.inc
+!include VExpressPkg/ArmVExpress-networking.fdf.inc

- INF Platform/ARM/VExpressPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf
+ INF VExpressPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf
!if 0
INF OptionRomPkg/MarvellYukonDxe/MarvellYukonDxe.inf
!endif
@@ -210,13 +210,13 @@ [FV.FvMain]
#
# Juno platform driver
#
- INF Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf
+ INF JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf

#
# SMBIOS/DMI
#
INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
- INF Platform/ARM/JunoPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
+ INF JunoPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf

#
# Bds
diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc
index 987c2d8ca3ba..e638ee6f7ab1 100644
--- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc
+++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManager.dsc.inc
@@ -14,4 +14,4 @@ [LibraryClasses.common]

[Components.common]
# Configuration Manager
- Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
+ JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
diff --git a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
index 00be2c435bd6..b496756295bd 100644
--- a/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
+++ b/Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
@@ -32,7 +32,7 @@ [Packages]
DynamicTablesPkg/DynamicTablesPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/JunoPkg/ArmJuno.dec
+ JunoPkg/ArmJuno.dec

[LibraryClasses]
ArmPlatformLib
diff --git a/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf b/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf
index 5dcd67af47aa..3d14332b3ea0 100644
--- a/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf
+++ b/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf
@@ -23,7 +23,7 @@ [Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
ArmCommonPkg/ArmCommonPkg.dec
- Platform/ARM/JunoPkg/ArmJuno.dec
+ JunoPkg/ArmJuno.dec

[LibraryClasses]
AcpiLib
diff --git a/Platform/ARM/JunoPkg/Drivers/SataSiI3132Dxe/SataSiI3132Dxe.inf b/Platform/ARM/JunoPkg/Drivers/SataSiI3132Dxe/SataSiI3132Dxe.inf
index 123e085ecd95..be9c08bc5f88 100644
--- a/Platform/ARM/JunoPkg/Drivers/SataSiI3132Dxe/SataSiI3132Dxe.inf
+++ b/Platform/ARM/JunoPkg/Drivers/SataSiI3132Dxe/SataSiI3132Dxe.inf
@@ -24,7 +24,7 @@ [Defines]

[Packages]
MdePkg/MdePkg.dec
- Platform/ARM/JunoPkg/ArmJuno.dec
+ JunoPkg/ArmJuno.dec

[LibraryClasses]
MemoryAllocationLib
diff --git a/Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoLib.inf b/Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoLib.inf
index 145663c2fa28..cc24f5e895ce 100644
--- a/Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoLib.inf
+++ b/Platform/ARM/JunoPkg/Library/ArmJunoLib/ArmJunoLib.inf
@@ -18,7 +18,7 @@ [Packages]
EmbeddedPkg/EmbeddedPkg.dec
ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
- Platform/ARM/JunoPkg/ArmJuno.dec
+ JunoPkg/ArmJuno.dec

[LibraryClasses]
IoLib
diff --git a/Platform/ARM/JunoPkg/Library/ArmJunoMtlLib/ArmJunoMtlLib.inf b/Platform/ARM/JunoPkg/Library/ArmJunoMtlLib/ArmJunoMtlLib.inf
index 0b1460c27408..55a18031df3f 100644
--- a/Platform/ARM/JunoPkg/Library/ArmJunoMtlLib/ArmJunoMtlLib.inf
+++ b/Platform/ARM/JunoPkg/Library/ArmJunoMtlLib/ArmJunoMtlLib.inf
@@ -19,7 +19,7 @@ [Packages]
ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/JunoPkg/ArmJuno.dec
+ JunoPkg/ArmJuno.dec

[LibraryClasses]
ArmLib
diff --git a/Platform/ARM/JunoPkg/Library/HdLcdArmJunoLib/HdLcdArmJunoLib.inf b/Platform/ARM/JunoPkg/Library/HdLcdArmJunoLib/HdLcdArmJunoLib.inf
index 346c1a3d123e..a34dceb7bdc0 100644
--- a/Platform/ARM/JunoPkg/Library/HdLcdArmJunoLib/HdLcdArmJunoLib.inf
+++ b/Platform/ARM/JunoPkg/Library/HdLcdArmJunoLib/HdLcdArmJunoLib.inf
@@ -23,7 +23,7 @@ [Packages]
ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/JunoPkg/ArmJuno.dec
+ JunoPkg/ArmJuno.dec

[LibraryClasses]
BaseLib
diff --git a/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.inf b/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.inf
index 8b4a6e2fad97..4f3f3c708715 100644
--- a/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.inf
+++ b/Platform/ARM/JunoPkg/Library/JunoPciHostBridgeLib/JunoPciHostBridgeLib.inf
@@ -32,7 +32,7 @@ [Packages]
ArmPkg/ArmPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/JunoPkg/ArmJuno.dec
+ JunoPkg/ArmJuno.dec

[LibraryClasses]
BaseLib
diff --git a/Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJunoLib.inf b/Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJunoLib.inf
index e5e5628de387..5064409173b1 100644
--- a/Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJunoLib.inf
+++ b/Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJunoLib.inf
@@ -19,7 +19,7 @@ [Sources.common]
[Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/JunoPkg/ArmJuno.dec
+ JunoPkg/ArmJuno.dec

[LibraryClasses]
BaseLib
diff --git a/Platform/ARM/JunoPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf b/Platform/ARM/JunoPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
index 5a13605925e7..8f0231314678 100644
--- a/Platform/ARM/JunoPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
+++ b/Platform/ARM/JunoPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
@@ -32,7 +32,7 @@ [Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/JunoPkg/ArmJuno.dec
+ JunoPkg/ArmJuno.dec

[LibraryClasses]
ArmLib
diff --git a/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxeFvp.inf b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxeFvp.inf
index 6fc307df014c..9c6b4698540b 100644
--- a/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxeFvp.inf
+++ b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxeFvp.inf
@@ -35,7 +35,7 @@ [Packages]
DynamicTablesPkg/DynamicTablesPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/Morello/MorelloPlatform.dec
+ Morello/MorelloPlatform.dec

[LibraryClasses]
UefiDriverEntryPoint
diff --git a/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerFvp.dsc.inc b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerFvp.dsc.inc
index 71916783c24c..a2fc71f307b2 100644
--- a/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerFvp.dsc.inc
+++ b/Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerFvp.dsc.inc
@@ -13,4 +13,4 @@ [BuildOptions]

[Components.common]
# Configuration Manager
- Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxeFvp.inf
+ Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxeFvp.inf
diff --git a/Platform/ARM/Morello/Drivers/PlatformDxe/PlatformDxeFvp.inf b/Platform/ARM/Morello/Drivers/PlatformDxe/PlatformDxeFvp.inf
index c36c62f05a39..5e773543b39d 100644
--- a/Platform/ARM/Morello/Drivers/PlatformDxe/PlatformDxeFvp.inf
+++ b/Platform/ARM/Morello/Drivers/PlatformDxe/PlatformDxeFvp.inf
@@ -22,7 +22,7 @@ [Sources.common]
[Packages]
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
- Platform/ARM/Morello/MorelloPlatform.dec
+ Morello/MorelloPlatform.dec

[LibraryClasses]
UefiDriverEntryPoint
diff --git a/Platform/ARM/Morello/Library/PciHostBridgeLib/PciHostBridgeLibFvp.inf b/Platform/ARM/Morello/Library/PciHostBridgeLib/PciHostBridgeLibFvp.inf
index 1d6c5b01d13d..ee18350a361e 100644
--- a/Platform/ARM/Morello/Library/PciHostBridgeLib/PciHostBridgeLibFvp.inf
+++ b/Platform/ARM/Morello/Library/PciHostBridgeLib/PciHostBridgeLibFvp.inf
@@ -29,7 +29,7 @@ [Packages]
ArmPkg/ArmPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/Morello/MorelloPlatform.dec
+ Morello/MorelloPlatform.dec

[FixedPcd]
gArmMorelloTokenSpaceGuid.PcdPciBusMax
diff --git a/Platform/ARM/Morello/Library/PlatformLib/PlatformLib.inf b/Platform/ARM/Morello/Library/PlatformLib/PlatformLib.inf
index c2d7da3701d2..a63ec5f52f7e 100644
--- a/Platform/ARM/Morello/Library/PlatformLib/PlatformLib.inf
+++ b/Platform/ARM/Morello/Library/PlatformLib/PlatformLib.inf
@@ -20,7 +20,7 @@ [Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/Morello/MorelloPlatform.dec
+ Morello/MorelloPlatform.dec

[Sources.common]
PlatformLib.c
diff --git a/Platform/ARM/Morello/MorelloPlatform.dsc.inc b/Platform/ARM/Morello/MorelloPlatform.dsc.inc
index dccd22248318..703518a3d428 100644
--- a/Platform/ARM/Morello/MorelloPlatform.dsc.inc
+++ b/Platform/ARM/Morello/MorelloPlatform.dsc.inc
@@ -9,7 +9,7 @@
[LibraryClasses.common]
ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
- ArmPlatformLib|Platform/ARM/Morello/Library/PlatformLib/PlatformLib.inf
+ ArmPlatformLib|Morello/Library/PlatformLib/PlatformLib.inf
BasePathLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
diff --git a/Platform/ARM/Morello/MorelloPlatformFvp.dsc b/Platform/ARM/Morello/MorelloPlatformFvp.dsc
index ee612296a80e..1adf90227130 100644
--- a/Platform/ARM/Morello/MorelloPlatformFvp.dsc
+++ b/Platform/ARM/Morello/MorelloPlatformFvp.dsc
@@ -24,16 +24,16 @@ [Defines]
SUPPORTED_ARCHITECTURES = AARCH64
BUILD_TARGETS = NOOPT|DEBUG|RELEASE
SKUID_IDENTIFIER = DEFAULT
- FLASH_DEFINITION = Platform/ARM/Morello/MorelloPlatformFvp.fdf
+ FLASH_DEFINITION = Morello/MorelloPlatformFvp.fdf
BUILD_NUMBER = 1

# Network definition
DEFINE NETWORK_ISCSI_ENABLE = FALSE

-!include Platform/ARM/Morello/MorelloPlatform.dsc.inc
-!include Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
+!include Morello/MorelloPlatform.dsc.inc
+!include VExpressPkg/ArmVExpress.dsc.inc
!include DynamicTablesPkg/DynamicTables.dsc.inc
-!include Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerFvp.dsc.inc
+!include Morello/ConfigurationManager/ConfigurationManagerFvp.dsc.inc

# include common/basic libraries from MdePkg.
!include MdePkg/MdeLibs.dsc.inc
@@ -46,7 +46,7 @@ [LibraryClasses.common]
OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf

[LibraryClasses.common.DXE_DRIVER]
- PciHostBridgeLib|Platform/ARM/Morello/Library/PciHostBridgeLib/PciHostBridgeLibFvp.inf
+ PciHostBridgeLib|Morello/Library/PciHostBridgeLib/PciHostBridgeLibFvp.inf

[PcdsFeatureFlag.common]
gArmMorelloTokenSpaceGuid.PcdVirtioBlkSupported|TRUE
@@ -68,4 +68,4 @@ [Components.common]
OvmfPkg/VirtioNetDxe/VirtioNet.inf

# Platform driver
- Platform/ARM/Morello/Drivers/PlatformDxe/PlatformDxeFvp.inf
+ Morello/Drivers/PlatformDxe/PlatformDxeFvp.inf
diff --git a/Platform/ARM/Morello/MorelloPlatformFvp.fdf b/Platform/ARM/Morello/MorelloPlatformFvp.fdf
index 8bdb7f0d0f5f..9634f45f15c3 100644
--- a/Platform/ARM/Morello/MorelloPlatformFvp.fdf
+++ b/Platform/ARM/Morello/MorelloPlatformFvp.fdf
@@ -99,7 +99,7 @@ [FV.FvMain]
INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf

# Configuration Manager
- INF Platform/ARM/Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxeFvp.inf
+ INF Morello/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxeFvp.inf

# Dynamic Table fdf
!include DynamicTablesPkg/DynamicTables.fdf.inc
@@ -140,7 +140,7 @@ [FV.FvMain]
INF ShellPkg/Application/Shell/Shell.inf

# Platform driver
- INF Platform/ARM/Morello/Drivers/PlatformDxe/PlatformDxeFvp.inf
+ INF Morello/Drivers/PlatformDxe/PlatformDxeFvp.inf

# Bds
INF MdeModulePkg/Application/UiApp/UiApp.inf
diff --git a/Platform/ARM/Morello/Readme.md b/Platform/ARM/Morello/Readme.md
index 8d441234f3b8..b43834625bfb 100644
--- a/Platform/ARM/Morello/Readme.md
+++ b/Platform/ARM/Morello/Readme.md
@@ -5,7 +5,7 @@ extension. Capability architecture specific changes will be added [here](https:/

The platform port in UEFI firmware provides ARMv8-A architecture enablement.

-Platform code is located at Platform/ARM/Morello.
+Platform code is located at Morello.

# Documentation

diff --git a/Platform/ARM/N1Sdp/N1SdpPlatform.dsc b/Platform/ARM/N1Sdp/N1SdpPlatform.dsc
index 61e7a909f80d..7e6e8d31b449 100644
--- a/Platform/ARM/N1Sdp/N1SdpPlatform.dsc
+++ b/Platform/ARM/N1Sdp/N1SdpPlatform.dsc
@@ -18,10 +18,10 @@ [Defines]
SUPPORTED_ARCHITECTURES = AARCH64
BUILD_TARGETS = NOOPT|DEBUG|RELEASE
SKUID_IDENTIFIER = DEFAULT
- FLASH_DEFINITION = Platform/ARM/N1Sdp/N1SdpPlatform.fdf
+ FLASH_DEFINITION = N1Sdp/N1SdpPlatform.fdf
BUILD_NUMBER = 1

-!include Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
+!include VExpressPkg/ArmVExpress.dsc.inc
!include MdePkg/MdeLibs.dsc.inc

[LibraryClasses.common]
diff --git a/Platform/ARM/Readme.md b/Platform/ARM/Readme.md
index ad2386c0dbb6..1916651242b5 100644
--- a/Platform/ARM/Readme.md
+++ b/Platform/ARM/Readme.md
@@ -11,7 +11,7 @@ can be found here:

# Build EDK2 TianoCore

-`build -a AARCH64 -p Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc -t GCC5`
+`build -a AARCH64 -p VExpressPkg/ArmVExpress-FVP-AArch64.dsc -t GCC5`

Once built, the edk2 image is the following file Build/ArmVExpress-FVP-AArch64/DEBUG_GCC5/FV/FVP_AARCH64_EFI.fd

diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
index 8c34c2fa73e4..409d3aa5ccbc 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
@@ -33,7 +33,7 @@ [Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/SgiPkg/SgiPlatform.dec
+ SgiPkg/SgiPlatform.dec

[FixedPcd]
gArmPlatformTokenSpaceGuid.PcdCoreCount
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
index ce89aa93ea7b..c74685bec7b2 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
@@ -33,7 +33,7 @@ [Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/SgiPkg/SgiPlatform.dec
+ SgiPkg/SgiPlatform.dec

[FixedPcd]
gArmPlatformTokenSpaceGuid.PcdCoreCount
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
index 1999bc1553e9..1ad34860fa7b 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
@@ -35,7 +35,7 @@ [Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/SgiPkg/SgiPlatform.dec
+ SgiPkg/SgiPlatform.dec

[FixedPcd]
gArmPlatformTokenSpaceGuid.PcdCoreCount
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
index 25be2e276e85..c136ea4320e0 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
@@ -33,7 +33,7 @@ [Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/SgiPkg/SgiPlatform.dec
+ SgiPkg/SgiPlatform.dec

[FixedPcd]
gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf
index 4b36c3e5ceb2..36bc95615f86 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf
@@ -33,7 +33,7 @@ [Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/SgiPkg/SgiPlatform.dec
+ SgiPkg/SgiPlatform.dec

[FixedPcd]
gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf
index 97a87462932b..d5b6479e4f44 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf
@@ -33,7 +33,7 @@ [Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/SgiPkg/SgiPlatform.dec
+ SgiPkg/SgiPlatform.dec

[FixedPcd]
gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf
index deaca3719ae4..3863237d2a0c 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf
@@ -35,7 +35,7 @@ [Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/SgiPkg/SgiPlatform.dec
+ SgiPkg/SgiPlatform.dec

[FixedPcd]
gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
index a1bd71fde761..7b536e823869 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
@@ -33,7 +33,7 @@ [Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/SgiPkg/SgiPlatform.dec
+ SgiPkg/SgiPlatform.dec

[FixedPcd]
gArmPlatformTokenSpaceGuid.PcdCoreCount
diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
index 9d89314a594e..7cfe42bba0f2 100644
--- a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
+++ b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
@@ -20,7 +20,7 @@ [Packages]
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
- Platform/ARM/SgiPkg/SgiPlatform.dec
+ SgiPkg/SgiPlatform.dec

[LibraryClasses]
AcpiLib
diff --git a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
index 4258eb9deadb..3ed6def28003 100644
--- a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
+++ b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
@@ -30,7 +30,7 @@ [Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/SgiPkg/SgiPlatform.dec
+ SgiPkg/SgiPlatform.dec

[LibraryClasses]
ArmLib
diff --git a/Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf b/Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf
index 75a6ba2ae647..db13b59856fc 100644
--- a/Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf
+++ b/Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf
@@ -19,7 +19,7 @@ [Packages]
ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/SgiPkg/SgiPlatform.dec
+ SgiPkg/SgiPlatform.dec

[LibraryClasses]
BaseLib
diff --git a/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf b/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf
index 74486eacd009..0b24102001c3 100644
--- a/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf
+++ b/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf
@@ -20,7 +20,7 @@ [Sources.common]
[Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/SgiPkg/SgiPlatform.dec
+ SgiPkg/SgiPlatform.dec

[LibraryClasses]
BaseLib
diff --git a/Platform/ARM/SgiPkg/Library/NorFlashLib/StandaloneMmNorFlashLib.inf b/Platform/ARM/SgiPkg/Library/NorFlashLib/StandaloneMmNorFlashLib.inf
index 96bbf1e42313..d98a4a252373 100644
--- a/Platform/ARM/SgiPkg/Library/NorFlashLib/StandaloneMmNorFlashLib.inf
+++ b/Platform/ARM/SgiPkg/Library/NorFlashLib/StandaloneMmNorFlashLib.inf
@@ -21,7 +21,7 @@ [Sources.common]
[Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/SgiPkg/SgiPlatform.dec
+ SgiPkg/SgiPlatform.dec

[LibraryClasses]
BaseLib
diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
index 22e247ea4fae..f86167cccd70 100644
--- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
+++ b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
@@ -18,7 +18,7 @@ [Packages]
EmbeddedPkg/EmbeddedPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/SgiPkg/SgiPlatform.dec
+ SgiPkg/SgiPlatform.dec
StandaloneMmPkg/StandaloneMmPkg.dec

[LibraryClasses]
diff --git a/Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPei.inf b/Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPei.inf
index 407160c07563..12677b8c7c78 100644
--- a/Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPei.inf
+++ b/Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPei.inf
@@ -15,7 +15,7 @@ [Defines]
[Packages]
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/SgiPkg/SgiPlatform.dec
+ SgiPkg/SgiPlatform.dec

[LibraryClasses]
FdtLib
diff --git a/Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc b/Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc
index 2cb4895cfcff..601d48f5d804 100644
--- a/Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc
+++ b/Platform/ARM/SgiPkg/PlatformStandaloneMm.dsc
@@ -21,7 +21,7 @@ [Defines]
SUPPORTED_ARCHITECTURES = AARCH64
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT
- FLASH_DEFINITION = Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf
+ FLASH_DEFINITION = SgiPkg/PlatformStandaloneMm.fdf
DEFINE DEBUG_MESSAGE = TRUE

# LzmaF86
@@ -29,7 +29,7 @@ [Defines]

# include common definitions.
!include MdePkg/MdeLibs.dsc.inc
-!include Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc
+!include SgiPkg/SgiPlatformMm.dsc.inc

################################################################################
#
diff --git a/Platform/ARM/SgiPkg/PlatformStandaloneMm2.dsc b/Platform/ARM/SgiPkg/PlatformStandaloneMm2.dsc
index 46c2ae3529d1..ef833654099a 100644
--- a/Platform/ARM/SgiPkg/PlatformStandaloneMm2.dsc
+++ b/Platform/ARM/SgiPkg/PlatformStandaloneMm2.dsc
@@ -20,7 +20,7 @@ [Defines]
SUPPORTED_ARCHITECTURES = AARCH64
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT
- FLASH_DEFINITION = Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf
+ FLASH_DEFINITION = SgiPkg/PlatformStandaloneMm.fdf
DEFINE DEBUG_MESSAGE = TRUE

# LzmaF86
@@ -28,7 +28,7 @@ [Defines]

# include common definitions.
!include MdePkg/MdeLibs.dsc.inc
-!include Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc
+!include SgiPkg/SgiPlatformMm.dsc.inc

################################################################################
#
diff --git a/Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.dsc b/Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.dsc
index edd5a49315be..501fefe7edc4 100644
--- a/Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.dsc
+++ b/Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.dsc
@@ -18,13 +18,13 @@ [Defines]
SUPPORTED_ARCHITECTURES = AARCH64|ARM
BUILD_TARGETS = NOOPT|DEBUG|RELEASE
SKUID_IDENTIFIER = DEFAULT
- FLASH_DEFINITION = Platform/ARM/SgiPkg/SgiPlatform.fdf
- BOARD_DXE_FV_COMPONENTS = Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.fdf.inc
+ FLASH_DEFINITION = SgiPkg/SgiPlatform.fdf
+ BOARD_DXE_FV_COMPONENTS = SgiPkg/RdE1Edge/RdE1Edge.fdf.inc
BUILD_NUMBER = 1

# include common definitions from SgiPlatform.dsc
-!include Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
-!include Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc
+!include SgiPkg/SgiPlatform.dsc.inc
+!include SgiPkg/SgiMemoryMap.dsc.inc

# include common/basic libraries from MdePkg.
!include MdePkg/MdeLibs.dsc.inc
@@ -52,4 +52,4 @@ [PcdsFixedAtBuild.common]
################################################################################

[Components.common]
- Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
+ SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
diff --git a/Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.fdf.inc b/Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.fdf.inc
index 056fc55c098a..d86a45276892 100644
--- a/Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.fdf.inc
+++ b/Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.fdf.inc
@@ -7,4 +7,4 @@
# Per-platform additional content of the DXE phase firmware volume

# ACPI support
- INF RuleOverride=ACPITABLE Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
+ INF RuleOverride=ACPITABLE SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf
diff --git a/Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.dsc b/Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.dsc
index 37f0deed6b45..a6288b6dda01 100644
--- a/Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.dsc
+++ b/Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.dsc
@@ -18,13 +18,13 @@ [Defines]
SUPPORTED_ARCHITECTURES = AARCH64|ARM
BUILD_TARGETS = NOOPT|DEBUG|RELEASE
SKUID_IDENTIFIER = DEFAULT
- FLASH_DEFINITION = Platform/ARM/SgiPkg/SgiPlatform.fdf
- BOARD_DXE_FV_COMPONENTS = Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.fdf.inc
+ FLASH_DEFINITION = SgiPkg/SgiPlatform.fdf
+ BOARD_DXE_FV_COMPONENTS = SgiPkg/RdN1Edge/RdN1Edge.fdf.inc
BUILD_NUMBER = 1

# include common definitions from SgiPlatform.dsc
-!include Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
-!include Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc
+!include SgiPkg/SgiPlatform.dsc.inc
+!include SgiPkg/SgiMemoryMap.dsc.inc

# include common/basic libraries from MdePkg.
!include MdePkg/MdeLibs.dsc.inc
@@ -52,4 +52,4 @@ [PcdsFixedAtBuild.common]
################################################################################

[Components.common]
- Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
+ SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
diff --git a/Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.fdf.inc b/Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.fdf.inc
index 4b191ca55cb9..3cf8ceae0bd8 100644
--- a/Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.fdf.inc
+++ b/Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.fdf.inc
@@ -7,4 +7,4 @@
# Per-platform additional content of the DXE phase firmware volume

# ACPI support
- INF RuleOverride=ACPITABLE Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
+ INF RuleOverride=ACPITABLE SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf
diff --git a/Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.dsc b/Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.dsc
index 7449c75be4da..143902b8972c 100644
--- a/Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.dsc
+++ b/Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.dsc
@@ -18,13 +18,13 @@ [Defines]
SUPPORTED_ARCHITECTURES = AARCH64|ARM
BUILD_TARGETS = NOOPT|DEBUG|RELEASE
SKUID_IDENTIFIER = DEFAULT
- FLASH_DEFINITION = Platform/ARM/SgiPkg/SgiPlatform.fdf
- BOARD_DXE_FV_COMPONENTS = Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.fdf.inc
+ FLASH_DEFINITION = SgiPkg/SgiPlatform.fdf
+ BOARD_DXE_FV_COMPONENTS = SgiPkg/RdN1EdgeX2/RdN1EdgeX2.fdf.inc
BUILD_NUMBER = 1

# include common definitions from SgiPlatform.dsc
-!include Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
-!include Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc
+!include SgiPkg/SgiPlatform.dsc.inc
+!include SgiPkg/SgiMemoryMap.dsc.inc

# include common/basic libraries from MdePkg.
!include MdePkg/MdeLibs.dsc.inc
@@ -55,4 +55,4 @@ [PcdsFixedAtBuild.common]
################################################################################

[Components.common]
- Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
+ SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
diff --git a/Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.fdf.inc b/Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.fdf.inc
index 369264a916b4..6f2cb5e380af 100644
--- a/Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.fdf.inc
+++ b/Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.fdf.inc
@@ -7,4 +7,4 @@
# Per-platform additional content of the DXE phase firmware volume

# ACPI support
- INF RuleOverride=ACPITABLE Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
+ INF RuleOverride=ACPITABLE SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf
diff --git a/Platform/ARM/SgiPkg/RdN2/RdN2.dsc b/Platform/ARM/SgiPkg/RdN2/RdN2.dsc
index adce7ee90ff8..9ba3c9f9bfae 100644
--- a/Platform/ARM/SgiPkg/RdN2/RdN2.dsc
+++ b/Platform/ARM/SgiPkg/RdN2/RdN2.dsc
@@ -18,13 +18,13 @@ [Defines]
SUPPORTED_ARCHITECTURES = AARCH64|ARM
BUILD_TARGETS = NOOPT|DEBUG|RELEASE
SKUID_IDENTIFIER = DEFAULT
- FLASH_DEFINITION = Platform/ARM/SgiPkg/SgiPlatform.fdf
- BOARD_DXE_FV_COMPONENTS = Platform/ARM/SgiPkg/RdN2/RdN2.fdf.inc
+ FLASH_DEFINITION = SgiPkg/SgiPlatform.fdf
+ BOARD_DXE_FV_COMPONENTS = SgiPkg/RdN2/RdN2.fdf.inc
BUILD_NUMBER = 1

# include common definitions from SgiPlatform.dsc
-!include Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
-!include Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc
+!include SgiPkg/SgiPlatform.dsc.inc
+!include SgiPkg/SgiMemoryMap2.dsc.inc

# include common/basic libraries from MdePkg.
!include MdePkg/MdeLibs.dsc.inc
@@ -52,4 +52,4 @@ [PcdsFixedAtBuild.common]
################################################################################

[Components.common]
- Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
+ SgiPkg/AcpiTables/RdN2AcpiTables.inf
diff --git a/Platform/ARM/SgiPkg/RdN2/RdN2.fdf.inc b/Platform/ARM/SgiPkg/RdN2/RdN2.fdf.inc
index ebd6ed90530c..ee7d309594fc 100644
--- a/Platform/ARM/SgiPkg/RdN2/RdN2.fdf.inc
+++ b/Platform/ARM/SgiPkg/RdN2/RdN2.fdf.inc
@@ -7,4 +7,4 @@
# Per-platform additional content of the DXE phase firmware volume

# ACPI support
- INF RuleOverride=ACPITABLE Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
+ INF RuleOverride=ACPITABLE SgiPkg/AcpiTables/RdN2AcpiTables.inf
diff --git a/Platform/ARM/SgiPkg/RdN2Cfg1/RdN2Cfg1.dsc b/Platform/ARM/SgiPkg/RdN2Cfg1/RdN2Cfg1.dsc
index c26f652cb9e9..f16cc4079f9a 100644
--- a/Platform/ARM/SgiPkg/RdN2Cfg1/RdN2Cfg1.dsc
+++ b/Platform/ARM/SgiPkg/RdN2Cfg1/RdN2Cfg1.dsc
@@ -20,13 +20,13 @@ [Defines]
SUPPORTED_ARCHITECTURES = AARCH64
BUILD_TARGETS = NOOPT|DEBUG|RELEASE
SKUID_IDENTIFIER = DEFAULT
- FLASH_DEFINITION = Platform/ARM/SgiPkg/SgiPlatform.fdf
- BOARD_DXE_FV_COMPONENTS = Platform/ARM/SgiPkg/RdN2Cfg1/RdN2Cfg1.fdf.inc
+ FLASH_DEFINITION = SgiPkg/SgiPlatform.fdf
+ BOARD_DXE_FV_COMPONENTS = SgiPkg/RdN2Cfg1/RdN2Cfg1.fdf.inc
BUILD_NUMBER = 1

# include common definitions from SgiPlatform.dsc
-!include Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
-!include Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc
+!include SgiPkg/SgiPlatform.dsc.inc
+!include SgiPkg/SgiMemoryMap2.dsc.inc

# include common/basic libraries from MdePkg.
!include MdePkg/MdeLibs.dsc.inc
@@ -54,4 +54,4 @@ [PcdsFixedAtBuild.common]
################################################################################

[Components.common]
- Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf
+ SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf
diff --git a/Platform/ARM/SgiPkg/RdN2Cfg1/RdN2Cfg1.fdf.inc b/Platform/ARM/SgiPkg/RdN2Cfg1/RdN2Cfg1.fdf.inc
index ef0c02afb4f4..be13d61d6eb6 100644
--- a/Platform/ARM/SgiPkg/RdN2Cfg1/RdN2Cfg1.fdf.inc
+++ b/Platform/ARM/SgiPkg/RdN2Cfg1/RdN2Cfg1.fdf.inc
@@ -9,4 +9,4 @@
# Per-platform additional content of the DXE phase firmware volume

# ACPI support
- INF RuleOverride=ACPITABLE Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf
+ INF RuleOverride=ACPITABLE SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf
diff --git a/Platform/ARM/SgiPkg/RdV1/RdV1.dsc b/Platform/ARM/SgiPkg/RdV1/RdV1.dsc
index a878d28df7cb..26d8f82a062f 100644
--- a/Platform/ARM/SgiPkg/RdV1/RdV1.dsc
+++ b/Platform/ARM/SgiPkg/RdV1/RdV1.dsc
@@ -18,13 +18,13 @@ [Defines]
SUPPORTED_ARCHITECTURES = AARCH64|ARM
BUILD_TARGETS = NOOPT|DEBUG|RELEASE
SKUID_IDENTIFIER = DEFAULT
- FLASH_DEFINITION = Platform/ARM/SgiPkg/SgiPlatform.fdf
- BOARD_DXE_FV_COMPONENTS = Platform/ARM/SgiPkg/RdV1/RdV1.fdf.inc
+ FLASH_DEFINITION = SgiPkg/SgiPlatform.fdf
+ BOARD_DXE_FV_COMPONENTS = SgiPkg/RdV1/RdV1.fdf.inc
BUILD_NUMBER = 1

# include common definitions from SgiPlatform.dsc
-!include Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
-!include Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc
+!include SgiPkg/SgiPlatform.dsc.inc
+!include SgiPkg/SgiMemoryMap.dsc.inc

# include common/basic libraries from MdePkg.
!include MdePkg/MdeLibs.dsc.inc
@@ -52,4 +52,4 @@ [PcdsFixedAtBuild.common]
################################################################################

[Components.common]
- Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf
+ SgiPkg/AcpiTables/RdV1AcpiTables.inf
diff --git a/Platform/ARM/SgiPkg/RdV1/RdV1.fdf.inc b/Platform/ARM/SgiPkg/RdV1/RdV1.fdf.inc
index 1277bf39c162..f6c6f8d76119 100644
--- a/Platform/ARM/SgiPkg/RdV1/RdV1.fdf.inc
+++ b/Platform/ARM/SgiPkg/RdV1/RdV1.fdf.inc
@@ -7,4 +7,4 @@
# Per-platform additional content of the DXE phase firmware volume

# ACPI support
- INF RuleOverride=ACPITABLE Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf
+ INF RuleOverride=ACPITABLE SgiPkg/AcpiTables/RdV1AcpiTables.inf
diff --git a/Platform/ARM/SgiPkg/RdV1Mc/RdV1Mc.dsc b/Platform/ARM/SgiPkg/RdV1Mc/RdV1Mc.dsc
index 578cb74fa06a..e7937a838df8 100644
--- a/Platform/ARM/SgiPkg/RdV1Mc/RdV1Mc.dsc
+++ b/Platform/ARM/SgiPkg/RdV1Mc/RdV1Mc.dsc
@@ -18,13 +18,13 @@ [Defines]
SUPPORTED_ARCHITECTURES = AARCH64|ARM
BUILD_TARGETS = NOOPT|DEBUG|RELEASE
SKUID_IDENTIFIER = DEFAULT
- FLASH_DEFINITION = Platform/ARM/SgiPkg/SgiPlatform.fdf
- BOARD_DXE_FV_COMPONENTS = Platform/ARM/SgiPkg/RdV1Mc/RdV1Mc.fdf.inc
+ FLASH_DEFINITION = SgiPkg/SgiPlatform.fdf
+ BOARD_DXE_FV_COMPONENTS = SgiPkg/RdV1Mc/RdV1Mc.fdf.inc
BUILD_NUMBER = 1

# include common definitions from SgiPlatform.dsc
-!include Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
-!include Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc
+!include SgiPkg/SgiPlatform.dsc.inc
+!include SgiPkg/SgiMemoryMap.dsc.inc

# include common/basic libraries from MdePkg.
!include MdePkg/MdeLibs.dsc.inc
@@ -55,4 +55,4 @@ [PcdsFixedAtBuild.common]
################################################################################

[Components.common]
- Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf
+ SgiPkg/AcpiTables/RdV1McAcpiTables.inf
diff --git a/Platform/ARM/SgiPkg/RdV1Mc/RdV1Mc.fdf.inc b/Platform/ARM/SgiPkg/RdV1Mc/RdV1Mc.fdf.inc
index 6b83893fe0fe..fe1febf11fcb 100644
--- a/Platform/ARM/SgiPkg/RdV1Mc/RdV1Mc.fdf.inc
+++ b/Platform/ARM/SgiPkg/RdV1Mc/RdV1Mc.fdf.inc
@@ -7,4 +7,4 @@
# Per-platform additional content of the DXE phase firmware volume

# ACPI support
- INF RuleOverride=ACPITABLE Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf
+ INF RuleOverride=ACPITABLE SgiPkg/AcpiTables/RdV1McAcpiTables.inf
diff --git a/Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc b/Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc
index 50790135a6d4..a018187c96bd 100644
--- a/Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc
+++ b/Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc
@@ -18,13 +18,13 @@ [Defines]
SUPPORTED_ARCHITECTURES = AARCH64|ARM
BUILD_TARGETS = NOOPT|DEBUG|RELEASE
SKUID_IDENTIFIER = DEFAULT
- FLASH_DEFINITION = Platform/ARM/SgiPkg/SgiPlatform.fdf
- BOARD_DXE_FV_COMPONENTS = Platform/ARM/SgiPkg/Sgi575/Sgi575.fdf.inc
+ FLASH_DEFINITION = SgiPkg/SgiPlatform.fdf
+ BOARD_DXE_FV_COMPONENTS = SgiPkg/Sgi575/Sgi575.fdf.inc
BUILD_NUMBER = 1

# include common definitions from SgiPlatform.dsc
-!include Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
-!include Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc
+!include SgiPkg/SgiPlatform.dsc.inc
+!include SgiPkg/SgiMemoryMap.dsc.inc

# include common/basic libraries from MdePkg.
!include MdePkg/MdeLibs.dsc.inc
@@ -52,4 +52,4 @@ [PcdsFixedAtBuild.common]
################################################################################

[Components.common]
- Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
+ SgiPkg/AcpiTables/Sgi575AcpiTables.inf
diff --git a/Platform/ARM/SgiPkg/Sgi575/Sgi575.fdf.inc b/Platform/ARM/SgiPkg/Sgi575/Sgi575.fdf.inc
index 3748d86efdf4..77b8e5c02967 100644
--- a/Platform/ARM/SgiPkg/Sgi575/Sgi575.fdf.inc
+++ b/Platform/ARM/SgiPkg/Sgi575/Sgi575.fdf.inc
@@ -7,4 +7,4 @@
# Per-platform additional content of the DXE phase firmware volume

# ACPI support
- INF RuleOverride=ACPITABLE Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
+ INF RuleOverride=ACPITABLE SgiPkg/AcpiTables/Sgi575AcpiTables.inf
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
index 7e37732fb93c..c6e1be9eedda 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
@@ -4,7 +4,7 @@
# SPDX-License-Identifier: BSD-2-Clause-Patent
#

-!include Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
+!include VExpressPkg/ArmVExpress.dsc.inc

[Defines]
# To allow the use of secure storage, set this to TRUE.
@@ -28,13 +28,13 @@ [LibraryClasses.common]
ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
- ArmPlatformSysConfigLib|Platform/ARM/VExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf
- ArmPlatformLib|Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf
+ ArmPlatformSysConfigLib|VExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf
+ ArmPlatformLib|SgiPkg/Library/PlatformLib/PlatformLib.inf
BasePathLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
EfiResetSystemLib|ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.inf
LcdHwLib|ArmPlatformPkg/Library/HdLcd/HdLcd.inf
- LcdPlatformLib|Platform/ARM/SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf
- NorFlashPlatformLib|Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.inf
+ LcdPlatformLib|SgiPkg/Library/HdLcdArmSgiLib/HdLcdArmSgiLib.inf
+ NorFlashPlatformLib|SgiPkg/Library/NorFlashLib/NorFlashLib.inf
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
!if $(SECURE_BOOT_ENABLE) == TRUE
@@ -78,7 +78,7 @@ [LibraryClasses.common.DXE_CORE]

[LibraryClasses.common.DXE_DRIVER]
FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf
- PciHostBridgeLib|Platform/ARM/SgiPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
+ PciHostBridgeLib|SgiPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf
PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf
PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf
@@ -232,7 +232,7 @@ [Components.common]
<LibraryClasses>
NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
}
- Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPei.inf
+ SgiPkg/Library/SgiPlatformPei/SgiPlatformPei.inf

#
# DXE
@@ -299,12 +299,12 @@ [Components.common]
# SMBIOS/DMI
#
MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
- Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
+ SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf

#
# platform driver
#
- Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
+ SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf

#
# FAT filesystem + GPT/MBR partitioning
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.fdf b/Platform/ARM/SgiPkg/SgiPlatform.fdf
index 1e72c1d0544c..80046643069f 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.fdf
+++ b/Platform/ARM/SgiPkg/SgiPlatform.fdf
@@ -113,7 +113,7 @@ [FV.FvMain]
# SMBIOS/DMI
#
INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
- INF Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
+ INF SgiPkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf

# Required by PCI
INF ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf
@@ -182,7 +182,7 @@ [FV.FvMain]
#
# Platform driver
#
- INF Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
+ INF SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf

#
# Bds
@@ -228,7 +228,7 @@ [FV.FVMAIN_COMPACT]
INF MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf
INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf
INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf
- INF Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPei.inf
+ INF SgiPkg/Library/SgiPlatformPei/SgiPlatformPei.inf

FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {
diff --git a/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc b/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc
index 5287e1f8e568..6e457e8127c6 100644
--- a/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc
+++ b/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc
@@ -63,7 +63,7 @@ [LibraryClasses.common.MM_STANDALONE]
AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
- NorFlashPlatformLib|Platform/ARM/SgiPkg/Library/NorFlashLib/StandaloneMmNorFlashLib.inf
+ NorFlashPlatformLib|SgiPkg/Library/NorFlashLib/StandaloneMmNorFlashLib.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
PlatformSecureLib|SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.inf
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
index 79ce9658fefa..3682af4dc44c 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
@@ -24,33 +24,33 @@ [Defines]
SUPPORTED_ARCHITECTURES = ARM
BUILD_TARGETS = DEBUG|RELEASE
SKUID_IDENTIFIER = DEFAULT
- FLASH_DEFINITION = Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.fdf
+ FLASH_DEFINITION = VExpressPkg/ArmVExpress-CTA15-A7.fdf

DEFINE EDK2_SKIP_PEICORE = 1
DEFINE ARM_BIGLITTLE_TC2 = 1 # We build for the TC2 hardware by default

-!include Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
+!include VExpressPkg/ArmVExpress.dsc.inc
!include MdePkg/MdeLibs.dsc.inc

[LibraryClasses.common]
ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
- ArmPlatformLib|Platform/ARM/VExpressPkg/Library/ArmVExpressLibCTA15-A7/ArmVExpressLib.inf
+ ArmPlatformLib|VExpressPkg/Library/ArmVExpressLibCTA15-A7/ArmVExpressLib.inf

- ArmPlatformSysConfigLib|Platform/ARM/VExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf
+ ArmPlatformSysConfigLib|VExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf

- #DebugAgentTimerLib|Platform/ARM/VExpressPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.inf
+ #DebugAgentTimerLib|VExpressPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.inf

# ARM General Interrupt Driver in Secure and Non-secure
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf

LcdHwLib|ArmPlatformPkg/Library/HdLcd/HdLcd.inf
- LcdPlatformLib|Platform/ARM/VExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVExpressLib.inf
+ LcdPlatformLib|VExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVExpressLib.inf

ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf

[LibraryClasses.common.DXE_RUNTIME_DRIVER]
- ArmPlatformSysConfigLib|Platform/ARM/VExpressPkg/Library/ArmVExpressSysConfigRuntimeLib/ArmVExpressSysConfigRuntimeLib.inf
+ ArmPlatformSysConfigLib|VExpressPkg/Library/ArmVExpressSysConfigRuntimeLib/ArmVExpressSysConfigRuntimeLib.inf

[LibraryClasses.ARM]
ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
@@ -60,7 +60,7 @@ [LibraryClasses.ARM]
# syscfg MMIO register implementation on ARM.
# This will not work at actual runtime.
#
- ResetSystemLib|Platform/ARM/VExpressPkg/Library/ResetSystemLib/ResetSystemLib.inf
+ ResetSystemLib|VExpressPkg/Library/ResetSystemLib/ResetSystemLib.inf

[BuildOptions]
!ifdef ARM_BIGLITTLE_TC2
@@ -68,11 +68,11 @@ [BuildOptions]
*_*_ARM_PP_FLAGS = -DARM_BIGLITTLE_TC2=1
!endif

- RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 -I$(WORKSPACE)/Platform/ARM/VExpressPkg/Include/Platform/CTA15-A7
+ RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 -I$(WORKSPACE)/VExpressPkg/Include/Platform/CTA15-A7

- GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a15 -I$(WORKSPACE)/Platform/ARM/VExpressPkg/Include/Platform/CTA15-A7
+ GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a15 -I$(WORKSPACE)/VExpressPkg/Include/Platform/CTA15-A7

- XCODE:*_*_ARM_PLATFORM_FLAGS = -I$(WORKSPACE)/Platform/ARM/VExpressPkg/Include/Platform/CTA15-A7
+ XCODE:*_*_ARM_PLATFORM_FLAGS = -I$(WORKSPACE)/VExpressPkg/Include/Platform/CTA15-A7

################################################################################
#
@@ -189,7 +189,7 @@ [Components.common]
#
ArmPlatformPkg/PrePi/PeiMPCore.inf {
<LibraryClasses>
- ArmPlatformLib|Platform/ARM/VExpressPkg/Library/ArmVExpressLibCTA15-A7/ArmVExpressLib.inf
+ ArmPlatformLib|VExpressPkg/Library/ArmVExpressLibCTA15-A7/ArmVExpressLib.inf
}

#
@@ -237,7 +237,7 @@ [Components.common]
#
# Platform
#
- Platform/ARM/VExpressPkg/Drivers/ArmVExpressDxe/ArmHwDxe.inf
+ VExpressPkg/Drivers/ArmVExpressDxe/ArmHwDxe.inf

#
# Filesystems
@@ -250,10 +250,10 @@ [Components.common]
# Multimedia Card Interface
#
EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf
- Platform/ARM/VExpressPkg/Drivers/PL180MciDxe/PL180MciDxe.inf
+ VExpressPkg/Drivers/PL180MciDxe/PL180MciDxe.inf

# SMSC LAN 9118
- Platform/ARM/VExpressPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf
+ VExpressPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf

#
# FAT filesystem + GPT/MBR partitioning
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.fdf b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.fdf
index 6bb1d540fe35..00dc813b69fb 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.fdf
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.fdf
@@ -97,13 +97,13 @@ [FV.FvMain]
#
# Platform
#
- INF Platform/ARM/VExpressPkg/Drivers/ArmVExpressDxe/ArmHwDxe.inf
+ INF VExpressPkg/Drivers/ArmVExpressDxe/ArmHwDxe.inf

#
# Multimedia Card Interface
#
INF EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf
- INF Platform/ARM/VExpressPkg/Drivers/PL180MciDxe/PL180MciDxe.inf
+ INF VExpressPkg/Drivers/PL180MciDxe/PL180MciDxe.inf

#
# Filesystems
@@ -126,14 +126,14 @@ [FV.FvMain]
#
# USB support
#
- INF Platform/ARM/VExpressPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.inf
+ INF VExpressPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.inf

#
# Android Fastboot
#
INF EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.inf
INF EmbeddedPkg/Drivers/AndroidFastbootTransportUsbDxe/FastbootTransportUsbDxe.inf
- INF Platform/ARM/VExpressPkg/Drivers/ArmVExpressFastBootDxe/ArmVExpressFastBootDxe.inf
+ INF VExpressPkg/Drivers/ArmVExpressFastBootDxe/ArmVExpressFastBootDxe.inf

# ACPI Support
INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
@@ -141,9 +141,9 @@ [FV.FvMain]
#
# Networking stack
#
-!include Platform/ARM/VExpressPkg/ArmVExpress-networking.fdf.inc
+!include VExpressPkg/ArmVExpress-networking.fdf.inc

- INF Platform/ARM/VExpressPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf
+ INF VExpressPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf

#
# UEFI application
@@ -171,7 +171,7 @@ [FV.FvMain]

# Example to add a Device Tree to the Firmware Volume
#FILE FREEFORM = PCD(gArmVExpressTokenSpaceGuid.PcdFdtVExpressHwA15x2A7x3) {
- # SECTION RAW = Platform/ARM/VExpressPkg/Fdts/vexpress-v2p-ca15_a7.dtb
+ # SECTION RAW = VExpressPkg/Fdts/vexpress-v2p-ca15_a7.dtb
#}

[FV.FVMAIN_COMPACT]
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
index cf7350649edb..98d9049a6e14 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
@@ -23,7 +23,7 @@ [Defines]
SUPPORTED_ARCHITECTURES = AARCH64
BUILD_TARGETS = DEBUG|RELEASE
SKUID_IDENTIFIER = DEFAULT
- FLASH_DEFINITION = Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf
+ FLASH_DEFINITION = VExpressPkg/ArmVExpress-FVP-AArch64.fdf

!ifndef ARM_FVP_RUN_NORFLASH
DEFINE EDK2_SKIP_PEICORE=1
@@ -31,19 +31,19 @@ [Defines]

DT_SUPPORT = FALSE

-!include Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
+!include VExpressPkg/ArmVExpress.dsc.inc
!include MdePkg/MdeLibs.dsc.inc
!include DynamicTablesPkg/DynamicTables.dsc.inc

[LibraryClasses.common]
ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
- ArmPlatformLib|Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLib.inf
+ ArmPlatformLib|VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLib.inf
ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf

- ArmPlatformSysConfigLib|Platform/ARM/VExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf
+ ArmPlatformSysConfigLib|VExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf
!ifdef EDK2_ENABLE_PL111
LcdHwLib|ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.inf
- LcdPlatformLib|Platform/ARM/VExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpressLib.inf
+ LcdPlatformLib|VExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpressLib.inf
!endif

# Virtio Support
@@ -53,24 +53,24 @@ [LibraryClasses.common]
FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
!endif

- DtPlatformDtbLoaderLib|Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
+ DtPlatformDtbLoaderLib|VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf

[LibraryClasses.common.DXE_RUNTIME_DRIVER]
- ArmPlatformSysConfigLib|Platform/ARM/VExpressPkg/Library/ArmVExpressSysConfigRuntimeLib/ArmVExpressSysConfigRuntimeLib.inf
+ ArmPlatformSysConfigLib|VExpressPkg/Library/ArmVExpressSysConfigRuntimeLib/ArmVExpressSysConfigRuntimeLib.inf

[LibraryClasses.common.SEC]
- ArmPlatformLib|Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf
+ ArmPlatformLib|VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf

[LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION, LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.DXE_DRIVER]
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf

PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf
- PciHostBridgeLib|Platform/ARM/VExpressPkg/Library/ArmVExpressPciHostBridgeLib/ArmVExpressPciHostBridgeLib.inf
+ PciHostBridgeLib|VExpressPkg/Library/ArmVExpressPciHostBridgeLib/ArmVExpressPciHostBridgeLib.inf
PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf
PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf

[BuildOptions]
- GCC:*_*_AARCH64_PLATFORM_FLAGS == -I$(WORKSPACE)/Platform/ARM/VExpressPkg/Include/Platform/RTSM
+ GCC:*_*_AARCH64_PLATFORM_FLAGS == -I$(WORKSPACE)/VExpressPkg/Include/Platform/RTSM


################################################################################
@@ -204,7 +204,7 @@ [Components.common]
# UEFI is placed in RAM by bootloader
ArmPlatformPkg/PrePi/PeiUniCore.inf {
<LibraryClasses>
- ArmPlatformLib|Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLib.inf
+ ArmPlatformLib|VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLib.inf
}
!else
# UEFI lives in FLASH and copies itself to RAM
@@ -282,7 +282,7 @@ [Components.common]
!endif
}

- Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf {
+ VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf {
<PcdsFixedAtBuild>
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x1c090000
gArmPlatformTokenSpaceGuid.PL011UartInterrupt|0x25
@@ -309,12 +309,12 @@ [Components.common]
# Multimedia Card Interface
#
EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf
- Platform/ARM/VExpressPkg/Drivers/PL180MciDxe/PL180MciDxe.inf
+ VExpressPkg/Drivers/PL180MciDxe/PL180MciDxe.inf

#
# Platform Driver
#
- Platform/ARM/VExpressPkg/Drivers/ArmVExpressDxe/ArmFvpDxe.inf
+ VExpressPkg/Drivers/ArmVExpressDxe/ArmFvpDxe.inf
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf

#
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf
index 7635cb7a8406..102965615207 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.fdf
@@ -94,7 +94,7 @@ [FV.FvMain]
INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf

# Configuration Manager
- INF Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
+ INF VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf

#
# Dynamic Table fdf
@@ -135,7 +135,7 @@ [FV.FvMain]
# Multimedia Card Interface
#
INF EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf
- INF Platform/ARM/VExpressPkg/Drivers/PL180MciDxe/PL180MciDxe.inf
+ INF VExpressPkg/Drivers/PL180MciDxe/PL180MciDxe.inf

#
# SMBIOS Support
@@ -145,12 +145,12 @@ [FV.FvMain]
#
# Platform Driver
#
- INF Platform/ARM/VExpressPkg/Drivers/ArmVExpressDxe/ArmFvpDxe.inf
+ INF VExpressPkg/Drivers/ArmVExpressDxe/ArmFvpDxe.inf
INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf

!ifdef EDK2_ENABLE_SMSC_91X
-!include Platform/ARM/VExpressPkg/ArmVExpress-networking.fdf.inc
- INF Platform/ARM/VExpressPkg/Drivers/Lan91xDxe/Lan91xDxe.inf
+!include VExpressPkg/ArmVExpress-networking.fdf.inc
+ INF VExpressPkg/Drivers/Lan91xDxe/Lan91xDxe.inf
!endif

#
@@ -196,12 +196,12 @@ [FV.FvMain]

# builtin device tree binaries -- order matches ARM_VEXPRESS_PLATFORM_ID
FILE FREEFORM = 25462CDA-221F-47DF-AC1D-259CFAA4E326 {
- SECTION RAW = Platform/ARM/VExpressPkg/DeviceTree/fvp-base-gicv2-psci.dtb
- SECTION RAW = Platform/ARM/VExpressPkg/DeviceTree/fvp-base-gicv2legacy-psci.dtb
- SECTION RAW = Platform/ARM/VExpressPkg/DeviceTree/fvp-base-gicv3-psci.dtb
- SECTION RAW = Platform/ARM/VExpressPkg/DeviceTree/fvp-foundation-gicv2-psci.dtb
- SECTION RAW = Platform/ARM/VExpressPkg/DeviceTree/fvp-foundation-gicv2legacy-psci.dtb
- SECTION RAW = Platform/ARM/VExpressPkg/DeviceTree/fvp-foundation-gicv3-psci.dtb
+ SECTION RAW = VExpressPkg/DeviceTree/fvp-base-gicv2-psci.dtb
+ SECTION RAW = VExpressPkg/DeviceTree/fvp-base-gicv2legacy-psci.dtb
+ SECTION RAW = VExpressPkg/DeviceTree/fvp-base-gicv3-psci.dtb
+ SECTION RAW = VExpressPkg/DeviceTree/fvp-foundation-gicv2-psci.dtb
+ SECTION RAW = VExpressPkg/DeviceTree/fvp-foundation-gicv2legacy-psci.dtb
+ SECTION RAW = VExpressPkg/DeviceTree/fvp-foundation-gicv3-psci.dtb
}
!endif

diff --git a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
index 1381867ac055..60f1926aced5 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
@@ -80,8 +80,8 @@ [LibraryClasses.common]

# Versatile Express Specific Libraries
PlatformPeiLib|ArmPlatformPkg/PlatformPei/PlatformPeiLib.inf
- ArmPlatformSysConfigLib|Platform/ARM/VExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf
- NorFlashPlatformLib|Platform/ARM/VExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpressLib.inf
+ ArmPlatformSysConfigLib|VExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf
+ NorFlashPlatformLib|VExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpressLib.inf
ResetSystemLib|ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.inf

# ARM PL031 RTC Driver
@@ -425,7 +425,7 @@ [Components.common]
!include NetworkPkg/Network.dsc.inc
!ifdef EDK2_ENABLE_SMSC_91X
# SMSC LAN 91C111
- Platform/ARM/VExpressPkg/Drivers/Lan91xDxe/Lan91xDxe.inf
+ VExpressPkg/Drivers/Lan91xDxe/Lan91xDxe.inf
!endif

#
@@ -433,7 +433,7 @@ [Components.common]
#
EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.inf
EmbeddedPkg/Drivers/AndroidFastbootTransportUsbDxe/FastbootTransportUsbDxe.inf
- Platform/ARM/VExpressPkg/Drivers/ArmVExpressFastBootDxe/ArmVExpressFastBootDxe.inf
+ VExpressPkg/Drivers/ArmVExpressFastBootDxe/ArmVExpressFastBootDxe.inf

# FV Filesystem
MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf
@@ -464,4 +464,4 @@ [Components.common]
[Components.ARM]

# ISP1761 USB OTG Controller
- Platform/ARM/VExpressPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.inf
+ VExpressPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.inf
diff --git a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
index b53daf51d4b1..bbb3dd02ef8d 100644
--- a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
+++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
@@ -31,7 +31,7 @@ [Packages]
DynamicTablesPkg/DynamicTablesPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
+ VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
ArmPlatformLib
diff --git a/Platform/ARM/VExpressPkg/Drivers/ArmVExpressDxe/ArmFvpDxe.inf b/Platform/ARM/VExpressPkg/Drivers/ArmVExpressDxe/ArmFvpDxe.inf
index 14e02ad51d90..26798cdfb22c 100644
--- a/Platform/ARM/VExpressPkg/Drivers/ArmVExpressDxe/ArmFvpDxe.inf
+++ b/Platform/ARM/VExpressPkg/Drivers/ArmVExpressDxe/ArmFvpDxe.inf
@@ -23,7 +23,7 @@ [Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
OvmfPkg/OvmfPkg.dec
ArmCommonPkg/ArmCommonPkg.dec
- Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
+ VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
ArmShellCmdRunAxfLib
diff --git a/Platform/ARM/VExpressPkg/Drivers/ArmVExpressFastBootDxe/ArmVExpressFastBootDxe.inf b/Platform/ARM/VExpressPkg/Drivers/ArmVExpressFastBootDxe/ArmVExpressFastBootDxe.inf
index d95dc0268eba..5121177324d5 100644
--- a/Platform/ARM/VExpressPkg/Drivers/ArmVExpressFastBootDxe/ArmVExpressFastBootDxe.inf
+++ b/Platform/ARM/VExpressPkg/Drivers/ArmVExpressFastBootDxe/ArmVExpressFastBootDxe.inf
@@ -39,7 +39,7 @@ [Packages]
MdeModulePkg/MdeModulePkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
ArmPkg/ArmPkg.dec
- Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
+ VExpressPkg/ArmVExpressPkg.dec

[Pcd]
gArmVExpressTokenSpaceGuid.PcdAndroidFastbootNvmDevicePath
diff --git a/Platform/ARM/VExpressPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.inf b/Platform/ARM/VExpressPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.inf
index 40efb73f5db9..2ebcf910ed2d 100644
--- a/Platform/ARM/VExpressPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.inf
+++ b/Platform/ARM/VExpressPkg/Drivers/Isp1761UsbDxe/Isp1761UsbDxe.inf
@@ -40,7 +40,7 @@ [Packages]
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
- Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
+ VExpressPkg/ArmVExpressPkg.dec

[Pcd]
gArmVExpressTokenSpaceGuid.PcdIsp1761BaseAddress
diff --git a/Platform/ARM/VExpressPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf b/Platform/ARM/VExpressPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf
index b289f80c35a5..988eb4a23ea0 100644
--- a/Platform/ARM/VExpressPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf
+++ b/Platform/ARM/VExpressPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf
@@ -31,7 +31,7 @@ [Packages]
NetworkPkg/NetworkPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
+ VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
BaseLib
diff --git a/Platform/ARM/VExpressPkg/Drivers/Lan91xDxe/Lan91xDxe.inf b/Platform/ARM/VExpressPkg/Drivers/Lan91xDxe/Lan91xDxe.inf
index 11a9f74c50f4..61fa01dbfa7e 100644
--- a/Platform/ARM/VExpressPkg/Drivers/Lan91xDxe/Lan91xDxe.inf
+++ b/Platform/ARM/VExpressPkg/Drivers/Lan91xDxe/Lan91xDxe.inf
@@ -33,7 +33,7 @@ [Packages]
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
NetworkPkg/NetworkPkg.dec
- Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
+ VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
ArmLib
diff --git a/Platform/ARM/VExpressPkg/Drivers/PL180MciDxe/PL180MciDxe.inf b/Platform/ARM/VExpressPkg/Drivers/PL180MciDxe/PL180MciDxe.inf
index 34690a135e16..ff1407aefd4e 100644
--- a/Platform/ARM/VExpressPkg/Drivers/PL180MciDxe/PL180MciDxe.inf
+++ b/Platform/ARM/VExpressPkg/Drivers/PL180MciDxe/PL180MciDxe.inf
@@ -29,7 +29,7 @@ [Sources.common]
[Packages]
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
+ VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
BaseLib
diff --git a/Platform/ARM/VExpressPkg/Library/ArmMaliDpLib/ArmMaliDpLib.inf b/Platform/ARM/VExpressPkg/Library/ArmMaliDpLib/ArmMaliDpLib.inf
index 784e84bd9293..c230d33510db 100644
--- a/Platform/ARM/VExpressPkg/Library/ArmMaliDpLib/ArmMaliDpLib.inf
+++ b/Platform/ARM/VExpressPkg/Library/ArmMaliDpLib/ArmMaliDpLib.inf
@@ -20,7 +20,7 @@ [Sources.common]
[Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
+ VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
BaseLib
diff --git a/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf b/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
index 7992ffa22c91..823233a4153b 100644
--- a/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
+++ b/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
@@ -20,7 +20,7 @@ [Sources]
[Packages]
ArmPkg/ArmPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
+ VExpressPkg/ArmVExpressPkg.dec
EmbeddedPkg/EmbeddedPkg.dec

[LibraryClasses]
diff --git a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibCTA15-A7/ArmVExpressLib.inf b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibCTA15-A7/ArmVExpressLib.inf
index e585fe6c1876..d2bf15aa405e 100644
--- a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibCTA15-A7/ArmVExpressLib.inf
+++ b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibCTA15-A7/ArmVExpressLib.inf
@@ -20,7 +20,7 @@ [Packages]
EmbeddedPkg/EmbeddedPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
+ VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
IoLib
diff --git a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLib.inf b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLib.inf
index 929dadc28a84..8ff24785939a 100644
--- a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLib.inf
+++ b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLib.inf
@@ -19,7 +19,7 @@ [Packages]
EmbeddedPkg/EmbeddedPkg.dec
ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
- Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
+ VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
IoLib
diff --git a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf
index ede7ab0a32ce..7271ff5ab298 100644
--- a/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf
+++ b/Platform/ARM/VExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf
@@ -16,7 +16,7 @@ [Defines]
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
- Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
+ VExpressPkg/ArmVExpressPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
diff --git a/Platform/ARM/VExpressPkg/Library/ArmVExpressPciHostBridgeLib/ArmVExpressPciHostBridgeLib.inf b/Platform/ARM/VExpressPkg/Library/ArmVExpressPciHostBridgeLib/ArmVExpressPciHostBridgeLib.inf
index e5080074e2e9..39e6d0e112b4 100644
--- a/Platform/ARM/VExpressPkg/Library/ArmVExpressPciHostBridgeLib/ArmVExpressPciHostBridgeLib.inf
+++ b/Platform/ARM/VExpressPkg/Library/ArmVExpressPciHostBridgeLib/ArmVExpressPciHostBridgeLib.inf
@@ -29,7 +29,7 @@ [Packages]
ArmPkg/ArmPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
+ VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
IoLib
diff --git a/Platform/ARM/VExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf b/Platform/ARM/VExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf
index 36f447ee79bd..feb00a41c4ff 100644
--- a/Platform/ARM/VExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf
+++ b/Platform/ARM/VExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf
@@ -22,7 +22,7 @@ [Sources.common]
[Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
+ VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
BaseLib
diff --git a/Platform/ARM/VExpressPkg/Library/ArmVExpressSysConfigRuntimeLib/ArmVExpressSysConfigRuntimeLib.inf b/Platform/ARM/VExpressPkg/Library/ArmVExpressSysConfigRuntimeLib/ArmVExpressSysConfigRuntimeLib.inf
index 5179165f98e2..5aa8aefb790d 100644
--- a/Platform/ARM/VExpressPkg/Library/ArmVExpressSysConfigRuntimeLib/ArmVExpressSysConfigRuntimeLib.inf
+++ b/Platform/ARM/VExpressPkg/Library/ArmVExpressSysConfigRuntimeLib/ArmVExpressSysConfigRuntimeLib.inf
@@ -23,7 +23,7 @@ [Sources.common]
[Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
+ VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
BaseLib
diff --git a/Platform/ARM/VExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVExpressLib.inf b/Platform/ARM/VExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVExpressLib.inf
index 191261d0629a..aa4d98b91935 100644
--- a/Platform/ARM/VExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVExpressLib.inf
+++ b/Platform/ARM/VExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVExpressLib.inf
@@ -22,7 +22,7 @@ [Sources.common]
[Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
+ VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
ArmPlatformSysConfigLib
diff --git a/Platform/ARM/VExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpressLib.inf b/Platform/ARM/VExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpressLib.inf
index a411ba4d0072..736230e53160 100644
--- a/Platform/ARM/VExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpressLib.inf
+++ b/Platform/ARM/VExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpressLib.inf
@@ -19,7 +19,7 @@ [Sources.common]
[Packages]
MdePkg/MdePkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
- Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
+ VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
BaseLib
diff --git a/Platform/ARM/VExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpressLib.inf b/Platform/ARM/VExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpressLib.inf
index 999a0814f508..afa950846260 100644
--- a/Platform/ARM/VExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpressLib.inf
+++ b/Platform/ARM/VExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpressLib.inf
@@ -22,7 +22,7 @@ [Sources.common]
[Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
+ VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
ArmPlatformSysConfigLib
diff --git a/Platform/ARM/VExpressPkg/Library/ResetSystemLib/ResetSystemLib.inf b/Platform/ARM/VExpressPkg/Library/ResetSystemLib/ResetSystemLib.inf
index e18df3c0baec..37e00bd5bc60 100644
--- a/Platform/ARM/VExpressPkg/Library/ResetSystemLib/ResetSystemLib.inf
+++ b/Platform/ARM/VExpressPkg/Library/ResetSystemLib/ResetSystemLib.inf
@@ -24,7 +24,7 @@ [Packages]
ArmPlatformPkg/ArmPlatformPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
+ VExpressPkg/ArmVExpressPkg.dec

[LibraryClasses]
DebugLib
diff --git a/Platform/Comcast/RDKQemu/RDKQemu.fdf b/Platform/Comcast/RDKQemu/RDKQemu.fdf
index 953a72c955c4..50b1929d6136 100644
--- a/Platform/Comcast/RDKQemu/RDKQemu.fdf
+++ b/Platform/Comcast/RDKQemu/RDKQemu.fdf
@@ -111,7 +111,7 @@ [FV.FVMAIN_COMPACT]
#
# The UEFI driver is at the end of the list of the driver to be dispatched
# after the device drivers (eg: Ethernet) to ensure we have support for them.
- #INF Platform/ARM/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
+ #INF Drivers/FdtPlatformDxe/FdtPlatformDxe.inf

FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {
diff --git a/Readme.md b/Readme.md
index 62876b4b7d75..c9fd8e987cb7 100644
--- a/Readme.md
+++ b/Readme.md
@@ -157,7 +157,7 @@ $ NUM_CPUS=$((`getconf _NPROCESSORS_ONLN` + 2))
For the toolchain tag, use GCC5 for gcc version 5 or later, GCC4x for
earlier versions, or CLANG35/CLANG38 as appropriate when building with clang.
```
-$ build -n $NUM_CPUS -a AARCH64 -t GCC5 -p Platform/ARM/JunoPkg/ArmJuno.dsc
+$ build -n $NUM_CPUS -a AARCH64 -t GCC5 -p JunoPkg/ArmJuno.dsc
```
(Note that the description file gets resolved by the build command through
searching in all locations specified in **PACKAGES_PATH**.)
--
2.17.1


[RFC PATCH edk2-platforms v1 5/7] Platform/ARM: Resolve ArmCommonPkg library references

PierreGondois
 

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

The Platform/ARM/ARM.dec file implies that the Platform/ARM/ folder
is a package. This folder however hosts other packages describing
platforms (JunoPkg, SgiPkg, ...) and packages describing drivers
(BootMonFs, FdtPlatformDxe).

As the Dec specification mention:
"EDK II Packages cannot be nested within other EDK II Packages."
Also, CI modules are based on packages. Having non-nested packages
allows to have distinct entities each CI module must check.

To remove the nested structure:
1- Create a Platform/ARM/ArmCommonPkg package containing code
shared among platforms. It will contains the following folders:
Platform/ARM/[Drivers/ | Include/ | Library/]
2- Remove the BootMonFs and FdtPlatformDxe packages and resolve
the broken dependencies to these drivers
3- Resolve the broken dependencies to the libraries from
Platform/ARM/Library

As part of 3, this patch updates references to the libraries
previously in Platform/ARM/Library.

Bugzilla: 3259 (https://bugzilla.tianocore.org/show_bug.cgi?id=3259)
Signed-off-by: Pierre Gondois <Pierre.Gondois@...>
---
Platform/ARM/JunoPkg/ArmJuno.dsc | 2 +-
Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc | 2 +-
Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
index 93d78597930d..c208415f3602 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.dsc
+++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
@@ -377,7 +377,7 @@ [Components.common]
#
ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf {
<LibraryClasses>
- BdsLib|Platform/ARM/Library/BdsLib/BdsLib.inf
+ BdsLib|ArmCommonPkg/Library/BdsLib/BdsLib.inf
}

# SCMI Driver
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
index ee75fc472ec6..79ce9658fefa 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
@@ -283,5 +283,5 @@ [Components.common]
#
ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf {
<LibraryClasses>
- BdsLib|Platform/ARM/Library/BdsLib/BdsLib.inf
+ BdsLib|ArmCommonPkg/Library/BdsLib/BdsLib.inf
}
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
index e45e5a610f4c..1381867ac055 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
@@ -118,7 +118,7 @@ [LibraryClasses.common]

# RunAxf support via Dynamic Shell Command protocol
# It uses the Shell libraries.
- ArmShellCmdRunAxfLib|Platform/ARM/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf
+ ArmShellCmdRunAxfLib|ArmCommonPkg/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf.inf
ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf
--
2.17.1


[RFC PATCH edk2-platforms v1 4/7] Platform/ARM: Move FdtPlatformDxe package to ArmCommonPkg

PierreGondois
 

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

The Platform/ARM/ARM.dec file implies that the Platform/ARM/ folder
is a package. This folder however hosts other packages describing
platforms (JunoPkg, SgiPkg, ...) and packages describing drivers
(BootMonFs, FdtPlatformDxe).

As the Dec specification mention:
"EDK II Packages cannot be nested within other EDK II Packages."
Also, CI modules are based on packages. Having non-nested packages
allows to have distinct entities each CI module must check.

To remove the nested structure:
1- Create a Platform/ARM/ArmCommonPkg package containing code
shared among platforms. It will contains the following folders:
Platform/ARM/[Drivers/ | Include/ | Library/]
2- Remove the BootMonFs and FdtPlatformDxe packages and resolve
the broken dependencies to these drivers
3- Resolve the broken dependencies to the libraries from
Platform/ARM/Library

As part of 2, this patch removes the FdtPlatformDxe.dec package to
ArmCommonPkg.dec and updates references to FdtPlatformDxe accordingly.

Bugzilla: 3259 (https://bugzilla.tianocore.org/show_bug.cgi?id=3259)
Signed-off-by: Pierre Gondois <Pierre.Gondois@...>
---
Platform/ARM/ArmCommonPkg/ArmCommonPkg.dec | 10 ++++++++
.../Drivers/FdtPlatformDxe/FdtPlatformDxe.dec | 25 -------------------
.../Drivers/FdtPlatformDxe/FdtPlatformDxe.inf | 1 -
Platform/ARM/JunoPkg/ArmJuno.dsc | 2 +-
Platform/ARM/JunoPkg/ArmJuno.fdf | 2 +-
.../JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf | 1 -
.../ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc | 2 +-
.../ARM/VExpressPkg/ArmVExpress-CTA15-A7.fdf | 2 +-
8 files changed, 14 insertions(+), 31 deletions(-)
delete mode 100644 Platform/ARM/ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.dec

diff --git a/Platform/ARM/ArmCommonPkg/ArmCommonPkg.dec b/Platform/ARM/ArmCommonPkg/ArmCommonPkg.dec
index dac54b9f9ed8..12bf49d769e5 100644
--- a/Platform/ARM/ArmCommonPkg/ArmCommonPkg.dec
+++ b/Platform/ARM/ArmCommonPkg/ArmCommonPkg.dec
@@ -20,6 +20,7 @@ [LibraryClasses]

[Guids]
gArmBootMonFsFileInfoGuid = { 0x41e26b9c, 0xada6, 0x45b3, { 0x80, 0x8e, 0x23, 0x57, 0xa3, 0x5b, 0x60, 0xd6 } }
+ gFdtPlatformDxeTokenSpaceGuid = { 0xbfcaa0af, 0xedd4, 0x4ce7, { 0xbd, 0xb3, 0x39, 0x15, 0x07, 0x28, 0x65, 0x77 } }

[Guids.common]
gArmBootMonFsTokenSpaceGuid = { 0xeb76a201, 0x69b4, 0x491f, { 0x9b, 0xde, 0xbf, 0x30, 0xbd, 0x03, 0x82, 0xb4 } }
@@ -27,3 +28,12 @@ [Guids.common]
[PcdsFixedAtBuild.common]
# Boot Monitor FileSystem
gArmBootMonFsTokenSpaceGuid.PcdBootMonFsSupportedDevicePaths|L""|VOID*|0x0000003A
+
+[PcdsFeatureFlag.common]
+ # Enable the development specific features
+ gFdtPlatformDxeTokenSpaceGuid.PcdOverridePlatformFdt|TRUE|BOOLEAN|0x00000001
+ # Add 'dumpfdt' EFI Shell command
+ gFdtPlatformDxeTokenSpaceGuid.PcdDumpFdtShellCommand|TRUE|BOOLEAN|0x00000002
+
+[PcdsFixedAtBuild.common, PcdsDynamic.common]
+ gFdtPlatformDxeTokenSpaceGuid.PcdFdtDevicePaths|L""|VOID*|0x00000055
diff --git a/Platform/ARM/ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.dec b/Platform/ARM/ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.dec
deleted file mode 100644
index 550156938f0c..000000000000
--- a/Platform/ARM/ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.dec
+++ /dev/null
@@ -1,25 +0,0 @@
-#/** @file
-#
-# Copyright (c) 2011-2017, ARM Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#**/
-
-[Defines]
- DEC_SPECIFICATION = 0x0001001A
- PACKAGE_NAME = FdtPlatformDxe
- PACKAGE_GUID = ed22c1e5-71cb-48d6-a9d8-c20f8d6b909f
- PACKAGE_VERSION = 0.1
-
-[Guids]
- gFdtPlatformDxeTokenSpaceGuid = { 0xbfcaa0af, 0xedd4, 0x4ce7, { 0xbd, 0xb3, 0x39, 0x15, 0x07, 0x28, 0x65, 0x77 } }
-
-[PcdsFeatureFlag.common]
- # Enable the development specific features
- gFdtPlatformDxeTokenSpaceGuid.PcdOverridePlatformFdt|TRUE|BOOLEAN|0x00000001
- # Add 'dumpfdt' EFI Shell command
- gFdtPlatformDxeTokenSpaceGuid.PcdDumpFdtShellCommand|TRUE|BOOLEAN|0x00000002
-
-[PcdsFixedAtBuild.common, PcdsDynamic.common]
- gFdtPlatformDxeTokenSpaceGuid.PcdFdtDevicePaths|L""|VOID*|0x00000055
diff --git a/Platform/ARM/ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf b/Platform/ARM/ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
index b844c0dc5233..471efb51afd0 100644
--- a/Platform/ARM/ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
+++ b/Platform/ARM/ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
@@ -26,7 +26,6 @@ [Packages]
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
Platform/ARM/ArmCommonPkg/ArmCommonPkg.dec
- Platform/ARM/Drivers/FdtPlatformDxe/FdtPlatformDxe.dec
ShellPkg/ShellPkg.dec

[LibraryClasses]
diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
index fdfc8cd9e20f..93d78597930d 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.dsc
+++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
@@ -375,7 +375,7 @@ [Components.common]
#
# FDT installation
#
- Platform/ARM/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf {
+ ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf {
<LibraryClasses>
BdsLib|Platform/ARM/Library/BdsLib/BdsLib.inf
}
diff --git a/Platform/ARM/JunoPkg/ArmJuno.fdf b/Platform/ARM/JunoPkg/ArmJuno.fdf
index 4e9cbee52932..01c7edb08661 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.fdf
+++ b/Platform/ARM/JunoPkg/ArmJuno.fdf
@@ -232,7 +232,7 @@ [FV.FvMain]
#
# The UEFI driver is at the end of the list of the driver to be dispatched
# after the device drivers (eg: Ethernet) to ensure we have support for them.
- INF Platform/ARM/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
+ INF ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf

# SCMI Driver
INF ArmPkg/Drivers/ArmScmiDxe/ArmScmiDxe.inf
diff --git a/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf b/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf
index 8b3a159ebe20..5dcd67af47aa 100644
--- a/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf
+++ b/Platform/ARM/JunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf
@@ -23,7 +23,6 @@ [Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
ArmCommonPkg/ArmCommonPkg.dec
- Platform/ARM/Drivers/FdtPlatformDxe/FdtPlatformDxe.dec
Platform/ARM/JunoPkg/ArmJuno.dec

[LibraryClasses]
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
index e06a2a47f091..ee75fc472ec6 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
@@ -281,7 +281,7 @@ [Components.common]
#
# FDT installation
#
- Platform/ARM/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf {
+ ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf {
<LibraryClasses>
BdsLib|Platform/ARM/Library/BdsLib/BdsLib.inf
}
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.fdf b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.fdf
index 4dd01308554c..6bb1d540fe35 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.fdf
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.fdf
@@ -167,7 +167,7 @@ [FV.FvMain]
#
# The UEFI driver is at the end of the list of the driver to be dispatched
# after the device drivers (eg: Ethernet) to ensure we have support for them.
- INF Platform/ARM/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
+ INF ArmCommonPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf

# Example to add a Device Tree to the Firmware Volume
#FILE FREEFORM = PCD(gArmVExpressTokenSpaceGuid.PcdFdtVExpressHwA15x2A7x3) {
--
2.17.1


[RFC PATCH edk2-platforms v1 3/7] Platform/ARM: Move BootMonFs package to ArmCommonPkg

PierreGondois
 

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

The Platform/ARM/ARM.dec file implies that the Platform/ARM/ folder
is a package. This folder however hosts other packages describing
platforms (JunoPkg, SgiPkg, ...) and packages describing drivers
(BootMonFs, FdtPlatformDxe).

As the Dec specification mention:
"EDK II Packages cannot be nested within other EDK II Packages."
Also, CI modules are based on packages. Having non-nested packages
allows to have distinct entities each CI module must check.

To remove the nested structure:
1- Create a Platform/ARM/ArmCommonPkg package containing code
shared among platforms. It will contains the following folders:
Platform/ARM/[Drivers/ | Include/ | Library/]
2- Remove the BootMonFs and FdtPlatformDxe packages and resolve
the broken dependencies to these drivers
3- Resolve the broken dependencies to the libraries from
Platform/ARM/Library

As part of 2, this patch removes the BootMonFs.dec package to
ArmCommonPkg.dec and updates references to BootMonFs accordingly.

Bugzilla: 3259 (https://bugzilla.tianocore.org/show_bug.cgi?id=3259)
Signed-off-by: Pierre Gondois <Pierre.Gondois@...>
---
Platform/ARM/ArmCommonPkg/ArmCommonPkg.dec | 7 +++++++
.../Drivers/BootMonFs/BootMonFs.dec | 20 -------------------
.../Drivers/BootMonFs/BootMonFs.inf | 1 -
Platform/ARM/JunoPkg/ArmJuno.fdf | 2 +-
Platform/ARM/Morello/MorelloPlatformFvp.fdf | 2 +-
Platform/ARM/N1Sdp/N1SdpPlatform.fdf | 2 +-
Platform/ARM/SgiPkg/SgiPlatform.fdf | 2 +-
.../ARM/VExpressPkg/ArmVExpress-CTA15-A7.fdf | 2 +-
Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc | 2 +-
9 files changed, 13 insertions(+), 27 deletions(-)
delete mode 100644 Platform/ARM/ArmCommonPkg/Drivers/BootMonFs/BootMonFs.dec

diff --git a/Platform/ARM/ArmCommonPkg/ArmCommonPkg.dec b/Platform/ARM/ArmCommonPkg/ArmCommonPkg.dec
index cce497c27fa5..dac54b9f9ed8 100644
--- a/Platform/ARM/ArmCommonPkg/ArmCommonPkg.dec
+++ b/Platform/ARM/ArmCommonPkg/ArmCommonPkg.dec
@@ -20,3 +20,10 @@ [LibraryClasses]

[Guids]
gArmBootMonFsFileInfoGuid = { 0x41e26b9c, 0xada6, 0x45b3, { 0x80, 0x8e, 0x23, 0x57, 0xa3, 0x5b, 0x60, 0xd6 } }
+
+[Guids.common]
+ gArmBootMonFsTokenSpaceGuid = { 0xeb76a201, 0x69b4, 0x491f, { 0x9b, 0xde, 0xbf, 0x30, 0xbd, 0x03, 0x82, 0xb4 } }
+
+[PcdsFixedAtBuild.common]
+ # Boot Monitor FileSystem
+ gArmBootMonFsTokenSpaceGuid.PcdBootMonFsSupportedDevicePaths|L""|VOID*|0x0000003A
diff --git a/Platform/ARM/ArmCommonPkg/Drivers/BootMonFs/BootMonFs.dec b/Platform/ARM/ArmCommonPkg/Drivers/BootMonFs/BootMonFs.dec
deleted file mode 100644
index 1819e2f46d9c..000000000000
--- a/Platform/ARM/ArmCommonPkg/Drivers/BootMonFs/BootMonFs.dec
+++ /dev/null
@@ -1,20 +0,0 @@
-#/** @file
-#
-# Copyright (c) 2011-2017, ARM Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#**/
-
-[Defines]
- DEC_SPECIFICATION = 0x0001001A
- PACKAGE_NAME = BootMonFs
- PACKAGE_GUID = 41f14aba-452f-4204-a435-25242973c5b1
- PACKAGE_VERSION = 0.1
-
-[Guids.common]
- gArmBootMonFsTokenSpaceGuid = { 0xeb76a201, 0x69b4, 0x491f, { 0x9b, 0xde, 0xbf, 0x30, 0xbd, 0x03, 0x82, 0xb4 } }
-
-[PcdsFixedAtBuild.common]
- # Boot Monitor FileSystem
- gArmBootMonFsTokenSpaceGuid.PcdBootMonFsSupportedDevicePaths|L""|VOID*|0x0000003A
diff --git a/Platform/ARM/ArmCommonPkg/Drivers/BootMonFs/BootMonFs.inf b/Platform/ARM/ArmCommonPkg/Drivers/BootMonFs/BootMonFs.inf
index 10efa919e2f6..791e6fae0126 100644
--- a/Platform/ARM/ArmCommonPkg/Drivers/BootMonFs/BootMonFs.inf
+++ b/Platform/ARM/ArmCommonPkg/Drivers/BootMonFs/BootMonFs.inf
@@ -29,7 +29,6 @@ [Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
Platform/ARM/ArmCommonPkg/ArmCommonPkg.dec
- Platform/ARM/Drivers/BootMonFs/BootMonFs.dec

[LibraryClasses]
BaseLib
diff --git a/Platform/ARM/JunoPkg/ArmJuno.fdf b/Platform/ARM/JunoPkg/ArmJuno.fdf
index f70d30c6a9d9..4e9cbee52932 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.fdf
+++ b/Platform/ARM/JunoPkg/ArmJuno.fdf
@@ -139,7 +139,7 @@ [FV.FvMain]
INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf

# Versatile Express FileSystem
- INF Platform/ARM/Drivers/BootMonFs/BootMonFs.inf
+ INF ArmCommonPkg/Drivers/BootMonFs/BootMonFs.inf

#
# FAT filesystem + GPT/MBR partitioning
diff --git a/Platform/ARM/Morello/MorelloPlatformFvp.fdf b/Platform/ARM/Morello/MorelloPlatformFvp.fdf
index 851ee3159b3d..8bdb7f0d0f5f 100644
--- a/Platform/ARM/Morello/MorelloPlatformFvp.fdf
+++ b/Platform/ARM/Morello/MorelloPlatformFvp.fdf
@@ -114,7 +114,7 @@ [FV.FvMain]
INF ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf
INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf

- INF Platform/ARM/Drivers/BootMonFs/BootMonFs.inf
+ INF ArmCommonPkg/Drivers/BootMonFs/BootMonFs.inf
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf

# Virtio Block Device support
diff --git a/Platform/ARM/N1Sdp/N1SdpPlatform.fdf b/Platform/ARM/N1Sdp/N1SdpPlatform.fdf
index c4e1f7b4b8fc..af6a76470c71 100644
--- a/Platform/ARM/N1Sdp/N1SdpPlatform.fdf
+++ b/Platform/ARM/N1Sdp/N1SdpPlatform.fdf
@@ -126,7 +126,7 @@ [FV.FvMain]
INF ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf
INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf

- INF Platform/ARM/Drivers/BootMonFs/BootMonFs.inf
+ INF ArmCommonPkg/Drivers/BootMonFs/BootMonFs.inf
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf

# FAT filesystem + GPT/MBR partitioning
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.fdf b/Platform/ARM/SgiPkg/SgiPlatform.fdf
index 8227ae03330c..1e72c1d0544c 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.fdf
+++ b/Platform/ARM/SgiPkg/SgiPlatform.fdf
@@ -157,7 +157,7 @@ [FV.FvMain]
INF ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf
!endif

- INF Platform/ARM/Drivers/BootMonFs/BootMonFs.inf
+ INF ArmCommonPkg/Drivers/BootMonFs/BootMonFs.inf
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf

#
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.fdf b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.fdf
index f98de162e634..4dd01308554c 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.fdf
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.fdf
@@ -121,7 +121,7 @@ [FV.FvMain]
INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf

# Versatile Express FileSystem
- INF Platform/ARM/Drivers/BootMonFs/BootMonFs.inf
+ INF ArmCommonPkg/Drivers/BootMonFs/BootMonFs.inf

#
# USB support
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
index d6f31ecda42f..e45e5a610f4c 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
@@ -417,7 +417,7 @@ [Components.common]
}

# Versatile Express FileSystem
- Platform/ARM/Drivers/BootMonFs/BootMonFs.inf
+ ArmCommonPkg/Drivers/BootMonFs/BootMonFs.inf

#
# Networking stack
--
2.17.1

11501 - 11520 of 92312