aboutsummaryrefslogtreecommitdiff
path: root/arch/arm64/kvm/nested.c
diff options
context:
space:
mode:
authorMarc Zyngier <[email protected]>2024-06-14 15:45:51 +0100
committerOliver Upton <[email protected]>2024-06-19 08:14:38 +0000
commit5d476ca57d7d1fb6a5a39e46747bb2034190ee4a (patch)
treec9b28edc0da8dfc52b0876fa93d31c703fa3ff9f /arch/arm64/kvm/nested.c
parent0cb8aae2267687a13e22cf906d1ee1e9840bbe27 (diff)
KVM: arm64: nv: Add handling of range-based TLBI operations
We already support some form of range operation by handling FEAT_TTL, but so far the "arbitrary" range operations are unsupported. Let's fix that. For EL2 S1, this is simple enough: we just map both NSH, ISH and OSH instructions onto the ISH version for EL1. For TLBI instructions affecting EL1 S1, we use the same model as their non-range counterpart to invalidate in the context of the correct VMID. For TLBI instructions affecting S2, we interpret the data passed by the guest to compute the range and use that to tear-down part of the shadow S2 range and invalidate the TLBs. Finally, we advertise FEAT_TLBIRANGE if the host supports it. Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
Diffstat (limited to 'arch/arm64/kvm/nested.c')
-rw-r--r--arch/arm64/kvm/nested.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c
index 63bc8d5022fe..451926cb6c5d 100644
--- a/arch/arm64/kvm/nested.c
+++ b/arch/arm64/kvm/nested.c
@@ -805,12 +805,8 @@ static u64 limit_nv_id_reg(u32 id, u64 val)
switch (id) {
case SYS_ID_AA64ISAR0_EL1:
- /* Support everything but TME and Range TLBIs */
- tmp = FIELD_GET(NV_FTR(ISAR0, TLB), val);
- tmp = min(tmp, ID_AA64ISAR0_EL1_TLB_OS);
- val &= ~(NV_FTR(ISAR0, TLB) |
- NV_FTR(ISAR0, TME));
- val |= FIELD_PREP(NV_FTR(ISAR0, TLB), tmp);
+ /* Support everything but TME */
+ val &= ~NV_FTR(ISAR0, TME);
break;
case SYS_ID_AA64ISAR1_EL1: