]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: arm64: vgic: Rework vgic_is_v3() and add vgic_host_has_gicvX()
authorSascha Bischoff <Sascha.Bischoff@arm.com>
Thu, 19 Mar 2026 15:50:13 +0000 (15:50 +0000)
committerMarc Zyngier <maz@kernel.org>
Thu, 19 Mar 2026 16:25:55 +0000 (16:25 +0000)
commit3a2857da94d4783c076b15035c578892f1817dce
tree4a9fb0ebfeba2d50e9e861e81326975afd5b1010
parent90f0155f8754e75fa29fce02e40d690fb733852d
KVM: arm64: vgic: Rework vgic_is_v3() and add vgic_host_has_gicvX()

The GIC version checks used to determine host capabilities and guest
configuration have become somewhat conflated (in part due to the
addition of GICv5 support). vgic_is_v3() is a prime example, which
prior to this change has been a combination of guest configuration and
host cabability.

Split out the host capability check from vgic_is_v3(), which now only
checks if the vgic model itself is GICv3. Add two new functions:
vgic_host_has_gicv3() and vgic_host_has_gicv5(). These explicitly
check the host capabilities, i.e., can the host system run a GICvX
guest or not.

The vgic_is_v3() check in vcpu_set_ich_hcr() has been replaced with
vgic_host_has_gicv3() as this only applies on GICv3-capable hardware,
and isn't strictly only applicable for a GICv3 guest (it is actually
vital for vGICv2 on GICv3 hosts).

Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
Link: https://patch.msgid.link/20260319154937.3619520-3-sascha.bischoff@arm.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/sys_regs.c
arch/arm64/kvm/vgic/vgic-v3.c
arch/arm64/kvm/vgic/vgic.h