From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [RFC 06/19] xen/arm: Implement hypercall PHYSDEVOP_map_pirq Date: Thu, 19 Jun 2014 12:39:13 +0100 Message-ID: <53A2CBE1.1020403@linaro.org> References: <1402935486-29136-1-git-send-email-julien.grall@linaro.org> <1402935486-29136-7-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 1WxagY-0004RA-NC for xen-devel@lists.xenproject.org; Thu, 19 Jun 2014 11:39:18 +0000 Received: by mail-wi0-f171.google.com with SMTP id n15so9185281wiw.4 for ; Thu, 19 Jun 2014 04:39:17 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: xen-devel@lists.xenproject.org, stefano.stabellini@citrix.com, ian.campbell@citrix.com, tim@xen.org List-Id: xen-devel@lists.xenproject.org On 06/18/2014 08:24 PM, Stefano Stabellini wrote: >> /* >> diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c >> index e451324..c18b2ca 100644 >> --- a/xen/arch/arm/vgic.c >> +++ b/xen/arch/arm/vgic.c >> @@ -82,10 +82,7 @@ int domain_vgic_init(struct domain *d) >> /* Currently nr_lines in vgic and gic doesn't have the same meanings >> * Here nr_lines = number of SPIs >> */ >> - if ( is_hardware_domain(d) ) >> - d->arch.vgic.nr_lines = gic_number_lines() - 32; >> - else >> - d->arch.vgic.nr_lines = 0; /* We don't need SPIs for the guest */ >> + d->arch.vgic.nr_lines = gic_number_lines() - 32; >> >> d->arch.vgic.shared_irqs = >> xzalloc_array(struct vgic_irq_rank, DOMAIN_NR_RANKS(d)); > > I see what you mean about virq != pirq. > > It seems to me that setting d->arch.vgic.nr_lines = gic_number_lines() - > 32 for the hardware domain is OK, but it is really a waste for the > others. We could find a way to pass down the info about how many SPIs we > need from libxl. Or we could delay the vgic allocations until the first > SPI is assigned to the domU. I gave a check on both midway and the versatile express and there is about 200 lines. It make the overhead of less than 8K per domain. Which is not too bad. If the host really support 1024 IRQs that would make an overhead of ~32K. > Similarly to the MMIO hole sizing, I don't think that it would be a > requirement for this patch series but it is something to keep in mind. Handling virq != pirq will be more complex as we need to take into account of the hotplug solution. The vgic has a register which provide the number of lines, I suspect this number can't grow up while the guest is running. Regards, -- Julien Grall