aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/processor.h
diff options
context:
space:
mode:
authorMarkus Metzger <markus.t.metzger@intel.com>2009-04-03 10:43:39 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-07 07:36:19 -0400
commit35bb7600c17762bb129588c1877d2717fe325289 (patch)
tree881d4a657017da348531ec9e57c0d57794c2f4d4 /arch/x86/include/asm/processor.h
parent15879d042164650b93d83281ad5f87ad323bfbfe (diff)
x86, debugctlmsr: add _on_cpu variants to debugctlmsr functions
Add functions to get and set the debugctlmsr on different cpus. Signed-off-by: Markus Metzger <markus.t.metzger@intel.com> Cc: roland@redhat.com Cc: eranian@googlemail.com Cc: oleg@redhat.com Cc: juan.villacis@intel.com Cc: ak@linux.jf.intel.com LKML-Reference: <20090403144554.738772000@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include/asm/processor.h')
-rw-r--r--arch/x86/include/asm/processor.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 2483807e06e..1efeb497f1f 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -785,6 +785,21 @@ static inline unsigned long get_debugctlmsr(void)
785 return debugctlmsr; 785 return debugctlmsr;
786} 786}
787 787
788static inline unsigned long get_debugctlmsr_on_cpu(int cpu)
789{
790 u64 debugctlmsr = 0;
791 u32 val1, val2;
792
793#ifndef CONFIG_X86_DEBUGCTLMSR
794 if (boot_cpu_data.x86 < 6)
795 return 0;
796#endif
797 rdmsr_on_cpu(cpu, MSR_IA32_DEBUGCTLMSR, &val1, &val2);
798 debugctlmsr = val1 | ((u64)val2 << 32);
799
800 return debugctlmsr;
801}
802
788static inline void update_debugctlmsr(unsigned long debugctlmsr) 803static inline void update_debugctlmsr(unsigned long debugctlmsr)
789{ 804{
790#ifndef CONFIG_X86_DEBUGCTLMSR 805#ifndef CONFIG_X86_DEBUGCTLMSR
@@ -794,6 +809,18 @@ static inline void update_debugctlmsr(unsigned long debugctlmsr)
794 wrmsrl(MSR_IA32_DEBUGCTLMSR, debugctlmsr); 809 wrmsrl(MSR_IA32_DEBUGCTLMSR, debugctlmsr);
795} 810}
796 811
812static inline void update_debugctlmsr_on_cpu(int cpu,
813 unsigned long debugctlmsr)
814{
815#ifndef CONFIG_X86_DEBUGCTLMSR
816 if (boot_cpu_data.x86 < 6)
817 return;
818#endif
819 wrmsr_on_cpu(cpu, MSR_IA32_DEBUGCTLMSR,
820 (u32)((u64)debugctlmsr),
821 (u32)((u64)debugctlmsr >> 32));
822}
823
797/* 824/*
798 * from system description table in BIOS. Mostly for MCA use, but 825 * from system description table in BIOS. Mostly for MCA use, but
799 * others may find it useful: 826 * others may find it useful: