[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v3 1/8] public / x86: Introduce __HYPERCALL_dm_op...
On Fri, Jan 13, 2017 at 09:05:19AM +0000, Paul Durrant wrote: > > -----Original Message----- > > From: Jan Beulich [mailto:JBeulich@xxxxxxxx] > > Sent: 12 January 2017 16:29 > > To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>; Paul Durrant > > <Paul.Durrant@xxxxxxxxxx> > > Cc: Ian Jackson <Ian.Jackson@xxxxxxxxxx>; Jennifer Herbert > > <jennifer.herbert@xxxxxxxxxx>; Wei Liu <wei.liu2@xxxxxxxxxx>; xen- > > devel@xxxxxxxxxxxxxxxxxxxx; Daniel De Graaf <dgdegra@xxxxxxxxxxxxx> > > Subject: RE: [PATCH v3 1/8] public / x86: Introduce __HYPERCALL_dm_op... > > > > >>> On 12.01.17 at 17:10, <Paul.Durrant@xxxxxxxxxx> wrote: > > >> > + > > >> > +struct xen_dm_op_buf { > > >> > + XEN_GUEST_HANDLE_64(void) h; > > >> > + uint32_t size; > > >> > +}; > > >> > > >> Sorry to quibble, but there is a problem here which has only just > > >> occurred to me. This ABI isn't futureproof, and has padding at the end > > >> which affects how the array is layed out. > > > > Yes, padding needs to be added. > > > > >> The userspace side should be > > >> > > >> struct xen_dm_op_buf { > > >> void *h; > > >> size_t size; > > >> } > > >> > > >> which will work sensibly for 32bit and 64bit userspace, and futureproof > > >> (for when 128bit turns up). Its size is also a power of two which > > >> avoids alignment issues in the array. > > >> > > >> The kernel already has to parse this structure anyway, and will know the > > >> bitness of its userspace process. We could easily (at this point) > > >> require the kernel to turn it into the kernels bitness for forwarding on > > >> to Xen, which covers the 32bit userspace under a 64bit kernel problem, > > >> in a way which won't break the hypercall ABI when 128bit comes along. > > > > But that won't cover a 32-bit kernel. > > > > Do we need to care about a 32-bit kernel for a tools-only hypercall? I > thought a toolstack already had to be (at least) 64-bit to match Xen. > Toolstack can run on 32bit kernel on 64bit Xen. Wei. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |