From: Wei Liu <wei.liu2@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
Julien Grall <julien.grall@arm.com>,
Wei Liu <wei.liu2@citrix.com>,
Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] tools/libxc: Fix domid parameter types
Date: Mon, 9 Oct 2017 16:19:22 +0100 [thread overview]
Message-ID: <20171009151922.qose6e3d6e3ot64u@citrix.com> (raw)
In-Reply-To: <eadf13a0-9d33-51fc-78c3-ab769949606c@citrix.com>
On Mon, Oct 09, 2017 at 03:51:49PM +0100, Andrew Cooper wrote:
> On 09/10/17 15:47, Wei Liu wrote:
> > On Fri, Oct 06, 2017 at 08:00:00PM +0100, Andrew Cooper wrote:
> >> Mixed throughout libxc are uint32_t, int, and domid_t for domid parameters.
> >> With a signed type, and an explicitly 16-bit type, it is exceedingly difficult
> >> to construct an INVALID_DOMID constant which works with all of them. (The
> >> main problem being that domid_t gets unconditionally zero extended when
> >> promoted to int for arithmatic.)
> >>
> >> Libxl uses uint32_t consistently everywhere, so alter libxc to match.
> > I would rather using domid_t throughout in libxc. Is there any problem
> > with that?
>
> That would cause implicit truncation between libxl's idea of a domid,
> and libxc's idea of a domid. In practice, it means any libxl domid with
> the upper 16 bits set may start to work (on the wrong domain!) where
> they may have failed previously.
>
But that's already the case for a lot of hypercalls -- domid_t is widely
used in public headers. The truncation happens regardless of what libxc
uses.
> Finally, it won't fix the INVALID_DOMID constant problem, as xc_dom.h
> leaks fully into libxl.
>
Sorry, I don't follow. What do you want to do?
Surely INVALID_DOMID should be part of public ABI? How does something in
xc_dom.h leaking (what is leaking?) change that?
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-10-09 15:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-06 19:00 [PATCH] tools/libxc: Fix domid parameter types Andrew Cooper
2017-10-09 14:47 ` Wei Liu
2017-10-09 14:51 ` Andrew Cooper
2017-10-09 15:19 ` Wei Liu [this message]
2017-10-09 15:38 ` Andrew Cooper
2017-10-11 9:51 ` Ian Jackson
2017-10-11 9:52 ` Andrew Cooper
2017-10-11 10:01 ` Wei Liu
2017-10-11 10:28 ` Ian Jackson
2017-10-11 10:32 ` Julien Grall
2017-10-11 11:01 ` 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=20171009151922.qose6e3d6e3ot64u@citrix.com \
--to=wei.liu2@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=julien.grall@arm.com \
--cc=xen-devel@lists.xen.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).