]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: arm64: set_id_regs: Allow GICv3 support to be set at runtime
authorMarc Zyngier <maz@kernel.org>
Wed, 1 Apr 2026 10:36:11 +0000 (11:36 +0100)
committerMarc Zyngier <maz@kernel.org>
Wed, 1 Apr 2026 14:42:26 +0000 (15:42 +0100)
commitb3265a1b2bd00335308f27477cecb7702f4bb615
treebe56f848294d23a79415af0da01c17b94d5f50ce
parentf4626281c6bb563ef5ad9d3a59a1449b45a3dc30
KVM: arm64: set_id_regs: Allow GICv3 support to be set at runtime

set_id_regs creates a GIC3 guest when possible, and then proceeds
to write the ID registers as if they were not affected by the presence
of a GIC. As it turns out, ID_AA64PFR1_EL1 is the proof of the
contrary.

KVM now makes a point in exposing the GIC support to the guest,
no matter what userspace says (userspace such as QEMU is known to
write silly things at times).

Accommodate for this level of nonsense by teaching set_id_regs about
fields that are mutable, and only compare registers that have been
re-sanitised first.

Reported-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20260401103611.357092-17-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
tools/testing/selftests/kvm/arm64/set_id_regs.c