Skip to content

KVM: arm64: SCTLR2, DoubleFault2, and NV external abort fixes

Oliver Upton kvmarm 2 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. v3 Latest27 patches 5 repliesApplied
  2. v227 patches 10 repliesSuperseded

Changes in v3 from the cover letter

- Fix mask computation when SCLTR2_ELx.NMEA is set
- Consolidate TMEA handling for all aborts, spin off NMEA (Marc)
- Set up the fault context correctly for the injected abort (e.g. not setting HPFAR_EL2 when UNKNOWN) (Marc)
- Don't use the guest hypervisor's VSESR when FEAT_RAS isn't implemented for the guest (Marc)

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/27arm64: Detect FEAT_SCTLR2arch/arm64/kernel/cpufeature.c arch/arm64/tools/cpucaps+9 -00 replies
2/27arm64: Detect FEAT_DoubleFault2arch/arm64/kernel/cpufeature.c+1 -00 replies
3/27KVM: arm64: Add helper to identify a nested contextarch/arm64/include/asm/kvm_emulate.h arch/arm64/kvm/arch_timer.c arch/arm64/kvm/arm.c +5 more+22 -280 replies
4/27KVM: arm64: Treat vCPU with pending SError as runnablearch/arm64/kvm/arm.c+2 -10 replies
5/27KVM: arm64: nv: Respect exception routing rules for SEAsarch/arm64/include/asm/kvm_emulate.h arch/arm64/kvm/emulate-nested.c arch/arm64/kvm/guest.c +3 more+48 -470 replies
6/27KVM: arm64: nv: Honor SError exception routing / maskingarch/arm64/include/asm/kvm_emulate.h arch/arm64/include/asm/kvm_host.h arch/arm64/include/asm/kvm_nested.h +8 more+142 -390 replies
7/27KVM: arm64: nv: Add FEAT_RAS vSError sys regs to tablearch/arm64/include/asm/kvm_host.h arch/arm64/include/asm/vncr_mapping.h arch/arm64/kvm/sys_regs.c+7 -00 replies
8/27KVM: arm64: nv: Use guest hypervisor's vSError statearch/arm64/include/asm/kvm_emulate.h arch/arm64/include/asm/kvm_host.h arch/arm64/kvm/hyp/include/hyp/switch.h +1 more+76 -81 reply
9/27KVM: arm64: nv: Advertise support for FEAT_RASarch/arm64/kvm/nested.c+1 -20 replies
10/27KVM: arm64: nv: Describe trap behavior of SCTLR2_EL1arch/arm64/kvm/emulate-nested.c+12 -00 replies
11/27KVM: arm64: Wire up SCTLR2_ELx sysreg descriptorsarch/arm64/include/asm/kvm_host.h arch/arm64/include/asm/vncr_mapping.h arch/arm64/kvm/sys_regs.c+28 -00 replies
12/27KVM: arm64: Context switch SCTLR2_ELx when advertised to the guestarch/arm64/kvm/hyp/include/hyp/sysreg-sr.h arch/arm64/kvm/hyp/vhe/sysreg-sr.c+23 -00 replies
13/27KVM: arm64: Enable SCTLR2 when advertised to the guestarch/arm64/include/asm/kvm_emulate.h+3 -00 replies
14/27KVM: arm64: Describe SCTLR2_ELx RESx masksarch/arm64/kvm/config.c arch/arm64/kvm/nested.c+34 -00 replies
15/27KVM: arm64: Factor out helper for selecting exception target ELarch/arm64/kvm/inject_fault.c+14 -140 replies
16/27KVM: arm64: nv: Ensure Address size faults affect correct ESRarch/arm64/kvm/inject_fault.c+21 -180 replies
17/27KVM: arm64: Route SEAs to the SError vector when EASE is setarch/arm64/kvm/emulate-nested.c arch/arm64/kvm/hyp/exception.c arch/arm64/kvm/inject_fault.c+46 -20 replies
18/27KVM: arm64: nv: Take "masked" aborts to EL2 when HCRX_EL2.TMEA is setarch/arm64/kvm/inject_fault.c+32 -23 replies
19/27KVM: arm64: nv: Honor SError routing effects of SCTLR2_ELx.NMEAarch/arm64/kvm/inject_fault.c+19 -10 replies
20/27KVM: arm64: nv: Enable vSErrors when HCRX_EL2.TMEA is setarch/arm64/include/asm/kvm_emulate.h+5 -10 replies
21/27KVM: arm64: Advertise support for FEAT_SCTLR2arch/arm64/kvm/sys_regs.c+5 -20 replies
22/27KVM: arm64: Advertise support for FEAT_DoubleFault2arch/arm64/kvm/sys_regs.c+0 -20 replies
23/27KVM: arm64: Don't retire MMIO instruction w/ pending (emulated) SErrorarch/arm64/kvm/mmio.c+4 -20 replies
24/27KVM: arm64: selftests: Add basic SError injection testtools/testing/selftests/kvm/Makefile.kvm tools/testing/selftests/kvm/arm64/external_aborts.c tools/testing/selftests/kvm/include/arm64/processor.h+121 -80 replies
25/27KVM: arm64: selftests: Test SEAs are taken to SError vector when EASE=1tools/testing/selftests/kvm/arm64/external_aborts.c+41 -10 replies
26/27KVM: arm64: selftests: Add SCTLR2_EL1 to get-reg-listtools/testing/selftests/kvm/arm64/get-reg-list.c+7 -00 replies
27/27KVM: arm64: selftests: Catch up set_id_regs with the kerneltools/testing/selftests/kvm/arm64/set_id_regs.c+12 -20 replies

Reviews trailers per patch

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

PatchMarc Zyngier
1/27R-b
2/27R-b
3/27R-b
4/27R-b
5/27R-b
6/27R-b
7/27R-b
8/27R-b
9/27R-b
10/27R-b
11/27R-b
12/27R-b
13/27R-b
14/27R-b
15/27R-b
16/27R-b
17/27R-b
18/27R-b
19/27
20/27R-b
21/27R-b
22/27R-b
23/27R-b
24/27R-b
25/27R-b
26/27R-b
27/27R-b

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

Read the v3 thread

Cover letter [PATCH v3 00/27] KVM: arm64: SCTLR2, DoubleFault2, and NV external abort fixes

v2: https://lore.kernel.org/kvmarm/[email protected]/

v2 -> v3:
- Fix mask computation when SCLTR2_ELx.NMEA is set
- Consolidate TMEA handling for all aborts, spin off NMEA (Marc)
- Set up the fault context correctly for the injected abort (e.g. not setting HPFAR_EL2 when UNKNOWN) (Marc)
- Don't use the guest hypervisor's VSESR when FEAT_RAS isn't implemented for the guest (Marc)

Marc Zyngier (1):
KVM: arm64: Add helper to identify a nested context

Oliver Upton (26):
arm64: Detect FEAT_SCTLR2
arm64: Detect FEAT_DoubleFault2
KVM: arm64: Treat vCPU with pending SError as runnable
KVM: arm64: nv: Respect exception routing rules for SEAs
KVM: arm64: nv: Honor SError exception routing / masking
KVM: arm64: nv: Add FEAT_RAS vSError sys regs to table
KVM: arm64: nv: Use guest hypervisor's vSError state
KVM: arm64: nv: Advertise support for FEAT_RAS
KVM: arm64: nv: Describe trap behavior of SCTLR2_EL1
KVM: arm64: Wire up SCTLR2_ELx sysreg descriptors
KVM: arm64: Context switch SCTLR2_ELx when advertised to the guest
KVM: arm64: Enable SCTLR2 when advertised to the guest
KVM: arm64: Describe SCTLR2_ELx RESx masks
KVM: arm64: Factor out helper for selecting exception target EL
KVM: arm64: nv: Ensure Address size faults affect correct ESR
KVM: arm64: Route SEAs to the SError vector when EASE is set
KVM: arm64: nv: Take "masked" aborts to EL2 when HCRX_EL2.TMEA is set
KVM: arm64: nv: Honor SError routing effects of SCTLR2_ELx.NMEA
KVM: arm64: nv: Enable vSErrors when HCRX_EL2.TMEA is set
KVM: arm64: Advertise support for FEAT_SCTLR2
KVM: arm64: Advertise support for FEAT_DoubleFault2
KVM: arm64: Don't retire MMIO instruction w/ pending (emulated) SError
KVM: arm64: selftests: Add basic SError injection test
KVM: arm64: selftests: Test SEAs are taken to SError vector when

    EASE=1

KVM: arm64: selftests: Add SCTLR2_EL1 to get-reg-list
KVM: arm64: selftests: Catch up set_id_regs with the kernel

 arch/arm64/include/asm/kvm_emulate.h          |  51 +++-
 arch/arm64/include/asm/kvm_host.h             |  32 ++-
 arch/arm64/include/asm/kvm_nested.h           |   2 +
 arch/arm64/include/asm/vncr_mapping.h         |   2 +
 arch/arm64/kernel/cpufeature.c                |   9 +
 arch/arm64/kvm/arch_timer.c                   |   2 +-
 arch/arm64/kvm/arm.c                          |   9 +-
 arch/arm64/kvm/config.c                       |  28 +++
 arch/arm64/kvm/emulate-nested.c               |  49 +++-
 arch/arm64/kvm/guest.c                        |  33 +--
 arch/arm64/kvm/handle_exit.c                  |  24 +-
 arch/arm64/kvm/hyp/exception.c                |  10 +-
 arch/arm64/kvm/hyp/include/hyp/switch.h       |  53 +++-
 arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h    |  48 +++-
 arch/arm64/kvm/hyp/vgic-v3-sr.c               |   2 +-
 arch/arm64/kvm/hyp/vhe/sysreg-sr.c            |   6 +
 arch/arm64/kvm/inject_fault.c                 | 231 ++++++++++++------
 arch/arm64/kvm/mmio.c                         |  12 +-
 arch/arm64/kvm/mmu.c                          |  17 +-
 arch/arm64/kvm/nested.c                       |  49 +++-
 arch/arm64/kvm/sys_regs.c                     |  31 ++-
 arch/arm64/kvm/vgic/vgic-v3-nested.c          |   2 +-
 arch/arm64/tools/cpucaps                      |   1 +
 tools/testing/selftests/kvm/Makefile.kvm      |   2 +-
 .../arm64/{mmio_abort.c => external_aborts.c} | 159 +++++++++++-
 .../selftests/kvm/arm64/get-reg-list.c        |   7 +
 .../testing/selftests/kvm/arm64/set_id_regs.c |  14 +-
 .../selftests/kvm/include/arm64/processor.h   |  10 +
 28 files changed, 725 insertions(+), 170 deletions(-)
 rename tools/testing/selftests/kvm/arm64/{mmio_abort.c => external_aborts.c} (50%)

base-commit: 86731a2a651e58953fc949573895f2fa6d456841

Signature · 1 line
2.39.5