aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/x86_64/hyperv_features.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2021-06-22 13:05:16 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2021-06-24 04:31:18 -0400
commita9db9609c0e41d8c06611678d45dff36ded563dc (patch)
tree7c58e3a0342895d517ff8da8d74f4466417ea559 /tools/testing/selftests/kvm/x86_64/hyperv_features.c
parentKVM: selftests: Use "standard" min virtual address for Hyper-V pages (diff)
downloadlinux-dev-a9db9609c0e41d8c06611678d45dff36ded563dc.tar.xz
linux-dev-a9db9609c0e41d8c06611678d45dff36ded563dc.zip
KVM: selftests: Add helpers to allocate N pages of virtual memory
Add wrappers to allocate 1 and N pages of memory using de facto standard values as the defaults for minimum virtual address, data memslot, and page table memslot. Convert all compatible users. No functional change intended. Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20210622200529.3650424-7-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to '')
-rw-r--r--tools/testing/selftests/kvm/x86_64/hyperv_features.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/selftests/kvm/x86_64/hyperv_features.c b/tools/testing/selftests/kvm/x86_64/hyperv_features.c
index ad7ee06fa71e..42bd658f52a8 100644
--- a/tools/testing/selftests/kvm/x86_64/hyperv_features.c
+++ b/tools/testing/selftests/kvm/x86_64/hyperv_features.c
@@ -604,7 +604,7 @@ int main(void)
/* Test MSRs */
vm = vm_create_default(VCPU_ID, 0, guest_msr);
- msr_gva = vm_vaddr_alloc(vm, getpagesize(), 0x10000, 0, 0);
+ msr_gva = vm_vaddr_alloc_page(vm);
memset(addr_gva2hva(vm, msr_gva), 0x0, getpagesize());
vcpu_args_set(vm, VCPU_ID, 1, msr_gva);
vcpu_enable_cap(vm, VCPU_ID, &cap);
@@ -626,10 +626,10 @@ int main(void)
vm = vm_create_default(VCPU_ID, 0, guest_hcall);
/* Hypercall input/output */
- hcall_page = vm_vaddr_alloc(vm, 2 * getpagesize(), 0x10000, 0, 0);
+ hcall_page = vm_vaddr_alloc_pages(vm, 2);
memset(addr_gva2hva(vm, hcall_page), 0x0, 2 * getpagesize());
- hcall_params = vm_vaddr_alloc(vm, getpagesize(), 0x10000, 0, 0);
+ hcall_params = vm_vaddr_alloc_page(vm);
memset(addr_gva2hva(vm, hcall_params), 0x0, getpagesize());
vcpu_args_set(vm, VCPU_ID, 2, addr_gva2gpa(vm, hcall_page), hcall_params);