From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH] virtio_ring: make structure defines packed Date: Sat, 09 Feb 2008 18:51:14 -0600 Message-ID: <47AE4A82.3030504@codemonkey.ws> References: <200802081401.21194.borntraeger@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel , Christian Ehrhardt , virtualization@lists.linux-foundation.org To: Christian Borntraeger Return-path: In-Reply-To: <200802081401.21194.borntraeger@de.ibm.com> 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 Hi Christian, Christian Borntraeger wrote: > struct vring_used > { > __u16 flags; > __u16 idx; > + __u32 padding; > struct vring_used_elem ring[]; > -}; > +} __attribute__ ((packed)); > This padding that you've put in is not something that would normally occur on x86. I've checked with GCC on 32-bit and 64-bit and neither would include that padding. Is that padding included on s390? I don't think we can do this on x86 at this point as it changes the ABI. FWIW, I agree with Arnd also that we should not explicitly pad structures that are naturally aligned anyway. Regards, Anthony Liguori > struct vring { > unsigned int num; > > ------------------------------------------------------------------------- > 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/ > _______________________________________________ > kvm-devel mailing list > kvm-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/kvm-devel > ------------------------------------------------------------------------- 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/