KVM: arm64: Make TLBI OS/Range UNDEF if not advertised to the guest
authorMarc Zyngier <maz@kernel.org>
Wed, 14 Feb 2024 13:18:22 +0000 (13:18 +0000)
committerOliver Upton <oliver.upton@linux.dev>
Mon, 19 Feb 2024 17:13:01 +0000 (17:13 +0000)
commit8ecdccb9e5dbbddfe5eb2d4201c1b921461b1bd4
treec0b596b8ba35a2241cae8bd6bb6ea8a0432303cf
parentd196c20c6e58686fa46285c6528acc0b19357b84
KVM: arm64: Make TLBI OS/Range UNDEF if not advertised to the guest

Outer Shareable and Range TLBI instructions shouldn't be made available
to the guest if they are not advertised. Use FGU to disable those,
and set HCR_EL2.TLBIOS in the case the host doesn't have FGT. Note
that in that later case, we cannot efficiently disable TLBI Range
instructions, as this would require to trap all TLBIs.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Joey Gouly <joey.gouly@arm.com>
Link: https://lore.kernel.org/r/20240214131827.2856277-22-maz@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/sys_regs.c