qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH v3 3/3] piix_pci: optimize set irq path


From: Isaku Yamahata
Subject: [Qemu-devel] Re: [PATCH v3 3/3] piix_pci: optimize set irq path
Date: Mon, 21 Mar 2011 21:26:12 +0900
User-agent: Mutt/1.5.19 (2009-01-05)

On Mon, Mar 21, 2011 at 01:37:07PM +0200, Michael S. Tsirkin wrote:
> > +/* irq routing is changed. so rebuild bitmap */
> > +static void piix3_update_irq_levels(PIIX3State *piix3)
> > +{
> > +    int pirq;
> > +
> > +    piix3->pic_levels = 0;
> > +    for (pirq = 0; pirq < PIIX_NUM_PIRQS; pirq++) {
> > +        piix3_set_irq_level(piix3, pirq,
> > +                            pci_bus_get_irq_level(piix3->dev.bus, pirq),
> > +                            false);
> > +    }
> > +}
> > +
> > +static void piix3_write_config(PCIDevice *dev,
> > +                               uint32_t address, uint32_t val, int len)
> > +{
> > +    pci_default_write_config(dev, address, val, len);
> > +    if (ranges_overlap(address, len, PIIX_PIRQC, 4)) {
> > +        PIIX3State *piix3 = DO_UPCAST(PIIX3State, dev, dev);
> > +        int pic_irq;
> > +        piix3_update_irq_levels(piix3);
> > +        for (pic_irq = 0; pic_irq < PIIX_NUM_PIC_IRQS; pic_irq++) {
> > +            piix3_set_irq_pic(piix3, pic_irq);
> >          }
> 
> We wouldn't need this loop if piix3_update_irq_levels
> called piix3_set_irq_level with propagate enabled.

No. piix3_update_irq_levels loops over PIRQs(= 4).
But we need to loop over all pic PINs(= 16) to raise/lower irqs.
-- 
yamahata



reply via email to

[Prev in Thread] Current Thread [Next in Thread]