All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Durrant, Paul" <pdurrant@amazon.co.uk>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Anthony PERARD <anthony.perard@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Ian Jackson <ian.jackson@eu.citrix.com>, Wei Liu <wl@xen.org>
Subject: Re: [Xen-devel] [PATCH v4 1/7] libxl: add definition of INVALID_DOMID to the API
Date: Fri, 31 Jan 2020 11:10:02 +0000	[thread overview]
Message-ID: <53287f7ea7984575b91ab388cfe0bee8@EX13D32EUC003.ant.amazon.com> (raw)
In-Reply-To: <20200131110603.GS4679@Air-de-Roger>

> -----Original Message-----
> From: Roger Pau Monné <roger.pau@citrix.com>
> Sent: 31 January 2020 11:06
> To: Durrant, Paul <pdurrant@amazon.co.uk>
> Cc: Anthony PERARD <anthony.perard@citrix.com>; xen-
> devel@lists.xenproject.org; Ian Jackson <ian.jackson@eu.citrix.com>; Wei
> Liu <wl@xen.org>
> Subject: Re: [Xen-devel] [PATCH v4 1/7] libxl: add definition of
> INVALID_DOMID to the API
> 
> On Fri, Jan 31, 2020 at 10:31:49AM +0000, Durrant, Paul wrote:
> > > -----Original Message-----
> > > From: Xen-devel <xen-devel-bounces@lists.xenproject.org> On Behalf Of
> > > Roger Pau Monné
> > > Sent: 22 January 2020 14:53
> > > To: Durrant, Paul <pdurrant@amazon.co.uk>
> > > Cc: Anthony PERARD <anthony.perard@citrix.com>; xen-
> > > devel@lists.xenproject.org; Ian Jackson <ian.jackson@eu.citrix.com>;
> Wei
> > > Liu <wl@xen.org>
> > > Subject: Re: [Xen-devel] [PATCH v4 1/7] libxl: add definition of
> > > INVALID_DOMID to the API
> > >
> > > On Wed, Jan 22, 2020 at 02:44:40PM +0000, Paul Durrant wrote:
> > > > Currently both xl and libxl have internal definitions of
> INVALID_DOMID
> > > > which happen to be identical. However, for the purposes of
> describing
> > > the
> > > > behaviour of libxl_domain_create_new/restore() it is useful to have
> a
> > > > specified invalid value for a domain id.
> > > >
> > > > This patch therefore moves the libxl definition from
> libxl_internal.h to
> > > > libxl.h and removes the internal definition from xl_utils.h. The
> > > hardcoded
> > > > '-1' passed back via domcreate_complete() is then updated to
> > > INVALID_DOMID
> > > > and comment above libxl_domain_create_new/restore() is accordingly
> > > > modified.
> > >
> > > Urg, it's kind of ugly to add another definition of invalid domid when
> > > there's already DOMID_INVALID in the public headers. I guess there's a
> > > reason I'm missing for not using DOMID_INVALID instead of introducing
> > > a new value?
> > >
> >
> > TBH I don't know. As far as xl/libxl goes, domids are uint32_ts so maybe
> DOMID_INVALID was for some reason not considered appropriate? Bear in
> mind, this patch is not truly introducing a new value; it's just making
> something that was internal but identical in both xl and libxl part of the
> interface.
> 
> Hm, OK. It seems quite a mess that libxl uses a 32bit value when the
> hypervisor is using a 16bit field, but I guess there's nothing that
> can be done at this point to fix this.
> 
> Since this will be part of the public interface now, it might make
> sense to define it to the same value as DOMID_INVALID (0x7FF4). And
> make sure domid values passed to libxl are truncated to 16bits.

That sounds like feature creep that I'd rather not go near in this patch. I suspect a can of worms awaits.

> 
> Maybe it's not that relevant, but domids passed to libxl would need to
> be sanitized in order to make sure Xen's DOMID_INVALID is not treated
> as a valid domid value from libxl's PoV. There are also other special
> domids that need to be filtered.

There is already a validity check: libxl_domid_valid_guest().

  Paul

> 
> > > If so could this be mentioned in the commit message?
> > >
> >
> > I'll add a note to the commit comment to point out that this is not
> changing any value used by the toolstack.
> 
> Thanks!
> 
> Roger.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2020-01-31 11:10 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-22 14:44 [Xen-devel] [PATCH v4 0/7] xl/libxl: domid allocation/preservation changes Paul Durrant
2020-01-22 14:44 ` [Xen-devel] [PATCH v4 1/7] libxl: add definition of INVALID_DOMID to the API Paul Durrant
2020-01-22 14:52   ` Roger Pau Monné
2020-01-31 10:31     ` Durrant, Paul
2020-01-31 11:06       ` Roger Pau Monné
2020-01-31 11:10         ` Durrant, Paul [this message]
2020-01-31 12:07           ` Andrew Cooper
2020-01-31 12:11             ` Durrant, Paul
2020-01-30 17:31   ` Ian Jackson
2020-01-30 17:35     ` Durrant, Paul
2020-01-30 17:51       ` Ian Jackson
2020-01-22 14:44 ` [Xen-devel] [PATCH v4 2/7] libxl_create: make 'soft reset' explicit Paul Durrant
2020-01-22 14:44 ` [Xen-devel] [PATCH v4 3/7] libxl: generalise libxl__domain_userdata_lock() Paul Durrant
2020-01-30 17:04   ` Ian Jackson
2020-01-22 14:44 ` [Xen-devel] [PATCH v4 4/7] libxl: add infrastructure to track and query 'recent' domids Paul Durrant
2020-01-30 17:23   ` Ian Jackson
2020-01-31 10:55   ` Anthony PERARD
2020-01-31 10:57     ` Durrant, Paul
2020-01-22 14:44 ` [Xen-devel] [PATCH v4 5/7] libxl: allow creation of domains with a specified or random domid Paul Durrant
2020-01-30 17:25   ` Ian Jackson
2020-01-30 17:32     ` Durrant, Paul
2020-01-22 14:44 ` [Xen-devel] [PATCH v4 6/7] xl.conf: introduce 'domid_policy' Paul Durrant
2020-01-22 14:44 ` [Xen-devel] [PATCH v4 7/7] xl: allow domid to be preserved on save/restore or migrate Paul Durrant
2020-01-30 17:28   ` Ian Jackson
2020-01-30 17:42     ` Durrant, Paul
2020-01-30 18:20       ` Andrew Cooper
2020-01-31 16:07         ` Wei Liu
2020-02-01 11:56           ` Durrant, Paul
2020-02-21 11:58             ` Wei Liu

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=53287f7ea7984575b91ab388cfe0bee8@EX13D32EUC003.ant.amazon.com \
    --to=pdurrant@amazon.co.uk \
    --cc=anthony.perard@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=roger.pau@citrix.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.