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

[Xen-changelog] [xen-unstable] x86: Clean up efer/ler macros after MSR c

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: Clean up efer/ler macros after MSR changes.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 11 Jun 2010 07:25:28 -0700
Delivery-date: Fri, 11 Jun 2010 07:28:00 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1276265989 -3600
# Node ID fd948758d9b846c1903a0b54832119c4a224c8eb
# Parent  886494c9fda4d00d22718e896bf81ed72d78cb4d
x86: Clean up efer/ler macros after MSR changes.

Move them out of a header file and make the macros proper functions again.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/domain.c     |    1 -
 xen/arch/x86/traps.c      |   24 ++++++++++++++++++++++++
 xen/include/asm-x86/msr.h |   17 ++---------------
 xen/include/xen/cpuidle.h |    2 +-
 4 files changed, 27 insertions(+), 17 deletions(-)

diff -r 886494c9fda4 -r fd948758d9b8 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Fri Jun 11 14:26:02 2010 +0100
+++ b/xen/arch/x86/domain.c     Fri Jun 11 15:19:49 2010 +0100
@@ -58,7 +58,6 @@
 #endif
 
 DEFINE_PER_CPU(struct vcpu *, curr_vcpu);
-DEFINE_PER_CPU(u64, efer);
 DEFINE_PER_CPU(unsigned long, cr4);
 
 static void default_idle(void);
diff -r 886494c9fda4 -r fd948758d9b8 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Fri Jun 11 14:26:02 2010 +0100
+++ b/xen/arch/x86/traps.c      Fri Jun 11 15:19:49 2010 +0100
@@ -80,6 +80,8 @@ static char __read_mostly opt_nmi[10] = 
 static char __read_mostly opt_nmi[10] = "fatal";
 #endif
 string_param("nmi", opt_nmi);
+
+DEFINE_PER_CPU(u64, efer);
 
 DEFINE_PER_CPU_READ_MOSTLY(u32, ler_msr);
 
@@ -3113,6 +3115,28 @@ asmlinkage void do_device_not_available(
     return;
 }
 
+u64 read_efer(void)
+{
+    return this_cpu(efer);
+}
+
+void write_efer(u64 val)
+{
+    this_cpu(efer) = val;
+    wrmsrl(MSR_EFER, val);
+}
+
+static void ler_enable(void)
+{
+    u64 debugctl;
+    
+    if ( !this_cpu(ler_msr) )
+        return;
+
+    rdmsrl(MSR_IA32_DEBUGCTLMSR, debugctl);
+    wrmsrl(MSR_IA32_DEBUGCTLMSR, debugctl | 1);
+}
+
 asmlinkage void do_debug(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
diff -r 886494c9fda4 -r fd948758d9b8 xen/include/asm-x86/msr.h
--- a/xen/include/asm-x86/msr.h Fri Jun 11 14:26:02 2010 +0100
+++ b/xen/include/asm-x86/msr.h Fri Jun 11 15:19:49 2010 +0100
@@ -102,23 +102,10 @@ static inline int wrmsr_safe(unsigned in
 
 
 DECLARE_PER_CPU(u64, efer);
-
-#define read_efer() this_cpu(efer)
-
-#define write_efer(val) do { \
-    this_cpu(efer) = val; \
-    wrmsrl(MSR_EFER, val); \
-} while(0)
+u64 read_efer(void);
+void write_efer(u64 val);
 
 DECLARE_PER_CPU(u32, ler_msr);
-
-#define ler_enable() do { \
-    u64 debugctl; \
-    if ( !this_cpu(ler_msr) ) \
-        return; \
-    rdmsrl(MSR_IA32_DEBUGCTLMSR, debugctl); \
-    wrmsrl(MSR_IA32_DEBUGCTLMSR, debugctl | 1); \
-} while(0)
 
 #endif /* !__ASSEMBLY__ */
 
diff -r 886494c9fda4 -r fd948758d9b8 xen/include/xen/cpuidle.h
--- a/xen/include/xen/cpuidle.h Fri Jun 11 14:26:02 2010 +0100
+++ b/xen/include/xen/cpuidle.h Fri Jun 11 15:19:49 2010 +0100
@@ -27,7 +27,7 @@
 #ifndef _XEN_CPUIDLE_H
 #define _XEN_CPUIDLE_H
 
-#include <xen/smp.h>
+#include <xen/cpumask.h>
 
 #define ACPI_PROCESSOR_MAX_POWER        8
 #define CPUIDLE_NAME_LEN                16

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86: Clean up efer/ler macros after MSR changes., Xen patchbot-unstable <=