KVM: selftests: Use the right memslot for code, page-tables, and data allocations
authorRicardo Koller <ricarkol@google.com>
Mon, 17 Oct 2022 19:58:29 +0000 (19:58 +0000)
committerMarc Zyngier <maz@kernel.org>
Thu, 10 Nov 2022 19:10:27 +0000 (19:10 +0000)
commit1446e331432d7f24ed56b870ad605a4345fee43f
tree54093d23ce2ea18866ad535fa9a94fc1244c8f21
parent5485e822e31a75dfac3713d94b6b22025d4895da
KVM: selftests: Use the right memslot for code, page-tables, and data allocations

Now that kvm_vm allows specifying different memslots for code, page tables,
and data, use the appropriate memslot when making allocations in
common/libraty code. Change them accordingly:

- code (allocated by lib/elf) use the CODE memslot
- stacks, exception tables, and other core data pages (like the TSS in x86)
  use the DATA memslot
- page tables and the PGD use the PT memslot
- test data (anything allocated with vm_vaddr_alloc()) uses the TEST_DATA
  memslot

No functional change intended. All allocators keep using memslot #0.

Cc: Sean Christopherson <seanjc@google.com>
Cc: Andrew Jones <andrew.jones@linux.dev>
Signed-off-by: Ricardo Koller <ricarkol@google.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20221017195834.2295901-10-ricarkol@google.com
tools/testing/selftests/kvm/include/kvm_util_base.h
tools/testing/selftests/kvm/lib/aarch64/processor.c
tools/testing/selftests/kvm/lib/elf.c
tools/testing/selftests/kvm/lib/kvm_util.c
tools/testing/selftests/kvm/lib/riscv/processor.c
tools/testing/selftests/kvm/lib/s390x/processor.c
tools/testing/selftests/kvm/lib/x86_64/processor.c