xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Allow dom0 pstate control to read MSRs
@ 2010-08-12 21:10 Mark Langsdorf
  0 siblings, 0 replies; only message in thread
From: Mark Langsdorf @ 2010-08-12 21:10 UTC (permalink / raw)
  To: xen-devel

The current version of the powernow driver uses the APERF/MPEF
and the HWCR MSRs.  Add cases in traps.c to let dom0 access 
those MSRs.

--Mark Langsdorf
Operating System Research Center

Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>

diff -r f45026ec8db5 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Mon Aug 09 18:29:50 2010 +0100
+++ b/xen/arch/x86/traps.c	Thu Aug 12 16:02:37 2010 -0500
@@ -2228,6 +2228,7 @@
         case MSR_K8_PSTATE5:
         case MSR_K8_PSTATE6:
         case MSR_K8_PSTATE7:
+        case MSR_K8_HWCR:
             if ( boot_cpu_data.x86_vendor != X86_VENDOR_AMD )
                 goto fail;
             if ( !is_cpufreq_controller(v->domain) )
@@ -2267,6 +2268,14 @@
             break;
         case MSR_IA32_MPERF:
         case MSR_IA32_APERF:
+            if (( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL ) &&
+                ( boot_cpu_data.x86_vendor != X86_VENDOR_AMD ) )
+                goto fail;
+            if ( !is_cpufreq_controller(v->domain) )
+                break;
+            if ( wrmsr_safe(regs->ecx, eax, edx) != 0 )
+                goto fail;
+            break;
         case MSR_IA32_PERF_CTL:
             if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
                 goto fail;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-08-12 21:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-12 21:10 [PATCH] Allow dom0 pstate control to read MSRs Mark Langsdorf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).