From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: IOAPIC: Do not check polarity Date: Sun, 15 Mar 2009 12:38:37 +0200 Message-ID: <49BCDAAD.7000706@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Bernhard Kohl Return-path: Received: from mx2.redhat.com ([66.187.237.31]:60386 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754677AbZCOKim (ORCPT ); Sun, 15 Mar 2009 06:38:42 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Bernhard Kohl wrote: > NSN's proprietary OS DMX heavily depends on a correct BIOS MP table. > From there it also gets the information for initialization of PCI > devices. We defined the polarity and trigger mode as for standard > PCI devices "low level". The OS programs the ioapic the same way. > > Nothing else in QEMU's and KVM's IRQ, PIC, IOAPIC and LAPIC code > cares about interrupt polarity. The "level" is always used as a > logical value. So we must not change the level here. If we do so, > PCI low level interrupts are not fired if the guest raises the > interrupt (level=1), but first if it is reset again (level=0). This > can result in infinite waiting for a single interupt. For example > the DMX guest waits for the link up interupt of the E1000 > ethernet device before enabling the TX and RX interupts of > this device. E1000 emulation sets level=1, no interrupt is fired, > deadlock. > > This does not happen if we use the -no-kvm-irqchip option. > This means that qemu's ioapic does not care about the polarity and > kvm's ioapic shouldn't do either. > While qemu uses active-high interrupts throughout, kvm is meant to be useful with other userspace (or for emulating other chipsets) and thus needs correct polarity emulation. If the guest programs polarity to active-low, this indicates either a guest bug or a bios bug. Is it possible the bios does not communicate the fact that pci interrupts are active high correctly? -- error compiling committee.c: too many arguments to function