From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH] KVM/X86: vpmu migration, make perf_event associated with vcpu thread Date: Sat, 30 Nov 2013 12:08:49 +0100 Message-ID: <5299C741.40609@redhat.com> References: <5298D5FC.8030709@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , kvm To: Wang Hui Return-path: Received: from mail-qe0-f45.google.com ([209.85.128.45]:37680 "EHLO mail-qe0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751624Ab3K3LIz (ORCPT ); Sat, 30 Nov 2013 06:08:55 -0500 Received: by mail-qe0-f45.google.com with SMTP id 6so11134607qea.4 for ; Sat, 30 Nov 2013 03:08:54 -0800 (PST) In-Reply-To: <5298D5FC.8030709@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: Il 29/11/2013 18:59, Wang Hui ha scritto: > But when I wrote a test module to make IA32_PMC1 to count the event of unhalted > cpu-cycles, after migration the value of IA32_PMC1 never grows up again. I found > that after migration perf_event was created exactly, but when it was created, > "current" is qemu's main thread which won't enter no-root mode, so the count of > perf_event will never increase. I think the fix is to apply the MSRs in QEMU's VCPU thread, through run_on_cpu. Interesting that I could not reproduce this when testing my patches. Paolo