From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3RO5-0000wY-QS for qemu-devel@nongnu.org; Sun, 28 Jul 2013 09:52:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3RNx-0006Vd-8p for qemu-devel@nongnu.org; Sun, 28 Jul 2013 09:51:53 -0400 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:60418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3RNx-0006VZ-2L for qemu-devel@nongnu.org; Sun, 28 Jul 2013 09:51:45 -0400 Received: by mail-wi0-f182.google.com with SMTP id hi8so293524wib.3 for ; Sun, 28 Jul 2013 06:51:44 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <51F521DD.5010308@redhat.com> Date: Sun, 28 Jul 2013 15:51:25 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1374764722-10685-1-git-send-email-pbonzini@redhat.com> <1374764722-10685-3-git-send-email-pbonzini@redhat.com> <20130728125745.GA27246@redhat.com> In-Reply-To: <20130728125745.GA27246@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 2/2] kvm: migrate vPMU state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: qemu-devel@nongnu.org, ehabkost@redhat.com, afaerber@suse.de Il 28/07/2013 14:57, Gleb Natapov ha scritto: >> @@ -1114,6 +1135,33 @@ static int kvm_put_msrs(X86CPU *cpu, int level) >> kvm_msr_entry_set(&msrs[n++], MSR_KVM_STEAL_TIME, >> env->steal_time_msr); >> } >> + if (has_msr_architectural_pmu) { >> + /* Stop the counter. */ >> + kvm_msr_entry_set(&msrs[n++], MSR_CORE_PERF_FIXED_CTR_CTRL, 0); >> + kvm_msr_entry_set(&msrs[n++], MSR_CORE_PERF_GLOBAL_CTRL, 0); >> + > Why is this needed? In v1 it was in the commit message. I'll fix it up before applying: > Second, to avoid any possible side effects during the setting of MSRs > I stop the PMU while setting the counters and event selector MSRs. > Stopping the PMU snapshots the counters and ensures that no strange > races can happen if the counters were saved close to their overflow > value. Paolo