From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v3 12/18] xen/arm: IRQ: Do not allow IRQ to be shared between domains and XEN Date: Mon, 21 Apr 2014 20:16:33 +0100 Message-ID: <53556E91.3090909@linaro.org> References: <1396968247-8768-1-git-send-email-julien.grall@linaro.org> <1396968247-8768-13-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WcJhl-0000Rt-9p for xen-devel@lists.xenproject.org; Mon, 21 Apr 2014 19:16:37 +0000 Received: by mail-wg0-f44.google.com with SMTP id m15so2960460wgh.15 for ; Mon, 21 Apr 2014 12:16:35 -0700 (PDT) In-Reply-To: <1396968247-8768-13-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org, ian.campbell@citrix.com Cc: stefano.stabellini@citrix.com, tim@xen.org List-Id: xen-devel@lists.xenproject.org Hi Ian, On 08/04/14 15:44, Julien Grall wrote: > + /* If the IRQ is already used by someone > + * - If it's the same domain -> Xen doesn't need to update the IRQ desc > + * - Otherwise -> For now, don't allow the IRQ to be shared between > + * Xen and domains. > + */ > + if ( desc->action != NULL ) > + { > + struct domain *ad = irq_get_domain(desc); > + > + if ( (desc->status & IRQ_GUEST) && d == ad ) > + goto out; > + > + if ( desc->status & IRQ_GUEST ) > + printk(XENLOG_ERR "ERROR: IRQ %u is already used by domain %u\n", > + irq->irq, ad->domain_id); > + else > + printk(XENLOG_ERR "ERROR: IRQ %u is already used by Xen\n", > + irq->irq); > + retval = -EBUSY; > + goto out; This code is buggy, I forgot to free the action in this case. I will fix it in the next version. Ian: As said in the cover letter, I will only resend a V4 with all patches from this one (i.e #12 and onwards) as the other are already acked. Let me know if I need to resend #1-#11. Regards, -- Julien Grall