From: "Jan Beulich" Subject: Re: [RFC 13/19] xen/iommu: arm: Wire iommu DOMCTL for ARM Date: Tue, 17 Jun 2014 09:24:04 +0100 Message-ID: <53A01744020000780001AE18@mail.emea.novell.com> References: <1402935486-29136-1-git-send-email-julien.grall@linaro.org> <1402935486-29136-14-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wwogd-0000oX-58 for xen-devel@lists.xenproject.org; Tue, 17 Jun 2014 08:24:11 +0000 In-Reply-To: <1402935486-29136-14-git-send-email-julien.grall@linaro.org> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: xen-devel@lists.xenproject.org, Keir Fraser , stefano.stabellini@citrix.com, ian.campbell@citrix.com, tim@xen.org List-Id: xen-devel@lists.xenproject.org >>> On 16.06.14 at 18:18, wrote: > --- a/xen/arch/x86/domctl.c > +++ b/xen/arch/x86/domctl.c > @@ -1320,7 +1320,7 @@ long arch_do_domctl( > break; > > default: > - ret = iommu_do_domctl(domctl, d, u_domctl); > + ret = -ENOSYS; > break; > } > > diff --git a/xen/common/domctl.c b/xen/common/domctl.c > index 5d3ac87..85866b7 100644 > --- a/xen/common/domctl.c > +++ b/xen/common/domctl.c > @@ -1028,6 +1028,10 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl) > > default: > ret = arch_do_domctl(op, d, u_domctl); > +#ifdef HAS_PASSTHROUGH > + if ( ret == -ENOSYS ) > + ret = iommu_do_domctl(op, d, u_domctl); > +#endif > break; > } > To be honest I'm not convinced of this approach. I'd prefer ARM's arch_do_domctl() to invoke iommu_do_domctl() just like x86's does. In particular I'm neither in favor of checking for specific error codes before chaining, nor do I think that - despite there being a number of such cases in the tree - ENOSYS is the right error value for not implemented sub-hypercalls (to me only top level hypercalls may produce this). Jan