diff options
Diffstat (limited to 'arch/x86/include/asm/processor.h')
-rw-r--r-- | arch/x86/include/asm/processor.h | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index c2cceae709c..c7768269b1c 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -135,7 +135,8 @@ extern struct cpuinfo_x86 boot_cpu_data; | |||
135 | extern struct cpuinfo_x86 new_cpu_data; | 135 | extern struct cpuinfo_x86 new_cpu_data; |
136 | 136 | ||
137 | extern struct tss_struct doublefault_tss; | 137 | extern struct tss_struct doublefault_tss; |
138 | extern __u32 cleared_cpu_caps[NCAPINTS]; | 138 | extern __u32 cpu_caps_cleared[NCAPINTS]; |
139 | extern __u32 cpu_caps_set[NCAPINTS]; | ||
139 | 140 | ||
140 | #ifdef CONFIG_SMP | 141 | #ifdef CONFIG_SMP |
141 | DECLARE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info); | 142 | DECLARE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info); |
@@ -409,9 +410,6 @@ DECLARE_PER_CPU(unsigned long, stack_canary); | |||
409 | extern unsigned int xstate_size; | 410 | extern unsigned int xstate_size; |
410 | extern void free_thread_xstate(struct task_struct *); | 411 | extern void free_thread_xstate(struct task_struct *); |
411 | extern struct kmem_cache *task_xstate_cachep; | 412 | extern struct kmem_cache *task_xstate_cachep; |
412 | extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c); | ||
413 | extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); | ||
414 | extern unsigned short num_cache_leaves; | ||
415 | 413 | ||
416 | struct thread_struct { | 414 | struct thread_struct { |
417 | /* Cached TLS descriptors: */ | 415 | /* Cached TLS descriptors: */ |
@@ -427,8 +425,12 @@ struct thread_struct { | |||
427 | unsigned short fsindex; | 425 | unsigned short fsindex; |
428 | unsigned short gsindex; | 426 | unsigned short gsindex; |
429 | #endif | 427 | #endif |
428 | #ifdef CONFIG_X86_32 | ||
430 | unsigned long ip; | 429 | unsigned long ip; |
430 | #endif | ||
431 | #ifdef CONFIG_X86_64 | ||
431 | unsigned long fs; | 432 | unsigned long fs; |
433 | #endif | ||
432 | unsigned long gs; | 434 | unsigned long gs; |
433 | /* Hardware debugging registers: */ | 435 | /* Hardware debugging registers: */ |
434 | unsigned long debugreg0; | 436 | unsigned long debugreg0; |
@@ -460,14 +462,8 @@ struct thread_struct { | |||
460 | unsigned io_bitmap_max; | 462 | unsigned io_bitmap_max; |
461 | /* MSR_IA32_DEBUGCTLMSR value to switch in if TIF_DEBUGCTLMSR is set. */ | 463 | /* MSR_IA32_DEBUGCTLMSR value to switch in if TIF_DEBUGCTLMSR is set. */ |
462 | unsigned long debugctlmsr; | 464 | unsigned long debugctlmsr; |
463 | #ifdef CONFIG_X86_DS | 465 | /* 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; | 466 | 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 | }; | 467 | }; |
472 | 468 | ||
473 | static inline unsigned long native_get_debugreg(int regno) | 469 | static inline unsigned long native_get_debugreg(int regno) |
@@ -795,6 +791,21 @@ static inline unsigned long get_debugctlmsr(void) | |||
795 | return debugctlmsr; | 791 | return debugctlmsr; |
796 | } | 792 | } |
797 | 793 | ||
794 | static inline unsigned long get_debugctlmsr_on_cpu(int cpu) | ||
795 | { | ||
796 | u64 debugctlmsr = 0; | ||
797 | u32 val1, val2; | ||
798 | |||
799 | #ifndef CONFIG_X86_DEBUGCTLMSR | ||
800 | if (boot_cpu_data.x86 < 6) | ||
801 | return 0; | ||
802 | #endif | ||
803 | rdmsr_on_cpu(cpu, MSR_IA32_DEBUGCTLMSR, &val1, &val2); | ||
804 | debugctlmsr = val1 | ((u64)val2 << 32); | ||
805 | |||
806 | return debugctlmsr; | ||
807 | } | ||
808 | |||
798 | static inline void update_debugctlmsr(unsigned long debugctlmsr) | 809 | static inline void update_debugctlmsr(unsigned long debugctlmsr) |
799 | { | 810 | { |
800 | #ifndef CONFIG_X86_DEBUGCTLMSR | 811 | #ifndef CONFIG_X86_DEBUGCTLMSR |
@@ -804,6 +815,18 @@ static inline void update_debugctlmsr(unsigned long debugctlmsr) | |||
804 | wrmsrl(MSR_IA32_DEBUGCTLMSR, debugctlmsr); | 815 | wrmsrl(MSR_IA32_DEBUGCTLMSR, debugctlmsr); |
805 | } | 816 | } |
806 | 817 | ||
818 | static inline void update_debugctlmsr_on_cpu(int cpu, | ||
819 | unsigned long debugctlmsr) | ||
820 | { | ||
821 | #ifndef CONFIG_X86_DEBUGCTLMSR | ||
822 | if (boot_cpu_data.x86 < 6) | ||
823 | return; | ||
824 | #endif | ||
825 | wrmsr_on_cpu(cpu, MSR_IA32_DEBUGCTLMSR, | ||
826 | (u32)((u64)debugctlmsr), | ||
827 | (u32)((u64)debugctlmsr >> 32)); | ||
828 | } | ||
829 | |||
807 | /* | 830 | /* |
808 | * from system description table in BIOS. Mostly for MCA use, but | 831 | * from system description table in BIOS. Mostly for MCA use, but |
809 | * others may find it useful: | 832 | * others may find it useful: |
@@ -814,6 +837,7 @@ extern unsigned int BIOS_revision; | |||
814 | 837 | ||
815 | /* Boot loader type from the setup header: */ | 838 | /* Boot loader type from the setup header: */ |
816 | extern int bootloader_type; | 839 | extern int bootloader_type; |
840 | extern int bootloader_version; | ||
817 | 841 | ||
818 | extern char ignore_fpu_irq; | 842 | extern char ignore_fpu_irq; |
819 | 843 | ||
@@ -874,7 +898,6 @@ static inline void spin_lock_prefetch(const void *x) | |||
874 | .vm86_info = NULL, \ | 898 | .vm86_info = NULL, \ |
875 | .sysenter_cs = __KERNEL_CS, \ | 899 | .sysenter_cs = __KERNEL_CS, \ |
876 | .io_bitmap_ptr = NULL, \ | 900 | .io_bitmap_ptr = NULL, \ |
877 | .fs = __KERNEL_PERCPU, \ | ||
878 | } | 901 | } |
879 | 902 | ||
880 | /* | 903 | /* |