Skip to content

KVM: arm64: vgic-v3 userspace access consolidation (and other goodies)

Marc Zyngier kvm kvmarm linux-arm-kernel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest20 patches 3 repliesIn review
  2. v119 patches 27 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20KVM: arm64: Add get_reg_by_id() as a sys_reg_desc retrieving helperarch/arm64/kvm/sys_regs.c arch/arm64/kvm/sys_regs.h arch/arm64/kvm/vgic-sys-reg-v3.c+23 -170 replies
2/20KVM: arm64: Reorder handling of invariant sysregs from userspacearch/arm64/kvm/sys_regs.c+12 -60 replies
3/20KVM: arm64: Introduce generic get_user/set_user helpers for system registersarch/arm64/kvm/sys_regs.c arch/arm64/kvm/sys_regs.h+44 -220 replies
4/20KVM: arm64: Rely on index_to_param() for size checks on userspace accessarch/arm64/kvm/sys_regs.c+0 -61 reply
5/20KVM: arm64: Consolidate sysreg userspace accessesarch/arm64/kvm/sys_regs.c arch/arm64/kvm/sys_regs.h+61 -1030 replies
6/20KVM: arm64: Get rid of reg_from/to_user()arch/arm64/kvm/sys_regs.c+6 -240 replies
7/20KVM: arm64: vgic-v3: Simplify vgic_v3_has_cpu_sysregs_attr()arch/arm64/kvm/vgic-sys-reg-v3.c arch/arm64/kvm/vgic/vgic-mmio-v3.c arch/arm64/kvm/vgic/vgic.h+13 -120 replies
8/20KVM: arm64: vgic-v3: Push user access into vgic_v3_cpu_sysregs_uaccess()arch/arm64/kvm/vgic-sys-reg-v3.c arch/arm64/kvm/vgic/vgic-kvm-device.c arch/arm64/kvm/vgic/vgic.h+24 -351 reply
9/20KVM: arm64: vgic-v3: Make the userspace accessors use sysreg APIarch/arm64/kvm/vgic-sys-reg-v3.c+257 -1970 replies
10/20KVM: arm64: vgic-v3: Convert userspace accessors over to FIELD_GET/FIELD_PREParch/arm64/kvm/vgic-sys-reg-v3.c+27 -330 replies
11/20KVM: arm64: vgic-v3: Use u32 to manage the line level from userspacearch/arm64/kvm/vgic/vgic-kvm-device.c arch/arm64/kvm/vgic/vgic-mmio-v3.c arch/arm64/kvm/vgic/vgic-mmio.c +2 more+12 -80 replies
12/20KVM: arm64: vgic-v3: Consolidate userspace access for MMIO registersarch/arm64/kvm/vgic/vgic-kvm-device.c+37 -660 replies
13/20KVM: arm64: vgic-v2: Consolidate userspace access for MMIO registersarch/arm64/kvm/vgic/vgic-kvm-device.c+17 -220 replies
14/20KVM: arm64: vgic: Use {get,put}_user() instead of copy_{from.to}_userarch/arm64/kvm/vgic/vgic-kvm-device.c+3 -30 replies
15/20KVM: arm64: vgic-v2: Add helper for legacy dist/cpuif base address settingarch/arm64/kvm/arm.c arch/arm64/kvm/vgic/vgic-kvm-device.c include/kvm/arm_vgic.h+35 -90 replies
16/20KVM: arm64: vgic: Consolidate userspace access for base address settingarch/arm64/kvm/vgic/vgic-kvm-device.c include/kvm/arm_vgic.h+31 -450 replies
17/20KVM: arm64: vgic: Tidy-up calls to vgic_{get,set}_common_attr()arch/arm64/kvm/vgic/vgic-kvm-device.c+26 -520 replies
18/20KVM: arm64: Get rid of find_reg_by_id()arch/arm64/kvm/sys_regs.c arch/arm64/kvm/sys_regs.h+0 -160 replies
19/20KVM: arm64: Descope kvm_arm_sys_reg_{get,set}_reg()arch/arm64/include/asm/kvm_host.h arch/arm64/kvm/sys_regs.h+2 -30 replies
20/20KVM: arm64: Get rid or outdated commentsarch/arm64/kvm/sys_regs.c+0 -50 replies

Reviews trailers per patch

14 of 20 patches have a Reviewed-by or Acked-by.

PatchReiji Watanabe
1/20R-b
2/20R-b
3/20R-b
4/20R-b
5/20R-b
6/20R-b
7/20R-b
8/20R-b
9/20R-b
10/20R-b
11/20R-b
12/20R-b
13/20R-b
14/20R-b
15/20
16/20
17/20
18/20
19/20
20/20

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

Read the v2 thread

Cover letter [PATCH v2 00/20] KVM: arm64: vgic-v3 userspace access consolidation (and other goodies)

This is a follow-up to [1], which aims a performing a bunch of cleanups in the way we expose sysregs to userspace, with a particular focus on the GICv3 part of that code.

* From v1:
- A couple of extra cleanups thanks to Reiji's comments
- A fix for the breakage of the legacy GICv2 address setup
- Collected RBs from Reiji and Oliver, with thanks.

[1] https://lore.kernel.org/r/[email protected]

Marc Zyngier (20):
KVM: arm64: Add get_reg_by_id() as a sys_reg_desc retrieving helper
KVM: arm64: Reorder handling of invariant sysregs from userspace
KVM: arm64: Introduce generic get_user/set_user helpers for system
registers
KVM: arm64: Rely on index_to_param() for size checks on userspace
access
KVM: arm64: Consolidate sysreg userspace accesses
KVM: arm64: Get rid of reg_from/to_user()
KVM: arm64: vgic-v3: Simplify vgic_v3_has_cpu_sysregs_attr()
KVM: arm64: vgic-v3: Push user access into
vgic_v3_cpu_sysregs_uaccess()
KVM: arm64: vgic-v3: Make the userspace accessors use sysreg API
KVM: arm64: vgic-v3: Convert userspace accessors over to
FIELD_GET/FIELD_PREP
KVM: arm64: vgic-v3: Use u32 to manage the line level from userspace
KVM: arm64: vgic-v3: Consolidate userspace access for MMIO registers
KVM: arm64: vgic-v2: Consolidate userspace access for MMIO registers
KVM: arm64: vgic: Use {get,put}_user() instead of copy_{from.to}_user
KVM: arm64: vgic-v2: Add helper for legacy dist/cpuif base address
setting
KVM: arm64: vgic: Consolidate userspace access for base address
setting
KVM: arm64: vgic: Tidy-up calls to vgic_{get,set}_common_attr()
KVM: arm64: Get rid of find_reg_by_id()
KVM: arm64: Descope kvm_arm_sys_reg_{get,set}_reg()
KVM: arm64: Get rid or outdated comments

 arch/arm64/include/asm/kvm_host.h     |   2 -
 arch/arm64/kvm/arm.c                  |  11 +-
 arch/arm64/kvm/sys_regs.c             | 282 +++++++---------
 arch/arm64/kvm/sys_regs.h             |  18 +-
 arch/arm64/kvm/vgic-sys-reg-v3.c      | 462 +++++++++++++++-----------
 arch/arm64/kvm/vgic/vgic-kvm-device.c | 342 ++++++++-----------
 arch/arm64/kvm/vgic/vgic-mmio-v3.c    |  10 +-
 arch/arm64/kvm/vgic/vgic-mmio.c       |   6 +-
 arch/arm64/kvm/vgic/vgic-mmio.h       |   4 +-
 arch/arm64/kvm/vgic/vgic.h            |   9 +-
 include/kvm/arm_vgic.h                |   2 +-
 11 files changed, 547 insertions(+), 601 deletions(-)
Signature · 1 line
2.34.1