]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: arm64: vgic: Fix IIDR revision field extracted from wrong value
authorDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 7 Apr 2026 20:27:02 +0000 (21:27 +0100)
committerMarc Zyngier <maz@kernel.org>
Fri, 24 Apr 2026 11:03:47 +0000 (12:03 +0100)
commita0e6ae45af17e8b27958830595799c702ffbab8d
tree5a44a0daf7e328c1fa9078d4bd5f9729601fdf43
parentf05799491d6a2a29d8e15f4451e685c4a6e13d8f
KVM: arm64: vgic: Fix IIDR revision field extracted from wrong value

The uaccess write handlers for GICD_IIDR in both GICv2 and GICv3
extract the revision field from 'reg' (the current IIDR value read back
from the emulated distributor) instead of 'val' (the value userspace is
trying to write). This means userspace can never actually change the
implementation revision — the extracted value is always the current one.

Fix the FIELD_GET to use 'val' so that userspace can select a different
revision for migration compatibility.

Fixes: 49a1a2c70a7f ("KVM: arm64: vgic-v3: Advertise GICR_CTLR.{IR, CES} as a new GICD_IIDR revision")
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Link: https://patch.msgid.link/20260407210949.2076251-2-dwmw2@infradead.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
arch/arm64/kvm/vgic/vgic-mmio-v2.c
arch/arm64/kvm/vgic/vgic-mmio-v3.c