From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/14] KVM: userspace interface Date: Mon, 06 Nov 2006 12:47:35 +0200 Message-ID: <454F12C7.4070504@qumranet.com> References: <454E4941.7000108@qumranet.com> <20061105202934.B5F842500A7@cleopatra.q> <1162807420.3160.186.camel@laptopd505.fenrus.org> <454F0E4A.7030001@qumranet.com> <1162809128.3160.201.camel@laptopd505.fenrus.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, akpm-3NddpPZAyC0@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Return-path: To: Arjan van de Ven In-Reply-To: <1162809128.3160.201.camel-NIQFrBLA1CpScpXdPBN83iCwEArCW2h5@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Arjan van de Ven wrote: >> \> as a general rule, it's a lot better to sort structures big-to-small, to >> >>> make sure alignments inside the struct are minimized and don't suck too >>> much. This is especially important to get right for 32/64 bit >>> compatibility. This comment is true for most structures in this header >>> file; please consider this at least >>> >>> >> Doesn't that cause an unnatural field order? >> > > Does it matter? > > Just a matter of taste. >> for example, in some >> structures I separated in and out variables. Sorting by size is a bit >> like sorting alphabetically. >> >> Anyway I observed 32/64 bit compatibility religiously. >> > > but you did take the alignment rules of 64 bit variables into account, > eg 32 bit has it 4 byte aligned, while 64 bit has it 8 byte aligned.. > you are 100% sure even your 32 bit structures have all 64 bit values 8 > byte aligned? > (you get this automatic if you sort by size) > Also you made sure that if you have such implicit padding that you zero > out the memory between the fields to avoid information leaks? > I put explicit padding everywhere. > Sorting by size at least makes this all go away..... > > True. I'll rethink it. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642