Skip to content

KVM: arm64: selftests: Cover the ITS MOVALL command

Fuad Tabba kvmarm linux-arm-kernel 2 versions – Applied

Status from this message: Applied to fixes, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 1 replyApplied
  2. v12 patches 2 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3KVM: arm64: selftests: Add MOVI and MOVALL commands to the ITS librarytools/testing/selftests/kvm/include/arm64/gic_v3_its.h tools/testing/selftests/kvm/lib/arm64/gic_v3_its.c+30 -00 replies
2/3KVM: arm64: selftests: Build a VM per test in vgic_lpi_stresstools/testing/selftests/kvm/arm64/vgic_lpi_stress.c+41 -230 replies
3/3KVM: arm64: selftests: Test MOVI and MOVALL on a pending LPItools/testing/selftests/kvm/arm64/vgic_lpi_stress.c+195 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/3] KVM: arm64: selftests: Cover the ITS MOVALL command

Hi folks,

Changes since v1 [1]:
- Make the LPIs pending before they're moved, since pending state is what MOVALL moves. (Marc)
- Put the test in vgic_lpi_stress, which now builds a VM per test.

    (Marc)

- Test MOVI as well.
- Rebased on kvmarm/next.

This series tests MOVI and MOVALL on pending LPIs, in vgic_lpi_stress. The MOVALL case passes only with "KVM: arm64: vgic-its: Fix MOVALL handling of source redistributor", which is in kvmarm/fixes. Under QEMU with pKVM, VHE and nVHE hosts, it failed all 21 runs without the fix, and the test passed all 21 with it and all 5 on top of Oliver's series [2]. MOVI is there because it's what Linux uses to change an LPI's affinity.

The test can also catch the stale LR that Oliver's "KVM: arm64: vgic:
Move IRQ migrations out of vgic_prune_ap_list()" fixes, since the vCPU the LPI is moved from can keep it in its list registers during the move. I've only seen that in the MOVALL case without the MOVALL fix, where 13 of the 21 runs took the LPI on that vCPU. I couldn't reproduce it with MOVI, with the fix, or in 70 runs in a Linux VM on an M4 with Ubuntu's 6.8 kernel, which predates the MOVALL bug. Oliver, this may be the pending-LPI migration test you mentioned.

Turns out the test does run on an M4, unlike what I said in v1, since KVM emulates the ITS whether or not the host has one.

Based on kvmarm/next (8c00199d322b9).

Cheers,
/fuad

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

Fuad Tabba (3):
KVM: arm64: selftests: Add MOVI and MOVALL commands to the ITS library
KVM: arm64: selftests: Build a VM per test in vgic_lpi_stress
KVM: arm64: selftests: Test MOVI and MOVALL on a pending LPI

 .../selftests/kvm/arm64/vgic_lpi_stress.c     | 258 ++++++++++++++++--
 .../selftests/kvm/include/arm64/gic_v3_its.h  |   2 +
 .../selftests/kvm/lib/arm64/gic_v3_its.c      |  28 ++
 3 files changed, 265 insertions(+), 23 deletions(-)

base-commit: 8c00199d322b9e5e936bb0ff624ac95b01c740fe

Signature · 1 line
2.39.5