Skip to content

Commit

Permalink
KVM: selftests: Fix size of memslots created by Xen tests
Browse files Browse the repository at this point in the history
For better or worse, the memslot APIs take the number of pages, not the
size in bytes.  The Xen tests need 2 pages, not 8192 pages.

Fixes: 8d4e7e8 ("KVM: x86: declare Xen HVM shared info capability and add test case")
Cc: David Woodhouse <[email protected]>
Signed-off-by: Sean Christopherson <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: David Woodhouse <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
sean-jc authored and bonzini committed Feb 11, 2021
1 parent 2f3b90f commit a685d99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ int main(int argc, char *argv[])

/* Map a region for the shared_info page */
vm_userspace_mem_region_add(vm, VM_MEM_SRC_ANONYMOUS,
SHINFO_REGION_GPA, SHINFO_REGION_SLOT,
2 * getpagesize(), 0);
SHINFO_REGION_GPA, SHINFO_REGION_SLOT, 2, 0);
virt_map(vm, SHINFO_REGION_GPA, SHINFO_REGION_GPA, 2, 0);

struct kvm_xen_hvm_config hvmc = {
Expand Down
3 changes: 1 addition & 2 deletions tools/testing/selftests/kvm/x86_64/xen_vmcall_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ int main(int argc, char *argv[])

/* Map a region for the hypercall pages */
vm_userspace_mem_region_add(vm, VM_MEM_SRC_ANONYMOUS,
HCALL_REGION_GPA, HCALL_REGION_SLOT,
2 * getpagesize(), 0);
HCALL_REGION_GPA, HCALL_REGION_SLOT, 2, 0);
virt_map(vm, HCALL_REGION_GPA, HCALL_REGION_GPA, 2, 0);

for (;;) {
Expand Down

0 comments on commit a685d99

Please sign in to comment.