Skip to content

KVM/arm64: VM configuration enforcement

Marc Zyngier kvmarm linux-arm-kernel 4 versions – Applied

Status from this message: Applied to kvmarm/next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest26 patches 3 repliesApplied
  2. v326 patches 7 repliesSuperseded
  3. v225 patches 22 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v125 patches31 repliesSuperseded

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/26arm64: sysreg: Add missing ID_AA64ISAR[13]_EL1 fields and variantsarch/arm64/tools/sysreg+7 -11 reply
2/26KVM: arm64: Add feature checking helpersarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/pmu-emul.c arch/arm64/kvm/sys_regs.c +1 more+52 -200 replies
3/26KVM: arm64: nv: Add sanitising to VNCR-backed sysregsarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/arm.c arch/arm64/kvm/nested.c+62 -20 replies
4/26KVM: arm64: nv: Add sanitising to EL2 configuration registersarch/arm64/kvm/nested.c+57 -10 replies
5/26KVM: arm64: nv: Add sanitising to VNCR-backed FGT sysregsarch/arm64/kvm/nested.c+128 -00 replies
6/26KVM: arm64: nv: Add sanitising to VNCR-backed HCRX_EL2arch/arm64/kvm/nested.c+42 -00 replies
7/26KVM: arm64: nv: Drop sanitised_sys_reg() helperarch/arm64/kvm/emulate-nested.c+7 -150 replies
8/26KVM: arm64: Unify HDFG[WR]TR_GROUP FGT identifiersarch/arm64/kvm/emulate-nested.c+1 -20 replies
9/26KVM: arm64: nv: Correctly handle negative polarity FGTsarch/arm64/kvm/emulate-nested.c+56 -30 replies
10/26KVM: arm64: nv: Turn encoding ranges into discrete XArray storesarch/arm64/kvm/emulate-nested.c+36 -130 replies
11/26KVM: arm64: Drop the requirement for XARRAY_MULTIarch/arm64/kvm/Kconfig+0 -10 replies
12/26KVM: arm64: nv: Move system instructions to their own sys_reg_desc arrayarch/arm64/kvm/sys_regs.c+44 -150 replies
13/26KVM: arm64: Always populate the trap configuration xarrayarch/arm64/kvm/sys_regs.c+1 -40 replies
14/26KVM: arm64: Register AArch64 system register entries with the sysreg xarrayarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/emulate-nested.c arch/arm64/kvm/sys_regs.c+50 -30 replies
15/26KVM: arm64: Use the xarray as the primary sysreg/sysinsn walkerarch/arm64/include/asm/kvm_nested.h arch/arm64/kvm/emulate-nested.c arch/arm64/kvm/sys_regs.c+50 -550 replies
16/26KVM: arm64: Rename __check_nv_sr_forward() to triage_sysreg_trap()arch/arm64/include/asm/kvm_nested.h arch/arm64/kvm/emulate-nested.c arch/arm64/kvm/sys_regs.c +1 more+4 -30 replies
17/26KVM: arm64: Add Fine-Grained UNDEF tracking informationarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/emulate-nested.c+21 -120 replies
18/26KVM: arm64: Propagate and handle Fine-Grained UNDEF bitsarch/arm64/kvm/emulate-nested.c arch/arm64/kvm/hyp/include/hyp/switch.h+72 -200 replies
19/26KVM: arm64: Move existing feature disabling over to FGU infrastructurearch/arm64/include/asm/kvm_host.h arch/arm64/kvm/arm.c arch/arm64/kvm/hyp/include/hyp/switch.h +1 more+36 -140 replies
20/26KVM: arm64: Streamline save/restore of HFG[RW]TR_EL2arch/arm64/kvm/hyp/include/hyp/switch.h+9 -330 replies
21/26KVM: arm64: Make TLBI OS/Range UNDEF if not advertised to the guestarch/arm64/kvm/sys_regs.c+34 -00 replies
22/26KVM: arm64: Make PIR{,E0}_EL1 UNDEF if S1PIE is not advertised to the guestarch/arm64/kvm/hyp/include/hyp/sysreg-sr.h arch/arm64/kvm/sys_regs.c+25 -30 replies
23/26KVM: arm64: Make AMU sysreg UNDEF if FEAT_AMU is not advertised to the guestarch/arm64/kvm/sys_regs.c+4 -00 replies
24/26KVM: arm64: Make FEAT_MOPS UNDEF if not advertised to the guestarch/arm64/include/asm/kvm_arm.h arch/arm64/include/asm/kvm_host.h arch/arm64/kvm/hyp/include/hyp/switch.h +1 more+10 -40 replies
25/26KVM: arm64: Snapshot all non-zero RES0/RES1 sysreg fields for later checkingarch/arm64/kvm/check-res-bits.h arch/arm64/kvm/sys_regs.c+124 -00 replies
26/26KVM: arm64: Add debugfs file for guest's ID registersarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/sys_regs.c+84 -00 replies

Reviews trailers per patch

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

PatchMark BrownSuzuki K PouloseOliver UptonJoey GoulyCatalin Marinas
1/26R-b A-b
2/26R-b Co-developed--by
3/26R-b
4/26
5/26R-b
6/26
7/26R-b
8/26R-b
9/26
10/26R-b
11/26R-b
12/26R-b
13/26R-b
14/26R-b
15/26R-b
16/26R-b
17/26
18/26R-b
19/26R-b
20/26R-b
21/26R-b
22/26R-b
23/26R-b
24/26R-b
25/26
26/26

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v4 thread

Cover letter [PATCH v4 00/26] KVM/arm64: VM configuration enforcement

This is the fourth version of this configurationm enforcement series after additional reviewing from Suzuki and Oliver. Many thanks to both.

I think I have taken most of the feedback into account, but please shout if I have ignored something.

* From v3: [3]

- Fixed copy-paste issue while testing for the PAC flags

- Added Suzuki's RB on patch #2

* From v2: [2]

- Fix totally broken handling of negative features by delegating the work that requires a functionnal brain to other people

- Fix handling of HCR_ENSCXT as RES0 instead of RES1 (and its consequences...)

- Add handling of VTTBR_EL2.CNP being RES0

- Add a snapshot of all RES0/RES1 fields so that we can catch them being changed behind our backs

- Various cleanups

* From v1: [1]

- Fix embarrassing crash with FEAT_MOPS

- Better error handling in the FGT code

- Added/Fixed comments

- Simplified the __vcpu_sys_reg() macro

- Fixed FEAT_PIR handling

- Folded in Oliver's PMU rework

[1] https://lore.kernel.org/all/[email protected]
[2] https://lore.kernel.org/all/[email protected]
[3] https://lore.kernel.org/all/[email protected]

Marc Zyngier (26):
arm64: sysreg: Add missing ID_AA64ISAR[13]_EL1 fields and variants
KVM: arm64: Add feature checking helpers
KVM: arm64: nv: Add sanitising to VNCR-backed sysregs
KVM: arm64: nv: Add sanitising to EL2 configuration registers
KVM: arm64: nv: Add sanitising to VNCR-backed FGT sysregs
KVM: arm64: nv: Add sanitising to VNCR-backed HCRX_EL2
KVM: arm64: nv: Drop sanitised_sys_reg() helper
KVM: arm64: Unify HDFG[WR]TR_GROUP FGT identifiers
KVM: arm64: nv: Correctly handle negative polarity FGTs
KVM: arm64: nv: Turn encoding ranges into discrete XArray stores
KVM: arm64: Drop the requirement for XARRAY_MULTI
KVM: arm64: nv: Move system instructions to their own sys_reg_desc
array
KVM: arm64: Always populate the trap configuration xarray
KVM: arm64: Register AArch64 system register entries with the sysreg
xarray
KVM: arm64: Use the xarray as the primary sysreg/sysinsn walker
KVM: arm64: Rename __check_nv_sr_forward() to triage_sysreg_trap()
KVM: arm64: Add Fine-Grained UNDEF tracking information
KVM: arm64: Propagate and handle Fine-Grained UNDEF bits
KVM: arm64: Move existing feature disabling over to FGU infrastructure
KVM: arm64: Streamline save/restore of HFG[RW]TR_EL2
KVM: arm64: Make TLBI OS/Range UNDEF if not advertised to the guest
KVM: arm64: Make PIR{,E0}_EL1 UNDEF if S1PIE is not advertised to the
guest
KVM: arm64: Make AMU sysreg UNDEF if FEAT_AMU is not advertised to the
guest
KVM: arm64: Make FEAT_MOPS UNDEF if not advertised to the guest
KVM: arm64: Snapshot all non-zero RES0/RES1 sysreg fields for later
checking
KVM: arm64: Add debugfs file for guest's ID registers

 arch/arm64/include/asm/kvm_arm.h           |   4 +-
 arch/arm64/include/asm/kvm_host.h          |  98 +++++++-
 arch/arm64/include/asm/kvm_nested.h        |   1 -
 arch/arm64/kvm/Kconfig                     |   1 -
 arch/arm64/kvm/arm.c                       |   7 +
 arch/arm64/kvm/check-res-bits.h            | 121 ++++++++++
 arch/arm64/kvm/emulate-nested.c            | 231 +++++++++++++-----
 arch/arm64/kvm/hyp/include/hyp/switch.h    | 130 +++++-----
 arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h |  24 +-
 arch/arm64/kvm/nested.c                    | 267 ++++++++++++++++++++-
 arch/arm64/kvm/pmu-emul.c                  |  11 +-
 arch/arm64/kvm/sys_regs.c                  | 238 +++++++++++++++---
 arch/arm64/kvm/sys_regs.h                  |   2 +
 arch/arm64/tools/sysreg                    |   8 +-
 include/kvm/arm_pmu.h                      |  11 -
 15 files changed, 973 insertions(+), 181 deletions(-)
 create mode 100644 arch/arm64/kvm/check-res-bits.h
Signature · 1 line
2.39.2