arch-arm: Check VMID in secure mode as well (NS=0)

This is still trying to completely remove any artifact
which implies virtualization is only supported in
non-secure mode (NS=1)

Change-Id: I83fed1c33cc745ecdf3c5ad60f4f356f3c58aad5
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
This commit is contained in:
Giacomo Travaglini
2023-07-17 14:40:32 +01:00
parent a8efded644
commit 6b698630a2
2 changed files with 8 additions and 2 deletions

View File

@@ -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;

View File

@@ -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