]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: selftests: Restrict test region to 48-bit physical addresses when using nested
authorDavid Matlack <dmatlack@google.com>
Fri, 20 May 2022 23:32:49 +0000 (23:32 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 9 Jun 2022 14:52:27 +0000 (10:52 -0400)
commite3f212c3514769800def58e12032b40f6802878f
tree045d2765d4665f93f3c9a9486ada18632507379e
parent4ab8b136b0103d19e6fb8a4fbc8f5cd30e4d4e01
KVM: selftests: Restrict test region to 48-bit physical addresses when using nested

The selftests nested code only supports 4-level paging at the moment.
This means it cannot map nested guest physical addresses with more than
48 bits. Allow perf_test_util nested mode to work on hosts with more
than 48 physical addresses by restricting the guest test region to
48-bits.

While here, opportunistically fix an off-by-one error when dealing with
vm_get_max_gfn(). perf_test_util.c was treating this as the maximum
number of GFNs, rather than the maximum allowed GFN. This didn't result
in any correctness issues, but it did end up shifting the test region
down slightly when using huge pages.

Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: David Matlack <dmatlack@google.com>
Message-Id: <20220520233249.3776001-12-dmatlack@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/lib/perf_test_util.c