From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [RFC PATCH v3 07/18] xen/arm: ITS: implement hw_irq_controller for LPIs Date: Mon, 29 Jun 2015 13:46:27 +0100 Message-ID: <55913E23.5060200@citrix.com> References: <1434974517-12136-1-git-send-email-vijay.kilari@gmail.com> <1434974517-12136-8-git-send-email-vijay.kilari@gmail.com> <55896DEC.2030101@citrix.com> <558D6A4E.90202@citrix.com> <1435578788.32500.284.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1435578788.32500.284.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: Vijay Kilari , Stefano Stabellini , Prasun Kapoor , Vijaya Kumar K , Tim Deegan , "xen-devel@lists.xen.org" , Stefano Stabellini , manish.jaggi@caviumnetworks.com List-Id: xen-devel@lists.xenproject.org On 29/06/15 12:53, Ian Campbell wrote: >> In this case, I would prefer to see 2 callbacks (one for the host the >> other for the guest) which return the correct IRQ controller for a >> specific IRQ. I have in mind something like: >> >> get_guest_hw_irq_controller(unsigned int irq) >> { >> if ( !is_lpi ) >> return &gicv3_guest_irq_controller >> else >> return &gicv3_guest_lpi_controller >> } >> >> Same for the host irq controller. So the selection of the IRQ controller >> would be hidden from gic.c and keep the code a generic as possible. > > Yes, this is how I would expect it too. > > Alternatively I notice that the pattern today is: > desc->handler = gic_hw_ops->gic_(host|guest)_irq_type; > [set_bit(_IRQ_GUEST, &desc->status) or not] > gic_set_irq_properties(desc,[...]); > > So an alternative might be for the set_irq_properties hook in the ops to > also setup the handler (based on desc->status&_IRQ_GUEST and desc->irq), > perhaps renaming it to something less "property" based. Both callers are > git_route_irq_to_... so perhaps gic_route_irq? Sounds good for me. Regards, -- Julien Grall