[edk2-devel] [PATCH v5 6/7] OvmfPkg: RiscVVirt: Remove satp bare mode setting

Tuan Phan tphan at ventanamicro.com
Fri Jul 14 19:08:23 UTC 2023


There is no point to set satp to bare mode as that should be the
default mode when booting edk2.

Signed-off-by: Tuan Phan <tphan at ventanamicro.com>
Reviewed-by: Andrei Warkentin <andrei.warkentin at intel.com>
Reviewed-by: Sunil V L <sunilvl at ventanamicro.com>
---
 OvmfPkg/RiscVVirt/Sec/Memory.c | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/OvmfPkg/RiscVVirt/Sec/Memory.c b/OvmfPkg/RiscVVirt/Sec/Memory.c
index 0e2690c73687..aad71ee5dcbb 100644
--- a/OvmfPkg/RiscVVirt/Sec/Memory.c
+++ b/OvmfPkg/RiscVVirt/Sec/Memory.c
@@ -85,21 +85,6 @@ AddMemoryRangeHob (
   AddMemoryBaseSizeHob (MemoryBase, (UINT64)(MemoryLimit - MemoryBase));
 }
 
-/**
-  Configure MMU
-**/
-STATIC
-VOID
-InitMmu (
-  )
-{
-  //
-  // Set supervisor translation mode to Bare mode
-  //
-  RiscVSetSupervisorAddressTranslationRegister ((UINT64)SATP_MODE_OFF << 60);
-  DEBUG ((DEBUG_INFO, "%a: Set Supervisor address mode to bare-metal mode.\n", __func__));
-}
-
 /**
   Publish system RAM and reserve memory regions.
 
@@ -327,7 +312,8 @@ MemoryPeimInitialization (
 
   AddReservedMemoryMap (FdtPointer);
 
-  InitMmu ();
+  /* Make sure SEC is booting with bare mode */
+  ASSERT ((RiscVGetSupervisorAddressTranslationRegister () & SATP64_MODE) == (SATP_MODE_OFF << SATP64_MODE_SHIFT));
 
   BuildMemoryTypeInformationHob ();
 
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106943): https://edk2.groups.io/g/devel/message/106943
Mute This Topic: https://groups.io/mt/100147813/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list