From b7c1c1e1617589feb4b97c0ae0b9a176eb2a86b7 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini <pbonzini@redhat.com> Date: Fri, 5 Mar 2010 13:52:38 -0300 Subject: [PATCH 2/2] mark PCI IRQs as edge-triggered in mptables RH-Author: Paolo Bonzini <pbonzini@redhat.com> Message-id: <1267797158-30224-1-git-send-email-pbonzini@redhat.com> Patchwork-id: 7568 O-Subject: [RHEL 5.5 KVM PATCH] mark PCI IRQs as edge-triggered in mptables Bugzilla: 536749 RH-Acked-by: Marcelo Tosatti <mtosatti@redhat.com> RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com> RH-Acked-by: Gleb Natapov <gleb@redhat.com> Bugzilla: 536749 Upstream status: SeaBIOS requires a different patch; not posted yet Brew build: https://brewweb.devel.redhat.com/taskinfo?taskID=2303299 The mptable shows the ISA bus as the destination of all IRQ lines, and overrides this in the ACPI tables. However, RHEL3 does not understand the ACPI tables and gets confused when an IRQ is used by two PCI devices (for example a virtio drive and a network card). Work around this by tweaking the flags in the mptable. Thanks to Marcelo Tosatti for an initial patch and to Miroslav Rezanina for help analyzing the bug. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- Note to Marcelo: compared to your patch I'm using po=1 since that's what is put in the ACPI tables. bios/rombios32.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) Signed-off-by: Glauber Costa <glommer@redhat.com> --- bios/rombios32.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/bios/rombios32.c b/bios/rombios32.c index 32c2839..8928233 100755 --- a/bios/rombios32.c +++ b/bios/rombios32.c @@ -1169,7 +1169,10 @@ static void mptable_init(void) for(i = 0; i < 16; i++) { putb(&q, 3); /* entry type = I/O interrupt */ putb(&q, 0); /* interrupt type = vectored interrupt */ - putb(&q, 0); /* flags: po=0, el=0 */ + if ( PCI_ISA_IRQ_MASK & (1U << i) ) + putb(&q, 0xd); /* flags: po=1 (active-high), el=3 (level) */ + else + putb(&q, 0); /* flags: po=0 (conforms), el=0 (conforms) */ putb(&q, 0); putb(&q, 0); /* source bus ID = ISA */ putb(&q, i); /* source bus IRQ */ -- 1.6.6