OSDN Git Service

KVM: selftests: Drop reserved bit checks from PTE accessor
authorSean Christopherson <seanjc@google.com>
Thu, 6 Oct 2022 00:45:07 +0000 (00:45 +0000)
committerSean Christopherson <seanjc@google.com>
Thu, 17 Nov 2022 00:58:54 +0000 (16:58 -0800)
commit751f280017b697d98936618a21ca3defdc03a9f4
tree9f7c50420ca691d2f6356d9e2d164a9f84dbbc75
parent816c54b74742ac1a74a74de9355ab982d11e63e6
KVM: selftests: Drop reserved bit checks from PTE accessor

Drop the reserved bit checks from the helper to retrieve a PTE, there's
very little value in sanity checking the constructed page tables as any
will quickly be noticed in the form of an unexpected #PF.  The checks
also place unnecessary restrictions on the usage of the helpers, e.g. if
a test _wanted_ to set reserved bits for whatever reason.

Removing the NX check in particular allows for the removal of the @vcpu
param, which will in turn allow the helper to be reused nearly verbatim
for addr_gva2gpa().

Signed-off-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20221006004512.666529-3-seanjc@google.com
tools/testing/selftests/kvm/include/x86_64/processor.h
tools/testing/selftests/kvm/lib/x86_64/processor.c
tools/testing/selftests/kvm/x86_64/emulator_error_test.c