From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEhse-00010S-HF for qemu-devel@nongnu.org; Tue, 26 Apr 2011 09:00:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QEhsZ-0000p0-RQ for qemu-devel@nongnu.org; Tue, 26 Apr 2011 09:00:40 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:43962) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEhsZ-0000oY-Kq for qemu-devel@nongnu.org; Tue, 26 Apr 2011 09:00:35 -0400 Message-ID: <4DB6C1EE.4090506@siemens.com> Date: Tue, 26 Apr 2011 15:00:30 +0200 From: Jan Kiszka MIME-Version: 1.0 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> In-Reply-To: <4DA040A3.2070309@web.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: jan.kiszka@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: Aurelien Jarno , qemu-devel@nongnu.org Cc: Isaku Yamahata 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? Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux