From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vitaly Kuznetsov Subject: Re: [PATCH] x86/hyper-v: define structures from TLFS as packed Date: Fri, 30 Nov 2018 13:49:52 +0100 Message-ID: <87y39awwzz.fsf@vitty.brq.redhat.com> References: <20181130121511.12331-1-vkuznets@redhat.com> Mime-Version: 1.0 Content-Type: text/plain Cc: kvm@vger.kernel.org, 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 To: Thomas Gleixner Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Thomas Gleixner writes: > On Fri, 30 Nov 2018, Vitaly Kuznetsov wrote: > >> Subject: x86/hyper-v: define structures from TLFS as packed > > Please start the first word after the prefix colon with an uppercase > letter. Also structures from TLFS doesn't make sense to me. Something like > this: > > Subject: x86/hyper-v: Mark TLFS structures packed > >> Without 'packed' compiler is free to add optimization paddings and re-order >> structure fields for randomization/optimization. And structures from > > s/And/As/ ? > >> hyperv-tlfs.h are used for hypervisor-guest communication, we need to >> ultimately forbid such practices. > > That whole paragraph reads a bit strange. Something like: > > The TLFS structures are used for hypervisor-guest communication and must > exactly meet the specification. > > Compilers can add alignment padding to structures or reorder struct > members for randomization and optimization, which would break the > hypervisor ABI. > > Mark the structures as packed to prevent this. > > Hmm? Sure, will do v2! > >> Suggested-by: Nadav Amit >> Signed-off-by: Vitaly Kuznetsov > > Other than that: Acked-by: Thomas Gleixner Thanks! -- Vitaly