From 31ea9bcc70b04f9ac3374a9cdc8e9a0b1141ce33 Mon Sep 17 00:00:00 2001 From: Sami Mujawar Date: Thu, 26 Mar 2026 12:23:50 +0000 Subject: [PATCH] ArmVirtPkg: Kvmtool: Init Arm CCA HOBs in PlatformPeim() The ArmCcaInitialiseHobs() in ArmCcaInitPeiLib creates Guid HOBs to cache the IsRealm and IPA Width value. Therefore, invoke ArmCcaInitialiseHobs() from the PlatformPeim() to create the Arm CCA HOBs. Signed-off-by: Sami Mujawar --- .../KvmtoolPlatformPeiLib.c | 22 +++++++++++++------ .../KvmtoolPlatformPeiLib.inf | 1 + 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.c b/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.c index 07a760678f..8438657e81 100644 --- a/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.c +++ b/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.c @@ -1,7 +1,7 @@ /** @file Kvmtool platform PEI library. - Copyright (c) 2020, ARM Limited. All rights reserved. + Copyright (c) 2020 - 2026, ARM Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -31,12 +32,13 @@ PlatformPeim ( VOID ) { - VOID *Base; - VOID *NewBase; - UINTN FdtSize; - UINTN FdtPages; - UINT64 *FdtHobData; - UINT64 *UartHobData; + RETURN_STATUS RetStatus; + VOID *Base; + VOID *NewBase; + UINTN FdtSize; + UINTN FdtPages; + UINT64 *FdtHobData; + UINT64 *UartHobData; Base = (VOID *)(UINTN)PcdGet64 (PcdDeviceTreeInitialBaseAddress); if ((Base == NULL) || (FdtCheckHeader (Base) != 0)) { @@ -75,5 +77,11 @@ PlatformPeim ( BuildFvHob (PcdGet64 (PcdFvBaseAddress), PcdGet32 (PcdFvSize)); + RetStatus = ArmCcaInitialiseHobs (); + if (RETURN_ERROR (RetStatus)) { + ASSERT (0); + return (EFI_STATUS)RetStatus; + } + return EFI_SUCCESS; } diff --git a/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.inf b/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.inf index d642cc8e8e..fd7bde14cc 100644 --- a/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.inf +++ b/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.inf @@ -26,6 +26,7 @@ OvmfPkg/OvmfPkg.dec [LibraryClasses] + ArmCcaInitPeiLib DebugLib HobLib FdtLib