From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v4 16/33] xen/arm: Let the toolstack configure the number of SPIs Date: Tue, 31 Mar 2015 12:44:08 +0100 Message-ID: <551A8888.8050902@linaro.org> References: <1426793399-6283-1-git-send-email-julien.grall@linaro.org> <1426793399-6283-17-git-send-email-julien.grall@linaro.org> <1427799247.2115.61.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Ycub2-000459-Oy for xen-devel@lists.xenproject.org; Tue, 31 Mar 2015 11:44:40 +0000 Received: by wgra20 with SMTP id a20so15939498wgr.3 for ; Tue, 31 Mar 2015 04:44:35 -0700 (PDT) In-Reply-To: <1427799247.2115.61.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 , tim@xen.org, stefano.stabellini@citrix.com, Jan Beulich , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org Hi Ian, On 31/03/15 11:54, Ian Campbell wrote: > On Thu, 2015-03-19 at 19:29 +0000, Julien Grall wrote: >> @@ -68,16 +68,17 @@ static void vgic_init_pending_irq(struct pending_irq *p, unsigned int virq) >> p->irq = virq; >> } >> >> -int domain_vgic_init(struct domain *d) >> +int domain_vgic_init(struct domain *d, unsigned int nr_spis) >> { >> int i; >> >> d->arch.vgic.ctlr = 0; >> > [...] >> + /* Limit the number of SPIs supported base on the hardware */ >> + if ( nr_spis > (gic_number_lines() - NR_LOCAL_IRQS) ) >> + return -EINVAL; > > Is there anything in the h/w which leads to this restriction? The h/w accept an VirtualID < 1020. Although, given that we can only route a physical interrupt to the guest, it's pointless to support more SPIs than the h/w does. > If not then I think we should just check against the architectural 1020 > limit and leave it at that. I would have to check on 988 (1020 - 32) which I find less readable. >> diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h >> index 9e0419e..6dacfef 100644 >> --- a/xen/include/asm-arm/domain.h >> +++ b/xen/include/asm-arm/domain.h >> @@ -125,6 +125,8 @@ struct arch_domain >> unsigned int evtchn_irq; >> } __cacheline_aligned; >> >> +#define domain_is_configured(d) ((d)->arch.is_configured) >> + >> struct arch_vcpu >> { >> struct { >> diff --git a/xen/include/asm-arm/setup.h b/xen/include/asm-arm/setup.h >> index ba5a67d..254cc17 100644 >> --- a/xen/include/asm-arm/setup.h >> +++ b/xen/include/asm-arm/setup.h >> @@ -54,6 +54,7 @@ void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len); >> void arch_get_xen_caps(xen_capabilities_info_t *info); >> >> int construct_dom0(struct domain *d); >> +int configure_dom0(struct domain *d); > > Are these two hunks stray from some other patch in the series? No. It's part of an old version of this patch and I forgot to drop it. I will resend a new version. Regards, -- Julien Grall