Skip to content

KVM: arm64: Revamp Fine Grained Trap handling

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

Status from this message: Applied to next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest43 patches 6 repliesApplied
  2. v342 patches 28 repliesSuperseded
  3. v223 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v118 patches11 repliesSuperseded

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/43arm64: sysreg: Add ID_AA64ISAR1_EL1.LS64 encoding for FEAT_LS64WBarch/arm64/tools/sysreg+1 -00 replies
2/43arm64: sysreg: Update ID_AA64MMFR4_EL1 descriptionarch/arm64/tools/sysreg+16 -30 replies
3/43arm64: sysreg: Add layout for HCR_EL2arch/arm64/include/asm/kvm_arm.h arch/arm64/tools/sysreg+132 -610 replies
4/43arm64: sysreg: Replace HFGxTR_EL2 with HFG{R,W}TR_EL2arch/arm64/include/asm/el2_setup.h arch/arm64/include/asm/kvm_arm.h arch/arm64/include/asm/kvm_host.h +6 more+250 -1930 replies
5/43arm64: sysreg: Update ID_AA64PFR0_EL1 descriptionarch/arm64/tools/sysreg+1 -00 replies
6/43arm64: sysreg: Update PMSIDR_EL1 descriptionarch/arm64/tools/sysreg+26 -20 replies
7/43arm64: sysreg: Update TRBIDR_EL1 descriptionarch/arm64/tools/sysreg+6 -10 replies
8/43arm64: sysreg: Update CPACR_EL1 descriptionarch/arm64/tools/sysreg+3 -10 replies
9/43arm64: sysreg: Add registers trapped by HFG{R,W}TR2_EL2arch/arm64/tools/sysreg+395 -00 replies
10/43arm64: sysreg: Add registers trapped by HDFG{R,W}TR2_EL2arch/arm64/include/asm/sysreg.h arch/arm64/tools/sysreg+353 -00 replies
11/43arm64: sysreg: Add system instructions trapped by HFGIRT2_EL2arch/arm64/include/asm/sysreg.h+4 -10 replies
12/43arm64: Remove duplicated sysreg encodingsarch/arm64/include/asm/sysreg.h+0 -110 replies
13/43arm64: tools: Resync sysreg.htools/arch/arm64/include/asm/sysreg.h+48 -170 replies
14/43arm64: Add syndrome information for trapped LD64B/ST64B{,V,V0}arch/arm64/include/asm/esr.h+7 -10 replies
15/43arm64: Add FEAT_FGT2 capabilityarch/arm64/kernel/cpufeature.c arch/arm64/tools/cpucaps+8 -00 replies
16/43KVM: arm64: Tighten handling of unknown FGT groupsarch/arm64/kvm/emulate-nested.c+3 -20 replies
17/43KVM: arm64: Simplify handling of negative FGT bitsarch/arm64/kvm/emulate-nested.c+12 -370 replies
18/43KVM: arm64: Handle trapping of FEAT_LS64* instructionsarch/arm64/kvm/handle_exit.c+56 -00 replies
19/43KVM: arm64: Restrict ACCDATA_EL1 undef to FEAT_LS64_ACCDATA being disabledarch/arm64/kvm/sys_regs.c+3 -10 replies
20/43KVM: arm64: Don't treat HCRX_EL2 as a FGT registerarch/arm64/kvm/hyp/include/hyp/switch.h+3 -60 replies
21/43KVM: arm64: Plug FEAT_GCS handlingarch/arm64/kvm/handle_exit.c arch/arm64/kvm/sys_regs.c+19 -00 replies
22/43KVM: arm64: Compute FGT masks from KVM's own FGT tablesarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/emulate-nested.c+120 -00 replies
23/43KVM: arm64: Add description of FGT bits leading to EC!=0x18arch/arm64/kvm/emulate-nested.c+30 -60 replies
24/43KVM: arm64: Use computed masks as sanitisers for FGT registersarch/arm64/kvm/nested.c+6 -60 replies
25/43KVM: arm64: Unconditionally configure fine-grain trapsarch/arm64/kvm/hyp/include/hyp/switch.h+15 -240 replies
26/43KVM: arm64: Propagate FGT masks to the nVHE hypervisorarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/arm.c arch/arm64/kvm/hyp/nvhe/switch.c+22 -00 replies
27/43KVM: arm64: Use computed FGT masks to setup FGT registersarch/arm64/kvm/hyp/include/hyp/switch.h+38 -71 reply
28/43KVM: arm64: Remove hand-crafted masks for FGT registersarch/arm64/include/asm/kvm_arm.h arch/arm64/kvm/hyp/include/hyp/switch.h+1 -670 replies
29/43KVM: arm64: Use KVM-specific HCRX_EL2 RES0 maskarch/arm64/include/asm/kvm_arm.h arch/arm64/kvm/emulate-nested.c arch/arm64/kvm/nested.c+21 -60 replies
30/43KVM: arm64: Handle PSB CSYNC trapsarch/arm64/include/asm/esr.h arch/arm64/kvm/emulate-nested.c arch/arm64/kvm/handle_exit.c +1 more+9 -20 replies
31/43KVM: arm64: Switch to table-driven FGU configurationarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/Makefile arch/arm64/kvm/config.c +1 more+596 -702 replies
32/43KVM: arm64: Validate FGT register descriptions against RES0 masksarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/config.c arch/arm64/kvm/sys_regs.c+32 -00 replies
33/43KVM: arm64: Use FGT feature maps to drive RES0 bitsarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/config.c arch/arm64/kvm/nested.c+57 -1191 reply
34/43KVM: arm64: Allow kvm_has_feat() to take variable argumentsarch/arm64/include/asm/kvm_host.h+6 -20 replies
35/43KVM: arm64: Use HCRX_EL2 feature map to drive fixed-value bitsarch/arm64/kvm/config.c arch/arm64/kvm/nested.c+79 -390 replies
36/43KVM: arm64: Use HCR_EL2 feature map to drive fixed-value bitsarch/arm64/kvm/config.c arch/arm64/kvm/nested.c+150 -370 replies
37/43KVM: arm64: Add FEAT_FGT2 registers to the VNCR pagearch/arm64/include/asm/kvm_host.h arch/arm64/include/asm/vncr_mapping.h+10 -00 replies
38/43KVM: arm64: Add sanitisation for FEAT_FGT2 registersarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/arm.c arch/arm64/kvm/config.c +4 more+260 -01 reply
39/43KVM: arm64: Add trap routing for FEAT_FGT2 registersarch/arm64/kvm/emulate-nested.c+12 -00 replies
40/43KVM: arm64: Add context-switch for FEAT_FGT2 registersarch/arm64/kvm/hyp/include/hyp/switch.h+44 -00 replies
41/43KVM: arm64: Allow sysreg ranges for FGT descriptorsarch/arm64/kvm/emulate-nested.c+42 -810 replies
42/43KVM: arm64: Add FGT descriptors for FEAT_FGT2arch/arm64/kvm/emulate-nested.c+83 -00 replies
43/43KVM: arm64: Handle TSB CSYNC trapsarch/arm64/include/asm/esr.h arch/arm64/kvm/emulate-nested.c arch/arm64/kvm/handle_exit.c+8 -10 replies

Reviews trailers per patch

12 of 43 patches have a Reviewed-by or Acked-by.

PatchJoey Gouly
1/43R-b
2/43R-b
3/43R-b
4/43
5/43
6/43
7/43
8/43
9/43
10/43
11/43
12/43
13/43
14/43R-b
15/43
16/43
17/43R-b
18/43R-b
19/43
20/43
21/43
22/43R-b
23/43
24/43
25/43
26/43
27/43R-b
28/43
29/43R-b
30/43
31/43R-b
32/43
33/43R-b
34/43
35/43
36/43
37/43
38/43R-b
39/43
40/43
41/43
42/43
43/43

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

Read the v4 thread

Cover letter [PATCH v4 00/43] KVM: arm64: Revamp Fine Grained Trap handling

This is yet another version of the series last posted at [1].

The eagled eye reviewer will have noticed that since v2, the series has more or less doubled in size for any reasonable metric (number of patches, number of lines added or deleted). It is therefore pretty urgent that this gets either merged or forgotten! ;-)

See the change log below for the details -- most of it is related to FGT2 (and its rather large dependencies) being added.

* From v3:

- Added missing bit fields for CPACR_EL1

- Fixed a bunch of typos in comments and commit messages

- Cleaned-up whitespace damage from the sysreg generator

- Collected RBs from Joey, with thanks!

* From v2:

- Added comprehensive support for FEAT_FGT2, as the host kernel is now making use of these registers, without any form of context switch in KVM. What could possibly go wrong?

- Reworked some of the FGT description and handling primitives, reducing the boilerplate code and tables that get added over time.

- Rebased on 6.15-rc3.

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

Marc Zyngier (42):
arm64: sysreg: Add ID_AA64ISAR1_EL1.LS64 encoding for FEAT_LS64WB
arm64: sysreg: Update ID_AA64MMFR4_EL1 description
arm64: sysreg: Add layout for HCR_EL2
arm64: sysreg: Replace HFGxTR_EL2 with HFG{R,W}TR_EL2
arm64: sysreg: Update ID_AA64PFR0_EL1 description
arm64: sysreg: Update PMSIDR_EL1 description
arm64: sysreg: Update TRBIDR_EL1 description
arm64: sysreg: Update CPACR_EL1 description
arm64: sysreg: Add registers trapped by HFG{R,W}TR2_EL2
arm64: sysreg: Add registers trapped by HDFG{R,W}TR2_EL2
arm64: sysreg: Add system instructions trapped by HFGIRT2_EL2
arm64: Remove duplicated sysreg encodings
arm64: tools: Resync sysreg.h
arm64: Add syndrome information for trapped LD64B/ST64B{,V,V0}
arm64: Add FEAT_FGT2 capability
KVM: arm64: Tighten handling of unknown FGT groups
KVM: arm64: Simplify handling of negative FGT bits
KVM: arm64: Handle trapping of FEAT_LS64* instructions
KVM: arm64: Restrict ACCDATA_EL1 undef to FEAT_LS64_ACCDATA being
disabled
KVM: arm64: Don't treat HCRX_EL2 as a FGT register
KVM: arm64: Plug FEAT_GCS handling
KVM: arm64: Compute FGT masks from KVM's own FGT tables
KVM: arm64: Add description of FGT bits leading to EC!=0x18
KVM: arm64: Use computed masks as sanitisers for FGT registers
KVM: arm64: Propagate FGT masks to the nVHE hypervisor
KVM: arm64: Use computed FGT masks to setup FGT registers
KVM: arm64: Remove hand-crafted masks for FGT registers
KVM: arm64: Use KVM-specific HCRX_EL2 RES0 mask
KVM: arm64: Handle PSB CSYNC traps
KVM: arm64: Switch to table-driven FGU configuration
KVM: arm64: Validate FGT register descriptions against RES0 masks
KVM: arm64: Use FGT feature maps to drive RES0 bits
KVM: arm64: Allow kvm_has_feat() to take variable arguments
KVM: arm64: Use HCRX_EL2 feature map to drive fixed-value bits
KVM: arm64: Use HCR_EL2 feature map to drive fixed-value bits
KVM: arm64: Add FEAT_FGT2 registers to the VNCR page
KVM: arm64: Add sanitisation for FEAT_FGT2 registers
KVM: arm64: Add trap routing for FEAT_FGT2 registers
KVM: arm64: Add context-switch for FEAT_FGT2 registers
KVM: arm64: Allow sysreg ranges for FGT descriptors
KVM: arm64: Add FGT descriptors for FEAT_FGT2
KVM: arm64: Handle TSB CSYNC traps

Mark Rutland (1):
KVM: arm64: Unconditionally configure fine-grain traps

 arch/arm64/include/asm/el2_setup.h      |   14 +-
 arch/arm64/include/asm/esr.h            |   10 +-
 arch/arm64/include/asm/kvm_arm.h        |  186 ++--
 arch/arm64/include/asm/kvm_host.h       |   56 +-
 arch/arm64/include/asm/sysreg.h         |   26 +-
 arch/arm64/include/asm/vncr_mapping.h   |    5 +
 arch/arm64/kernel/cpufeature.c          |    7 +
 arch/arm64/kvm/Makefile                 |    2 +-
 arch/arm64/kvm/arm.c                    |   13 +
 arch/arm64/kvm/config.c                 | 1085 +++++++++++++++++++++++
 arch/arm64/kvm/emulate-nested.c         |  583 ++++++++----
 arch/arm64/kvm/handle_exit.c            |   77 ++
 arch/arm64/kvm/hyp/include/hyp/switch.h |  158 ++--
 arch/arm64/kvm/hyp/nvhe/switch.c        |   12 +
 arch/arm64/kvm/hyp/vgic-v3-sr.c         |    8 +-
 arch/arm64/kvm/nested.c                 |  223 +----
 arch/arm64/kvm/sys_regs.c               |   68 +-
 arch/arm64/tools/cpucaps                |    1 +
 arch/arm64/tools/sysreg                 | 1006 ++++++++++++++++++++-
 tools/arch/arm64/include/asm/sysreg.h   |   65 +-
 20 files changed, 2894 insertions(+), 711 deletions(-)
 create mode 100644 arch/arm64/kvm/config.c
Signature · 1 line
2.39.2