diff options
author | Sean Christopherson <seanjc@google.com> | 2023-04-04 17:45:18 -0700 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2023-04-11 10:19:03 -0700 |
commit | 7040e54fddf681758800d7375e728557213366f9 (patch) | |
tree | 4e9b739e71468c3733ce9300c08089b5de006ec6 /tools/testing/selftests/kvm/include/x86_64/processor.h | |
parent | b213812d3f4c29502d46f82e40a82cf959670e58 (diff) |
KVM: selftests: Rework dynamic XFeature helper to take mask, not bit
Take the XFeature mask in __vm_xsave_require_permission() instead of the
bit so that there's no need to define macros for both the bit and the
mask. Asserting that only a single bit is set and retrieving said bit
is easy enough via log2 helpers.
Opportunistically clean up the error message for the
ARCH_REQ_XCOMP_GUEST_PERM sanity check.
Reviewed-by: Aaron Lewis <aaronlewis@google.com>
Tested-by: Aaron Lewis <aaronlewis@google.com>
Link: https://lore.kernel.org/r/20230405004520.421768-5-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/testing/selftests/kvm/include/x86_64/processor.h')
-rw-r--r-- | tools/testing/selftests/kvm/include/x86_64/processor.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/selftests/kvm/include/x86_64/processor.h b/tools/testing/selftests/kvm/include/x86_64/processor.h index f6061fe7057f..41d798375570 100644 --- a/tools/testing/selftests/kvm/include/x86_64/processor.h +++ b/tools/testing/selftests/kvm/include/x86_64/processor.h @@ -1098,10 +1098,10 @@ uint64_t kvm_hypercall(uint64_t nr, uint64_t a0, uint64_t a1, uint64_t a2, uint64_t __xen_hypercall(uint64_t nr, uint64_t a0, void *a1); void xen_hypercall(uint64_t nr, uint64_t a0, void *a1); -void __vm_xsave_require_permission(int bit, const char *name); +void __vm_xsave_require_permission(uint64_t xfeature, const char *name); -#define vm_xsave_require_permission(perm) \ - __vm_xsave_require_permission(perm, #perm) +#define vm_xsave_require_permission(xfeature) \ + __vm_xsave_require_permission(xfeature, #xfeature) enum pg_level { PG_LEVEL_NONE, |