Received: from eggs.gnu.org ([140.186.70.92]:54923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QF98P-00078K-BE for qemu-devel@nongnu.org; Wed, 27 Apr 2011 14:06:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QF98N-0002DH-Tp for qemu-devel@nongnu.org; Wed, 27 Apr 2011 14:06:45 -0400 Received: from hall.aurel32.net ([88.191.126.93]:47288) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QF98N-0002DA-O0 for qemu-devel@nongnu.org; Wed, 27 Apr 2011 14:06:43 -0400 Date: Wed, 27 Apr 2011 20:06:39 +0200 From: Aurelien Jarno Message-ID: <20110427180639.GA12989@volta.aurel32.net> References: <20110403195314.GB23034@volta.aurel32.net> <20110403234207.GD11748@valinux.co.jp> <20110404021511.GF11748@valinux.co.jp> <4DA01AF2.3040309@web.de> <20110409110549.GA23309@valinux.co.jp> <4DA040A3.2070309@web.de> <4DB6C1EE.4090506@siemens.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <4DB6C1EE.4090506@siemens.com> Subject: Re: [Qemu-devel] [PATCH] ioapic: Do not set irr for masked edge IRQs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Isaku Yamahata , qemu-devel@nongnu.org On Tue, Apr 26, 2011 at 03:00:30PM +0200, Jan Kiszka wrote: > On 2011-04-09 13:18, Jan Kiszka wrote: > > From: Jan Kiszka > > > > So far we set IRR for edge IRQs even if the pin is masked. If the guest > > later on unmasks and switches the pin to level-triggered mode, irr will > > remain set, causing an IRQ storm. The point is that setting IRR is not > > correct in this case according to the spec, and avoiding this resolves > > the issue. > > > > Reported-and-tested-by: Isaku Yamahata > > Signed-off-by: Jan Kiszka > > --- > > hw/ioapic.c | 5 +++-- > > 1 files changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/hw/ioapic.c b/hw/ioapic.c > > index 569327d..6c26e82 100644 > > --- a/hw/ioapic.c > > +++ b/hw/ioapic.c > > @@ -160,8 +160,9 @@ static void ioapic_set_irq(void *opaque, int vector, int level) > > s->irr &= ~mask; > > } > > } else { > > - /* edge triggered */ > > - if (level) { > > + /* According to the 82093AA manual, we must ignore edge requests > > + * if the input pin is masked. */ > > + if (level && !(entry & IOAPIC_LVT_MASKED)) { > > s->irr |= mask; > > ioapic_service(s); > > } > > Ping? > Done. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net