WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH][cpufreq] Always return successfully from PowerNow! M

To: xen-devel@xxxxxxxxxxxxxxxxxxx, "Joachim Deguara" <joachim.deguara@xxxxxxx>
Subject: [Xen-devel] [PATCH][cpufreq] Always return successfully from PowerNow! MSR traps
From: "Mark Langsdorf" <mark.langsdorf@xxxxxxx>
Date: Wed, 12 Dec 2007 18:15:02 -0600
Delivery-date: Wed, 12 Dec 2007 16:06:45 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.6 (enterprise 20070904.708012)
When testing the Xen PowerNow! driver, we discovered the Linux kernel 
will oops while accessing the AMD PowerNow! MSRs if "cpufreq=dom0-kernel" 
is not passed on the Xen command line.

Fix this bug by having the MSR access always succeed, even if the data
involved is bogus.  Note that kernels other than dom0 still cannot
access the PowerNow! MSRs.

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

diff -r 4054cd60895b xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Mon Dec 10 13:49:22 2007 +0000
+++ b/xen/arch/x86/traps.c      Wed Dec 12 17:52:12 2007 -0600
@@ -1911,7 +1911,7 @@ static int emulate_privileged_op(struct 
             if ( (cpufreq_controller != FREQCTL_dom0_kernel) ||
                  (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) ||
                  wrmsr_safe(regs->ecx, eax, edx) )
-                goto fail;
+               eax = 0;
             break;
         case MSR_IA32_PERF_CTL:
             if ( (cpufreq_controller != FREQCTL_dom0_kernel) ||
@@ -1974,7 +1974,7 @@ static int emulate_privileged_op(struct 
             if ( (cpufreq_controller != FREQCTL_dom0_kernel) ||
                  (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) ||
                  rdmsr_safe(regs->ecx, regs->eax, regs->edx) )
-                goto fail;
+               regs->eax = regs->edx = 0;
             break;
         case MSR_EFER:
             if ( rdmsr_safe(regs->ecx, regs->eax, regs->edx) )



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH][cpufreq] Always return successfully from PowerNow! MSR traps, Mark Langsdorf <=