From: Paul Durrant <Paul.Durrant@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
Andrew Cooper <Andrew.Cooper3@citrix.com>
Cc: Ian Jackson <Ian.Jackson@citrix.com>,
Daniel De Graaf <dgdegra@tycho.nsa.gov>,
Jennifer Herbert <jennifer.herbert@citrix.com>,
Wei Liu <wei.liu2@citrix.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v3 1/8] public / x86: Introduce __HYPERCALL_dm_op...
Date: Fri, 13 Jan 2017 09:05:19 +0000 [thread overview]
Message-ID: <b081dad93dd4488b84336d60f0671945@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <5877BCEE020000780012F8E9@prv-mh.provo.novell.com>
> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: 12 January 2017 16:29
> To: Andrew Cooper <Andrew.Cooper3@citrix.com>; Paul Durrant
> <Paul.Durrant@citrix.com>
> Cc: Ian Jackson <Ian.Jackson@citrix.com>; Jennifer Herbert
> <jennifer.herbert@citrix.com>; Wei Liu <wei.liu2@citrix.com>; xen-
> devel@lists.xenproject.org; Daniel De Graaf <dgdegra@tycho.nsa.gov>
> Subject: RE: [PATCH v3 1/8] public / x86: Introduce __HYPERCALL_dm_op...
>
> >>> On 12.01.17 at 17:10, <Paul.Durrant@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.
Paul
> And I'm not sure we really need to bother considering hypothetical
> 128-bit architectures at this point in time.
>
> > As discussed...
> >
> > xen_dm_op_buf is currently used directly in the tools code because there
> is
> > no explicit support for DMOPs in privcmd. When explicit support is added
> then
> > this can change and we can use a void ptr and size_t as you say.
> >
> > For the privcmd -> Xen interface that using XEN_GUEST_HANDLE_64 does
> indeed
> > limit us and so using XEN_GUEST_HANDLE would indeed seem more
> sensible (and
> > we won't need a 32-bit compat wrapper for DMOP because it's a tools-only
> > hypercall).
>
> Just like with other tools only interfaces, I think this should remain a
> 64-bit handle, to avoid (as you say, but wrongly in conjunction with a
> "normal" handle) the need for a compat wrapper.
>
> Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-01-13 9:05 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-12 14:58 [PATCH v3 0/8] New hypercall for device models Paul Durrant
2017-01-12 14:58 ` [PATCH v3 1/8] public / x86: Introduce __HYPERCALL_dm_op Paul Durrant
2017-01-12 15:33 ` Andrew Cooper
2017-01-12 16:10 ` Paul Durrant
2017-01-12 16:29 ` Jan Beulich
2017-01-13 9:05 ` Paul Durrant [this message]
2017-01-13 10:30 ` Jan Beulich
2017-01-13 10:47 ` Paul Durrant
2017-01-13 10:44 ` Wei Liu
2017-01-13 12:03 ` Andrew Cooper
2017-01-13 12:47 ` Jan Beulich
2017-01-16 16:05 ` Andrew Cooper
2017-01-16 16:16 ` Jan Beulich
2017-01-16 17:07 ` Paul Durrant
2017-01-16 17:18 ` Jan Beulich
2017-01-17 11:22 ` Andrew Cooper
2017-01-17 12:29 ` George Dunlap
2017-01-17 15:06 ` Andrew Cooper
2017-01-17 15:37 ` Jan Beulich
2017-01-17 12:42 ` Jan Beulich
2017-01-17 15:13 ` Andrew Cooper
2017-01-17 15:31 ` Jan Beulich
2017-01-12 14:58 ` [PATCH v3 2/8] dm_op: convert HVMOP_*ioreq_server* Paul Durrant
2017-01-12 16:30 ` Jan Beulich
2017-01-12 14:58 ` [PATCH v3 3/8] dm_op: convert HVMOP_track_dirty_vram Paul Durrant
2017-01-13 11:45 ` Jan Beulich
2017-01-13 11:46 ` Paul Durrant
2017-01-13 13:22 ` Tim Deegan
2017-01-16 15:12 ` George Dunlap
2017-01-12 14:58 ` [PATCH v3 4/8] dm_op: convert HVMOP_set_pci_intx_level, HVMOP_set_isa_irq_level, and Paul Durrant
2017-01-12 14:58 ` [PATCH v3 5/8] dm_op: convert HVMOP_modified_memory Paul Durrant
2017-01-13 11:51 ` Jan Beulich
2017-01-13 11:54 ` Paul Durrant
2017-01-12 14:58 ` [PATCH v3 6/8] dm_op: convert HVMOP_set_mem_type Paul Durrant
2017-01-13 11:54 ` Jan Beulich
2017-01-12 14:58 ` [PATCH v3 7/8] dm_op: convert HVMOP_inject_trap and HVMOP_inject_msi Paul Durrant
2017-01-12 14:58 ` [PATCH v3 8/8] x86/hvm: serialize trap injecting producer and consumer Paul Durrant
2017-01-12 16:28 ` Andrew Cooper
2017-01-12 16:41 ` Jan Beulich
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=b081dad93dd4488b84336d60f0671945@AMSPEX02CL03.citrite.net \
--to=paul.durrant@citrix.com \
--cc=Andrew.Cooper3@citrix.com \
--cc=Ian.Jackson@citrix.com \
--cc=JBeulich@suse.com \
--cc=dgdegra@tycho.nsa.gov \
--cc=jennifer.herbert@citrix.com \
--cc=wei.liu2@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).