Skip to content

KVM: arm64: selftests: Run selftests in VHE EL2

Oliver Upton 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 Latest13 patches 6 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/13KVM: arm64: selftests: Provide kvm_arch_vm_post_create() in library codetools/testing/selftests/kvm/arm64/set_id_regs.c tools/testing/selftests/kvm/include/arm64/processor.h tools/testing/selftests/kvm/lib/arm64/processor.c+20 -141 reply
2/13KVM: arm64: selftests: Initialize VGICv3 only oncetools/testing/selftests/kvm/lib/arm64/vgic.c+0 -31 reply
3/13KVM: arm64: selftests: Add helper to check for VGICv3 supporttools/testing/selftests/kvm/arm64/arch_timer.c tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c tools/testing/selftests/kvm/arm64/vgic_irq.c +4 more+21 -71 reply
4/13KVM: arm64: selftests: Add unsanitised helpers for VGICv3 creationtools/testing/selftests/kvm/include/arm64/vgic.h tools/testing/selftests/kvm/lib/arm64/vgic.c+35 -170 replies
5/13KVM: arm64: selftests: Create a VGICv3 for 'default' VMstools/testing/selftests/kvm/arm64/arch_timer.c tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c tools/testing/selftests/kvm/arm64/no-vgic-v3.c +16 more+60 -560 replies
6/13KVM: arm64: selftests: Alias EL1 registers to EL2 counterpartstools/testing/selftests/kvm/arm64/vpmu_counter_access.c tools/testing/selftests/kvm/include/arm64/processor.h tools/testing/selftests/kvm/include/kvm_util.h +1 more+69 -110 replies
7/13KVM: arm64: selftests: Provide helper for getting default vCPU targettools/testing/selftests/kvm/arm64/psci_test.c tools/testing/selftests/kvm/arm64/smccc_filter.c tools/testing/selftests/kvm/arm64/vpmu_counter_access.c +3 more+23 -132 replies
8/13KVM: arm64: selftests: Select SMCCC conduit based on current ELtools/testing/selftests/kvm/arm64/hypercalls.c tools/testing/selftests/kvm/arm64/kvm-uuid.c tools/testing/selftests/kvm/arm64/psci_test.c +2 more+21 -80 replies
9/13KVM: arm64: selftests: Use hyp timer IRQs when test runs at EL2tools/testing/selftests/kvm/arm64/arch_timer.c tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c tools/testing/selftests/kvm/include/arm64/arch_timer.h+28 -80 replies
10/13KVM: arm64: selftests: Use the vCPU attr for setting nr of PMU counterstools/testing/selftests/kvm/arm64/vpmu_counter_access.c+28 -310 replies
11/13KVM: arm64: selftests: Initialize HCR_EL2tools/testing/selftests/kvm/lib/arm64/processor.c+6 -00 replies
12/13KVM: arm64: selftests: Enable EL2 by defaulttools/testing/selftests/kvm/arm64/smccc_filter.c tools/testing/selftests/kvm/include/arm64/processor.h tools/testing/selftests/kvm/lib/arm64/processor.c+26 -10 replies
13/13KVM: arm64: selftests: Add basic test for running in VHE EL2tools/testing/selftests/kvm/Makefile.kvm tools/testing/selftests/kvm/arm64/hello_el2.c+59 -00 replies

Reviews trailers per patch

2 of 13 patches have a Reviewed-by or Acked-by.

PatchItaru KitayamaZenghui Yu
1/13
2/13R-b
3/13
4/13
5/13
6/13
7/13R-b
8/13
9/13
10/13
11/13
12/13
13/13

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/13] KVM: arm64: selftests: Run selftests in VHE EL2

I've been working on some MMU-related features that are unused by KVM meaning they're somewhat annoying to test. Because of that, I found the time / patience to port our existing selftests infrastructure over to running in VHE EL2, opportunistically promoting tests when the stars align.

Creating a VGIC is a hard requirement of enabling EL2 for a VM. As a consequence of this, I need to eat my words from my earlier conversation with Sean on this topic and hammer in a default VGICv3. This requires some participation from the arch-neutral code given the ordering constraints on vCPU and VGIC creation.

At the tail end of this series is a sanity test for EL2 but nothing is actually running nested (yet). Despite that, running in EL2 has proven valuable already as it has uncovered a bug [*].

This is all _very_ lightly tested on an M2 :) Applies to 6.17-rc4

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

Oliver Upton (13):
KVM: arm64: selftests: Provide kvm_arch_vm_post_create() in library
code
KVM: arm64: selftests: Initialize VGICv3 only once
KVM: arm64: selftests: Add helper to check for VGICv3 support
KVM: arm64: selftests: Add unsanitised helpers for VGICv3 creation
KVM: arm64: selftests: Create a VGICv3 for 'default' VMs
KVM: arm64: selftests: Alias EL1 registers to EL2 counterparts
KVM: arm64: selftests: Provide helper for getting default vCPU target
KVM: arm64: selftests: Select SMCCC conduit based on current EL
KVM: arm64: selftests: Use hyp timer IRQs when test runs at EL2
KVM: arm64: selftests: Use the vCPU attr for setting nr of PMU
counters
KVM: arm64: selftests: Initialize HCR_EL2
KVM: arm64: selftests: Enable EL2 by default
KVM: arm64: selftests: Add basic test for running in VHE EL2

 tools/testing/selftests/kvm/Makefile.kvm      |  1 +
 .../testing/selftests/kvm/arm64/arch_timer.c  | 13 +--
 .../kvm/arm64/arch_timer_edge_cases.c         | 13 +--
 tools/testing/selftests/kvm/arm64/hello_el2.c | 58 ++++++++++++
 .../testing/selftests/kvm/arm64/hypercalls.c  |  2 +-
 tools/testing/selftests/kvm/arm64/kvm-uuid.c  |  2 +-
 .../testing/selftests/kvm/arm64/no-vgic-v3.c  |  2 +
 tools/testing/selftests/kvm/arm64/psci_test.c | 13 +--
 .../testing/selftests/kvm/arm64/set_id_regs.c | 20 ++--
 .../selftests/kvm/arm64/smccc_filter.c        | 17 +++-
 tools/testing/selftests/kvm/arm64/vgic_init.c |  2 +
 tools/testing/selftests/kvm/arm64/vgic_irq.c  |  4 +-
 .../selftests/kvm/arm64/vgic_lpi_stress.c     |  8 +-
 .../selftests/kvm/arm64/vpmu_counter_access.c | 75 +++++++--------
 .../selftests/kvm/dirty_log_perf_test.c       | 35 -------
 tools/testing/selftests/kvm/dirty_log_test.c  |  1 +
 tools/testing/selftests/kvm/get-reg-list.c    |  9 +-
 .../selftests/kvm/include/arm64/arch_timer.h  | 24 +++++
 .../kvm/include/arm64/kvm_util_arch.h         |  5 +-
 .../selftests/kvm/include/arm64/processor.h   | 73 +++++++++++++++
 .../selftests/kvm/include/arm64/vgic.h        |  3 +
 .../testing/selftests/kvm/include/kvm_util.h  |  7 +-
 .../selftests/kvm/lib/arm64/processor.c       | 91 ++++++++++++++++---
 tools/testing/selftests/kvm/lib/arm64/vgic.c  | 64 +++++++++----
 tools/testing/selftests/kvm/lib/kvm_util.c    | 15 ++-
 .../testing/selftests/kvm/lib/x86/processor.c |  2 +-
 tools/testing/selftests/kvm/s390/cmma_test.c  |  2 +-
 tools/testing/selftests/kvm/steal_time.c      |  2 +-
 28 files changed, 395 insertions(+), 168 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/arm64/hello_el2.c

base-commit: b320789d6883cc00ac78ce83bccbfe7ed58afcf0

Signature · 1 line
2.47.3