From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKj4d-00038C-Gp for qemu-devel@nongnu.org; Thu, 30 Jul 2015 04:20:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZKj4Y-000733-Ho for qemu-devel@nongnu.org; Thu, 30 Jul 2015 04:20:19 -0400 Received: from mail-wi0-x231.google.com ([2a00:1450:400c:c05::231]:38424) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKj4Y-00072p-7J for qemu-devel@nongnu.org; Thu, 30 Jul 2015 04:20:14 -0400 Received: by wibxm9 with SMTP id xm9so57719023wib.1 for ; Thu, 30 Jul 2015 01:20:13 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Thu, 30 Jul 2015 10:20:08 +0200 Message-Id: <1438244408-9461-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH] ioapic: coalesce level interrupts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: jan.kiszka@siemens.com If a level-triggered interrupt goes down and back up before the corresponding EOI, it should be coalesced. This fixes one testcase in kvm-unit-tests' ioapic.flat. Signed-off-by: Paolo Bonzini --- hw/intc/ioapic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c index b527932..6ad3c66 100644 --- a/hw/intc/ioapic.c +++ b/hw/intc/ioapic.c @@ -98,7 +98,9 @@ static void ioapic_set_irq(void *opaque, int vector, int level) /* level triggered */ if (level) { s->irr |= mask; - ioapic_service(s); + if (!(entry & IOAPIC_LVT_REMOTE_IRR)) { + ioapic_service(s); + } } else { s->irr &= ~mask; } -- 2.4.3