aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/processor.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/include/asm/processor.h')
-rw-r--r--arch/x86/include/asm/processor.h35
1 files changed, 28 insertions, 7 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index c2cceae709c8..0b2fab0051e0 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -460,14 +460,8 @@ struct thread_struct {
460 unsigned io_bitmap_max; 460 unsigned io_bitmap_max;
461/* MSR_IA32_DEBUGCTLMSR value to switch in if TIF_DEBUGCTLMSR is set. */ 461/* MSR_IA32_DEBUGCTLMSR value to switch in if TIF_DEBUGCTLMSR is set. */
462 unsigned long debugctlmsr; 462 unsigned long debugctlmsr;
463#ifdef CONFIG_X86_DS 463 /* Debug Store context; see asm/ds.h */
464/* Debug Store context; see include/asm-x86/ds.h; goes into MSR_IA32_DS_AREA */
465 struct ds_context *ds_ctx; 464 struct ds_context *ds_ctx;
466#endif /* CONFIG_X86_DS */
467#ifdef CONFIG_X86_PTRACE_BTS
468/* the signal to send on a bts buffer overflow */
469 unsigned int bts_ovfl_signal;
470#endif /* CONFIG_X86_PTRACE_BTS */
471}; 465};
472 466
473static inline unsigned long native_get_debugreg(int regno) 467static inline unsigned long native_get_debugreg(int regno)
@@ -795,6 +789,21 @@ static inline unsigned long get_debugctlmsr(void)
795 return debugctlmsr; 789 return debugctlmsr;
796} 790}
797 791
792static inline unsigned long get_debugctlmsr_on_cpu(int cpu)
793{
794 u64 debugctlmsr = 0;
795 u32 val1, val2;
796
797#ifndef CONFIG_X86_DEBUGCTLMSR
798 if (boot_cpu_data.x86 < 6)
799 return 0;
800#endif
801 rdmsr_on_cpu(cpu, MSR_IA32_DEBUGCTLMSR, &val1, &val2);
802 debugctlmsr = val1 | ((u64)val2 << 32);
803
804 return debugctlmsr;
805}
806
798static inline void update_debugctlmsr(unsigned long debugctlmsr) 807static inline void update_debugctlmsr(unsigned long debugctlmsr)
799{ 808{
800#ifndef CONFIG_X86_DEBUGCTLMSR 809#ifndef CONFIG_X86_DEBUGCTLMSR
@@ -804,6 +813,18 @@ static inline void update_debugctlmsr(unsigned long debugctlmsr)
804 wrmsrl(MSR_IA32_DEBUGCTLMSR, debugctlmsr); 813 wrmsrl(MSR_IA32_DEBUGCTLMSR, debugctlmsr);
805} 814}
806 815
816static inline void update_debugctlmsr_on_cpu(int cpu,
817 unsigned long debugctlmsr)
818{
819#ifndef CONFIG_X86_DEBUGCTLMSR
820 if (boot_cpu_data.x86 < 6)
821 return;
822#endif
823 wrmsr_on_cpu(cpu, MSR_IA32_DEBUGCTLMSR,
824 (u32)((u64)debugctlmsr),
825 (u32)((u64)debugctlmsr >> 32));
826}
827
807/* 828/*
808 * from system description table in BIOS. Mostly for MCA use, but 829 * from system description table in BIOS. Mostly for MCA use, but
809 * others may find it useful: 830 * others may find it useful: