From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Lalancette Subject: [PATCH][REPOST]: Fake emulate Intel perfctr MSRs Date: Fri, 20 Jun 2008 09:51:30 +0200 Message-ID: <485B6182.8060508@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090809050305040104060109" To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([66.187.233.31]:53974 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751589AbYFTHwX (ORCPT ); Fri, 20 Jun 2008 03:52:23 -0400 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m5K7qMsr001049 for ; Fri, 20 Jun 2008 03:52:22 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m5K7q43r013174 for ; Fri, 20 Jun 2008 03:52:22 -0400 Received: from localhost.localdomain (vpn-14-74.rdu.redhat.com [10.11.14.74]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m5K7q4MR029804 for ; Fri, 20 Jun 2008 03:52:04 -0400 Sender: kvm-owner@vger.kernel.org List-ID: This is a multi-part message in MIME format. --------------090809050305040104060109 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Respin of my previous patch to fake emulate the Intel perfctr MSRs. As Sheng Yang pointed out, I didn't need an additional include, and I could use other #define's. Signed-off-by: Chris Lalancette --------------090809050305040104060109 Content-Type: text/x-patch; name="kvm-intel-wrmsr-emulate-2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="kvm-intel-wrmsr-emulate-2.patch" diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 6e4278d..f2feacf 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -917,6 +917,18 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data) case MSR_IA32_TIME_STAMP_COUNTER: guest_write_tsc(data); break; + case MSR_P6_PERFCTR0: + case MSR_P6_PERFCTR1: + case MSR_P6_EVNTSEL0: + case MSR_P6_EVNTSEL1: + /* + * Just discard all writes to the performance counters; this + * should keep both older linux and windows 64-bit guests + * happy + */ + pr_unimpl(vcpu, "unimplemented perfctr wrmsr: 0x%x data 0x%llx\n", msr_index, data); + + break; default: msr = find_msr_entry(vmx, msr_index); if (msr) { --------------090809050305040104060109--