From mboxrd@z Thu Jan 1 00:00:00 1970 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH 28/35] kvm: x86: Introduce kvmclock device to save/restore its state Date: Wed, 12 Jan 2011 13:04:33 +0100 Message-ID: References: <4D2B6CB5.9050602@codemonkey.ws> <4D2B74D8.4080309@web.de> <4D2B8662.9060909@web.de> <4D2C60FB.7030009@linux.vnet.ibm.com> <4D2D80ED.8030405@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Anthony Liguori , kvm@vger.kernel.org, Glauber Costa , Marcelo Tosatti , qemu-devel@nongnu.org, Jan Kiszka To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:5756 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755840Ab1ALMEx (ORCPT ); Wed, 12 Jan 2011 07:04:53 -0500 In-Reply-To: <4D2D80ED.8030405@redhat.com> (Avi Kivity's message of "Wed, 12 Jan 2011 12:22:37 +0200") Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity writes: > 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. Exactly. And that place is a bus. What if the device interfaces in bus-specific ways with its parent bus? Then we can't simply replace the parent bus by a KVM bus. We'd need *two* parent buses, as Jan pointed out upthread. > 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. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=34821 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PczRe-0004CD-JT for qemu-devel@nongnu.org; Wed, 12 Jan 2011 07:04:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PczRc-00045B-Ue for qemu-devel@nongnu.org; Wed, 12 Jan 2011 07:04:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38940) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PczRc-00044x-KL for qemu-devel@nongnu.org; Wed, 12 Jan 2011 07:04:52 -0500 From: Markus Armbruster 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> Date: Wed, 12 Jan 2011 13:04:33 +0100 In-Reply-To: <4D2D80ED.8030405@redhat.com> (Avi Kivity's message of "Wed, 12 Jan 2011 12:22:37 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 , qemu-devel@nongnu.org, Anthony Liguori , Jan Kiszka Avi Kivity writes: > 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. Exactly. And that place is a bus. What if the device interfaces in bus-specific ways with its parent bus? Then we can't simply replace the parent bus by a KVM bus. We'd need *two* parent buses, as Jan pointed out upthread. > 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.