From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH] virtio_ring: make structure defines packed Date: Sun, 10 Feb 2008 03:18:06 +0100 Message-ID: <200802100318.07877.arnd@arndb.de> References: <200802081401.21194.borntraeger@de.ibm.com> <47AE4A82.3030504@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: kvm-devel , Christian Borntraeger , Christian Ehrhardt , virtualization@lists.linux-foundation.org To: Anthony Liguori Return-path: In-Reply-To: <47AE4A82.3030504@codemonkey.ws> Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org On Sunday 10 February 2008, you wrote: > Christian Borntraeger wrote: > > =A0struct vring_used > > =A0{ > > =A0=A0=A0=A0=A0=A0__u16 flags; > > =A0=A0=A0=A0=A0=A0__u16 idx; > > +=A0=A0=A0=A0=A0__u32 padding; > > =A0=A0=A0=A0=A0=A0struct vring_used_elem ring[]; > > -}; > > +} __attribute__ ((packed)); > > =A0 = > = > This padding that you've put in is not something that would normally = > occur on x86. =A0I've checked with GCC on 32-bit and 64-bit and neither = > would include that padding. =A0Is that padding included on s390? No, it is not included on any architecture that is supported by Linux. The only tricky case to watch out is if vring_used_elem contained a __u64 member. In that case, the alignment would be 32 bits on x86 and 64 bits on s390, powerpc, mips and parisc. Arnd <>< ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/