From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [RFC PATCH 3/16]: PVH xen: Add PHYSDEVOP_map_iomem Date: Wed, 30 Jan 2013 16:24:53 -0500 Message-ID: <20130130212452.GA1885@konrad-lan.dumpdata.com> References: <20130111173243.2438c22a@mantra.us.oracle.com> <20130124150629.GD20551@ocelot.phlegethon.org> <20130124170350.7a0afe31@mantra.us.oracle.com> <20130128163926.GC7223@konrad-lan.dumpdata.com> <5106B99502000078000BA307@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <5106B99502000078000BA307@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: "Xen-devel@lists.xensource.com" , Tim Deegan List-Id: xen-devel@lists.xenproject.org On Mon, Jan 28, 2013 at 04:47:01PM +0000, Jan Beulich wrote: > >>> On 28.01.13 at 17:39, Konrad Rzeszutek Wilk wrote: > > On Thu, Jan 24, 2013 at 05:03:50PM -0800, Mukesh Rathor wrote: > >> On Thu, 24 Jan 2013 15:06:29 +0000 > >> Tim Deegan wrote: > >> > >> > At 17:32 -0800 on 11 Jan (1357925563), Mukesh Rathor wrote: > >> >DEFINE_XEN_GUEST_HANDLE(physdev_dbgp_op_t); > >> > > > >> > > + > >> > > +#define PHYSDEVOP_map_iomem 30 > >> > > +struct physdev_map_iomem { > >> > > + /* IN */ > >> > > + unsigned long first_gfn; > >> > > + unsigned long first_mfn; > >> > > + unsigned int nr_mfns; > >> > > + unsigned int add_mapping; /* 1 == add mapping; 0 == > >> > > unmap */ + > >> > > +}; > >> > > +typedef struct physdev_map_iomem physdev_map_iomem_t; > >> > > +DEFINE_XEN_GUEST_HANDLE(physdev_map_iomem_t); > >> > > + > >> > > >> > This needs documentation. Also, the arguemnts should be explicitly > >> > sized to avoid compat difficulties. > >> > > >> > Tim. > >> > >> Done: > >> > >> /* Map given gfns to mfns where mfns are part of IO space. */ > >> #define PHYSDEVOP_map_iomem 30 > >> struct physdev_map_iomem { > >> /* IN */ > >> uint64_t first_gfn; > >> uint64_t first_mfn; > >> uint32_t nr_mfns; > >> uint32_t add_mapping; /* 1 == add mapping; 0 == unmap */ > >> > >> }; > > > > Which is BTW what the Linux tree already has. > > > > Perhaps the 'add_mapping' should be just called 'flags' > > and have two #defines? > > > > It is also has a bit of an issue when you use __packed__ - that is it > > will shrink from 32 bytes down to 24 bytes. > > How that? Or really - how would it ever end up being 32 bytes? It won't. The structure will be aligned on the 8 bytes, so it will be 24 bytes. Thanks for noticing my mistake.