[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] pci_change_irq_level is broken...
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] pci_change_irq_level is broken... |
Date: |
Tue, 20 Sep 2011 11:57:11 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 |
On 09/20/2011 10:24 AM, Alan Amaral wrote:
> I'm not on this mailing list, so please CC me on any replies. Thanks.
>
> I ran qemu with valgrind last night and found an error in the pci emulation
> code, which may,
> or may not, be biting us. So far the effects seem benign, although there
> exists the possibility
> of trashing random memory.
>
> In the function pci_change_irq_level() the argument irq_num is passed in as
> 0-3, and used
> as an index to change bus->irq_count[4].
I don't know what version of qemu you're using, but this is
int *irq_count;
in current sources. There's certainly no hard-coded "4".
> assert(irq_num >= 0);
> assert(irq_num < bus->nirq);
> bus->irq_count[irq_num] += change;
> bus->set_irq(bus->irq_opaque, bus_irq_num, bus->irq_count[irq_num] != 0);
This version with the asserts, though, could be done. The site
that created the bus ought to match up nirq with the map function.
r~