KVM: arm64: gic-v5: Support GICv3 compat
authorSascha Bischoff <Sascha.Bischoff@arm.com>
Fri, 27 Jun 2025 10:09:02 +0000 (10:09 +0000)
committerOliver Upton <oliver.upton@linux.dev>
Tue, 8 Jul 2025 21:41:06 +0000 (14:41 -0700)
commitc017e49ed1381001ba7a6521daae8f968b11cf09
treec8d1f088288c65f72916b521742ee3b97408ee09
parentb62f4b5dec91b62af2791fb7004f91c92ed1444f
KVM: arm64: gic-v5: Support GICv3 compat

Add support for GICv3 compat mode (FEAT_GCIE_LEGACY) which allows a
GICv5 host to run GICv3-based VMs. This change enables the
VHE/nVHE/hVHE/protected modes, but does not support nested
virtualization.

A lazy-disable approach is taken for compat mode; it is enabled on the
vgic_v3_load path but not disabled on the vgic_v3_put path. A
non-GICv3 VM, i.e., one based on GICv5, is responsible for disabling
compat mode on the corresponding vgic_v5_load path. Currently, GICv5
is not supported, and hence compat mode is not disabled again once it
is enabled, and this function is intentionally omitted from the code.

Co-authored-by: Timothy Hayes <timothy.hayes@arm.com>
Signed-off-by: Timothy Hayes <timothy.hayes@arm.com>
Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
Link: https://lore.kernel.org/r/20250627100847.1022515-5-sascha.bischoff@arm.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/hyp/vgic-v3-sr.c
arch/arm64/kvm/sys_regs.c
arch/arm64/kvm/vgic/vgic-init.c
arch/arm64/kvm/vgic/vgic.h
include/kvm/arm_vgic.h