KVM: selftests: Move "struct hv_enlightenments" to x86_64/svm.h
authorSean Christopherson <seanjc@google.com>
Tue, 1 Nov 2022 14:53:40 +0000 (15:53 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 18 Nov 2022 17:58:58 +0000 (12:58 -0500)
Move Hyper-V's VMCB "struct hv_enlightenments" to the svm.h header so
that the struct can be referenced in "struct vmcb_control_area".
Alternatively, a dedicated header for SVM+Hyper-V could be added, a la
x86_64/evmcs.h, but it doesn't appear that Hyper-V will end up needing
a wholesale replacement for the VMCB.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20221101145426.251680-3-vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/include/x86_64/svm.h
tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c

index c8343ff84f7f70a46372bf63a6616b0ef8dcbbbd..89ce2c6b57fe02c79bac3e093c012a9c98a9141c 100644 (file)
@@ -58,6 +58,23 @@ enum {
        INTERCEPT_RDPRU,
 };
 
+struct hv_enlightenments {
+       struct __packed hv_enlightenments_control {
+               u32 nested_flush_hypercall:1;
+               u32 msr_bitmap:1;
+               u32 enlightened_npt_tlb: 1;
+               u32 reserved:29;
+       } __packed hv_enlightenments_control;
+       u32 hv_vp_id;
+       u64 hv_vm_id;
+       u64 partition_assist_page;
+       u64 reserved;
+} __packed;
+
+/*
+ * Hyper-V uses the software reserved clean bit in VMCB
+ */
+#define HV_VMCB_NESTED_ENLIGHTENMENTS (1U << 31)
 
 struct __attribute__ ((__packed__)) vmcb_control_area {
        u32 intercept_cr;
index 5060fcfe17601ba0e779e3935b6b5854c70a6995..2fd64b419928a8db823fa97ce40f6c0566baaceb 100644 (file)
 
 #define L2_GUEST_STACK_SIZE 256
 
-struct hv_enlightenments {
-       struct __packed hv_enlightenments_control {
-               u32 nested_flush_hypercall:1;
-               u32 msr_bitmap:1;
-               u32 enlightened_npt_tlb: 1;
-               u32 reserved:29;
-       } __packed hv_enlightenments_control;
-       u32 hv_vp_id;
-       u64 hv_vm_id;
-       u64 partition_assist_page;
-       u64 reserved;
-} __packed;
-
-/*
- * Hyper-V uses the software reserved clean bit in VMCB
- */
-#define HV_VMCB_NESTED_ENLIGHTENMENTS (1U << 31)
-
 void l2_guest_code(void)
 {
        GUEST_SYNC(3);