From: "Jan Beulich" Subject: Re: [PATCH] domctl: fix IRQ permission granting/revocation Date: Wed, 10 Dec 2014 10:46:03 +0000 Message-ID: <5488327B020000780004E80A@mail.emea.novell.com> References: <54880D6B020000780004E6AA@mail.emea.novell.com> <54881E49.7090009@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XyemV-0007fV-08 for xen-devel@lists.xenproject.org; Wed, 10 Dec 2014 10:46:07 +0000 In-Reply-To: <54881E49.7090009@linaro.org> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: Ian Campbell , xen-devel , Keir Fraser , Ian Jackson , Tim Deegan List-Id: xen-devel@lists.xenproject.org >>> On 10.12.14 at 11:19, wrote: > Hi Jan, > > On 10/12/2014 08:07, Jan Beulich wrote: >> Commit 545607eb3c ("x86: fix various issues with handling guest IRQs") >> wasn't really consistent in one respect: The granting of access to an >> IRQ shouldn't assume the pIRQ->IRQ translation to be the same in both >> domains. In fact it is wrong to assume that a translation is already/ >> still in place at the time access is being granted/revoked. > > With the change to the interface, some part of libxl may misuse > xc_domain_irq_permission. For instance in tools/libxl/libxl_create.c: > > 1178 ret = irq >= 0 ? xc_physdev_map_pirq(CTX->xch, domid, irq, > &irq) > > We get the PIRQ of domain domid in irq. > > 1179 : -EOVERFLOW; > 1180 if (!ret) > 1181 ret = xc_domain_irq_permission(CTX->xch, domid, irq, > 1) > > Here, the PIRQ of the current domain should be passed. Fortunately, for > this specific case, the PIRQs are the same. But this is confusing. Agreed, but I'd leave it to the tools maintainers to clean this up. Jan