On Tue, Jun 23, 2015 at 8:02 PM, Julien Grall <julien.gr...@citrix.com> wrote: > Hi Vijay, > > On 22/06/15 13:01, vijay.kil...@gmail.com wrote: >> From: Vijaya Kumar K <vijaya.ku...@caviumnetworks.com> >> >> Implements hw_irq_controller api's required >> to handle LPI's > > This patch doesn't hw_irq_controller for LPI but just hack around the > current GICv3 host hw_irq_controller. > > As said on the previous version, the goal of hw_irq_controller is too > keep things simple (i.e few conditional code). Please introduce a > separate hw_irq_controller for LPIs.
If new hw_irq_controller is introduced for LPIs, then this has to be exported using some lpi structure which holds pointer to hw_irq_controller for guest & host type similar to gic_hw_ops >> +{ >> + struct its_collection *col; >> + struct its_device *its_dev = get_irq_device(desc); >> + u8 *cfg; >> + u32 virq = irq_to_virq(desc); >> + >> + ASSERT(virq < its_dev->nr_lpis); >> + >> + cfg = gic_rdists->prop_page + desc->irq - NR_GIC_LPI; >> + if ( enable ) >> + *cfg |= LPI_PROP_ENABLED; >> + else >> + *cfg &= ~LPI_PROP_ENABLED; >> + >> + /* >> + * Make the above write visible to the redistributors. >> + * And yes, we're flushing exactly: One. Single. Byte. >> + * Humpf... >> + */ >> + if ( gic_rdists->flags & RDIST_FLAGS_PROPBASE_NEEDS_FLUSHING ) >> + clean_and_invalidate_dcache_va_range(cfg, sizeof(*cfg)); >> + else >> + dsb(ishst); >> + >> + /* Get collection id for this event id */ >> + col = &its_dev->its->collections[virq % num_online_cpus()]; > > This is fragile, you are assuming that num_online_cpus() will never > change. Why don't you store the collection in every irq_desc? This will add additional 8 bytes overhead for each irq_desc. Also is there a macro to get number of actual number processors in system.? AUI, nr_cpu_ids always returns 128 Regards Vijay _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel