From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH for Xen 4.5] xen/arm: Add support for GICv3 for domU Date: Fri, 31 Oct 2014 11:23:18 +0000 Message-ID: <54537126.5010401@linaro.org> References: <1414695092-20761-1-git-send-email-julien.grall@linaro.org> <54535E240200007800043DAC@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" 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 1XkAIc-0006Yx-QB for xen-devel@lists.xenproject.org; Fri, 31 Oct 2014 11:23:22 +0000 Received: by mail-wi0-f175.google.com with SMTP id ex7so1008046wid.14 for ; Fri, 31 Oct 2014 04:23:21 -0700 (PDT) In-Reply-To: <54535E240200007800043DAC@mail.emea.novell.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: Jan Beulich Cc: ian.campbell@citrix.com, tim@xen.org, Vijaya Kumar K , Ian Jackson , stefano.stabellini@citrix.com, xen-devel@lists.xenproject.org, Daniel De Graaf List-Id: xen-devel@lists.xenproject.org Hi Jan, On 31/10/2014 09:02, Jan Beulich wrote: >> + domctl->u.configuredomain.gic_version = gic_version; >> + >> + /* TODO: Make the copy generic for all ARCH domctl */ >> + if ( __copy_to_guest(u_domctl, domctl, 1) ) > > With just a single field needing copying, __copy_field_to_guest() > would be quite a bit more efficient. The configuredomain structure contains only a field and I plan to rework this code for Xen 4.6 to make this copy generic within the function (see the TODO). Anyway, for this use case using __copy_field_to_guest is not more efficient for ARM. >> --- a/xen/include/public/domctl.h >> +++ b/xen/include/public/domctl.h >> @@ -68,6 +68,19 @@ struct xen_domctl_createdomain { >> typedef struct xen_domctl_createdomain xen_domctl_createdomain_t; >> DEFINE_XEN_GUEST_HANDLE(xen_domctl_createdomain_t); >> >> +#if defined(__arm__) || defined(__aarch64__) >> +#define XEN_DOMCTL_CONFIG_GIC_DEFAULT 0 >> +#define XEN_DOMCTL_CONFIG_GIC_V2 1 >> +#define XEN_DOMCTL_CONFIG_GIC_V3 2 >> +/* XEN_DOMCTL_configure_domain */ >> +struct xen_domctl_configuredomain { > > The naming suggests that the #if really should be around just the > gic_version field (with a dummy field in the #else case to be C89 > compatible, e.g. a zero width unnamed bitfield) and the > corresponding #define-s above, ... It's a bit like xen_domctl_setvcpuextstate which is defined only for x86 while the name seem pretty common. I think we have to stay consistent in this header and not defining DOMCTL which is not used for a specific architecture. Regards, -- Julien Grall