From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v3 08/24] xen/arm: Allow virq != irq Date: Fri, 20 Feb 2015 17:09:00 +0000 Message-ID: <54E76A2C.7030403@linaro.org> References: <1421159133-31526-1-git-send-email-julien.grall@linaro.org> <1421159133-31526-9-git-send-email-julien.grall@linaro.org> <1424447564.30924.322.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 1YOr4z-0002xR-Rv for xen-devel@lists.xenproject.org; Fri, 20 Feb 2015 17:09:29 +0000 Received: by wesw62 with SMTP id w62so6738357wes.9 for ; Fri, 20 Feb 2015 09:09:28 -0800 (PST) In-Reply-To: <1424447564.30924.322.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: xen-devel@lists.xenproject.org, tim@xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On 20/02/15 15:52, Ian Campbell wrote: > On Tue, 2015-01-13 at 14:25 +0000, Julien Grall wrote: >> Actually Xen is assuming that the virtual IRQ will always be the same as IRQ. > > s/Actually/Currently/? Yes, I always mix both because the former is close to the french word. >> Modify route_guest_irq to take the virtual IRQ in parameter and let Xen >> assign a different IRQ number. > > I think I must be misunderstanding this, but if route_guest_irq is > taking the vIRQ as a parameter then why does it then need to assign a > different IRQ number? > > Oh, did you mean allowing the *caller* to setup a non-1:1 mapping > perhaps? I think s/and let Xen assign/which allows Xen to.../ might be > closer to that meaning if that's the intention? Yes, the IRQ is not mapped 1:1 to the guest. I will replace by "which allows Xen to...". >> Also store the vIRQ in the desc action to >> easily retrieve easily the IRQ target when we need to inject the interrupt. > > -ETooManyEasilys ;-) > > (I think you want to drop the second one) Will fix it. > >> As DOM0 will get most the devices, the vIRQ is equal to the IRQ in that case. > > Am I correct that after this patch all callers still pass irq==virq to > the new function? > >> At the same time modify the behavior of irq_get_domain. The function now >> assumes that the irq_desc belongs to an IRQ assigned to a guest. > > s/assumes/requires/? Will fix it. >> >> action = xmalloc(struct irqaction); >> - if (!action) >> + if ( !action ) >> + return -ENOMEM; >> + >> + info = xmalloc(struct irq_guest); > > FWIW you might (subject to sizing/alignment needs) be able to do > action = _xmalloc(sizeof(struct irqaction) + sizeof(struct irq_guest); > info = (sturct irq_guest *)(action + 1); > > which would save some memory overhead for free pointers etc and allow > you to avoid manually managing the info. > > You probably won't like that though, so feel free to ignore. Actually it's a good idea :). I haven't though about it. Regards, -- Julien Grall