From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v3 10/24] xen/arm: gic: Add sanity checks gic_route_irq_to_guest Date: Mon, 23 Feb 2015 16:04:47 +0000 Message-ID: <1424707487.27930.192.camel@citrix.com> References: <1421159133-31526-1-git-send-email-julien.grall@linaro.org> <1421159133-31526-11-git-send-email-julien.grall@linaro.org> <1424448429.30924.333.camel@citrix.com> <54E76EAC.6090100@linaro.org> <1424704810.27930.155.camel@citrix.com> <54EB4B7F.8090605@linaro.org> <1424706764.27930.180.camel@citrix.com> <54EB4D1E.3060009@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 1YPvWW-00016W-EO for xen-devel@lists.xenproject.org; Mon, 23 Feb 2015 16:06:20 +0000 In-Reply-To: <54EB4D1E.3060009@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: Julien Grall Cc: xen-devel@lists.xenproject.org, tim@xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On Mon, 2015-02-23 at 15:54 +0000, Julien Grall wrote: > On 23/02/15 15:52, Ian Campbell wrote: > > On Mon, 2015-02-23 at 15:47 +0000, Julien Grall wrote: > >> Hi Ian, > >> > >> On 23/02/15 15:20, Ian Campbell wrote: > >>> On Fri, 2015-02-20 at 17:28 +0000, Julien Grall wrote: > >>>> The priority is controlled by route_irq_to_guest and set statically > >>>> using GIC_PRI_IRQ. > >>>> > >>>> If we decide to hardcoded the priority here, we should drop the > >>>> parameter on gic_route_irq_guest. But not keeping both. > >>> > >>> There is a middle ground, which is for guest-routed IRQs to be allowed a > >>> subset of the real priorities, but until those associated checks are in > >>> place I think hardcoding in gic_route_irq_to_guest leaves less scope for > >>> mistakes. > >> > >> The interface for routing an IRQ to xen (gic_route_irq_to_xen) is taking > >> the priority in parameter. > > > > It's useful and safe in the route to xen case. > > > >> I would prefer if we keep the same interface for guest and then hardcode > >> the value in route_irq_to_guest. > > > > In which case I think route_irq_to_guest should complain/error-out if > > the priority given is not the default one until such a time as it > > understands which inputs are safe. > > I guess you mean gic_route_irq_to_guest? Whichever function is ignoring its priority argument in favour of a hardcoded value. > I could add a check and error-out for this case. > > Regards, >