qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 19/26] q35: Fix non-PCI IRQ processing in ich


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [PATCH v3 19/26] q35: Fix non-PCI IRQ processing in ich9_lpc_update_apic
Date: Mon, 22 Oct 2012 16:04:16 +0200

On Fri, Oct 19, 2012 at 04:43:38PM -0400, Jason Baron wrote:
> From: Jan Kiszka <address@hidden>
> 
> Avoid passing a non-PCI IRQ to ich9_gsi_to_pirq. It's wrong and triggers
> an assertion.
> 
> Reviewed-by: Paolo Bonzini <address@hidden>
> Signed-off-by: Jan Kiszka <address@hidden>
> Signed-off-by: Jason Baron <address@hidden>

Thanks, applied.

> ---
>  hw/lpc_ich9.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/lpc_ich9.c b/hw/lpc_ich9.c
> index d9fd9de..a47d7a9 100644
> --- a/hw/lpc_ich9.c
> +++ b/hw/lpc_ich9.c
> @@ -264,9 +264,11 @@ static int ich9_gsi_to_pirq(int gsi)
>  
>  static void ich9_lpc_update_apic(ICH9LPCState *lpc, int gsi)
>  {
> -    int level;
> +    int level = 0;
>  
> -    level = pci_bus_get_irq_level(lpc->d.bus, ich9_gsi_to_pirq(gsi));
> +    if (gsi >= ICH9_LPC_PIC_NUM_PINS) {
> +        level |= pci_bus_get_irq_level(lpc->d.bus, ich9_gsi_to_pirq(gsi));
> +    }
>      if (gsi == ich9_lpc_sci_irq(lpc)) {
>          level |= lpc->sci_level;
>      }
> -- 
> 1.7.1



reply via email to

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