From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Subject: [PATCH] MSR_IA32_PERF_STATUS support Date: Wed, 09 Jan 2008 19:48:22 +0100 Message-ID: <478516F6.7050900@csgraf.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050501030202050705060400" To: kvm-devel Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org This is a multi-part message in MIME format. --------------050501030202050705060400 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit This patch adds support for the MSR MSR_IA32_PERF_STATUS. This is required to boot Darwin. I only implemented dummy support, as the real value would be of no meaning to any OS I know so far anyway and is only implemented on very recent Intel CPUs. --------------050501030202050705060400 Content-Type: text/x-patch; name="kvm-perf.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="kvm-perf.patch" Index: kernel/x86.c =================================================================== --- kernel.orig/x86.c +++ kernel/x86.c @@ -412,7 +412,7 @@ static u32 msrs_to_save[] = { #ifdef CONFIG_X86_64 MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR, #endif - MSR_IA32_TIME_STAMP_COUNTER, + MSR_IA32_TIME_STAMP_COUNTER, MSR_IA32_PERF_STATUS, }; static unsigned num_msrs_to_save; @@ -532,7 +532,6 @@ int kvm_get_msr_common(struct kvm_vcpu * case MSR_IA32_MC0_MISC+12: case MSR_IA32_MC0_MISC+16: case MSR_IA32_UCODE_REV: - case MSR_IA32_PERF_STATUS: case MSR_IA32_EBL_CR_POWERON: /* MTRR registers */ case 0xfe: @@ -548,6 +547,12 @@ int kvm_get_msr_common(struct kvm_vcpu * case MSR_IA32_MISC_ENABLE: data = vcpu->arch.ia32_misc_enable_msr; break; + case MSR_IA32_PERF_STATUS: + /* These are fake values, necessary to get + Darwin running */ + data = 1000ULL /* tsc_increment_by_tick */ + | (((uint64_t)(4ULL /* granularity */ & 0x7)) << 40); + break; #ifdef CONFIG_X86_64 case MSR_EFER: data = vcpu->arch.shadow_efer; --------------050501030202050705060400 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace --------------050501030202050705060400 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --------------050501030202050705060400--