[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v6 10/31] xen/arm: ITS: Introduce gic_is_lpi helper function
On Tue, Sep 1, 2015 at 6:32 PM, Julien Grall <julien.grall@xxxxxxxxxx> 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. and gic_is_lpi() as below will work both gicv2 and gicv3. bool_t gic_is_lpi(unsigned int irq) { return (irq >= FIRST_GIC_LPI && irq < gic_hw_ops->info->nr_irq_ids); } Regards Vijay _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |