]> xenbits.xensource.com Git - xen.git/commitdiff
x86: Clean up efer/ler macros after MSR changes.
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 11 Jun 2010 14:19:49 +0000 (15:19 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 11 Jun 2010 14:19:49 +0000 (15:19 +0100)
Move them out of a header file and make the macros proper functions again.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/domain.c
xen/arch/x86/traps.c
xen/include/asm-x86/msr.h
xen/include/xen/cpuidle.h

index 4dc081fa037469a5ccad49c728b4f46ae900e70a..d766ab48903da9cf45fe01b289c111f67f415868 100644 (file)
@@ -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);
index bfc4f248ce16519e44fc3ec75ffa0076b4489acc..e30b1528d72b9998599de0c4710a4c72f05a393b 100644 (file)
@@ -81,6 +81,8 @@ 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);
 
 DEFINE_PER_CPU_READ_MOSTLY(struct desc_struct *, gdt_table);
@@ -3113,6 +3115,28 @@ asmlinkage void do_device_not_available(struct cpu_user_regs *regs)
     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;
index 26fded68c0ba7d69e6555903fea5dc6a6c2a7c98..820a2528e6750dc6006bc88a2f385337119438e5 100644 (file)
@@ -102,24 +102,11 @@ static inline int wrmsr_safe(unsigned int msr, uint64_t val)
 
 
 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__ */
 
 #endif /* __ASM_MSR_H */
index 0b3b3fec272d078a08acddc830974896c15b353e..cf73341bf5f06be519ada5417b9e772db6af6821 100644 (file)
@@ -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