Add ArmCcaInitialize () to perform Arm CCA specific initialisation like: - Reading the Realm Config by calling the RSI interface. - Storing the IPA width of the Realm in PcdArmCcaEarlyIpaWidth. - Configuring the MMIO regions to update the page tables to set the protection attribute as Unprotected IPA.
Note: ArmCcaInitialize () is implemented in ArmCcaInitPeiLib for which a Null implementation is provided. Therefore, this change should not break existing platforms that do not implement the Arm CCA. Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org> Cc: Leif Lindholm <quic_llind...@quicinc.com> Cc: Gerd Hoffmann <kra...@redhat.com> Signed-off-by: Sami Mujawar <sami.muja...@arm.com> --- ArmVirtPkg/PrePi/PrePi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ArmVirtPkg/PrePi/PrePi.c b/ArmVirtPkg/PrePi/PrePi.c index f27e0ad3d223820f60d1f8087325a96c60ebe876..405da60177f56238a79687ff8e1839207b14afd3 100755 --- a/ArmVirtPkg/PrePi/PrePi.c +++ b/ArmVirtPkg/PrePi/PrePi.c @@ -9,6 +9,7 @@ #include <PiPei.h> #include <Pi/PiBootMode.h> +#include <Library/ArmCcaInitPeiLib.h> #include <Library/PeCoffLib.h> #include <Library/PrePiLib.h> #include <Library/PrintLib.h> @@ -34,6 +35,7 @@ PrePiMain ( CHAR8 Buffer[100]; UINTN CharCount; UINTN StacksSize; + RETURN_STATUS RetStatus; // Initialize the architecture specific bits ArchInitialize (); @@ -61,6 +63,12 @@ PrePiMain ( Status = MemoryPeim (UefiMemoryBase, FixedPcdGet32 (PcdSystemMemoryUefiRegionSize)); ASSERT_EFI_ERROR (Status); + // Perform the Arm CCA specific initialisations. + RetStatus = ArmCcaInitialize (); + if (RETURN_ERROR (RetStatus)) { + CpuDeadLoop (); + } + // Initialize the Serial Port SerialPortInitialize (); CharCount = AsciiSPrint ( -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117688): https://edk2.groups.io/g/devel/message/117688 Mute This Topic: https://groups.io/mt/105483427/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-