From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 2/2] turn off kvmclock when resetting cpu Date: Wed, 05 May 2010 18:34:22 +0300 Message-ID: <4BE18FFE.6040201@redhat.com> References: <1272998128-30384-1-git-send-email-glommer@redhat.com> <1272998128-30384-2-git-send-email-glommer@redhat.com> <1272998128-30384-3-git-send-email-glommer@redhat.com> <4BE11DB3.7020901@redhat.com> <20100505152402.GA3443@mothafucka.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, zamsden@redhat.com, mtosatti@redhat.com To: Glauber Costa Return-path: Received: from mx1.redhat.com ([209.132.183.28]:22880 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760331Ab0EEPeY (ORCPT ); Wed, 5 May 2010 11:34:24 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o45FYOZY023370 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 5 May 2010 11:34:24 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o45FYM68012364 for ; Wed, 5 May 2010 11:34:23 -0400 In-Reply-To: <20100505152402.GA3443@mothafucka.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: On 05/05/2010 06:24 PM, Glauber Costa wrote: > On Wed, May 05, 2010 at 10:26:43AM +0300, Avi Kivity wrote: > > >>> + msr_data.info.nmsrs = n; >>> + >>> + return kvm_vcpu_ioctl(env, KVM_SET_MSRS,&msr_data); >>> +} >>> + >>> + >>> >> How about a different approach? Query the supported MSRs >> (KVM_GET_MSR_LIST or thereabout) and reset them (with special cases >> for the TSC, and the old clock MSRs when the new ones are present)? >> > I didn't went that route because I was unsure that every one of them > would be resetable by writing 0 on it. > There are probably others. We should reset them correctly anyway. It's probably done by generic qemu code so it works. > And if we are going to special case the most part of it, then there > is no point in doing it. > > If you think it is doable to special case just the tsc, then I am fine. > I think if we have the following sequence clear all msrs qemu reset kvm specific msr reset Then we'd be fine. Oh, and tsc needs to be reset to 0 as well - it isn't a special case. -- error compiling committee.c: too many arguments to function