arch-arm: VMPIDR_EL2 can be used in secure mode as well

This was some old code still assuming EL2 is not implemented in secure
mode. This is wrong since the introduction of FEAT_SEL2 in gem5

Change-Id: Ie7e112a83e64f33a98885e88504c2d6bc5070218
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/70471
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
Giacomo Travaglini
2023-02-06 17:04:47 +00:00
parent fbca328487
commit 0fa843c9cb

View File

@@ -139,8 +139,6 @@ readMPIDR(ArmSystem *arm_sys, ThreadContext *tc)
{
const ExceptionLevel current_el = currEL(tc);
const bool is_secure = isSecureBelowEL3(tc);
switch (current_el) {
case EL0:
// Note: in MsrMrs instruction we read the register value before
@@ -150,7 +148,7 @@ readMPIDR(ArmSystem *arm_sys, ThreadContext *tc)
warn_once("Trying to read MPIDR at EL0\n");
[[fallthrough]];
case EL1:
if (ArmSystem::haveEL(tc, EL2) && !is_secure)
if (EL2Enabled(tc))
return tc->readMiscReg(MISCREG_VMPIDR_EL2);
else
return getMPIDR(arm_sys, tc);