KVM: arm64: Zero ID_AA64PFR0_EL1.GIC when no GICv3 is presented to the guest
authorMarc Zyngier <maz@kernel.org>
Tue, 27 Aug 2024 15:25:11 +0000 (16:25 +0100)
committerMarc Zyngier <maz@kernel.org>
Tue, 27 Aug 2024 17:32:55 +0000 (18:32 +0100)
commit5cb57a1aff7551bcb3b800d33141b06ef0ac178b
tree94c84c19881b4254fb9da214f8c9d501a34b7c34
parent795a0bbaeee2aa993338166bc063fe3c89373d2a
KVM: arm64: Zero ID_AA64PFR0_EL1.GIC when no GICv3 is presented to the guest

In order to be consistent, we shouldn't advertise a GICv3 when none
is actually usable by the guest.

Wipe the feature when these conditions apply, and allow the field
to be written from userspace.

This now allows us to rewrite the kvm_has_gicv3 helper() in terms
of kvm_has_feat(), given that it is always evaluated at runtime.

Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20240827152517.3909653-6-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/sys_regs.c
arch/arm64/kvm/vgic/vgic.h