diff --git a/src/arch/arm/pagetable.hh b/src/arch/arm/pagetable.hh index deaf10df9e..98c5f46a61 100644 --- a/src/arch/arm/pagetable.hh +++ b/src/arch/arm/pagetable.hh @@ -320,8 +320,8 @@ struct TlbEntry : public Serializable if (match && !lookup.ignoreAsn) { match = global || (lookup.asn == asid); } - if (match && nstid) { - match = isHyp || (lookup.vmid == vmid); + if (match && useVMID(lookup.targetEL, lookup.inHost)) { + match = lookup.vmid == vmid; } } return match; diff --git a/src/arch/arm/utility.hh b/src/arch/arm/utility.hh index d317651db5..c231b93bdb 100644 --- a/src/arch/arm/utility.hh +++ b/src/arch/arm/utility.hh @@ -366,6 +366,12 @@ void syncVecElemsToRegs(ThreadContext *tc); bool fgtEnabled(ThreadContext *tc); +static inline bool +useVMID(ExceptionLevel el, bool in_host) +{ + return el == EL1 || (el == EL0 && !in_host); +} + } // namespace ArmISA } // namespace gem5