Loading arch/x86/include/asm/pda.hdeleted 100644 → 0 +0 −45 Original line number Diff line number Diff line #ifndef _ASM_X86_PDA_H #define _ASM_X86_PDA_H #ifndef __ASSEMBLY__ #include <linux/stddef.h> #include <linux/types.h> #include <linux/cache.h> #include <linux/threads.h> #include <asm/page.h> #include <asm/percpu.h> /* Per processor datastructure. %gs points to it while the kernel runs */ struct x8664_pda { unsigned long unused1; unsigned long unused2; unsigned long unused3; unsigned long unused4; int unused5; unsigned int unused6; /* 36 was cpunumber */ unsigned long stack_canary; /* 40 stack canary value */ /* gcc-ABI: this canary MUST be at offset 40!!! */ short in_bootmem; /* pda lives in bootmem */ } ____cacheline_aligned_in_smp; DECLARE_PER_CPU(struct x8664_pda, __pda); extern void pda_init(int); #define cpu_pda(cpu) (&per_cpu(__pda, cpu)) #define read_pda(field) percpu_read(__pda.field) #define write_pda(field, val) percpu_write(__pda.field, val) #define add_pda(field, val) percpu_add(__pda.field, val) #define sub_pda(field, val) percpu_sub(__pda.field, val) #define or_pda(field, val) percpu_or(__pda.field, val) /* This is not atomic against other CPUs -- CPU preemption needs to be off */ #define test_and_clear_bit_pda(bit, field) \ x86_test_and_clear_bit_percpu(bit, __pda.field) #endif #define refresh_stack_canary() write_pda(stack_canary, current->stack_canary) #endif /* _ASM_X86_PDA_H */ arch/x86/include/asm/percpu.h +0 −6 Original line number Diff line number Diff line Loading @@ -133,12 +133,6 @@ do { \ /* We can use this directly for local CPU (faster). */ DECLARE_PER_CPU(unsigned long, this_cpu_off); #ifdef CONFIG_X86_64 extern void load_pda_offset(int cpu); #else static inline void load_pda_offset(int cpu) { } #endif #endif /* !__ASSEMBLY__ */ #ifdef CONFIG_SMP Loading arch/x86/include/asm/pgtable_64.h +0 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,6 @@ #include <asm/processor.h> #include <linux/bitops.h> #include <linux/threads.h> #include <asm/pda.h> extern pud_t level3_kernel_pgt[512]; extern pud_t level3_ident_pgt[512]; Loading arch/x86/include/asm/processor.h +22 −1 Original line number Diff line number Diff line Loading @@ -379,8 +379,29 @@ union thread_xstate { #ifdef CONFIG_X86_64 DECLARE_PER_CPU(struct orig_ist, orig_ist); DECLARE_PER_CPU(char[IRQ_STACK_SIZE], irq_stack); union irq_stack_union { char irq_stack[IRQ_STACK_SIZE]; /* * GCC hardcodes the stack canary as %gs:40. Since the * irq_stack is the object at %gs:0, we reserve the bottom * 48 bytes of the irq stack for the canary. */ struct { char gs_base[40]; unsigned long stack_canary; }; }; DECLARE_PER_CPU(union irq_stack_union, irq_stack_union); DECLARE_PER_CPU(char *, irq_stack_ptr); static inline void load_gs_base(int cpu) { /* Memory clobbers used to order pda/percpu accesses */ mb(); wrmsrl(MSR_GS_BASE, (unsigned long)per_cpu(irq_stack_union.gs_base, cpu)); mb(); } #endif extern void print_cpu_info(struct cpuinfo_x86 *); Loading arch/x86/include/asm/smp.h +0 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,6 @@ # include <asm/io_apic.h> # endif #endif #include <asm/pda.h> #include <asm/thread_info.h> #include <asm/cpumask.h> Loading Loading
arch/x86/include/asm/pda.hdeleted 100644 → 0 +0 −45 Original line number Diff line number Diff line #ifndef _ASM_X86_PDA_H #define _ASM_X86_PDA_H #ifndef __ASSEMBLY__ #include <linux/stddef.h> #include <linux/types.h> #include <linux/cache.h> #include <linux/threads.h> #include <asm/page.h> #include <asm/percpu.h> /* Per processor datastructure. %gs points to it while the kernel runs */ struct x8664_pda { unsigned long unused1; unsigned long unused2; unsigned long unused3; unsigned long unused4; int unused5; unsigned int unused6; /* 36 was cpunumber */ unsigned long stack_canary; /* 40 stack canary value */ /* gcc-ABI: this canary MUST be at offset 40!!! */ short in_bootmem; /* pda lives in bootmem */ } ____cacheline_aligned_in_smp; DECLARE_PER_CPU(struct x8664_pda, __pda); extern void pda_init(int); #define cpu_pda(cpu) (&per_cpu(__pda, cpu)) #define read_pda(field) percpu_read(__pda.field) #define write_pda(field, val) percpu_write(__pda.field, val) #define add_pda(field, val) percpu_add(__pda.field, val) #define sub_pda(field, val) percpu_sub(__pda.field, val) #define or_pda(field, val) percpu_or(__pda.field, val) /* This is not atomic against other CPUs -- CPU preemption needs to be off */ #define test_and_clear_bit_pda(bit, field) \ x86_test_and_clear_bit_percpu(bit, __pda.field) #endif #define refresh_stack_canary() write_pda(stack_canary, current->stack_canary) #endif /* _ASM_X86_PDA_H */
arch/x86/include/asm/percpu.h +0 −6 Original line number Diff line number Diff line Loading @@ -133,12 +133,6 @@ do { \ /* We can use this directly for local CPU (faster). */ DECLARE_PER_CPU(unsigned long, this_cpu_off); #ifdef CONFIG_X86_64 extern void load_pda_offset(int cpu); #else static inline void load_pda_offset(int cpu) { } #endif #endif /* !__ASSEMBLY__ */ #ifdef CONFIG_SMP Loading
arch/x86/include/asm/pgtable_64.h +0 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,6 @@ #include <asm/processor.h> #include <linux/bitops.h> #include <linux/threads.h> #include <asm/pda.h> extern pud_t level3_kernel_pgt[512]; extern pud_t level3_ident_pgt[512]; Loading
arch/x86/include/asm/processor.h +22 −1 Original line number Diff line number Diff line Loading @@ -379,8 +379,29 @@ union thread_xstate { #ifdef CONFIG_X86_64 DECLARE_PER_CPU(struct orig_ist, orig_ist); DECLARE_PER_CPU(char[IRQ_STACK_SIZE], irq_stack); union irq_stack_union { char irq_stack[IRQ_STACK_SIZE]; /* * GCC hardcodes the stack canary as %gs:40. Since the * irq_stack is the object at %gs:0, we reserve the bottom * 48 bytes of the irq stack for the canary. */ struct { char gs_base[40]; unsigned long stack_canary; }; }; DECLARE_PER_CPU(union irq_stack_union, irq_stack_union); DECLARE_PER_CPU(char *, irq_stack_ptr); static inline void load_gs_base(int cpu) { /* Memory clobbers used to order pda/percpu accesses */ mb(); wrmsrl(MSR_GS_BASE, (unsigned long)per_cpu(irq_stack_union.gs_base, cpu)); mb(); } #endif extern void print_cpu_info(struct cpuinfo_x86 *); Loading
arch/x86/include/asm/smp.h +0 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,6 @@ # include <asm/io_apic.h> # endif #endif #include <asm/pda.h> #include <asm/thread_info.h> #include <asm/cpumask.h> Loading