Skip to content

KVM: arm64: nv: Userspace register visibility fixes

Marc Zyngier kvm kvmarm linux-arm-kernel 1 version Applied

Status from this message: Applied to next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 2 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/11KVM: arm64: Make RVBAR_EL2 accesses UNDEFarch/arm64/kvm/sys_regs.c+1 -20 replies
2/11KVM: arm64: Don't advertise ICH_*_EL2 registers through GET_ONE_REGarch/arm64/kvm/sys_regs.c+37 -270 replies
3/11KVM: arm64: Define constant value for ICC_SRE_EL2arch/arm64/kvm/sys_regs.c arch/arm64/kvm/vgic/vgic.h+4 -20 replies
4/11KVM: arm64: Define helper for ICH_VTR_EL2arch/arm64/kvm/sys_regs.c arch/arm64/kvm/vgic/vgic.h+16 -50 replies
5/11KVM: arm64: Let GICv3 save/restore honor visibility attributearch/arm64/kvm/vgic-sys-reg-v3.c+6 -20 replies
6/11KVM: arm64: Expose GICv3 EL2 registers via KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGSarch/arm64/kvm/vgic-sys-reg-v3.c+113 -00 replies
7/11KVM: arm64: Condition FGT registers on feature availabilityarch/arm64/kvm/sys_regs.c+15 -50 replies
8/11KVM: arm64: Advertise FGT2 registers to userspacearch/arm64/kvm/sys_regs.c+15 -00 replies
9/11KVM: arm64: selftests: get-reg-list: Simplify feature dependencytools/testing/selftests/kvm/arm64/get-reg-list.c+22 -301 reply
10/11KVM: arm64: selftests: get-reg-list: Add base EL2 registerstools/testing/selftests/kvm/arm64/get-reg-list.c+145 -00 replies
11/11KVM: arm64: Document registers exposed via KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGSDocumentation/virt/kvm/devices/arm-vgic-v3.rst+58 -50 replies

Reviews trailers per patch

None of the 11 patches has a Reviewed-by or Acked-by.

PatchItaru Kitayama
1/11
2/11
3/11
4/11
5/11
6/11
7/11
8/11
9/11T-b
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/11] KVM: arm64: nv: Userspace register visibility fixes

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(-)
Signature · 1 line
2.39.2