]> 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)
commit6af9dec71406bd77ae30e3fe106b4e12d8d0caf9
tree045d2765d4665f93f3c9a9486ada18632507379e
parenta7362f3acdb5bf2a25c250c1356c68cf993f4286
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