From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR Date: Wed, 29 May 2013 09:18:45 -0500 Message-ID: <8738t5q37e.fsf@codemonkey.ws> References: <20130528160342.GA29915@redhat.com> <87bo7vvxej.fsf@codemonkey.ws> <87ppwammp5.fsf@rustcorp.com.au> <87mwreq76y.fsf@codemonkey.ws> <20130529132430.GA9363@redhat.com> <51A60575.1090407@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Rusty Russell , virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, KONRAD Frederic , Peter Maydell , Stefan Hajnoczi To: Paolo Bonzini , "Michael S. Tsirkin" Return-path: Received: from e23smtp06.au.ibm.com ([202.81.31.148]:58019 "EHLO e23smtp06.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965572Ab3E2OTN (ORCPT ); Wed, 29 May 2013 10:19:13 -0400 Received: from /spool/local by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 30 May 2013 00:12:32 +1000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [9.190.235.152]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id A092D2CE8054 for ; Thu, 30 May 2013 00:19:07 +1000 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r4TE4fQR22741020 for ; Thu, 30 May 2013 00:04:41 +1000 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r4TEJ5oB022449 for ; Thu, 30 May 2013 00:19:07 +1000 In-Reply-To: <51A60575.1090407@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Paolo Bonzini writes: > Il 29/05/2013 15:24, Michael S. Tsirkin ha scritto: >> You expect a compiler to pad this structure: >> >> struct foo { >> uint8_t a; >> uint8_t b; >> uint16_t c; >> uint32_t d; >> }; >> >> I'm guessing any compiler that decides to waste memory in this way >> will quickly get dropped by users and then we won't worry >> about building QEMU with it. > > You know the virtio-pci config structures are padded, but not all of > them are. For example, virtio_balloon_stat is not padded and indeed has > an __attribute__((__packed__)) in the spec. Not that these structures are actually used for something. We store the config in these structures so they are actually used for something. The proposed structures only serve as a way to express offsets. You would never actually have a variable of this type. Regards, Anthony Liguori > > For this reason I prefer to have the attribute everywhere. So people > don't have to wonder why it's here and not there. > > Paolo > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html