diff options
author | Markus Metzger <markus.t.metzger@intel.com> | 2009-04-03 10:43:39 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-07 07:36:19 -0400 |
commit | 35bb7600c17762bb129588c1877d2717fe325289 (patch) | |
tree | 881d4a657017da348531ec9e57c0d57794c2f4d4 | |
parent | 15879d042164650b93d83281ad5f87ad323bfbfe (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>
-rw-r--r-- | arch/x86/include/asm/processor.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 2483807e06e7..1efeb497f1f9 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 | ||
788 | static 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 | |||
788 | static inline void update_debugctlmsr(unsigned long debugctlmsr) | 803 | static 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 | ||
812 | static 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: |