From: Wei Liu <wei.liu2@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org,
Ross Lagerwall <ross.lagerwall@citrix.com>,
Wei Liu <wei.liu2@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>
Subject: Re: [PATCH for-4.7 3/4] tools/xsplice: fix mixing system errno values with Xen ones.
Date: Fri, 29 Apr 2016 16:30:16 +0100 [thread overview]
Message-ID: <20160429153016.GF26957@citrix.com> (raw)
In-Reply-To: <20160429151251.gm7va63cxly6ceel@mac>
On Fri, Apr 29, 2016 at 05:12:51PM +0200, Roger Pau Monne wrote:
> On Fri, Apr 29, 2016 at 04:02:33PM +0100, Wei Liu wrote:
> > On Fri, Apr 29, 2016 at 04:21:19PM +0200, Roger Pau Monne wrote:
> > > Avoid using system errno values when comparing with Xen errno values.
> > >
> > > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > > ---
> > > Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > > Cc: Ross Lagerwall <ross.lagerwall@citrix.com>
> > > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > > Cc: Wei Liu <wei.liu2@citrix.com>
> > > ---
> > > Using errno values inside of hypercall structs is not right IMHO, but there
> > > are already several occurrences of this. Although I'm adding the correct XEN_
> > > prefixes here, it's very likely that new additions/modifications to this
> > > file will not take this into account, breaking it for OSes != Linux.
> >
> > This seems to be a rather thorny issue.
> >
> > I have a gut feeling that returning XEN_ errno to userspace program is
> > layering violation. They should always be translated to OS level errno
> > by privcmd driver.
>
> Yes, the error value returned from the hypercall executed is indeed
> translated into the native OS error space. The problem here is that those
> error codes are returned _inside_ of the specific hypercall struct, which
> sadly privcmd doesn't know anything about.
>
> And of course teaching privcmd about every possible hypercall struct is
> simply impossible, since some of them are not stable (eg: domctls)
>
> > Aren't FreeBSD and NetBSD already doing that?
>
> As said above, this is only done for direct return codes, everything inside
> of the struct passed to the hypercall is returned as-is.
>
> This is a complete mess, and TBH, I don't have a clever idea about how to
> solve it.
>
Me neither. Maybe a new thread should be started to discuss this.
Wei.
> Roger.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-04-29 15:30 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-29 14:21 [PATCH for-4.7 0/4] xsplice fixes Roger Pau Monne
2016-04-29 14:21 ` [PATCH for-4.7 1/4] xen: remove usage of ENODATA error code Roger Pau Monne
2016-04-29 14:44 ` Jan Beulich
2016-04-29 15:06 ` Roger Pau Monne
2016-04-29 16:19 ` Jan Beulich
2016-04-29 16:34 ` Roger Pau Monne
2016-04-29 16:42 ` Jan Beulich
2016-04-29 16:52 ` Roger Pau Monne
2016-05-02 6:22 ` Jan Beulich
2016-05-02 8:55 ` Roger Pau Monne
2016-05-02 9:06 ` Jan Beulich
2016-05-02 11:06 ` Roger Pau Monne
2016-04-29 14:21 ` [PATCH for-4.7 2/4] tools/xsplice: corrently use errno Roger Pau Monne
2016-04-29 14:57 ` Wei Liu
2016-04-29 15:07 ` Roger Pau Monne
2016-04-29 15:08 ` Wei Liu
2016-04-29 14:21 ` [PATCH for-4.7 3/4] tools/xsplice: fix mixing system errno values with Xen ones Roger Pau Monne
2016-04-29 15:02 ` Wei Liu
2016-04-29 15:11 ` Andrew Cooper
2016-04-29 15:28 ` Wei Liu
2016-04-29 15:12 ` Roger Pau Monne
2016-04-29 15:30 ` Wei Liu [this message]
2016-05-02 11:00 ` Wei Liu
2016-04-29 14:21 ` [PATCH for-4.7 4/4] xen/xsplice: remove OSABI check when loading a payload Roger Pau Monne
2016-04-29 14:48 ` Jan Beulich
2016-04-29 15:16 ` Roger Pau Monne
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=20160429153016.GF26957@citrix.com \
--to=wei.liu2@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=roger.pau@citrix.com \
--cc=ross.lagerwall@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).