From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51653 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pcxz4-0002ui-Kg for qemu-devel@nongnu.org; Wed, 12 Jan 2011 05:31:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pcxz3-000721-03 for qemu-devel@nongnu.org; Wed, 12 Jan 2011 05:31:18 -0500 Received: from david.siemens.de ([192.35.17.14]:18089) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pcxz2-00071N-Nx for qemu-devel@nongnu.org; Wed, 12 Jan 2011 05:31:16 -0500 Message-ID: <4D2D82EE.20002@siemens.com> Date: Wed, 12 Jan 2011 11:31:10 +0100 From: Jan Kiszka MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 28/35] kvm: x86: Introduce kvmclock device to save/restore its state References: <4D2B6CB5.9050602@codemonkey.ws> <4D2B74D8.4080309@web.de> <4D2B8662.9060909@web.de> <4D2C60FB.7030009@linux.vnet.ibm.com> <4D2D80ED.8030405@redhat.com> In-Reply-To: <4D2D80ED.8030405@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: kvm@vger.kernel.org, Glauber Costa , Marcelo Tosatti , Markus Armbruster , qemu-devel@nongnu.org, Anthony Liguori Am 12.01.2011 11:22, Avi Kivity wrote: > On 01/11/2011 03:54 PM, Anthony Liguori wrote: >> >> Right, we should introduce a KVMBus that KVM devices are created on. >> The devices can get at KVMState through the BusState. > > There is no kvm bus in a PC (I looked). We're bending the device model > here because a device is implemented in the kernel and not in > userspace. An implementation detail is magnified beyond all proportions. > > An ioapic that is implemented by kvm lives in exactly the same place > that the qemu ioapic lives in. An assigned pci device lives on the PCI > bus, not a KVMBus. If we need a pointer to KVMState, then we must find > it elsewhere, not through creating imaginary buses that don't exist. > Exactly. So we can either "infect" the whole device tree with kvm (or maybe a more generic accelerator structure that also deals with Xen) or we need to pull the reference inside the device's init function from some global service (kvm_get_state). Jan PS: I started refreshing my whole patch series with the two controversial patches removed. Will send out later so that we can proceed with merging the critical bits, specifically all the bug fixes. -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux