From bc82574de476fbb485dee36650ab22865892d0d4 Mon Sep 17 00:00:00 2001 From: Sunil V L Date: Wed, 22 Feb 2023 10:36:59 +0800 Subject: OvmfPkg/RiscVVirt: Fix SCT memory allocation test case failure Fix the UEFI memory range calculation by including the correct stack memory range. Without this fix, SCT hangs in MemoryAllocation test cases which call AllocateAddress(). Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Gerd Hoffmann Cc: Andrei Warkentin Reported-by: Heinrich Schuchardt Signed-off-by: Sunil V L Reviewed-by: Andrei Warkentin --- OvmfPkg/RiscVVirt/Sec/SecMain.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OvmfPkg/RiscVVirt') diff --git a/OvmfPkg/RiscVVirt/Sec/SecMain.c b/OvmfPkg/RiscVVirt/Sec/SecMain.c index 054e49ef0c..73b9b21a67 100644 --- a/OvmfPkg/RiscVVirt/Sec/SecMain.c +++ b/OvmfPkg/RiscVVirt/Sec/SecMain.c @@ -71,8 +71,9 @@ SecStartup ( FirmwareContext.FlattenedDeviceTree = (UINT64)DeviceTreeAddress; SetFirmwareContextPointer (&FirmwareContext); - StackBase = (UINT64)FixedPcdGet32 (PcdOvmfSecPeiTempRamBase); - UefiMemoryBase = StackBase + FixedPcdGet32 (PcdOvmfSecPeiTempRamSize) - SIZE_32MB; + StackBase = (UINT64)FixedPcdGet32 (PcdOvmfSecPeiTempRamBase) + + FixedPcdGet32 (PcdOvmfSecPeiTempRamSize); + UefiMemoryBase = StackBase - SIZE_32MB; // Declare the PI/UEFI memory region HobList = HobConstructor ( -- cgit v1.2.3