From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH for-4.6 2/3] libxl/psr: use Xen error codes when checking hypercall return values Date: Tue, 21 Jul 2015 12:43:57 +0100 Message-ID: <55AE307D.5080307@citrix.com> References: <1437404102-7807-1-git-send-email-roger.pau@citrix.com> <1437404102-7807-3-git-send-email-roger.pau@citrix.com> <21934.10720.172223.582437@mariner.uk.xensource.com> <21934.11949.408734.564467@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZHVyN-0006lR-S4 for xen-devel@lists.xenproject.org; Tue, 21 Jul 2015 11:44:35 +0000 In-Reply-To: <21934.11949.408734.564467@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson , Roger Pau Monne , xen-devel@lists.xenproject.org, Ian Campbell , Wei Liu List-Id: xen-devel@lists.xenproject.org On 21/07/15 12:36, Ian Jackson wrote: > Ian Jackson writes ("Re: [PATCH for-4.6 2/3] libxl/psr: use Xen error codes when checking hypercall return values"): >> Acked-by: Ian Jackson > Actually, I withdraw that. I was confused about how things worked. > To summarise an irc discussion: > > * On NetBSD, hypercall numbers are translated by the privcmd driver. > This is probably correct. (Not sure if FreeBSD does the same.) > > * So the libxc API is that errno values are OS errno values. Roger's > patch is wrong. > > * A corrollary is that the hypervisor may not use errno values which > are not in the toolstack OS. Since the hypervisor is supposed to > be fairly portable to different toolstacks, that means we shouldn't > be using errno values which are not in POSIX. > > * Re EBADSLT in particular: > - There is one return site in 4.5, which is in hvm_save_one, > which is toolstack-onloy functionality. We can therefore > change it for 4.6. > - The other sites where EBADSLT are generated in staging must > also be fixed. > > So the correct approach is: > > - Patch to change EBADSLT to something else, everywhere. > - Patch to remove EBADSLT from hypervisor errno list (if it's not > just been renamed/renumbered). > - If FreeBSD privcmd does not translate errno numbers, make it do so. EBADSLT isn't the only example here. I believe ENODATA is a similar example. If we are going to do this, we should prune all non-posix errnos out of the hypervisor errno list. ~Andrew