From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOtpn-00015b-IY for qemu-devel@nongnu.org; Thu, 18 Oct 2012 13:24:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOtph-0001s4-H6 for qemu-devel@nongnu.org; Thu, 18 Oct 2012 13:24:39 -0400 Received: from thoth.sbs.de ([192.35.17.2]:20392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOtph-0001ro-78 for qemu-devel@nongnu.org; Thu, 18 Oct 2012 13:24:33 -0400 Message-ID: <50803B4C.1000302@siemens.com> Date: Thu, 18 Oct 2012 19:24:28 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <507EE07E.20504@redhat.com> <507EFADA.7080700@siemens.com> <507FA1C6.2010807@redhat.com> In-Reply-To: <507FA1C6.2010807@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Disabling KVM "on the fly" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Clemens Kolbitsch , "qemu-devel@nongnu.org" On 2012-10-18 08:29, Paolo Bonzini wrote: > Il 17/10/2012 20:37, Jan Kiszka ha scritto: >> On 2012-10-17 18:44, Paolo Bonzini wrote: >>> Il 17/10/2012 18:37, Clemens Kolbitsch ha scritto: >>>> Guys, >>>> >>>> I know this is question might seem a bit odd, but I'm curious: >>>> >>>> Has anyone ever tried to write code to disable KVM on the fly / is it >>>> at all possible? I have a situation where I need to use TCG for >>>> certain parts of the code, but would love to have acceleration for >>>> everything else. My idea was to pause the VM, then use the >>>> snapshotting mechanism to dump the state, and then to resume the >>>> snapshot, but writing the KVM state into the non-KVM structures. >>> >>> As a start, you can try using "migrate exec:cat>foo.save" with a KVM >>> machine and "-incoming 'exec:cat foo.save'" with a TCG machine. The >>> main problem should be that TCG doesn't implement kvmclock. >>> >>> If you disable the KVM interrupt controller and timer (which is just an >>> implementation detail, not a hardware difference), >> >> Unnecessary. Both models (KVM in-kernel and QEMU userspace) are >> compatible - in the absence of bugs. > > He wants to really switch it on the fly---not just migrate out and > in---and for that you need to disable the KVM-specific devices. Well, that's even more unrealistic than via migration. > >> But loading a KVM image into TCG lets non-trival guests lock up. Likely >> due to differences in the CPU virtualization/emulation (MSRs...). > > Perhaps that can be mitigated by using an older machine model. Start > with something simple like a pentium2 and work up from there... Even if, there are still too many untranslated, maybe even untranslatable states of the KVM CPU model, at least. Jan -- Siemens AG, Corporate Technology, CT RTC ITP SDP-DE Corporate Competence Center Embedded Linux