On Fri, Jan 13, 2017 at 09:05:19AM +0000, Paul Durrant wrote: > > -----Original Message----- > > From: Jan Beulich [mailto:jbeul...@suse.com] > > Sent: 12 January 2017 16:29 > > To: Andrew Cooper <andrew.coop...@citrix.com>; Paul Durrant > > <paul.durr...@citrix.com> > > Cc: Ian Jackson <ian.jack...@citrix.com>; Jennifer Herbert > > <jennifer.herb...@citrix.com>; Wei Liu <wei.l...@citrix.com>; xen- > > de...@lists.xenproject.org; Daniel De Graaf <dgde...@tycho.nsa.gov> > > Subject: RE: [PATCH v3 1/8] public / x86: Introduce __HYPERCALL_dm_op... > > > > >>> On 12.01.17 at 17:10, <paul.durr...@citrix.com> 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@lists.xen.org https://lists.xen.org/xen-devel