All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <alex-r27SGEef+tmzQB+pC5nmwQ@public.gmane.org>
To: kvm-devel <kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: [resend] [PATCH] MSR_IA32_PERF_STATUS support
Date: Tue, 15 Jan 2008 13:26:53 +0100	[thread overview]
Message-ID: <478CA68D.4050504@csgraf.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 489 bytes --]

This is a resend of a mail I sent on 01/10/2008. I did not receive any
response, so I assume it was lost.

The patch is really minor, does not break any compatibility (the MSR is
Intel family 13+) and makes Darwin work.

--- old mail ---

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.


[-- Attachment #2: kvm-perf.patch --]
[-- Type: text/x-patch, Size: 1115 bytes --]

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;


[-- Attachment #3: Type: text/plain, Size: 278 bytes --]

-------------------------------------------------------------------------
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

[-- Attachment #4: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

             reply	other threads:[~2008-01-15 12:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-15 12:26 Alexander Graf [this message]
     [not found] ` <478CA68D.4050504-r27SGEef+tmzQB+pC5nmwQ@public.gmane.org>
2008-01-15 15:28   ` [resend] [PATCH] MSR_IA32_PERF_STATUS support Avi Kivity
     [not found]     ` <478CD11A.1030500-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-15 16:43       ` Alexander Graf
     [not found]         ` <478CE2BD.7090002-r27SGEef+tmzQB+pC5nmwQ@public.gmane.org>
2008-01-15 17:45           ` Avi Kivity
2008-01-15 15:51   ` Avi Kivity
     [not found]     ` <478CD687.9070000-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-15 16:35       ` Alexander Graf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=478CA68D.4050504@csgraf.de \
    --to=alex-r27sgeef+tmzqb+pc5nmwq@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.