All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] KVM: arm64: Reject mismatched GICv3 ITS/VGIC models
@ 2026-10-19 13:42 Sascha Bischoff
  2026-10-19 13:42 ` [PATCH v2 1/2] KVM: arm64: vgic: Require matching VGIC model for GICv3 ITS Sascha Bischoff
  2026-10-19 13:42 ` [PATCH v2 2/2] KVM: selftests: Reject GICv3 ITS with a GICv5 VGIC Sascha Bischoff
  0 siblings, 2 replies; 6+ messages in thread
From: Sascha Bischoff @ 2026-10-19 13:42 UTC (permalink / raw)
  To: linux-arm-kernel, kvmarm, kvm
  Cc: maz, oupton, fuad.tabba, joey.gouly, seiden, suzuki.poulose,
	yuzenghui

On a GICv5 host with legacy GICv3 support, KVM exposes both VGIC
models to userspace. A VM can create a GICv3 ITS alongside a GICv5
VGIC, because neither creation path checks the model of the other
device. The ITS sets has_its, but a GICv5 VM cannot use a GICv3 ITS
for MSI translation. Creating the ITS before the VGIC also lets
userspace select an incompatible VGIC model later.

Record the VGIC model required by a GICv3 ITS and reject incompatible
device creation in either order. Drop has_its in favour of using the
newly added its_model instead. The second patch tests both orderings,
skipping the test if the host does not offer a GICv3 ITS.

This series is based on kvmarm/next-7.4+fixes-7.3-2.

Changes since V1:

* Worked in Marc's suggestion to drop has_its.
* Check for its_model being non-zero in vgic_has_its(), allowing us to
  drop has_its.
* Added a comment to explain what we are actually doing. Again, Marc's
  suggestion.
* Changed the type of vgic_model from u32 to enum kvm_device_type.

Thanks,
Sascha

Sascha Bischoff (2):
  KVM: arm64: vgic: Require matching VGIC model for GICv3 ITS
  KVM: selftests: Reject GICv3 ITS with a GICv5 VGIC

 arch/arm64/kvm/vgic/vgic-init.c             | 17 +++++++++++
 arch/arm64/kvm/vgic/vgic-its.c              | 15 +++++++++-
 arch/arm64/kvm/vgic/vgic-mmio-v3.c          |  5 +---
 include/kvm/arm_vgic.h                      |  5 ++--
 tools/testing/selftests/kvm/arm64/vgic_v5.c | 32 +++++++++++++++++++++
 5 files changed, 67 insertions(+), 7 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2026-10-20  7:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-19 13:42 [PATCH v2 0/2] KVM: arm64: Reject mismatched GICv3 ITS/VGIC models Sascha Bischoff
2026-10-19 13:42 ` [PATCH v2 1/2] KVM: arm64: vgic: Require matching VGIC model for GICv3 ITS Sascha Bischoff
2026-10-19 14:01   ` sashiko-bot
2026-10-19 15:32   ` Fuad Tabba
2026-10-20  7:44     ` Sascha Bischoff
2026-10-19 13:42 ` [PATCH v2 2/2] KVM: selftests: Reject GICv3 ITS with a GICv5 VGIC Sascha Bischoff

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.