From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=47147 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQPk7-00038V-Ae for qemu-devel@nongnu.org; Wed, 08 Dec 2010 14:32:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQPk2-0002jD-7I for qemu-devel@nongnu.org; Wed, 08 Dec 2010 14:31:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:24174) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQPk1-0002j7-QX for qemu-devel@nongnu.org; Wed, 08 Dec 2010 14:31:54 -0500 Date: Wed, 8 Dec 2010 17:31:28 -0200 From: Marcelo Tosatti Message-ID: <20101208193128.GA13021@amt.cnet> References: <1291644227-22923-1-git-send-email-glommer@redhat.com> <1291644227-22923-2-git-send-email-glommer@redhat.com> <20101206210401.GB14704@amt.cnet> <1291741956.28598.17.camel@mothafucka.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1291741956.28598.17.camel@mothafucka.localdomain> Subject: [Qemu-devel] Re: [PATCH v2 1/2] Do not register kvmclock savevm section if kvmclock is disabled. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Glauber Costa Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, avi@redhat.com On Tue, Dec 07, 2010 at 03:12:36PM -0200, Glauber Costa wrote: > On Mon, 2010-12-06 at 19:04 -0200, Marcelo Tosatti wrote: > > On Mon, Dec 06, 2010 at 09:03:46AM -0500, Glauber Costa wrote: > > > Usually nobody usually thinks about that scenario (me included and specially), > > > but kvmclock can be actually disabled in the host. > > > > > > It happens in two scenarios: > > > 1. host too old. > > > 2. we passed -kvmclock to our -cpu parameter. > > > > > > In both cases, we should not register kvmclock savevm section. This patch > > > achives that by registering this section only if kvmclock is actually > > > currently enabled in cpuid. > > > > > > The only caveat is that we have to register the savevm section a little bit > > > later, since we won't know the final kvmclock state before cpuid gets parsed. > > > > What is the problem of registering the section? Restoring the value if > > the host does not support it returns an error? > > > > Can't you ignore the error if kvmclock is not reported in cpuid, in the > > restore handler? > > We can change the restore handler, but not the restore handler of > binaries that are already out there. The motivation here is precisely to > address migration to hosts without kvmclock, so it's better to have > a way to disable, than to count on the fact that the other side will be > able to ignore it. OK. Can't you register conditionally on kvmclock cpuid bit at the end of kvm_arch_init_vcpu, in target-i386/kvm.c?