From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPIUg-0004WZ-52 for qemu-devel@nongnu.org; Mon, 08 Apr 2013 16:16:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPIUa-00026O-IV for qemu-devel@nongnu.org; Mon, 08 Apr 2013 16:16:46 -0400 Received: from mail-lb0-f177.google.com ([209.85.217.177]:44627) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPIUa-00026F-BG for qemu-devel@nongnu.org; Mon, 08 Apr 2013 16:16:40 -0400 Received: by mail-lb0-f177.google.com with SMTP id r10so6064939lbi.22 for ; Mon, 08 Apr 2013 13:16:39 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1365442666.18069.50@driftwood> References: <1365263076-16909-1-git-send-email-peter.maydell@linaro.org> <1365442666.18069.50@driftwood> From: Peter Maydell Date: Mon, 8 Apr 2013 21:16:18 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v4 00/11] Fix versatile_pci List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Rob Landley Cc: Arnd Bergmann , patches@linaro.org, "Michael S. Tsirkin" , Will Deacon , qemu-devel@nongnu.org, Paul Brook , =?UTF-8?Q?Andreas_F=C3=A4rber?= On 8 April 2013 18:37, Rob Landley wrote: > On 04/06/2013 10:44:25 AM, Peter Maydell wrote: >> >> This patch series fixes a number of serious bugs in our emulation of >> the PCI controller found on VersatilePB and the early Realview boards: >> * our interrupt mapping was totally wrong > > > Yes. Yes it was. However, what you were doing matched the kernel for many > years. > The kernel guys have screwed this up three consecutive times, as described > here: > > http://landley.net/hg/aboriginal/rev/7bf850767bb8 > > Because as far as I can tell, nobody has any test hardware for this anymore. There is some but it's pretty rare. >> This version of the patchset avoids breaking legacy Linux guests >> by automatically detecting those broken kernels and switching back >> to the old mapping. This works by looking at the values the kernel >> writes to the PCI_INTERRUPT_LINE register in the config space, which >> is effectively the interrupt number the kernel expects the device >> to be using. If this doesn't match reality we use the broken mapping. >> (Thanks to Michael S. Tsirkin for this suggestion.) > > > My concern here was that you'd going to change qemu so it doesn't run the > old images, and require a very new qemu to run the new images, so there will > be an incompatible flag day. No, it doesn't break old images, as the paragraph you quote clearly states. Yes, if the kernel guys fix the kernel you'll need a newer QEMU to run that. However as the kernel patches have been floating around unapplied since 2011 you can draw your own conclusions about how quickly the kernel will get fixed. > Yay improving the latest and greatest, but when I'm regression testing as > many different platforms as I can get working, stuff tends to break. (The > most recent target-specific one for me on the QEMU side was probably the > powerpc video thing, > http://landley.net/notes-2012.html#17-11-2012 . Other than the 1.3/1.4 > general TCG instability which was the translation unit size being calculated > wrong.) This is why I can't demand my users upgrade each time I do a > release: the target they're interested in might not work because my images > depend on things you don't regression test much. Yes, TCG and minor platform emulation is to some extent on a 'best effort' basis. Unfortunately we have neither the developer resources nor the automated test infrastructure to do better; if you can help on either front do say. > I'm glad to see you're addressing backwards compatability, but it looks like > I might have to patch my kernels to write the _old_ value to this register > in order to get something that runs on old qemu? If you want to run on a QEMU predating this patchset then you need to have a kernel which expects the old and broken behaviour, yes. This patchset is to some extent futureproofing in that it ensures that if the kernel guys actually fix the versatilepb PCI code at some future date the QEMU that is out in the wild will still cope. > Because I broke my kernel > to fit what qemu was doing, and I dunno when this register write changed. (I > _do_ know that what the kernel guys have been doing to versatile is insane > and inconsistent, and if you change your code to humor them they'll probably > break it again. Their register mapping in 3.8 was so wrong even _I_ could > tell.) I don't have any interest in adding workarounds to QEMU for kernel versions which didn't work on any QEMU version or on real hardware. I do care about making QEMU work like the hardware, and about keeping it working with kernels that assume the old longstanding QEMU behaviour. This patchset satisfies both those goals. If you have issues with the kernel breaking things then you need to take it up with the kernel developers. -- PMM