diff options
author | David Matlack <dmatlack@google.com> | 2022-05-20 23:32:39 +0000 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-06-09 10:52:22 -0400 |
commit | 4ee602e78d706e740a48be9b6ddb239df4a113b5 (patch) | |
tree | 45aacc85f8b42beb3fd7c131574b84a3efdddd1c /tools/testing/selftests/kvm/max_guest_memory_test.c | |
parent | e3cdaab5ff022874e65df80ae8b8382ccc0a4fe0 (diff) | |
download | linux-stable-4ee602e78d706e740a48be9b6ddb239df4a113b5.tar.gz linux-stable-4ee602e78d706e740a48be9b6ddb239df4a113b5.tar.bz2 linux-stable-4ee602e78d706e740a48be9b6ddb239df4a113b5.zip |
KVM: selftests: Replace x86_page_size with PG_LEVEL_XX
x86_page_size is an enum used to communicate the desired page size with
which to map a range of memory. Under the hood they just encode the
desired level at which to map the page. This ends up being clunky in a
few ways:
- The name suggests it encodes the size of the page rather than the
level.
- In other places in x86_64/processor.c we just use a raw int to encode
the level.
Simplify this by adopting the kernel style of PG_LEVEL_XX enums and pass
around raw ints when referring to the level. This makes the code easier
to understand since these macros are very common in KVM MMU code.
Signed-off-by: David Matlack <dmatlack@google.com>
Message-Id: <20220520233249.3776001-2-dmatlack@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/max_guest_memory_test.c')
-rw-r--r-- | tools/testing/selftests/kvm/max_guest_memory_test.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/max_guest_memory_test.c b/tools/testing/selftests/kvm/max_guest_memory_test.c index 3875c4b23a04..15f046e19cb2 100644 --- a/tools/testing/selftests/kvm/max_guest_memory_test.c +++ b/tools/testing/selftests/kvm/max_guest_memory_test.c @@ -244,7 +244,7 @@ int main(int argc, char *argv[]) #ifdef __x86_64__ /* Identity map memory in the guest using 1gb pages. */ for (i = 0; i < slot_size; i += size_1gb) - __virt_pg_map(vm, gpa + i, gpa + i, X86_PAGE_SIZE_1G); + __virt_pg_map(vm, gpa + i, gpa + i, PG_LEVEL_1G); #else for (i = 0; i < slot_size; i += vm_get_page_size(vm)) virt_pg_map(vm, gpa + i, gpa + i); |