qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Isaku Yamahata <yamahata@valinux.co.jp>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH v3 3/3] piix_pci: optimize set irq path
Date: Mon, 21 Mar 2011 21:26:12 +0900	[thread overview]
Message-ID: <20110321122612.GB9998@valinux.co.jp> (raw)
In-Reply-To: <20110321113707.GC27445@redhat.com>

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

  parent reply	other threads:[~2011-03-21 12:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-19 13:24 [Qemu-devel] [PATCH v3 0/3] piix_pci: optimize irq data path Isaku Yamahata
2011-03-19 13:24 ` [Qemu-devel] [PATCH v3 1/3] pci: add accessor function to get irq levels Isaku Yamahata
2011-03-19 13:24 ` [Qemu-devel] [PATCH v3 2/3] piix_pci: eliminate PIIX3State::pci_irq_levels Isaku Yamahata
2011-03-19 13:24 ` [Qemu-devel] [PATCH v3 3/3] piix_pci: optimize set irq path Isaku Yamahata
2011-03-21 11:37   ` [Qemu-devel] " Michael S. Tsirkin
2011-03-21 12:10     ` Isaku Yamahata
2011-03-21 12:31       ` Michael S. Tsirkin
2011-03-21 12:56         ` Isaku Yamahata
2011-03-21 13:01           ` Michael S. Tsirkin
2011-03-21 12:26     ` Isaku Yamahata [this message]
2011-03-21 14:10   ` Michael S. Tsirkin
2011-03-22  0:50     ` Isaku Yamahata
2011-03-22 13:40       ` Michael S. Tsirkin
2011-03-22 14:07         ` Isaku Yamahata
2011-03-22 16:24           ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110321122612.GB9998@valinux.co.jp \
    --to=yamahata@valinux.co.jp \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).