KVM: arm64: Make FEAT_MOPS UNDEF if not advertised to the guest
authorMarc Zyngier <maz@kernel.org>
Wed, 14 Feb 2024 13:18:25 +0000 (13:18 +0000)
committerOliver Upton <oliver.upton@linux.dev>
Mon, 19 Feb 2024 17:13:02 +0000 (17:13 +0000)
commit84de212d739ecd16c6289ec4ed47e27b0080bac6
treeb2341700361fed65e6f8e9874e9a1d8ec9a28e78
parentb03e8bb5a906ab0b67fe90e636c3ebff8eb0e91c
KVM: arm64: Make FEAT_MOPS UNDEF if not advertised to the guest

We unconditionally enable FEAT_MOPS, which is obviously wrong.

So let's only do that when it is advertised to the guest.
Which means we need to rely on a per-vcpu HCRX_EL2 shadow register.

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