arch-arm: Virtualization Host Extensions checking
authorAdrian Herrera <adrian.herrera@arm.com>
Fri, 29 Nov 2019 17:22:28 +0000 (17:22 +0000)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Wed, 15 Jan 2020 09:26:10 +0000 (09:26 +0000)
This patch adds Armv8.1-VHE checking. This is based on the bit
ID_AA64MMFR1_EL1.VH being 0b1.

Change-Id: Ia3f278c63fe1b5448a686db87a46853fc8b6bea5
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24045
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/arm/utility.cc
src/arch/arm/utility.hh

index 5ab56453b14dacfa540da0ed29089492b3b2b20d..a82fec495c4ca4dac4b71e2e464b0159137b1217 100644 (file)
@@ -289,6 +289,13 @@ getMPIDR(ArmSystem *arm_sys, ThreadContext *tc)
     }
 }
 
+bool
+HaveVirtHostExt(ThreadContext *tc)
+{
+    AA64MMFR1 id_aa64mmfr1 = tc->readMiscReg(MISCREG_ID_AA64MMFR1_EL1);
+    return id_aa64mmfr1.vh;
+}
+
 bool
 HaveSecureEL2Ext(ThreadContext *tc)
 {
index 7ec44f8e2aa01a7b7737dbb647e62e5e06ffc822..4d1348abc8be857ab8090b0311b129007a6440fe 100644 (file)
@@ -166,6 +166,7 @@ currEL(CPSR cpsr)
     return opModeToEL((OperatingMode) (uint8_t)cpsr.mode);
 }
 
+bool HaveVirtHostExt(ThreadContext *tc);
 bool HaveSecureEL2Ext(ThreadContext *tc);
 bool IsSecureEL2Enabled(ThreadContext *tc);
 bool EL2Enabled(ThreadContext *tc);