KVM: arm64: nv: Add handling of range-based TLBI operations
authorMarc Zyngier <maz@kernel.org>
Fri, 14 Jun 2024 14:45:51 +0000 (15:45 +0100)
committerOliver Upton <oliver.upton@linux.dev>
Wed, 19 Jun 2024 08:14:38 +0000 (08:14 +0000)
commit5d476ca57d7d1fb6a5a39e46747bb2034190ee4a
treec9b28edc0da8dfc52b0876fa93d31c703fa3ff9f
parent0cb8aae2267687a13e22cf906d1ee1e9840bbe27
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 <maz@kernel.org>
Link: https://lore.kernel.org/r/20240614144552.2773592-16-maz@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/hyp/vhe/tlb.c
arch/arm64/kvm/nested.c
arch/arm64/kvm/sys_regs.c