From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MwEAz-00046z-2V for qemu-devel@nongnu.org; Fri, 09 Oct 2009 08:02:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MwEAu-0003yD-EV for qemu-devel@nongnu.org; Fri, 09 Oct 2009 08:02:24 -0400 Received: from [199.232.76.173] (port=57996 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MwEAu-0003y4-Bj for qemu-devel@nongnu.org; Fri, 09 Oct 2009 08:02:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21191) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MwEAt-0000gV-M9 for qemu-devel@nongnu.org; Fri, 09 Oct 2009 08:02:20 -0400 Date: Fri, 9 Oct 2009 14:02:16 +0200 From: Gleb Natapov Subject: Re: [Qemu-devel] Re: [PATCH v2 3/9] provide in-kernel ioapic Message-ID: <20091009120216.GK19692@redhat.com> References: <4ACDEDEC.60706@us.ibm.com> <4ACDEF03.6010406@redhat.com> <20091008160726.GD29691@shareable.org> <4ACE10B5.3080509@redhat.com> <20091008162248.GK16702@redhat.com> <4ACE1381.3020804@redhat.com> <20091008163431.GM16702@redhat.com> <4ACE165F.3000506@redhat.com> <20091008171157.GE19692@redhat.com> <20091009100231.GB6576@shareable.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091009100231.GB6576@shareable.org> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jamie Lokier Cc: Anthony Liguori , Glauber Costa , Avi Kivity , kvm-devel , qemu-devel@nongnu.org On Fri, Oct 09, 2009 at 11:02:31AM +0100, Jamie Lokier wrote: > Gleb Natapov wrote: > > On Thu, Oct 08, 2009 at 06:42:07PM +0200, Avi Kivity wrote: > > > On 10/08/2009 06:34 PM, Gleb Natapov wrote: > > > >So suppose I have simple watchdog device that required to be poked every > > > >second, otherwise it resets a computer. On migration we have to migrate > > > >time elapsed since last poke, but if device doesn't expose it to > > > >software in any way you are saying we can recreate is some other way? > > > > > > The time is exposed (you can measure it by poking the device and > > The time yes, not its internal representation. What if one implementation > > stores how much time passed and another how much time left. > > One counts in wall clack another only when guest runs. etc... and > > this is a device with only one write only register. > > In that case you can decide between calling it two different devices > (which have the same guest-visible behaviour but are not > interchangable), or calling them different implementations of one > device - by adding a little more code to save state in a common format. > That is what currency done for in-kernel/out-of-kernel irq chips. Save state transformation. The problem begins if one of the devices has more state (not just the same state but in a different format). You need to drop info on migration. > (Although they may have to be different devices for qemu > configuration, it's ok for them to have the same PCI IDs and for the > guest not to know the difference) > > For your watchdog example, it's not hard to pick a saved state which > works for both. If you can't migrate from one to the other why even bother? In my example if one device counts wallclock time and another guest cpu time you can't migrate from one implementation to another. > > ioapic will be harder to find a useful common saved state, and there > might need to be an *optional hint* section (e.g. for selecting the > next CPU to get an interrupt), but I think it would be worth it in > this case. Being able to load a KVM image into TCG and vice versa is > quite useful sometimes. E.g. I've had to do some OS installs using > TCG at first, then switch to KVM later for performance. > Reboot :) -- Gleb.