From: Paul Durrant <Paul.Durrant@citrix.com>
To: Andrew Cooper <Andrew.Cooper3@citrix.com>,
"Jan Beulich (JBeulich@suse.com)" <JBeulich@suse.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: Thu, 12 Jan 2017 16:10:01 +0000 [thread overview]
Message-ID: <70b85885a0b34ef087e836028d4b93e0@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <43206a51-1396-7ea2-90e3-30134aa5434a@citrix.com>
> -----Original Message-----
[snip]
> > +
> > +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.
>
> 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.
>
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).
Let's see what Jan thinks.
Paul
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-01-12 16:16 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 [this message]
2017-01-12 16:29 ` Jan Beulich
2017-01-13 9:05 ` Paul Durrant
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=70b85885a0b34ef087e836028d4b93e0@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).