]> git.itanic.dy.fi Git - linux-stable/commitdiff
KVM: selftests: Sync 'struct hv_enlightened_vmcs' definition with hyperv-tlfs.h
authorVitaly Kuznetsov <vkuznets@redhat.com>
Tue, 1 Nov 2022 14:54:16 +0000 (15:54 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 21 Nov 2022 11:40:03 +0000 (06:40 -0500)
'struct hv_enlightened_vmcs' definition in selftests is not '__packed'
and so we rely on the compiler doing the right padding. This is not
obvious so it seems beneficial to use the same definition as in kernel.

Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Reviewed-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-39-vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/include/x86_64/evmcs.h

index 58db74f68af25d7eb36f3ca07cef4a847a084aa0..4b6840df297930e1e41a7a1ca78edc8047504240 100644 (file)
@@ -41,6 +41,8 @@ struct hv_enlightened_vmcs {
        u16 host_gs_selector;
        u16 host_tr_selector;
 
+       u16 padding16_1;
+
        u64 host_ia32_pat;
        u64 host_ia32_efer;
 
@@ -159,7 +161,7 @@ struct hv_enlightened_vmcs {
        u64 ept_pointer;
 
        u16 virtual_processor_id;
-       u16 padding16[3];
+       u16 padding16_2[3];
 
        u64 padding64_2[5];
        u64 guest_physical_address;
@@ -195,13 +197,13 @@ struct hv_enlightened_vmcs {
        u64 guest_rip;
 
        u32 hv_clean_fields;
-       u32 hv_padding_32;
+       u32 padding32_1;
        u32 hv_synthetic_controls;
        struct {
                u32 nested_flush_hypercall:1;
                u32 msr_bitmap:1;
                u32 reserved:30;
-       } hv_enlightenments_control;
+       }  __packed hv_enlightenments_control;
        u32 hv_vp_id;
        u32 padding32_2;
        u64 hv_vm_id;
@@ -222,7 +224,7 @@ struct hv_enlightened_vmcs {
        u64 host_ssp;
        u64 host_ia32_int_ssp_table_addr;
        u64 padding64_6;
-};
+} __packed;
 
 #define HV_VMX_ENLIGHTENED_CLEAN_FIELD_NONE                     0
 #define HV_VMX_ENLIGHTENED_CLEAN_FIELD_IO_BITMAP                BIT(0)