qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Wanpeng Li <liwp@linux.vnet.ibm.com>
Cc: Gavin Shan <shangw@linux.vnet.ibm.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel@nongnu.org, afaerber@suse.de,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] fix bug of isa_bus irq
Date: Sun, 11 Mar 2012 08:46:38 +0100	[thread overview]
Message-ID: <4F5C585E.5020906@web.de> (raw)
In-Reply-To: <1331449479-8197-1-git-send-email-liwp@linux.vnet.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 1390 bytes --]

On 2012-03-11 08:04, Wanpeng Li wrote:
> ISA bus only use IRQ 0~15, so don't need to give an array qemu_irq 0~23, just
> array qemu_irq i8259 is ok.
> 
> Signed-off-by: Wanpeng Li <liwp@linux.vnet.ibm.com>
> ---
>  hw/pc_piix.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/pc_piix.c b/hw/pc_piix.c
> index 63dba4e..52f7cf8 100644
> --- a/hw/pc_piix.c
> +++ b/hw/pc_piix.c
> @@ -210,7 +210,6 @@ static void pc_init1(MemoryRegion *system_memory,
>          isa_bus = isa_bus_new(NULL, system_io);
>          no_hpet = 1;
>      }
> -    isa_bus_irqs(isa_bus, gsi);
>  
>      if (kvm_irqchip_in_kernel()) {
>          i8259 = kvm_i8259_init(isa_bus);
> @@ -221,6 +220,8 @@ static void pc_init1(MemoryRegion *system_memory,
>          i8259 = i8259_init(isa_bus, cpu_irq[0]);
>      }
>  
> +    isa_bus_irqs(isa_bus, i8259);
> +
>      for (i = 0; i < ISA_NUM_IRQS; i++) {
>          gsi_state->i8259_irq[i] = i8259[i];
>      }

This is bogus. isa_bus_irqs sets the output IRQs of the ISA bus. And
those are not only delivered to the PIC on the PIIX2, but also the
IOAPIC. Thus we have to pass in the GSI input lines which dispatch to
both. Of those lines, only the first 16 will be used by the ISA bus
(there is even an assert to ensure this).

Did you see any concrete bug in the context of this logic?

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

  reply	other threads:[~2012-03-11  7:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-11  7:04 [Qemu-devel] [PATCH] fix bug of isa_bus irq Wanpeng Li
2012-03-11  7:46 ` Jan Kiszka [this message]
2012-03-12  6:08   ` Wanpeng Li
2012-03-12  6:55     ` Jan Kiszka
  -- strict thread matches above, loose matches on Subject: below --
2012-03-11  6:39 Wanpeng Li

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=4F5C585E.5020906@web.de \
    --to=jan.kiszka@web.de \
    --cc=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=liwp@linux.vnet.ibm.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=shangw@linux.vnet.ibm.com \
    /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).