On Tue, Oct 11, 2022 at 01:06:23AM +0000, Ricardo Koller wrote: > 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@xxxxxxxxxx> > Cc: Andrew Jones <andrew.jones@xxxxxxxxx> > Signed-off-by: Ricardo Koller <ricarkol@xxxxxxxxxx> > Reviewed-by: Sean Christopherson <seanjc@xxxxxxxxxx> > --- > .../selftests/kvm/include/kvm_util_base.h | 4 ++ > .../selftests/kvm/lib/aarch64/processor.c | 12 ++-- > tools/testing/selftests/kvm/lib/elf.c | 3 +- > tools/testing/selftests/kvm/lib/kvm_util.c | 57 ++++++++++++------- > .../selftests/kvm/lib/riscv/processor.c | 8 ++- > .../selftests/kvm/lib/s390x/processor.c | 8 ++- > .../selftests/kvm/lib/x86_64/processor.c | 13 +++-- > 7 files changed, 65 insertions(+), 40 deletions(-) > Reviewed-by: Andrew Jones <andrew.jones@xxxxxxxxx>