public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] KVM: arm64: vgic: Fix IIDR revision handling and add revision 1
@ 2026-04-07 20:27 David Woodhouse
  2026-04-07 20:27 ` [PATCH 1/3] KVM: arm64: vgic: Fix IIDR revision field extracted from wrong value David Woodhouse
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: David Woodhouse @ 2026-04-07 20:27 UTC (permalink / raw)
  To: Marc Zyngier, Oliver Upton, Joey Gouly, Suzuki K Poulose,
	Zenghui Yu, Catalin Marinas, Will Deacon, Paolo Bonzini,
	Shuah Khan, David Woodhouse, Raghavendra Rao Ananta, Eric Auger,
	Kees Cook, Arnd Bergmann, Nathan Chancellor, linux-arm-kernel,
	kvmarm, linux-kernel, kvm, linux-kselftest

The uaccess write handlers for GICD_IIDR extract the revision field
from the wrong variable, making it impossible for userspace to actually
change the implementation revision. Fix that.

Additionally, allow userspace to select IIDR revision 1, restoring the 
behaviour from before commit d53c2c29ae0d ("KVM: arm/arm64: vgic: Allow 
configuration of interrupt groups") behaviour where interrupt groups are 
not guest-configurable. This is needed by hypervisors that were 
reverting that commit to preserve the original guest-visible 
semantics.

When revision 1 is selected:
 - GICv2: IGROUPR reads as zero (group 0), writes ignored
 - GICv3: IGROUPR reads as all-ones (group 1), writes ignored

The IIDR revision comments in both vgic-mmio-v2.c and vgic-mmio-v3.c
are updated to document all three revisions.

David Woodhouse (3):
      KVM: arm64: vgic: Fix IIDR revision field extracted from wrong value
      KVM: arm64: vgic: Allow userspace to set IIDR revision 1
      KVM: arm64: selftests: Add vgic IIDR revision test

 arch/arm64/kvm/vgic/vgic-mmio-v2.c                 |   7 +-
 arch/arm64/kvm/vgic/vgic-mmio-v3.c                 |   6 +-
 arch/arm64/kvm/vgic/vgic-mmio.c                    |  15 +++
 include/kvm/arm_vgic.h                             |   1 +
 tools/testing/selftests/kvm/Makefile.kvm           |   1 +
 .../testing/selftests/kvm/arm64/vgic_group_iidr.c  | 112 +++++++++++++++++++++
 6 files changed, 140 insertions(+), 2 deletions(-)



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-04-08 10:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-07 20:27 [PATCH 0/3] KVM: arm64: vgic: Fix IIDR revision handling and add revision 1 David Woodhouse
2026-04-07 20:27 ` [PATCH 1/3] KVM: arm64: vgic: Fix IIDR revision field extracted from wrong value David Woodhouse
2026-04-07 20:27 ` [PATCH 2/3] KVM: arm64: vgic: Allow userspace to set IIDR revision 1 David Woodhouse
2026-04-08  7:54   ` Marc Zyngier
2026-04-08  8:39     ` Woodhouse, David
2026-04-08 10:32     ` David Woodhouse
2026-04-07 20:27 ` [PATCH 3/3] KVM: arm64: selftests: Add vgic IIDR revision test David Woodhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox