Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JzBRj-00050O-DF for qemu-devel@nongnu.org; Thu, 22 May 2008 10:07:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JzBRh-0004wU-Hi for qemu-devel@nongnu.org; Thu, 22 May 2008 10:07:06 -0400 Received: from [199.232.76.173] (port=37658 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JzBRh-0004wF-BB for qemu-devel@nongnu.org; Thu, 22 May 2008 10:07:05 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:19042) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JzBRg-00011h-ME for qemu-devel@nongnu.org; Thu, 22 May 2008 10:07:05 -0400 Received: from mariner.uk.xensource.com ([10.80.2.22]) by smtp01.ad.xensource.com (8.13.1/8.13.1) with ESMTP id m4ME70PA017675 for ; Thu, 22 May 2008 07:07:00 -0700 Received: from iwj by mariner.uk.xensource.com with local (Exim 4.63) (envelope-from ) id 1JzBRa-00058c-2w for qemu-devel@nongnu.org; Thu, 22 May 2008 15:06:58 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18485.32258.81655.92288@mariner.uk.xensource.com> Date: Thu, 22 May 2008 15:06:58 +0100 Subject: Re: [Qemu-devel] [PATCH] pci.c: restore bus-level pci interrupt state via pci_set_irq In-Reply-To: <18477.45500.562760.815208@mariner.uk.xensource.com> References: <18477.45500.562760.815208@mariner.uk.xensource.com> From: Ian Jackson Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Ian Jackson writes ("[Qemu-devel] [PATCH] pci.c: restore bus-level pci interrupt state via pci_set_irq"): > (This patch depends on my previous one which makes providing a save > function to register_savevm optional.) > > pci.c: restore bus-level pci interrupt state via pci_set_irq > > This change abolishes pcibus_save. Instead we use an invariant - that > device interrupts are supposed to be reflected in the bus interrupt > state - to restore the bus interrupt state. > > This makes the code smaller and removes one way in which a savefile > could be corrupted (eg, if it had been generated by a buggy emulator). > > It also means that systems which do some of their own PCI bus > emulation and thus reflect PCI bus state elsewhere (eg CPU acclerators > such as Xen) get notified of the PCI bus interrupt level, via > pci_set_irq's call to bus->set_irq. Was there something wrong with this patch ? I need a resolution to this because currently xen-unstable has a different incompatible way of addressing the need I mention in my final paragraph above. I want to bring the two branches into line but that means I will need a way to solve this situation in qemu. If I can't get a suitable conclusion here then it will be yet another useless divergence (including another savefile format difference) between Xen qemu and upstream. I'm afraid I'm going to digress now rather, because my efforts to submit patches here are leaving me quite frustrated: I appreciate that the structure of Xen as a whole may not always be the way the Qemu designers would have done, because Xen takes much more responsibility for the overall management of the guest. But I think those are legitimate design choices, and I think it is quite possible to maintain this difference in model without doing undue violence to either Qemu or Xen. Qemu already has nearly all of the internal APIs and interfaces necessary to deal with the differences for the Xen case. But we really need those APIs to be used. This example is of a very small patch which changes Qemu to use those internal APIs where they apply, and which has some minor benefits upstream, but is essential for Xen. There are also several useful patches in our tree that you may wish to have. For example, we have patches to allow acceleration of guest graphics operations by use of the host's SDL; I think these would be quite compatible with Qemu mainline if it weren't for the fact that the two trees are so diverged. I am hoping to be able to bring our trees close enough together that I can submit substantial new features like that one here, and have them accepted. I appreciate that in the past (before my time!) some of the things that Xen did to their version of qemu were quite unpleasant. Xen hasn't always had a good record of keeping changes suitable for upstream use where possible, and feeding patches upstream. And I'm not saying that Qemu upstream should take all of the changes to make Qemu work in the Xen HVM context. We are prepared to continue maintaining our own private branch. But we would like to do this via appropriate hooks and modularisation, or at the very least by keeping the textual changes small. We would like to keep our changes to the minimum necessary, and to pass upstream everything that would be useful to other users of Qemu. That will allow work on bugfixes and features to be shared. I'm really trying to do a good and useful job here. I appreciate that I do, like anyone, sometimes make mistakes. But I have to say that I'm feeling rather discouraged by the difficulties I'm having getting patches accepted upstream. If the problem is simply lack of effort, for example a shortage of committers with time on their hands, then I can certainly help. Also, just to be clear, I don't see the kqemu, or kvm, as competing with the Xen changes in this area. Obviously they are competing projects - which is healthy. But that doesn't mean that we can cooperate to try to make qemu have the right hooks so that all of our use cases are readily supportable - and fast. Ian.