From: "Jan Beulich" Subject: Re: [PATCH for Xen 4.5] xen/arm: Add support for GICv3 for domU Date: Fri, 31 Oct 2014 15:12:54 +0000 Message-ID: <5453B5060200007800043F9B@mail.emea.novell.com> References: <1414695092-20761-1-git-send-email-julien.grall@linaro.org> <54535E240200007800043DAC@mail.emea.novell.com> <54537126.5010401@linaro.org> <54539EA50200007800043EAE@mail.emea.novell.com> <54539458.3010901@linaro.org> 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 1XkDsm-00049m-0B for xen-devel@lists.xenproject.org; Fri, 31 Oct 2014 15:12:56 +0000 In-Reply-To: <54539458.3010901@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: 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 >>> On 31.10.14 at 14:53, wrote: > On 10/31/2014 01:37 PM, Jan Beulich wrote: >>>>> On 31.10.14 at 12:23, wrote: >>> On 31/10/2014 09:02, Jan Beulich wrote: >>>>> --- 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. >> >> That's a particularly bad example to compare with, as this is about >> CPU registers having got added after the ABI was defined. This >> (hopefully) shouldn't have many similar cases on other architectures. >> Plus, doing things in an odd way just because there's an odd >> precedent is always suspicious to me. >> >>> I think we have to stay consistent in this header and not defining >>> DOMCTL which is not used for a specific architecture. >> >> Yes, I always advocate for consistency - provided what is there is >> a reasonable reference and was done properly. > > Would renaming the structure name with "xen_arm_domctl_configuredomain" > would be sufficient for you? Maybe (better xen_domctl_arm_configure_domain then), if you are reasonably certain this can't become useful for another arch. Jan