qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Isaku Yamahata <yamahata@valinux.co.jp>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH v6 4/4] piix_pci: load path clean up
Date: Mon, 28 Mar 2011 18:36:10 +0200	[thread overview]
Message-ID: <20110328163610.GA29503@redhat.com> (raw)
In-Reply-To: <1bebb0f46f1bc7df5e0619169e54138c043ce96a.1301324539.git.yamahata@valinux.co.jp>

On Tue, Mar 29, 2011 at 12:05:30AM +0900, Isaku Yamahata wrote:
> The previous patch didn't change the behavior when load,
> it resulted in ugly code. This patch cleans it up.
> 
> With this patch, pic irq lines are manipulated when loaded.
> It is expected that it won't change the behaviour because
> the interrupts are level: at the moment e.g. pci devices already
> reassert interrupts on load.
> 
> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
> ---
> Changes v3 -> v4:
> - newly introduced
> - TODO: test more OSes, stress test with save/load, live-migration

The patch looks good to me.
You plan to do some of this testing?

> ---
>  hw/piix_pci.c |   12 ++++--------
>  1 files changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/hw/piix_pci.c b/hw/piix_pci.c
> index 7ffb821..5f0d92f 100644
> --- a/hw/piix_pci.c
> +++ b/hw/piix_pci.c
> @@ -281,8 +281,7 @@ static void piix3_set_irq_pic(PIIX3State *piix3, int pic_irq)
>                       (pic_irq * PIIX_NUM_PIRQS))));
>  }
>  
> -static void piix3_set_irq_level(PIIX3State *piix3, int pirq, int level,
> -                                bool propagate)
> +static void piix3_set_irq_level(PIIX3State *piix3, int pirq, int level)
>  {
>      int pic_irq;
>      uint64_t mask;
> @@ -296,15 +295,13 @@ static void piix3_set_irq_level(PIIX3State *piix3, int pirq, int level,
>      piix3->pic_levels &= ~mask;
>      piix3->pic_levels |= mask * !!level;
>  
> -    if (propagate) {
> -        piix3_set_irq_pic(piix3, pic_irq);
> -    }
> +    piix3_set_irq_pic(piix3, pic_irq);
>  }
>  
>  static void piix3_set_irq(void *opaque, int pirq, int level)
>  {
>      PIIX3State *piix3 = opaque;
> -    piix3_set_irq_level(piix3, pirq, level, true);
> +    piix3_set_irq_level(piix3, pirq, level);
>  }
>  
>  /* irq routing is changed. so rebuild bitmap */
> @@ -315,8 +312,7 @@ static void piix3_update_irq_levels(PIIX3State *piix3)
>      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);
> +                            pci_bus_get_irq_level(piix3->dev.bus, pirq));
>      }
>  }
>  
> -- 
> 1.7.1.1

  reply	other threads:[~2011-03-28 16:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-28 15:05 [Qemu-devel] [PATCH v6 0/4] piix_pci: optimize irq data path Isaku Yamahata
2011-03-28 15:05 ` [Qemu-devel] [PATCH v6 1/4] pci: add accessor function to get irq levels Isaku Yamahata
2011-03-28 15:05 ` [Qemu-devel] [PATCH v6 2/4] piix_pci: eliminate PIIX3State::pci_irq_levels Isaku Yamahata
2011-03-28 15:05 ` [Qemu-devel] [PATCH v6 3/4] piix_pci: optimize set irq path Isaku Yamahata
2011-03-28 15:05 ` [Qemu-devel] [PATCH v6 4/4] piix_pci: load path clean up Isaku Yamahata
2011-03-28 16:36   ` Michael S. Tsirkin [this message]
2011-03-28 16:29 ` [Qemu-devel] Re: [PATCH v6 0/4] piix_pci: optimize irq data path Michael S. Tsirkin
2011-03-28 16:41 ` 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=20110328163610.GA29503@redhat.com \
    --to=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yamahata@valinux.co.jp \
    /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).