From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2 06/21] xen/arm: Allow virq != irq Date: Wed, 06 Aug 2014 16:07:23 +0100 Message-ID: <53E244AB.8060103@linaro.org> References: <1406818852-31856-1-git-send-email-julien.grall@linaro.org> <1406818852-31856-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.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XF2oM-00066c-Nr for xen-devel@lists.xenproject.org; Wed, 06 Aug 2014 15:07:30 +0000 Received: by mail-wg0-f46.google.com with SMTP id m15so2751860wgh.29 for ; Wed, 06 Aug 2014 08:07:28 -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, tim@xen.org, ian.campbell@citrix.com, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org Hi Stefano, On 08/06/2014 03:50 PM, Stefano Stabellini wrote: >> -int route_irq_to_guest(struct domain *d, unsigned int irq, >> - const char * devname) >> +int route_irq_to_guest(struct domain *d, unsigned int virq, >> + unsigned int irq, const char * devname) >> { >> struct irqaction *action; >> - struct irq_desc *desc = irq_to_desc(irq); >> + struct irq_guest *info; >> + struct irq_desc *desc; >> unsigned long flags; >> int retval = 0; >> >> action = xmalloc(struct irqaction); >> - if (!action) >> + if ( !action ) >> + return -ENOMEM; >> + >> + info = xmalloc(struct irq_guest); >> + if ( !info ) >> + { >> + xfree(action); >> return -ENOMEM; >> + } > > Rather than xmalloc'ing another struct and storing the pointer in > dev_id, maybe we could simply expand struct arch_irq_desc? I though about it. If we add another field in arch_irq_desc, we will likely use more memory than xmalloc. This is because most of the platform doesn't use 1024 interrupts but about 256 interrupts. As the new field will be a pointer (on ARM64, 8 bytes), that would make Xen use statically about 8K more. We could allocate irq_desc dynamically during Xen boot. Regards, -- Julien Grall