qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Alan Amaral <alan.amaral@virtualcomputer.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] pci_change_irq_level is broken...
Date: Tue, 20 Sep 2011 11:57:11 -0700	[thread overview]
Message-ID: <4E78E207.5070308@twiddle.net> (raw)
In-Reply-To: <00218408-4F7E-47E8-9A3A-7515E5472C40@mimectl>

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~

  reply	other threads:[~2011-09-20 18:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-20 17:24 [Qemu-devel] pci_change_irq_level is broken Alan Amaral
2011-09-20 18:57 ` Richard Henderson [this message]
2011-09-20 19:19   ` Alan Amaral
2011-09-20 19:41     ` Jan Kiszka
2011-09-20 19:56     ` Richard Henderson
2011-09-21 16:34       ` Alan Amaral
  -- strict thread matches above, loose matches on Subject: below --
2011-09-21 16:26 Alan Amaral
2011-09-21 16:33 ` Jan Kiszka
2011-09-21 16:38 ` Alan Amaral

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=4E78E207.5070308@twiddle.net \
    --to=rth@twiddle.net \
    --cc=alan.amaral@virtualcomputer.com \
    --cc=qemu-devel@nongnu.org \
    /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).