[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] x86: Clean up efer/ler macros after MSR changes.
# 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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |