xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Paul Durrant <Paul.Durrant@citrix.com>,
	"Keir (Xen.org)" <keir@xen.org>, Jan Beulich <jbeulich@suse.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [PATCH] blkif: add indirect descriptors interface to	public headers
Date: Tue, 12 Nov 2013 09:42:29 -0500	[thread overview]
Message-ID: <20131112144229.GA9435@phenom.dumpdata.com> (raw)
In-Reply-To: <1384266541.10204.14.camel@kazak.uk.xensource.com>

On Tue, Nov 12, 2013 at 02:29:01PM +0000, Ian Campbell wrote:
> On Tue, 2013-11-12 at 09:22 -0500, Konrad Rzeszutek Wilk wrote:
> 
> > > > +struct blkif_request_indirect {
> > > > +    uint8_t        operation;    /* BLKIF_OP_INDIRECT                    */
> > > > +    uint8_t        indirect_op;  /* BLKIF_OP_{READ/WRITE}                */
> > > > +    uint16_t       nr_segments;  /* number of segments                   */
> > > 
> > > This is going to be a problem. What alignment boundary are you
> > expecting the next field to start on? AFAIK 32-bit gcc will 4-byte
> > align it, 32-bit MSVC will 8-byte align it.
> > > 
> > 
> > Oh no. I thought that the Linux one had this set correctly, ah it did:
> > 
> >                                                                                   
> > struct blkif_request_indirect {                                                    
> > [...]
> > } __attribute__((__packed__));     
> 
> That attribute packed isn't allowed in the public interface headers.

Right. I had hit that at some point with putting in a u64 and seeing
it mushroom up while if I did two u32 it padded it nicely.

Perhaps that is what we should do? The Linux struct has the same size
whether it be 64-bit or 32-bit.

> 
> Since compilers do differ in their packing, and guests may be using
> various pragmas, it might be useful to write down that for x86 these
> headers are to be treated as using the <WHATEVER> ABI (gcc? Some Intel
> standard?). 

Or perhaps just mention the size of the structure and offset?

> 
> For ARM we reference the specific standard[0]. It is up to the guest OS
> to make sure that it's version of the headers lay things out following
> that standard (NB Linux blkif.h is currently buggy on ARM in this
> regard, Julien has the details).
> 
> Ian.
> 
> [0]
> http://xenbits.xen.org/docs/unstable/hypercall/arm/include,public,arch-arm.h.html#incontents_arm_abi
> 

  reply	other threads:[~2013-11-12 14:42 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-12 10:36 [PATCH] blkif: add indirect descriptors interface to public headers Roger Pau Monne
2013-11-12 13:46 ` Paul Durrant
2013-11-12 14:12   ` David Vrabel
2013-11-12 14:18     ` Paul Durrant
2013-11-12 14:43     ` Jan Beulich
2013-11-12 14:49       ` David Vrabel
2013-11-12 14:54         ` Roger Pau Monné
2013-11-12 14:58           ` Jan Beulich
2013-11-14  9:57             ` Roger Pau Monné
2013-11-12 14:22   ` Konrad Rzeszutek Wilk
2013-11-12 14:29     ` Ian Campbell
2013-11-12 14:42       ` Konrad Rzeszutek Wilk [this message]
2013-11-12 14:54         ` Ian Campbell
2013-11-12 15:16       ` Paul Durrant
2013-11-13  9:26         ` Ian Campbell
2013-11-13 11:07           ` Paul Durrant
2013-11-13 11:11             ` Ian Campbell
2013-11-13 11:24               ` Paul Durrant
2013-11-14 10:06                 ` Roger Pau Monné
2013-11-14 10:14                   ` Paul Durrant
2013-11-14 10:27                     ` Roger Pau Monné
2013-11-14 10:38                       ` Paul Durrant
2013-11-14 10:52                         ` Roger Pau Monné
2013-11-14 11:26                           ` Paul Durrant
2013-11-14 16:24                         ` Konrad Rzeszutek Wilk
2013-11-14 16:26                           ` Paul Durrant
2013-11-14 16:34                             ` Konrad Rzeszutek Wilk
2013-11-14 16:53                               ` Paul Durrant
2013-11-14 16:57                                 ` Konrad Rzeszutek Wilk
2013-11-14 17:13                                   ` Paul Durrant
2013-11-14 18:14                                     ` Konrad Rzeszutek Wilk
2013-11-15  8:01                                     ` Roger Pau Monné
2013-11-15  9:05                                       ` Paul Durrant
2013-11-15  9:44                                         ` Ian Campbell
2013-11-14 19:16                                 ` Paul Durrant
2013-11-15  8:04                                   ` Roger Pau Monné
2013-11-13 12:01             ` Konrad Rzeszutek Wilk
2013-11-28 17:02 ` Roger Pau Monné
2013-11-29 10:14   ` Jan Beulich
2013-11-29 10:28     ` Ian Campbell
2013-11-29 12:47       ` Julien Grall
2013-11-29 12:49         ` Ian Campbell
2013-12-03  9:22     ` Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131112144229.GA9435@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Paul.Durrant@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=keir@xen.org \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).