Received: from eggs.gnu.org ([2001:4830:134:3::10]:47993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUDm2-0005e0-Ag for qemu-devel@nongnu.org; Mon, 01 Aug 2016 10:01:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUDlx-0006fC-E1 for qemu-devel@nongnu.org; Mon, 01 Aug 2016 10:00:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37220) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUDlx-0006f6-7o for qemu-devel@nongnu.org; Mon, 01 Aug 2016 10:00:49 -0400 Date: Mon, 1 Aug 2016 22:00:43 +0800 From: Peter Xu Message-ID: <20160801140043.GD6207@pxdev.xzpeter.org> References: <1469503738-28269-1-git-send-email-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v2] x86: ioapic: conditionally upgrade IOAPIC version List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, mst@redhat.com, peter.maydell@linaro.org On Mon, Aug 01, 2016 at 12:38:58PM +0200, Paolo Bonzini wrote: > > > On 26/07/2016 05:28, Peter Xu wrote: > > IOMMU IR and IOAPIC legacy devices (e.g., e1000) cannot work well > > together with some old Linux kernels (upstream before v4.0, or any > > released RHEL kernels). This patch fixes it. > > > > The problem is that: some old linux kernels (with IR enabled) only > > support IOAPIC chips with version 0x20. New kernels after commit d32932d > > ("x86/irq: Convert IOAPIC to use hierarchical irqdomain interfaces") > > fixed this problem. To make sure we can work with even old kernels, > > let's upgrade our IOAPIC to version 0x20. > > > > To make sure we have minimum impact on old systems, IOAPIC version is > > only boosted to 0x20 when vIOMMU IR is enabled. Besides that, the old > > version 0x11 is used. > > I'd rather do this conditional only on the machine type, but as you > pointed out it's a bit late to change the default in QEMU 2.7. > Therefore, for 2.7 you could add a property to the IOAPIC device, and > document that you need "-global ioapic.version=0x20" for interrupt > remapping to work with Linux <= 4.0. QEMU 2.8 can then flip the default > for the new machine types. Yes, an property seems to be a better choice. V3 sent. Thanks! -- peterx