Skip to content

KVM: selftests: Reserve memslot 1 for ucall MMIO

Tharit Tangkijwanichakul kvm kvm-riscv kvmarm linux-arm-kernel linux-kernel-mentees linux-kselftest linux-riscv lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5KVM: selftests: Introduce a shared base for test memslotstools/testing/selftests/kvm/arm64/hypercalls.c tools/testing/selftests/kvm/arm64/sea_to_user.c tools/testing/selftests/kvm/arm64/stage2_block_transitions.c +11 more+17 -130 replies
2/5KVM: selftests: Use the shared memslot base in memslot_perf_testtools/testing/selftests/kvm/memslot_perf_test.c+35 -270 replies
3/5KVM: selftests: Use the shared memslot base in memstresstools/testing/selftests/kvm/include/memstress.h+1 -10 replies
4/5KVM: selftests: Reserve memslot 1 for the ucall MMIO addresstools/testing/selftests/kvm/include/kvm_util.h tools/testing/selftests/kvm/lib/kvm_util.c+14 -70 replies
5/5KVM: selftests: Test protection of the ucall MMIO regiontools/testing/selftests/kvm/Makefile.kvm tools/testing/selftests/kvm/reserved_slot_test.c+62 -01 reply

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/5] KVM: selftests: Reserve memslot 1 for ucall MMIO

This series addresses the TODO in __vm_create() to reserve memslot 1 for the ucall MMIO region. It introduces a shared base for test memslots, migrates existing test users, and adds a read-only region to prevent overlapping allocations.

A regression test verifies overlap rejection and continued ucall operation.

Testing:
- Intel Core i5-10210U and Rockchip RK3588 (arm64).

These tests are changed but not tested:
- arm64/sea_to_user.c: not enough memory allocation.
- x86/nested_vmsave_vmload_test.c: requires X86_FEATURE_SVM.
- riscv/sbi_pmu_test.c: riscv hardware unavailability.

The following test failures reproduce on both the unmodified base <8edffbc1f6272db167037e1a8c49b99e9cd04803> with host kernel 7.3.0-rc1-gd4b7fb647204 on RK3588 and with this series applied:
- arm64/vgic_its_save.c
- arm64/hypercalls.c

These failures are unchanged by this series.

Tharit Tangkijwanichakul (5):
KVM: selftests: Introduce a shared base for test memslots
KVM: selftests: Use the shared memslot base in memslot_perf_test
KVM: selftests: Use the shared memslot base in memstress
KVM: selftests: Reserve memslot 1 for the ucall MMIO address
KVM: selftests: Test protection of the ucall MMIO region

 tools/testing/selftests/kvm/Makefile.kvm      |  1 +
 .../testing/selftests/kvm/arm64/hypercalls.c  |  3 +-
 .../testing/selftests/kvm/arm64/sea_to_user.c |  2 +-
 .../kvm/arm64/stage2_block_transitions.c      |  2 +-
 .../selftests/kvm/arm64/vgic_its_save.c       |  2 +-
 .../selftests/kvm/arm64/vgic_lpi_stress.c     |  2 +-
 tools/testing/selftests/kvm/dirty_log_test.c  |  2 +-
 .../testing/selftests/kvm/guest_memfd_test.c  |  2 +-
 .../testing/selftests/kvm/include/kvm_util.h  |  1 +
 .../testing/selftests/kvm/include/memstress.h |  2 +-
 .../selftests/kvm/kvm_page_table_test.c       |  2 +-
 tools/testing/selftests/kvm/lib/kvm_util.c    | 19 ++++--
 .../testing/selftests/kvm/memslot_perf_test.c | 62 +++++++++++--------
 tools/testing/selftests/kvm/mmu_stress_test.c |  2 +-
 .../selftests/kvm/reserved_slot_test.c        | 61 ++++++++++++++++++
 .../selftests/kvm/riscv/sbi_pmu_test.c        |  3 +-
 tools/testing/selftests/kvm/steal_time.c      |  3 +-
 .../selftests/kvm/x86/nested_dirty_log_test.c |  2 +-
 .../kvm/x86/nested_vmsave_vmload_test.c       |  2 +-
 19 files changed, 128 insertions(+), 47 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/reserved_slot_test.c
Signature · 1 line
2.53.0