diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-i386/cpufeature.h | 1 | ||||
-rw-r--r-- | include/asm-i386/i387.h | 30 | ||||
-rw-r--r-- | include/asm-sparc/unistd.h | 2 | ||||
-rw-r--r-- | include/asm-sparc64/unistd.h | 2 | ||||
-rw-r--r-- | include/asm-x86_64/cache.h | 4 | ||||
-rw-r--r-- | include/asm-x86_64/cpufeature.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/i387.h | 20 | ||||
-rw-r--r-- | include/asm-xtensa/ioctls.h | 2 | ||||
-rw-r--r-- | include/linux/memory_hotplug.h | 3 |
9 files changed, 52 insertions, 13 deletions
diff --git a/include/asm-i386/cpufeature.h b/include/asm-i386/cpufeature.h index 5c0b5876b931..b44bfc6239cb 100644 --- a/include/asm-i386/cpufeature.h +++ b/include/asm-i386/cpufeature.h | |||
@@ -71,6 +71,7 @@ | |||
71 | #define X86_FEATURE_P4 (3*32+ 7) /* P4 */ | 71 | #define X86_FEATURE_P4 (3*32+ 7) /* P4 */ |
72 | #define X86_FEATURE_CONSTANT_TSC (3*32+ 8) /* TSC ticks at a constant rate */ | 72 | #define X86_FEATURE_CONSTANT_TSC (3*32+ 8) /* TSC ticks at a constant rate */ |
73 | #define X86_FEATURE_UP (3*32+ 9) /* smp kernel running on up */ | 73 | #define X86_FEATURE_UP (3*32+ 9) /* smp kernel running on up */ |
74 | #define X86_FEATURE_FXSAVE_LEAK (3*32+10) /* FXSAVE leaks FOP/FIP/FOP */ | ||
74 | 75 | ||
75 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ | 76 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ |
76 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ | 77 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ |
diff --git a/include/asm-i386/i387.h b/include/asm-i386/i387.h index 152d0baa576a..7b1f01191e70 100644 --- a/include/asm-i386/i387.h +++ b/include/asm-i386/i387.h | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/kernel_stat.h> | ||
16 | #include <asm/processor.h> | 17 | #include <asm/processor.h> |
17 | #include <asm/sigcontext.h> | 18 | #include <asm/sigcontext.h> |
18 | #include <asm/user.h> | 19 | #include <asm/user.h> |
@@ -38,17 +39,38 @@ extern void init_fpu(struct task_struct *); | |||
38 | extern void kernel_fpu_begin(void); | 39 | extern void kernel_fpu_begin(void); |
39 | #define kernel_fpu_end() do { stts(); preempt_enable(); } while(0) | 40 | #define kernel_fpu_end() do { stts(); preempt_enable(); } while(0) |
40 | 41 | ||
42 | /* We need a safe address that is cheap to find and that is already | ||
43 | in L1 during context switch. The best choices are unfortunately | ||
44 | different for UP and SMP */ | ||
45 | #ifdef CONFIG_SMP | ||
46 | #define safe_address (__per_cpu_offset[0]) | ||
47 | #else | ||
48 | #define safe_address (kstat_cpu(0).cpustat.user) | ||
49 | #endif | ||
50 | |||
41 | /* | 51 | /* |
42 | * These must be called with preempt disabled | 52 | * These must be called with preempt disabled |
43 | */ | 53 | */ |
44 | static inline void __save_init_fpu( struct task_struct *tsk ) | 54 | static inline void __save_init_fpu( struct task_struct *tsk ) |
45 | { | 55 | { |
56 | /* Use more nops than strictly needed in case the compiler | ||
57 | varies code */ | ||
46 | alternative_input( | 58 | alternative_input( |
47 | "fnsave %1 ; fwait ;" GENERIC_NOP2, | 59 | "fnsave %[fx] ;fwait;" GENERIC_NOP8 GENERIC_NOP4, |
48 | "fxsave %1 ; fnclex", | 60 | "fxsave %[fx]\n" |
61 | "bt $7,%[fsw] ; jc 1f ; fnclex\n1:", | ||
49 | X86_FEATURE_FXSR, | 62 | X86_FEATURE_FXSR, |
50 | "m" (tsk->thread.i387.fxsave) | 63 | [fx] "m" (tsk->thread.i387.fxsave), |
51 | :"memory"); | 64 | [fsw] "m" (tsk->thread.i387.fxsave.swd) : "memory"); |
65 | /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception | ||
66 | is pending. Clear the x87 state here by setting it to fixed | ||
67 | values. __per_cpu_offset[0] is a random variable that should be in L1 */ | ||
68 | alternative_input( | ||
69 | GENERIC_NOP8 GENERIC_NOP2, | ||
70 | "emms\n\t" /* clear stack tags */ | ||
71 | "fildl %[addr]", /* set F?P to defined value */ | ||
72 | X86_FEATURE_FXSAVE_LEAK, | ||
73 | [addr] "m" (safe_address)); | ||
52 | task_thread_info(tsk)->status &= ~TS_USEDFPU; | 74 | task_thread_info(tsk)->status &= ~TS_USEDFPU; |
53 | } | 75 | } |
54 | 76 | ||
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h index 2a911aa4cae9..45feff893b8e 100644 --- a/include/asm-sparc/unistd.h +++ b/include/asm-sparc/unistd.h | |||
@@ -248,7 +248,7 @@ | |||
248 | #define __NR_setfsgid 229 /* Linux Specific */ | 248 | #define __NR_setfsgid 229 /* Linux Specific */ |
249 | #define __NR__newselect 230 /* Linux Specific */ | 249 | #define __NR__newselect 230 /* Linux Specific */ |
250 | #define __NR_time 231 /* Linux Specific */ | 250 | #define __NR_time 231 /* Linux Specific */ |
251 | #define __NR_sys_splice 232 /* Linux Specific */ | 251 | #define __NR_splice 232 /* Linux Specific */ |
252 | #define __NR_stime 233 /* Linux Specific */ | 252 | #define __NR_stime 233 /* Linux Specific */ |
253 | #define __NR_statfs64 234 /* Linux Specific */ | 253 | #define __NR_statfs64 234 /* Linux Specific */ |
254 | #define __NR_fstatfs64 235 /* Linux Specific */ | 254 | #define __NR_fstatfs64 235 /* Linux Specific */ |
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h index 6ada6a871cc8..597f6923a46e 100644 --- a/include/asm-sparc64/unistd.h +++ b/include/asm-sparc64/unistd.h | |||
@@ -250,7 +250,7 @@ | |||
250 | #ifdef __KERNEL__ | 250 | #ifdef __KERNEL__ |
251 | #define __NR_time 231 /* Linux sparc32 */ | 251 | #define __NR_time 231 /* Linux sparc32 */ |
252 | #endif | 252 | #endif |
253 | #define __NR_sys_splice 232 /* Linux Specific */ | 253 | #define __NR_splice 232 /* Linux Specific */ |
254 | #define __NR_stime 233 /* Linux Specific */ | 254 | #define __NR_stime 233 /* Linux Specific */ |
255 | #define __NR_statfs64 234 /* Linux Specific */ | 255 | #define __NR_statfs64 234 /* Linux Specific */ |
256 | #define __NR_fstatfs64 235 /* Linux Specific */ | 256 | #define __NR_fstatfs64 235 /* Linux Specific */ |
diff --git a/include/asm-x86_64/cache.h b/include/asm-x86_64/cache.h index c8043a16152e..f8dff1c67538 100644 --- a/include/asm-x86_64/cache.h +++ b/include/asm-x86_64/cache.h | |||
@@ -20,8 +20,8 @@ | |||
20 | __attribute__((__section__(".data.page_aligned"))) | 20 | __attribute__((__section__(".data.page_aligned"))) |
21 | #endif | 21 | #endif |
22 | 22 | ||
23 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | ||
24 | |||
25 | #endif | 23 | #endif |
26 | 24 | ||
25 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | ||
26 | |||
27 | #endif | 27 | #endif |
diff --git a/include/asm-x86_64/cpufeature.h b/include/asm-x86_64/cpufeature.h index 76bb6193ae91..662964b74e34 100644 --- a/include/asm-x86_64/cpufeature.h +++ b/include/asm-x86_64/cpufeature.h | |||
@@ -64,6 +64,7 @@ | |||
64 | #define X86_FEATURE_REP_GOOD (3*32+ 4) /* rep microcode works well on this CPU */ | 64 | #define X86_FEATURE_REP_GOOD (3*32+ 4) /* rep microcode works well on this CPU */ |
65 | #define X86_FEATURE_CONSTANT_TSC (3*32+5) /* TSC runs at constant rate */ | 65 | #define X86_FEATURE_CONSTANT_TSC (3*32+5) /* TSC runs at constant rate */ |
66 | #define X86_FEATURE_SYNC_RDTSC (3*32+6) /* RDTSC syncs CPU core */ | 66 | #define X86_FEATURE_SYNC_RDTSC (3*32+6) /* RDTSC syncs CPU core */ |
67 | #define X86_FEATURE_FXSAVE_LEAK (3*32+7) /* FIP/FOP/FDP leaks through FXSAVE */ | ||
67 | 68 | ||
68 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ | 69 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ |
69 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ | 70 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ |
diff --git a/include/asm-x86_64/i387.h b/include/asm-x86_64/i387.h index 876eb9a2fe78..cba8a3b0cded 100644 --- a/include/asm-x86_64/i387.h +++ b/include/asm-x86_64/i387.h | |||
@@ -72,6 +72,23 @@ extern int set_fpregs(struct task_struct *tsk, | |||
72 | #define set_fpu_swd(t,val) ((t)->thread.i387.fxsave.swd = (val)) | 72 | #define set_fpu_swd(t,val) ((t)->thread.i387.fxsave.swd = (val)) |
73 | #define set_fpu_fxsr_twd(t,val) ((t)->thread.i387.fxsave.twd = (val)) | 73 | #define set_fpu_fxsr_twd(t,val) ((t)->thread.i387.fxsave.twd = (val)) |
74 | 74 | ||
75 | #define X87_FSW_ES (1 << 7) /* Exception Summary */ | ||
76 | |||
77 | /* AMD CPUs don't save/restore FDP/FIP/FOP unless an exception | ||
78 | is pending. Clear the x87 state here by setting it to fixed | ||
79 | values. The kernel data segment can be sometimes 0 and sometimes | ||
80 | new user value. Both should be ok. | ||
81 | Use the PDA as safe address because it should be already in L1. */ | ||
82 | static inline void clear_fpu_state(struct i387_fxsave_struct *fx) | ||
83 | { | ||
84 | if (unlikely(fx->swd & X87_FSW_ES)) | ||
85 | asm volatile("fnclex"); | ||
86 | alternative_input(ASM_NOP8 ASM_NOP2, | ||
87 | " emms\n" /* clear stack tags */ | ||
88 | " fildl %%gs:0", /* load to clear state */ | ||
89 | X86_FEATURE_FXSAVE_LEAK); | ||
90 | } | ||
91 | |||
75 | static inline int restore_fpu_checking(struct i387_fxsave_struct *fx) | 92 | static inline int restore_fpu_checking(struct i387_fxsave_struct *fx) |
76 | { | 93 | { |
77 | int err; | 94 | int err; |
@@ -119,6 +136,7 @@ static inline int save_i387_checking(struct i387_fxsave_struct __user *fx) | |||
119 | #endif | 136 | #endif |
120 | if (unlikely(err)) | 137 | if (unlikely(err)) |
121 | __clear_user(fx, sizeof(struct i387_fxsave_struct)); | 138 | __clear_user(fx, sizeof(struct i387_fxsave_struct)); |
139 | /* No need to clear here because the caller clears USED_MATH */ | ||
122 | return err; | 140 | return err; |
123 | } | 141 | } |
124 | 142 | ||
@@ -149,7 +167,7 @@ static inline void __fxsave_clear(struct task_struct *tsk) | |||
149 | "i" (offsetof(__typeof__(*tsk), | 167 | "i" (offsetof(__typeof__(*tsk), |
150 | thread.i387.fxsave))); | 168 | thread.i387.fxsave))); |
151 | #endif | 169 | #endif |
152 | __asm__ __volatile__("fnclex"); | 170 | clear_fpu_state(&tsk->thread.i387.fxsave); |
153 | } | 171 | } |
154 | 172 | ||
155 | static inline void kernel_fpu_begin(void) | 173 | static inline void kernel_fpu_begin(void) |
diff --git a/include/asm-xtensa/ioctls.h b/include/asm-xtensa/ioctls.h index 10c443435c11..3b89a772d0a0 100644 --- a/include/asm-xtensa/ioctls.h +++ b/include/asm-xtensa/ioctls.h | |||
@@ -107,6 +107,6 @@ | |||
107 | #define TIOCSERSETMULTI _IOW('T', 91, struct serial_multiport_struct) /* Set multiport config */ | 107 | #define TIOCSERSETMULTI _IOW('T', 91, struct serial_multiport_struct) /* Set multiport config */ |
108 | 108 | ||
109 | #define TIOCMIWAIT _IO('T', 92) /* wait for a change on serial input line(s) */ | 109 | #define TIOCMIWAIT _IO('T', 92) /* wait for a change on serial input line(s) */ |
110 | #define TIOCGICOUNT _IOR('T', 93, struct async_icount) /* read serial port inline interrupt counts */ | 110 | #define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ |
111 | 111 | ||
112 | #endif /* _XTENSA_IOCTLS_H */ | 112 | #endif /* _XTENSA_IOCTLS_H */ |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 4ca3e6ad03ec..911206386171 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
@@ -99,10 +99,7 @@ static inline int __remove_pages(struct zone *zone, unsigned long start_pfn, | |||
99 | return -ENOSYS; | 99 | return -ENOSYS; |
100 | } | 100 | } |
101 | 101 | ||
102 | #if defined(CONFIG_MEMORY_HOTPLUG) || defined(CONFIG_ACPI_HOTPLUG_MEMORY) \ | ||
103 | || defined(CONFIG_ACPI_HOTPLUG_MEMORY_MODULE) | ||
104 | extern int add_memory(u64 start, u64 size); | 102 | extern int add_memory(u64 start, u64 size); |
105 | extern int remove_memory(u64 start, u64 size); | 103 | extern int remove_memory(u64 start, u64 size); |
106 | #endif | ||
107 | 104 | ||
108 | #endif /* __LINUX_MEMORY_HOTPLUG_H */ | 105 | #endif /* __LINUX_MEMORY_HOTPLUG_H */ |