All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] KVM: arm64: nv: Userspace register visibility fixes
@ 2025-07-14 12:26 Marc Zyngier
  2025-07-14 12:26 ` [PATCH 01/11] KVM: arm64: Make RVBAR_EL2 accesses UNDEF Marc Zyngier
                   ` (11 more replies)
  0 siblings, 12 replies; 14+ messages in thread
From: Marc Zyngier @ 2025-07-14 12:26 UTC (permalink / raw)
  To: kvmarm, linux-arm-kernel, kvm
  Cc: Joey Gouly, Suzuki K Poulose, Oliver Upton, Zenghui Yu,
	Eric Auger, Peter Maydell

Peter recently pointed out that we don't expose the EL2 GICv3
registers in a consistent manner, as they are presented through the
ONE_REG interface instead of KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS, despite
the latter already exposing the EL1 GICv3 regs.

While I was looking at this, I ended up finding a small number of
equally small problems:

- RVBAR_EL2 shouldn't be a thing at all

- FEAT_FGT registers should only be exposed to userspace if the
  feature is presented to the guest (and actually exists)

- FEAT_FGT2 registers are not exposed at all, and that's bad (though
  the machine that has FGT2 hasn't been built yet)

- Nothing documents which registers are exposed by
  KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS

So I cooked up a handful of fixes for those. And because I was feeling
generous, I hacked the get-reg-list test to check for the EL2
registers reported via ONE_REG /mindblown/.

Eric, I'd really appreciate if you could give this a go with QEMU to
check that you can now correctly get to the GIC El2 registers via the
expected interface.

Marc Zyngier (11):
  KVM: arm64: Make RVBAR_EL2 accesses UNDEF
  KVM: arm64: Don't advertise ICH_*_EL2 registers through GET_ONE_REG
  KVM: arm64: Define constant value for ICC_SRE_EL2
  KVM: arm64: Define helper for ICH_VTR_EL2
  KVM: arm64: Let GICv3 save/restore honor visibility attribute
  KVM: arm64: Expose GICv3 EL2 registers via
    KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS
  KVM: arm64: Condition FGT registers on feature availability
  KVM: arm64: Advertise FGT2 registers to userspace
  KVM: arm64: selftests: get-reg-list: Simplify feature dependency
  KVM: arm64: selftests: get-reg-list: Add base EL2 registers
  KVM: arm64: Document registers exposed via
    KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS

 .../virt/kvm/devices/arm-vgic-v3.rst          |  63 +++++-
 arch/arm64/kvm/sys_regs.c                     | 111 ++++++----
 arch/arm64/kvm/vgic-sys-reg-v3.c              | 121 ++++++++++-
 arch/arm64/kvm/vgic/vgic.h                    |  18 ++
 .../selftests/kvm/arm64/get-reg-list.c        | 197 +++++++++++++++---
 5 files changed, 432 insertions(+), 78 deletions(-)

-- 
2.39.2


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

end of thread, other threads:[~2025-07-16 16:48 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-14 12:26 [PATCH 00/11] KVM: arm64: nv: Userspace register visibility fixes Marc Zyngier
2025-07-14 12:26 ` [PATCH 01/11] KVM: arm64: Make RVBAR_EL2 accesses UNDEF Marc Zyngier
2025-07-14 12:26 ` [PATCH 02/11] KVM: arm64: Don't advertise ICH_*_EL2 registers through GET_ONE_REG Marc Zyngier
2025-07-14 12:26 ` [PATCH 03/11] KVM: arm64: Define constant value for ICC_SRE_EL2 Marc Zyngier
2025-07-14 12:26 ` [PATCH 04/11] KVM: arm64: Define helper for ICH_VTR_EL2 Marc Zyngier
2025-07-14 12:26 ` [PATCH 05/11] KVM: arm64: Let GICv3 save/restore honor visibility attribute Marc Zyngier
2025-07-14 12:26 ` [PATCH 06/11] KVM: arm64: Expose GICv3 EL2 registers via KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS Marc Zyngier
2025-07-14 12:26 ` [PATCH 07/11] KVM: arm64: Condition FGT registers on feature availability Marc Zyngier
2025-07-14 12:26 ` [PATCH 08/11] KVM: arm64: Advertise FGT2 registers to userspace Marc Zyngier
2025-07-14 12:26 ` [PATCH 09/11] KVM: arm64: selftests: get-reg-list: Simplify feature dependency Marc Zyngier
2025-07-14 22:49   ` Itaru Kitayama
2025-07-14 12:26 ` [PATCH 10/11] KVM: arm64: selftests: get-reg-list: Add base EL2 registers Marc Zyngier
2025-07-14 12:26 ` [PATCH 11/11] KVM: arm64: Document registers exposed via KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS Marc Zyngier
2025-07-16 16:47 ` [PATCH 00/11] KVM: arm64: nv: Userspace register visibility fixes Oliver Upton

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.