From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH XEN v5 09/23] tools: Refactor hypercall calling wrappers into libxencall. Date: Fri, 13 Nov 2015 15:17:32 +0000 Message-ID: <1447427852.18450.185.camel@citrix.com> References: <1447070397.27774.11.camel@citrix.com> <1447070458-31104-1-git-send-email-ian.campbell@citrix.com> <1447070458-31104-10-git-send-email-ian.campbell@citrix.com> <22083.23005.583089.172481@mariner.uk.xensource.com> <20151111153147.GB1500@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20151111153147.GB1500@zion.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: Wei Liu , Ian Jackson Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, 2015-11-11 at 15:31 +0000, Wei Liu wrote: > On Wed, Nov 11, 2015 at 03:08:13PM +0000, Ian Jackson wrote: > > Ian Campbell writes ("[PATCH XEN v5 09/23] tools: Refactor hypercall > > calling wrappers into libxencall."): > > > libxencall will provide a stable API and ABI for calling hypercalls > > > (although those hypercalls themselves may not have a stable API). As > > > well as the hypercall buffer infrastructure needed in order to safely > > > provide pointer arguments to hypercalls. > > ... > > > +/* > > > + * This library allows you to make arbitrary hypercalls (subject to > > > + * sufficient permission for the process and the domain itself). > > > Note > > > + * that while the library interface is stable the hypercalls are > > > + * subject to their own rules. > > > > Something needs to say what the error handling is like. > > > > Do these functions set errno ? > > > > > +/* > > > + * Call hypercalls with varying numbers of arguments. > > > + */ > > > +int xencall0(xencall_handle *xcall, unsigned int op); > > > > Is the return value the raw hypercall return value, or is hypervisor > > do_foo returning -EFOOBAR turned into to -1/errno=EFOOBAR ? > > (Hopefully the answer to this doesn't depend on the hypercall ABI...) > > > > That is -1/errno=E_XEN_FOOBAR across all OSes. > > (I think this stems from Linux ioctl semantics. Then NetBSD etc follow > suit.) I wish it were that simple :-(