From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2 for 4.5] xen/arm: Add support for GICv3 for domU Date: Wed, 05 Nov 2014 11:10:07 +0000 Message-ID: <545A058F.5040603@linaro.org> References: <1414872625-2961-1-git-send-email-julien.grall@linaro.org> <1415183041.11486.74.camel@citrix.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 1XlyTc-0004yI-HX for xen-devel@lists.xenproject.org; Wed, 05 Nov 2014 11:10:12 +0000 Received: by mail-wi0-f180.google.com with SMTP id hi2so1633818wib.13 for ; Wed, 05 Nov 2014 03:10:09 -0800 (PST) In-Reply-To: <1415183041.11486.74.camel@citrix.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 Campbell Cc: Wei Liu , Ian Jackson , Vijaya Kumar K , tim@xen.org, stefano.stabellini@citrix.com, Jan Beulich , xen-devel@lists.xenproject.org, Daniel De Graaf List-Id: xen-devel@lists.xenproject.org Hi Ian, On 05/11/2014 10:24, Ian Campbell wrote: >> @@ -30,6 +32,39 @@ long arch_do_domctl(struct xen_domctl *domctl, struct domain *d, >> >> return p2m_cache_flush(d, s, e); >> } >> + case XEN_DOMCTL_arm_configure_domain: >> + { >> + uint8_t gic_version; >> + >> + /* >> + * Xen 4.5: The vGIC is emulating the same version of the > > No need to say "Xen 4.5" here, this comment is true until it is removed. > You could say "Currently the vGIC is..." or something if you wanted to > indicate that this is temporary. Just saying temporary doesn't say anything about when this has been added and will be removed. "Xen 4.5" gives explicitly the time and show that we want to remove soon. > >> + * hardware GIC. Only the value XEN_DOMCTL_CONFIG_GIC_DEFAULT >> + * is allowed. The DOMCTL will return the actual version of the >> + * GIC. >> + */ >> + if ( domctl->u.configuredomain.gic_version != XEN_DOMCTL_CONFIG_GIC_DEFAULT ) >> + return -EOPNOTSUPP; > I'm also tempted to suggest that we should accept gic_version == the hw > value, i.e. by moping the switch below up and including > && domctl->u.configuredomain.gic_version != gic_version > in the condition. I consider that explicitly asking for a version of the GIC in Xen 4.5 is invalid. The user should only be able to use the default GIC. As the DOMCTL is not set in stone, the developer should not start to consider that XEN_DOMCTL_CONFIG_GIC_V{2,3} will be valid in the future. >> +#define GUEST_GICV3_GICR0_BASE 0x03020000ULL /* vCPU0 - vCPU15 */ > > Don't we only support 8 cpus today? I don't mind reserving space for > more, and I'd be pleasantly surprised if 16 actually worked ;-) I just copied used the code of Vijay. I suspect we could easily bump the number supported VCPUs to 16. But I didn't test it. Regards, -- Julien Grall