xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Durrant, Paul" <pdurrant@amazon.co.uk>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	Paul Durrant <paul@xen.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Julien Grall <julien@xen.org>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Ian Jackson <ian.jackson@eu.citrix.com>, Wei Liu <wl@xen.org>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>
Subject: RE: [PATCH v9 2/8] xen/common/domctl: introduce XEN_DOMCTL_get/setdomaincontext
Date: Mon, 5 Oct 2020 09:18:14 +0000	[thread overview]
Message-ID: <cc549f2902da4ca9b02247f21dfb103c@EX13D32EUC003.ant.amazon.com> (raw)
In-Reply-To: <783f8b1b-f11f-d8ff-3643-d35f17c6c363@citrix.com>

> -----Original Message-----
> From: Andrew Cooper <andrew.cooper3@citrix.com>
> Sent: 02 October 2020 22:58
> To: Paul Durrant <paul@xen.org>; xen-devel@lists.xenproject.org
> Cc: Durrant, Paul <pdurrant@amazon.co.uk>; Julien Grall <julien@xen.org>; Daniel De Graaf
> <dgdegra@tycho.nsa.gov>; Ian Jackson <ian.jackson@eu.citrix.com>; Wei Liu <wl@xen.org>; George Dunlap
> <george.dunlap@citrix.com>; Jan Beulich <jbeulich@suse.com>; Stefano Stabellini
> <sstabellini@kernel.org>
> Subject: RE: [EXTERNAL] [PATCH v9 2/8] xen/common/domctl: introduce XEN_DOMCTL_get/setdomaincontext
> 
> CAUTION: This email originated from outside of the organization. Do not click links or open
> attachments unless you can confirm the sender and know the content is safe.
> 
> 
> 
> On 24/09/2020 14:10, Paul Durrant wrote:
> > diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
> > index 791f0a2592..743105181f 100644
> > --- a/xen/include/public/domctl.h
> > +++ b/xen/include/public/domctl.h
> > @@ -1130,6 +1130,43 @@ struct xen_domctl_vuart_op {
> >                                   */
> >  };
> >
> > +/*
> > + * XEN_DOMCTL_getdomaincontext
> > + * ---------------------------
> > + *
> > + * buffer (IN):   The buffer into which the context data should be
> > + *                copied, or NULL to query the buffer size that should
> > + *                be allocated.
> > + * size (IN/OUT): If 'buffer' is NULL then the value passed in must be
> > + *                zero, and the value passed out will be the size of the
> > + *                buffer to allocate.
> > + *                If 'buffer' is non-NULL then the value passed in must
> > + *                be the size of the buffer into which data may be copied.
> > + *                The value passed out will be the size of data written.
> > + */
> > +struct xen_domctl_getdomaincontext {
> > +    uint32_t size;
> 
> This series is full of mismatched 32/64bit sizes, with several
> truncation bugs in the previous patch.
> 
> Just use a 64bit size here.  Life is too short to go searching for all
> the other truncation bug when this stream tips over 4G, and its not like
> there is a shortage of space in this structure.
> 

Ok.

> > +    uint32_t pad;
> > +    XEN_GUEST_HANDLE_64(void) buffer;
> > +};
> > +
> > +/* XEN_DOMCTL_setdomaincontext
> > + * ---------------------------
> > + *
> > + * buffer (IN):   The buffer from which the context data should be
> > + *                copied.
> > + * size (IN):     The size of the buffer from which data may be copied.
> > + *                This data must include DOMAIN_SAVE_CODE_HEADER at the
> > + *                start and terminate with a DOMAIN_SAVE_CODE_END record.
> > + *                Any data beyond the DOMAIN_SAVE_CODE_END record will be
> > + *                ignored.
> > + */
> > +struct xen_domctl_setdomaincontext {
> > +    uint32_t size;
> > +    uint32_t pad;
> > +    XEN_GUEST_HANDLE_64(const_void) buffer;
> > +};
> > +
> >  struct xen_domctl {
> >      uint32_t cmd;
> >  #define XEN_DOMCTL_createdomain                   1
> > @@ -1214,6 +1251,8 @@ struct xen_domctl {
> >  #define XEN_DOMCTL_vuart_op                      81
> >  #define XEN_DOMCTL_get_cpu_policy                82
> >  #define XEN_DOMCTL_set_cpu_policy                83
> > +#define XEN_DOMCTL_getdomaincontext              84
> > +#define XEN_DOMCTL_setdomaincontext              85
> 
> So, we've currently got:
> 
> #define XEN_DOMCTL_setvcpucontext                12
> #define XEN_DOMCTL_getvcpucontext                13
> #define XEN_DOMCTL_gethvmcontext                 33
> #define XEN_DOMCTL_sethvmcontext                 34
> #define XEN_DOMCTL_set_ext_vcpucontext           42
> #define XEN_DOMCTL_get_ext_vcpucontext           43
> #define XEN_DOMCTL_gethvmcontext_partial         55
> #define XEN_DOMCTL_setvcpuextstate               62
> #define XEN_DOMCTL_getvcpuextstate               63
> 
> which are doing alarmingly related things for vcpus.  (As an amusing
> exercise to the reader, figure out which are PV specific and which are
> HVM specific.  Hint: they're not disjoint sets.)
> 

Yes, hence the desire to come up with something common.

> 
> I know breaking with tradition is sacrilege, but at the very minimum,
> can we get some underscores in that name so you can at least read the
> words which make it up more easily.
> 

Sure.

  Paul

> ~Andrew

  reply	other threads:[~2020-10-05  9:18 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-24 13:10 [PATCH v9 0/8] domain context infrastructure Paul Durrant
2020-09-24 13:10 ` [PATCH v9 1/8] xen/common: introduce a new framework for save/restore of 'domain' context Paul Durrant
2020-10-02 21:20   ` Andrew Cooper
2020-10-03 14:33     ` Wei Liu
2020-10-05  8:03     ` Paul Durrant
2020-10-13 11:44       ` Jan Beulich
2020-10-02 22:00   ` Andrew Cooper
2020-09-24 13:10 ` [PATCH v9 2/8] xen/common/domctl: introduce XEN_DOMCTL_get/setdomaincontext Paul Durrant
2020-09-30 14:31   ` Wei Liu
2020-10-02 21:58   ` Andrew Cooper
2020-10-05  9:18     ` Durrant, Paul [this message]
2020-09-24 13:10 ` [PATCH v9 3/8] tools/misc: add xen-domctx to present domain context Paul Durrant
2020-09-30 14:32   ` Wei Liu
2020-10-02 22:39   ` Andrew Cooper
2020-10-05  9:16     ` Durrant, Paul
2020-09-24 13:10 ` [PATCH v9 4/8] docs/specs: add missing definitions to libxc-migration-stream Paul Durrant
2020-09-30 14:35   ` Wei Liu
2020-10-02 22:42   ` Andrew Cooper
2020-10-05  9:14     ` Durrant, Paul
2020-09-24 13:10 ` [PATCH v9 5/8] docs / tools: specific migration v4 to include DOMAIN_CONTEXT Paul Durrant
2020-09-30 14:41   ` Wei Liu
2020-10-05 10:09   ` Andrew Cooper
2020-10-05 10:13     ` Paul Durrant
2020-09-24 13:10 ` [PATCH v9 6/8] common/domain: add a domain context record for shared_info Paul Durrant
2020-09-25 12:44   ` Jan Beulich
2020-09-30 14:42   ` Wei Liu
2020-10-05 10:39   ` Andrew Cooper
2020-10-07 12:03     ` Paul Durrant
2020-10-13 11:49     ` Jan Beulich
2020-09-24 13:10 ` [PATCH v9 7/8] x86/time: add a domain context record for tsc_info Paul Durrant
2020-09-30 14:43   ` Wei Liu
2020-09-24 13:10 ` [PATCH v9 8/8] tools/libxc: add DOMAIN_CONTEXT records to the migration stream Paul Durrant
2020-09-30 14:46   ` Wei Liu
2020-10-01 15:17   ` Andrew Cooper
2020-09-24 19:36 ` [PATCH v9 0/8] domain context infrastructure Lengyel, Tamas
2020-09-25 12:49   ` Paul Durrant
2020-09-28 14:16     ` Lengyel, Tamas
2020-09-29 11:53       ` Durrant, Paul
2020-09-29 12:05         ` Tamas K Lengyel
2020-09-29 12:13           ` Durrant, Paul
2020-09-29 14:19             ` Lengyel, Tamas

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=cc549f2902da4ca9b02247f21dfb103c@EX13D32EUC003.ant.amazon.com \
    --to=pdurrant@amazon.co.uk \
    --cc=andrew.cooper3@citrix.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=george.dunlap@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=paul@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --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).