OSDN Git Service

KVM: selftests: Allocate ucall pool from MEM_REGION_DATA
authorOliver Upton <oliver.upton@linux.dev>
Wed, 7 Dec 2022 21:48:08 +0000 (21:48 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 9 Dec 2022 08:13:39 +0000 (09:13 +0100)
MEM_REGION_TEST_DATA is meant to hold data explicitly used by a
selftest, not implicit allocations due to the selftests infrastructure.
Allocate the ucall pool from MEM_REGION_DATA much like the rest of the
selftests library allocations.

Fixes: 426729b2cf2e ("KVM: selftests: Add ucall pool based implementation")
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Message-Id: <20221207214809.489070-5-oliver.upton@linux.dev>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/lib/ucall_common.c

index fcae964..7242017 100644 (file)
@@ -22,7 +22,7 @@ void ucall_init(struct kvm_vm *vm, vm_paddr_t mmio_gpa)
        vm_vaddr_t vaddr;
        int i;
 
-       vaddr = vm_vaddr_alloc(vm, sizeof(*hdr), KVM_UTIL_MIN_VADDR);
+       vaddr = __vm_vaddr_alloc(vm, sizeof(*hdr), KVM_UTIL_MIN_VADDR, MEM_REGION_DATA);
        hdr = (struct ucall_header *)addr_gva2hva(vm, vaddr);
        memset(hdr, 0, sizeof(*hdr));