qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] fix bug of isa_bus irq


From: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH] fix bug of isa_bus irq
Date: Sun, 11 Mar 2012 08:46:38 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

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 <address@hidden>
> ---
>  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: signature.asc
Description: OpenPGP digital signature


reply via email to

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