From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Huang Subject: Re: [PATCH 1/1] KVM: SVM: add rdmsr support for AMD event registers Date: Wed, 13 Aug 2014 11:04:11 -0500 Message-ID: <53EB8C7B.9000307@redhat.com> References: <1407945481-26622-1-git-send-email-wehuang@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: pbonzini@redhat.com, gleb@kernel.org To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:51701 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751965AbaHMQET (ORCPT ); Wed, 13 Aug 2014 12:04:19 -0400 In-Reply-To: <1407945481-26622-1-git-send-email-wehuang@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Wrong one, sorry. Please discard this one. Updated one will follow. -Wei On 08/13/2014 10:58 AM, Wei Huang wrote: > Current KVM only supports RDMSR for K7_EVNTSEL0 and K7_EVNTSEL0 > MSRs. Reading the rest MSRs will trigger KVM to inject #GP into > guest VM. This causes a warning message "Failed to access perfctr > msr (MSR c0010001 is ffffffffffffffff)" on AMD host. This patch > adds RDMSR support for all K7_EVNTSELn and K7_EVNTSELn registers > and thus supresses the warning message. > > Signed-off-by: Wei Huang > --- > arch/x86/kvm/x86.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index ef432f8..3f10ca2 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -2399,7 +2399,13 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata) > case MSR_K7_HWCR: > case MSR_VM_HSAVE_PA: > case MSR_K7_EVNTSEL0: > + case MSR_K7_EVNTSEL1: > + case MSR_K7_EVNTSEL2: > + case MSR_K7_EVNTSEL3: > case MSR_K7_PERFCTR0: > + case MSR_K7_PERFCTR1: > + case MSR_K7_PERFCTR2: > + case MSR_K7_PERFCTR3: > case MSR_K8_INT_PENDING_MSG: > case MSR_AMD64_NB_CFG: > case MSR_FAM10H_MMIO_CONF_BASE: >