From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v6 10/31] xen/arm: ITS: Introduce gic_is_lpi helper function Date: Thu, 3 Sep 2015 10:48:14 +0100 Message-ID: <55E8175E.9080406@citrix.com> References: <1441019208-2764-1-git-send-email-vijay.kilari@gmail.com> <1441019208-2764-11-git-send-email-vijay.kilari@gmail.com> <55E48592.8080905@citrix.com> <55E58E9C.3040404@citrix.com> <55E5A1E1.9040208@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Vijay Kilari Cc: Zoltan Kiss , Ian Campbell , 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 Hi, On 03/09/2015 07:32, Vijay Kilari wrote: > On Tue, Sep 1, 2015 at 6:32 PM, Julien Grall wrote: >> On 01/09/15 12:56, Vijay Kilari wrote: >>>> BTW, I suggested to create a field nr_lpis but you decided to store the >>>> number of bits supported. Why? >>> >>> I have nr_lpis field in vgic structure (patch #17). But it just tells >>> how LPIs are supported >>> for a domain. >> >> Why are you speaking about vgic structure? I'm only suggesting to >> replace you nr_id_bits by nr_lpis in the hw GIC. AFAICT, there is >> nothing to prevent having 2 field using the same name on 2 differents >> structure... >> >>> Where as nr_id_bits shows total number of lpis that hw supports. >> >> No nr_id_bits shows the total number of interrupt not LPIs. The total >> number of LPIs is (1 << nr_id_bits) - 8092. Although (1 << nr_id_bits) >> gives you the last LPI interrupt ID supported. >> >> Anyway, as I said earlier, re-calculating the last LPI interrupt ID >> everytime based on the shift is time consuming. You should optimize for >> the common case rather than using copy the raw value (i.e ID bits) from >> the HW directly. >> >> Maybe the name "max_lpi_id" would make more sense to you for a name? > > Instead of storing max_lpi_id which is ( 1 << nr_id_bits) - 8192, I prefer > to rename nr_id_bits as nr_irq_ids which can be initialized to (1 << nr_id_bits) > for gicv3 and gicv2_info.nr_lines for gicv2. I'm fine with that. Regards, -- Julien Grall