From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Ian Campbell <Ian.Campbell@eu.citrix.com>,
Julien Grall <julien.grall@linaro.org>
Cc: "Keir Fraser" <keir@xen.org>,
"Stefano Stabellini" <stefano.stabellini@eu.citrix.com>,
"Tim Deegan" <tim@xen.org>,
"Ian Jackson" <Ian.Jackson@eu.citrix.com>,
"Jan Beulich" <JBeulich@suse.com>,
xen-devel <xen-devel@lists.xenproject.org>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH RFC] make error codes a formal part of the ABI
Date: Wed, 14 Jan 2015 11:37:09 +0000 [thread overview]
Message-ID: <54B654E5.8010508@citrix.com> (raw)
In-Reply-To: <1421234663.19103.218.camel@eu.citrix.com>
On 14/01/15 11:24, Ian Campbell wrote:
> On Wed, 2015-01-14 at 10:52 +0000, Julien Grall wrote:
>> Hi Ian,
>>
>> On 14/01/2015 10:28, Ian Campbell wrote:
>>>>> (I suppose someone needs to patch libxc et al to actually use this)
>>>> The primary consumer, as said in the description, is meant to be
>>>> hvmloader. But yes, other tools parts may also want to follow
>>>> that.
>>> /me wonders how libxc has been getting away with out this until now,
>>> especially on non-Linux platforms.
>> On FreeBSD, we translate the XEN errno to the guest one in the privcmd
>> drivers.
> Ah, I looked in tools/libxc/*bsd* but didn't think to look in the kernel
> itself.
>
>> See
>> http://xenbits.xen.org/gitweb/?p=people/royger/freebsd.git;a=patch;h=f09eeed01bc884b37e978f6ec6e3e7a86778ef4b
> OK, so essentially the requirement is that libxc should see the guest's
> own ERRNO numbers and changing libxc to use xen's numbers would just be
> wrong.
>
> Which is good, because making that change would be a nightmare!
It is not so simple.
Currently, the hypercall ioctl overloads errno from both the kernel and
Xen. This makes it impossible for libxc to programmaticly distinguish
an kernel error from a Xen error (e.g. where did an EFAULT come from).
Ideally, the correct solution would be for the ioctl to return -1/errno
for a kernel failure alone, and then have the top level stub inspect
args[0] for the Xen error. This would require libxc to know about both
the local errnos and Xen errnos.
~Andrew
next prev parent reply other threads:[~2015-01-14 11:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-13 16:21 [PATCH RFC] make error codes a formal part of the ABI Jan Beulich
2015-01-13 16:35 ` Ian Campbell
2015-01-13 16:57 ` Ian Jackson
2015-01-13 17:10 ` Ian Campbell
2015-01-13 17:14 ` Jan Beulich
2015-01-14 8:46 ` Jan Beulich
2015-01-14 10:28 ` Ian Campbell
2015-01-14 10:52 ` Julien Grall
2015-01-14 11:24 ` Ian Campbell
2015-01-14 11:37 ` Andrew Cooper [this message]
2015-01-14 11:18 ` Jan Beulich
2015-01-14 11:27 ` Ian Campbell
2015-01-13 16:40 ` Andrew Cooper
2015-01-14 8:54 ` 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=54B654E5.8010508@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=Ian.Campbell@eu.citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=julien.grall@linaro.org \
--cc=keir@xen.org \
--cc=roger.pau@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@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.