From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vitaly Kuznetsov Subject: Re: [PATCH v3] x86/hyper-v: Mark TLFS structures packed Date: Wed, 12 Dec 2018 18:43:23 +0100 Message-ID: <87mupa4p50.fsf@vitty.brq.redhat.com> References: <20181203140636.21912-1-vkuznets@redhat.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , linux-kernel@vger.kernel.org, Roman Kagan , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , x86@kernel.org, "Michael Kelley \(EOSG\)" , Nadav Amit , Thomas Gleixner To: kvm@vger.kernel.org Return-path: In-Reply-To: <20181203140636.21912-1-vkuznets@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Vitaly Kuznetsov writes: > /* Define virtual processor assist page structure. */ > struct hv_vp_assist_page { > @@ -519,7 +519,7 @@ struct hv_vp_assist_page { > __u64 nested_enlightenments_control[2]; > __u32 enlighten_vmentry; > __u64 current_nested_vmcs; > -}; > +} __packed; > This particular structure wasn't properly padded: u32 padding is missing between 'enlighten_vmentry' and 'current_nested_vmcs'. > struct hv_enlightened_vmcs { > u32 revision_id; > @@ -693,7 +693,7 @@ struct hv_enlightened_vmcs { > u32 nested_flush_hypercall:1; > u32 msr_bitmap:1; > u32 reserved:30; > - } hv_enlightenments_control; > + } __packed hv_enlightenments_control; > u32 hv_vp_id; > > u64 hv_vm_id; > @@ -703,7 +703,7 @@ struct hv_enlightened_vmcs { > u64 padding64_5[7]; > u64 xss_exit_bitmap; > u64 padding64_6[7]; > -}; > +} __packed; struct hv_enlightened_vmcs also has a hole: we need an u16 padding after 'u16 host_tr_selector'. Both these problems led to Enlightened VMCS for Hyper-V on KVM being completely broken. As this is not yet merged, v4 is coming to rescue! -- Vitaly