Annotation of /trunk/kernel26-magellan/patches-2.6.16-r12/0100-2.6.16-patch-2.6.16.11_fixed
Parent Directory | Revision Log
Revision 72 -
(hide annotations)
(download)
Mon Jun 5 09:25:38 2006 UTC (18 years, 3 months ago) by niro
File size: 119006 byte(s)
Mon Jun 5 09:25:38 2006 UTC (18 years, 3 months ago) by niro
File size: 119006 byte(s)
ver bump to 2.6.16-r12: - updated to linux-2.6.16.19 - updated to ck11
1 | niro | 72 | diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c |
2 | index b4e5f8f..45308bd 100644 | ||
3 | --- a/arch/alpha/kernel/setup.c | ||
4 | +++ b/arch/alpha/kernel/setup.c | ||
5 | @@ -24,6 +24,7 @@ #include <linux/delay.h> | ||
6 | #include <linux/config.h> /* CONFIG_ALPHA_LCA etc */ | ||
7 | #include <linux/mc146818rtc.h> | ||
8 | #include <linux/console.h> | ||
9 | +#include <linux/cpu.h> | ||
10 | #include <linux/errno.h> | ||
11 | #include <linux/init.h> | ||
12 | #include <linux/string.h> | ||
13 | @@ -477,6 +478,22 @@ #undef PFN_DOWN | ||
14 | #undef PFN_PHYS | ||
15 | #undef PFN_MAX | ||
16 | |||
17 | +static int __init | ||
18 | +register_cpus(void) | ||
19 | +{ | ||
20 | + int i; | ||
21 | + | ||
22 | + for_each_possible_cpu(i) { | ||
23 | + struct cpu *p = kzalloc(sizeof(*p), GFP_KERNEL); | ||
24 | + if (!p) | ||
25 | + return -ENOMEM; | ||
26 | + register_cpu(p, i, NULL); | ||
27 | + } | ||
28 | + return 0; | ||
29 | +} | ||
30 | + | ||
31 | +arch_initcall(register_cpus); | ||
32 | + | ||
33 | void __init | ||
34 | setup_arch(char **cmdline_p) | ||
35 | { | ||
36 | diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c | ||
37 | index 02c2db0..1852554 100644 | ||
38 | --- a/arch/alpha/kernel/smp.c | ||
39 | +++ b/arch/alpha/kernel/smp.c | ||
40 | @@ -439,7 +439,7 @@ setup_smp(void) | ||
41 | if ((cpu->flags & 0x1cc) == 0x1cc) { | ||
42 | smp_num_probed++; | ||
43 | /* Assume here that "whami" == index */ | ||
44 | - cpu_set(i, cpu_possible_map); | ||
45 | + cpu_set(i, cpu_present_mask); | ||
46 | cpu->pal_revision = boot_cpu_palrev; | ||
47 | } | ||
48 | |||
49 | @@ -450,9 +450,8 @@ setup_smp(void) | ||
50 | } | ||
51 | } else { | ||
52 | smp_num_probed = 1; | ||
53 | - cpu_set(boot_cpuid, cpu_possible_map); | ||
54 | + cpu_set(boot_cpuid, cpu_present_mask); | ||
55 | } | ||
56 | - cpu_present_mask = cpumask_of_cpu(boot_cpuid); | ||
57 | |||
58 | printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n", | ||
59 | smp_num_probed, cpu_possible_map.bits[0]); | ||
60 | @@ -488,9 +487,8 @@ void __devinit | ||
61 | smp_prepare_boot_cpu(void) | ||
62 | { | ||
63 | /* | ||
64 | - * Mark the boot cpu (current cpu) as both present and online | ||
65 | + * Mark the boot cpu (current cpu) as online | ||
66 | */ | ||
67 | - cpu_set(smp_processor_id(), cpu_present_mask); | ||
68 | cpu_set(smp_processor_id(), cpu_online_map); | ||
69 | } | ||
70 | |||
71 | diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c | ||
72 | index 05312a8..558d2d2 100644 | ||
73 | --- a/arch/i386/kernel/apm.c | ||
74 | +++ b/arch/i386/kernel/apm.c | ||
75 | @@ -1081,7 +1081,7 @@ static int apm_console_blank(int blank) | ||
76 | break; | ||
77 | } | ||
78 | |||
79 | - if (error == APM_NOT_ENGAGED && state != APM_STATE_READY) { | ||
80 | + if (error == APM_NOT_ENGAGED) { | ||
81 | static int tried; | ||
82 | int eng_error; | ||
83 | if (tried++ == 0) { | ||
84 | diff --git a/arch/i386/kernel/cpu/amd.c b/arch/i386/kernel/cpu/amd.c | ||
85 | index 0810f81..d2d50cb 100644 | ||
86 | --- a/arch/i386/kernel/cpu/amd.c | ||
87 | +++ b/arch/i386/kernel/cpu/amd.c | ||
88 | @@ -207,6 +207,8 @@ #define CBAR_KEY (0X000000CB) | ||
89 | set_bit(X86_FEATURE_K7, c->x86_capability); | ||
90 | break; | ||
91 | } | ||
92 | + if (c->x86 >= 6) | ||
93 | + set_bit(X86_FEATURE_FXSAVE_LEAK, c->x86_capability); | ||
94 | |||
95 | display_cacheinfo(c); | ||
96 | |||
97 | diff --git a/arch/i386/kernel/cpu/cpufreq/Kconfig b/arch/i386/kernel/cpu/cpufreq/Kconfig | ||
98 | index 26892d2..16f2e35 100644 | ||
99 | --- a/arch/i386/kernel/cpu/cpufreq/Kconfig | ||
100 | +++ b/arch/i386/kernel/cpu/cpufreq/Kconfig | ||
101 | @@ -203,6 +203,7 @@ config X86_LONGRUN | ||
102 | config X86_LONGHAUL | ||
103 | tristate "VIA Cyrix III Longhaul" | ||
104 | select CPU_FREQ_TABLE | ||
105 | + depends on BROKEN | ||
106 | help | ||
107 | This adds the CPUFreq driver for VIA Samuel/CyrixIII, | ||
108 | VIA Cyrix Samuel/C3, VIA Cyrix Ezra and VIA Cyrix Ezra-T | ||
109 | diff --git a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c | ||
110 | index cc73a7a..ebe1848 100644 | ||
111 | --- a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c | ||
112 | +++ b/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c | ||
113 | @@ -244,7 +244,7 @@ #endif | ||
114 | for (i=1; (p4clockmod_table[i].frequency != CPUFREQ_TABLE_END); i++) { | ||
115 | if ((i<2) && (has_N44_O17_errata[policy->cpu])) | ||
116 | p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID; | ||
117 | - else if (has_N60_errata[policy->cpu] && p4clockmod_table[i].frequency < 2000000) | ||
118 | + else if (has_N60_errata[policy->cpu] && ((stock_freq * i)/8) < 2000000) | ||
119 | p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID; | ||
120 | else | ||
121 | p4clockmod_table[i].frequency = (stock_freq * i)/8; | ||
122 | diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c | ||
123 | index 28cc5d5..cfc4276 100644 | ||
124 | --- a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c | ||
125 | +++ b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c | ||
126 | @@ -75,7 +75,9 @@ static int speedstep_smi_ownership (void | ||
127 | __asm__ __volatile__( | ||
128 | "out %%al, (%%dx)\n" | ||
129 | : "=D" (result) | ||
130 | - : "a" (command), "b" (function), "c" (0), "d" (smi_port), "D" (0), "S" (magic) | ||
131 | + : "a" (command), "b" (function), "c" (0), "d" (smi_port), | ||
132 | + "D" (0), "S" (magic) | ||
133 | + : "memory" | ||
134 | ); | ||
135 | |||
136 | dprintk("result is %x\n", result); | ||
137 | diff --git a/arch/i386/kernel/dmi_scan.c b/arch/i386/kernel/dmi_scan.c | ||
138 | index 6a93d75..ca2a0cb 100644 | ||
139 | --- a/arch/i386/kernel/dmi_scan.c | ||
140 | +++ b/arch/i386/kernel/dmi_scan.c | ||
141 | @@ -106,7 +106,7 @@ static void __init dmi_save_devices(stru | ||
142 | struct dmi_device *dev; | ||
143 | |||
144 | for (i = 0; i < count; i++) { | ||
145 | - char *d = ((char *) dm) + (i * 2); | ||
146 | + char *d = (char *)(dm + 1) + (i * 2); | ||
147 | |||
148 | /* Skip disabled device */ | ||
149 | if ((*d & 0x80) == 0) | ||
150 | diff --git a/arch/m32r/kernel/m32r_ksyms.c b/arch/m32r/kernel/m32r_ksyms.c | ||
151 | index be8b711..6000950 100644 | ||
152 | --- a/arch/m32r/kernel/m32r_ksyms.c | ||
153 | +++ b/arch/m32r/kernel/m32r_ksyms.c | ||
154 | @@ -38,10 +38,6 @@ EXPORT_SYMBOL(__udelay); | ||
155 | EXPORT_SYMBOL(__delay); | ||
156 | EXPORT_SYMBOL(__const_udelay); | ||
157 | |||
158 | -EXPORT_SYMBOL(__get_user_1); | ||
159 | -EXPORT_SYMBOL(__get_user_2); | ||
160 | -EXPORT_SYMBOL(__get_user_4); | ||
161 | - | ||
162 | EXPORT_SYMBOL(strpbrk); | ||
163 | EXPORT_SYMBOL(strstr); | ||
164 | |||
165 | diff --git a/arch/m32r/kernel/setup.c b/arch/m32r/kernel/setup.c | ||
166 | index d742037..542ed93 100644 | ||
167 | --- a/arch/m32r/kernel/setup.c | ||
168 | +++ b/arch/m32r/kernel/setup.c | ||
169 | @@ -9,6 +9,7 @@ | ||
170 | |||
171 | #include <linux/config.h> | ||
172 | #include <linux/init.h> | ||
173 | +#include <linux/kernel.h> | ||
174 | #include <linux/stddef.h> | ||
175 | #include <linux/fs.h> | ||
176 | #include <linux/sched.h> | ||
177 | @@ -218,8 +219,6 @@ #else /* CONFIG_DISCONTIGMEM */ | ||
178 | extern unsigned long setup_memory(void); | ||
179 | #endif /* CONFIG_DISCONTIGMEM */ | ||
180 | |||
181 | -#define M32R_PCC_PCATCR 0x00ef7014 /* will move to m32r.h */ | ||
182 | - | ||
183 | void __init setup_arch(char **cmdline_p) | ||
184 | { | ||
185 | ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV); | ||
186 | @@ -268,15 +267,14 @@ #endif /* CONFIG_DISCONTIGMEM */ | ||
187 | paging_init(); | ||
188 | } | ||
189 | |||
190 | -static struct cpu cpu[NR_CPUS]; | ||
191 | +static struct cpu cpu_devices[NR_CPUS]; | ||
192 | |||
193 | static int __init topology_init(void) | ||
194 | { | ||
195 | - int cpu_id; | ||
196 | + int i; | ||
197 | |||
198 | - for (cpu_id = 0; cpu_id < NR_CPUS; cpu_id++) | ||
199 | - if (cpu_possible(cpu_id)) | ||
200 | - register_cpu(&cpu[cpu_id], cpu_id, NULL); | ||
201 | + for_each_present_cpu(i) | ||
202 | + register_cpu(&cpu_devices[i], i, NULL); | ||
203 | |||
204 | return 0; | ||
205 | } | ||
206 | diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c | ||
207 | index d7ec16e..840b434 100644 | ||
208 | --- a/arch/m32r/kernel/smpboot.c | ||
209 | +++ b/arch/m32r/kernel/smpboot.c | ||
210 | @@ -39,8 +39,10 @@ | ||
211 | * Martin J. Bligh : Added support for multi-quad systems | ||
212 | */ | ||
213 | |||
214 | +#include <linux/module.h> | ||
215 | #include <linux/config.h> | ||
216 | #include <linux/init.h> | ||
217 | +#include <linux/kernel.h> | ||
218 | #include <linux/mm.h> | ||
219 | #include <linux/smp_lock.h> | ||
220 | #include <linux/irq.h> | ||
221 | @@ -72,11 +74,15 @@ physid_mask_t phys_cpu_present_map; | ||
222 | |||
223 | /* Bitmask of currently online CPUs */ | ||
224 | cpumask_t cpu_online_map; | ||
225 | +EXPORT_SYMBOL(cpu_online_map); | ||
226 | |||
227 | cpumask_t cpu_bootout_map; | ||
228 | cpumask_t cpu_bootin_map; | ||
229 | -cpumask_t cpu_callout_map; | ||
230 | static cpumask_t cpu_callin_map; | ||
231 | +cpumask_t cpu_callout_map; | ||
232 | +EXPORT_SYMBOL(cpu_callout_map); | ||
233 | +cpumask_t cpu_possible_map = CPU_MASK_ALL; | ||
234 | +EXPORT_SYMBOL(cpu_possible_map); | ||
235 | |||
236 | /* Per CPU bogomips and other parameters */ | ||
237 | struct cpuinfo_m32r cpu_data[NR_CPUS] __cacheline_aligned; | ||
238 | @@ -110,7 +116,6 @@ static unsigned int calibration_result; | ||
239 | |||
240 | void smp_prepare_boot_cpu(void); | ||
241 | void smp_prepare_cpus(unsigned int); | ||
242 | -static void smp_tune_scheduling(void); | ||
243 | static void init_ipi_lock(void); | ||
244 | static void do_boot_cpu(int); | ||
245 | int __cpu_up(unsigned int); | ||
246 | @@ -177,6 +182,9 @@ void __init smp_prepare_cpus(unsigned in | ||
247 | } | ||
248 | for (phys_id = 0 ; phys_id < nr_cpu ; phys_id++) | ||
249 | physid_set(phys_id, phys_cpu_present_map); | ||
250 | +#ifndef CONFIG_HOTPLUG_CPU | ||
251 | + cpu_present_map = cpu_possible_map; | ||
252 | +#endif | ||
253 | |||
254 | show_mp_info(nr_cpu); | ||
255 | |||
256 | @@ -186,7 +194,6 @@ void __init smp_prepare_cpus(unsigned in | ||
257 | * Setup boot CPU information | ||
258 | */ | ||
259 | smp_store_cpu_info(0); /* Final full version of the data */ | ||
260 | - smp_tune_scheduling(); | ||
261 | |||
262 | /* | ||
263 | * If SMP should be disabled, then really disable it! | ||
264 | @@ -230,11 +237,6 @@ smp_done: | ||
265 | Dprintk("Boot done.\n"); | ||
266 | } | ||
267 | |||
268 | -static void __init smp_tune_scheduling(void) | ||
269 | -{ | ||
270 | - /* Nothing to do. */ | ||
271 | -} | ||
272 | - | ||
273 | /* | ||
274 | * init_ipi_lock : Initialize IPI locks. | ||
275 | */ | ||
276 | @@ -629,4 +631,3 @@ static void __init unmap_cpu_to_physid(i | ||
277 | physid_2_cpu[phys_id] = -1; | ||
278 | cpu_2_physid[cpu_id] = -1; | ||
279 | } | ||
280 | - | ||
281 | diff --git a/arch/m32r/lib/Makefile b/arch/m32r/lib/Makefile | ||
282 | index e632d10..d16b4e4 100644 | ||
283 | --- a/arch/m32r/lib/Makefile | ||
284 | +++ b/arch/m32r/lib/Makefile | ||
285 | @@ -2,6 +2,6 @@ # | ||
286 | # Makefile for M32R-specific library files.. | ||
287 | # | ||
288 | |||
289 | -lib-y := checksum.o ashxdi3.o memset.o memcpy.o getuser.o \ | ||
290 | - putuser.o delay.o strlen.o usercopy.o csum_partial_copy.o | ||
291 | +lib-y := checksum.o ashxdi3.o memset.o memcpy.o \ | ||
292 | + delay.o strlen.o usercopy.o csum_partial_copy.o | ||
293 | |||
294 | diff --git a/arch/m32r/lib/getuser.S b/arch/m32r/lib/getuser.S | ||
295 | deleted file mode 100644 | ||
296 | index 58a0db0..0000000 | ||
297 | --- a/arch/m32r/lib/getuser.S | ||
298 | +++ /dev/null | ||
299 | @@ -1,88 +0,0 @@ | ||
300 | -/* | ||
301 | - * __get_user functions. | ||
302 | - * | ||
303 | - * (C) Copyright 2001 Hirokazu Takata | ||
304 | - * | ||
305 | - * These functions have a non-standard call interface | ||
306 | - * to make them more efficient, especially as they | ||
307 | - * return an error value in addition to the "real" | ||
308 | - * return value. | ||
309 | - */ | ||
310 | - | ||
311 | -#include <linux/config.h> | ||
312 | - | ||
313 | -/* | ||
314 | - * __get_user_X | ||
315 | - * | ||
316 | - * Inputs: r0 contains the address | ||
317 | - * | ||
318 | - * Outputs: r0 is error code (0 or -EFAULT) | ||
319 | - * r1 contains zero-extended value | ||
320 | - * | ||
321 | - * These functions should not modify any other registers, | ||
322 | - * as they get called from within inline assembly. | ||
323 | - */ | ||
324 | - | ||
325 | -#ifdef CONFIG_ISA_DUAL_ISSUE | ||
326 | - | ||
327 | - .text | ||
328 | - .balign 4 | ||
329 | - .globl __get_user_1 | ||
330 | -__get_user_1: | ||
331 | -1: ldub r1, @r0 || ldi r0, #0 | ||
332 | - jmp r14 | ||
333 | - | ||
334 | - .balign 4 | ||
335 | - .globl __get_user_2 | ||
336 | -__get_user_2: | ||
337 | -2: lduh r1, @r0 || ldi r0, #0 | ||
338 | - jmp r14 | ||
339 | - | ||
340 | - .balign 4 | ||
341 | - .globl __get_user_4 | ||
342 | -__get_user_4: | ||
343 | -3: ld r1, @r0 || ldi r0, #0 | ||
344 | - jmp r14 | ||
345 | - | ||
346 | -bad_get_user: | ||
347 | - ldi r1, #0 || ldi r0, #-14 | ||
348 | - jmp r14 | ||
349 | - | ||
350 | -#else /* not CONFIG_ISA_DUAL_ISSUE */ | ||
351 | - | ||
352 | - .text | ||
353 | - .balign 4 | ||
354 | - .globl __get_user_1 | ||
355 | -__get_user_1: | ||
356 | -1: ldub r1, @r0 | ||
357 | - ldi r0, #0 | ||
358 | - jmp r14 | ||
359 | - | ||
360 | - .balign 4 | ||
361 | - .globl __get_user_2 | ||
362 | -__get_user_2: | ||
363 | -2: lduh r1, @r0 | ||
364 | - ldi r0, #0 | ||
365 | - jmp r14 | ||
366 | - | ||
367 | - .balign 4 | ||
368 | - .globl __get_user_4 | ||
369 | -__get_user_4: | ||
370 | -3: ld r1, @r0 | ||
371 | - ldi r0, #0 | ||
372 | - jmp r14 | ||
373 | - | ||
374 | -bad_get_user: | ||
375 | - ldi r1, #0 | ||
376 | - ldi r0, #-14 | ||
377 | - jmp r14 | ||
378 | - | ||
379 | -#endif /* not CONFIG_ISA_DUAL_ISSUE */ | ||
380 | - | ||
381 | -.section __ex_table,"a" | ||
382 | - .long 1b,bad_get_user | ||
383 | - .long 2b,bad_get_user | ||
384 | - .long 3b,bad_get_user | ||
385 | -.previous | ||
386 | - | ||
387 | - .end | ||
388 | diff --git a/arch/m32r/lib/putuser.S b/arch/m32r/lib/putuser.S | ||
389 | deleted file mode 100644 | ||
390 | index 218154c..0000000 | ||
391 | --- a/arch/m32r/lib/putuser.S | ||
392 | +++ /dev/null | ||
393 | @@ -1,84 +0,0 @@ | ||
394 | -/* | ||
395 | - * __put_user functions. | ||
396 | - * | ||
397 | - * (C) Copyright 1998 Linus Torvalds | ||
398 | - * (C) Copyright 2001 Hirokazu Takata | ||
399 | - * | ||
400 | - * These functions have a non-standard call interface | ||
401 | - * to make them more efficient. | ||
402 | - */ | ||
403 | - | ||
404 | -#include <linux/config.h> | ||
405 | - | ||
406 | -/* | ||
407 | - * __put_user_X | ||
408 | - * | ||
409 | - * Inputs: r0 contains the address | ||
410 | - * r1 contains the value | ||
411 | - * | ||
412 | - * Outputs: r0 is error code (0 or -EFAULT) | ||
413 | - * r1 is corrupted (will contain "current_task"). | ||
414 | - * | ||
415 | - * These functions should not modify any other registers, | ||
416 | - * as they get called from within inline assembly. | ||
417 | - */ | ||
418 | - | ||
419 | -#ifdef CONFIG_ISA_DUAL_ISSUE | ||
420 | - | ||
421 | - .text | ||
422 | - .balign 4 | ||
423 | - .globl __put_user_1 | ||
424 | -__put_user_1: | ||
425 | -1: stb r1, @r0 || ldi r0, #0 | ||
426 | - jmp r14 | ||
427 | - | ||
428 | - .balign 4 | ||
429 | - .globl __put_user_2 | ||
430 | -__put_user_2: | ||
431 | -2: sth r1, @r0 || ldi r0, #0 | ||
432 | - jmp r14 | ||
433 | - | ||
434 | - .balign 4 | ||
435 | - .globl __put_user_4 | ||
436 | -__put_user_4: | ||
437 | -3: st r1, @r0 || ldi r0, #0 | ||
438 | - jmp r14 | ||
439 | - | ||
440 | -bad_put_user: | ||
441 | - ldi r0, #-14 || jmp r14 | ||
442 | - | ||
443 | -#else /* not CONFIG_ISA_DUAL_ISSUE */ | ||
444 | - | ||
445 | - .text | ||
446 | - .balign 4 | ||
447 | - .globl __put_user_1 | ||
448 | -__put_user_1: | ||
449 | -1: stb r1, @r0 | ||
450 | - ldi r0, #0 | ||
451 | - jmp r14 | ||
452 | - | ||
453 | - .balign 4 | ||
454 | - .globl __put_user_2 | ||
455 | -__put_user_2: | ||
456 | -2: sth r1, @r0 | ||
457 | - ldi r0, #0 | ||
458 | - jmp r14 | ||
459 | - | ||
460 | - .balign 4 | ||
461 | - .globl __put_user_4 | ||
462 | -__put_user_4: | ||
463 | -3: st r1, @r0 | ||
464 | - ldi r0, #0 | ||
465 | - jmp r14 | ||
466 | - | ||
467 | -bad_put_user: | ||
468 | - ldi r0, #-14 | ||
469 | - jmp r14 | ||
470 | - | ||
471 | -#endif /* not CONFIG_ISA_DUAL_ISSUE */ | ||
472 | - | ||
473 | -.section __ex_table,"a" | ||
474 | - .long 1b,bad_put_user | ||
475 | - .long 2b,bad_put_user | ||
476 | - .long 3b,bad_put_user | ||
477 | -.previous | ||
478 | diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c | ||
479 | index ba92bab..4c4449b 100644 | ||
480 | --- a/arch/powerpc/kernel/pci_64.c | ||
481 | +++ b/arch/powerpc/kernel/pci_64.c | ||
482 | @@ -78,6 +78,7 @@ int global_phb_number; /* Global phb co | ||
483 | |||
484 | /* Cached ISA bridge dev. */ | ||
485 | struct pci_dev *ppc64_isabridge_dev = NULL; | ||
486 | +EXPORT_SYMBOL_GPL(ppc64_isabridge_dev); | ||
487 | |||
488 | static void fixup_broken_pcnet32(struct pci_dev* dev) | ||
489 | { | ||
490 | diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c | ||
491 | index f96c49b..abd758f 100644 | ||
492 | --- a/arch/powerpc/kernel/setup_64.c | ||
493 | +++ b/arch/powerpc/kernel/setup_64.c | ||
494 | @@ -256,12 +256,10 @@ #endif | ||
495 | /* | ||
496 | * Initialize stab / SLB management except on iSeries | ||
497 | */ | ||
498 | - if (!firmware_has_feature(FW_FEATURE_ISERIES)) { | ||
499 | - if (cpu_has_feature(CPU_FTR_SLB)) | ||
500 | - slb_initialize(); | ||
501 | - else | ||
502 | - stab_initialize(lpaca->stab_real); | ||
503 | - } | ||
504 | + if (cpu_has_feature(CPU_FTR_SLB)) | ||
505 | + slb_initialize(); | ||
506 | + else if (!firmware_has_feature(FW_FEATURE_ISERIES)) | ||
507 | + stab_initialize(lpaca->stab_real); | ||
508 | |||
509 | DBG(" <- early_setup()\n"); | ||
510 | } | ||
511 | diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c | ||
512 | index 4324f8a..096dfdc 100644 | ||
513 | --- a/arch/powerpc/kernel/signal_64.c | ||
514 | +++ b/arch/powerpc/kernel/signal_64.c | ||
515 | @@ -213,7 +213,7 @@ static inline void __user * get_sigframe | ||
516 | /* Default to using normal stack */ | ||
517 | newsp = regs->gpr[1]; | ||
518 | |||
519 | - if (ka->sa.sa_flags & SA_ONSTACK) { | ||
520 | + if ((ka->sa.sa_flags & SA_ONSTACK) && current->sas_ss_size) { | ||
521 | if (! on_sig_stack(regs->gpr[1])) | ||
522 | newsp = (current->sas_ss_sp + current->sas_ss_size); | ||
523 | } | ||
524 | diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S | ||
525 | index 7c10e90..ab6e44d 100644 | ||
526 | --- a/arch/x86_64/kernel/entry.S | ||
527 | +++ b/arch/x86_64/kernel/entry.S | ||
528 | @@ -180,6 +180,10 @@ rff_trace: | ||
529 | * | ||
530 | * XXX if we had a free scratch register we could save the RSP into the stack frame | ||
531 | * and report it properly in ps. Unfortunately we haven't. | ||
532 | + * | ||
533 | + * When user can change the frames always force IRET. That is because | ||
534 | + * it deals with uncanonical addresses better. SYSRET has trouble | ||
535 | + * with them due to bugs in both AMD and Intel CPUs. | ||
536 | */ | ||
537 | |||
538 | ENTRY(system_call) | ||
539 | @@ -254,7 +258,10 @@ sysret_signal: | ||
540 | xorl %esi,%esi # oldset -> arg2 | ||
541 | call ptregscall_common | ||
542 | 1: movl $_TIF_NEED_RESCHED,%edi | ||
543 | - jmp sysret_check | ||
544 | + /* Use IRET because user could have changed frame. This | ||
545 | + works because ptregscall_common has called FIXUP_TOP_OF_STACK. */ | ||
546 | + cli | ||
547 | + jmp int_with_check | ||
548 | |||
549 | badsys: | ||
550 | movq $-ENOSYS,RAX-ARGOFFSET(%rsp) | ||
551 | @@ -280,7 +287,8 @@ tracesys: | ||
552 | call syscall_trace_leave | ||
553 | RESTORE_TOP_OF_STACK %rbx | ||
554 | RESTORE_REST | ||
555 | - jmp ret_from_sys_call | ||
556 | + /* Use IRET because user could have changed frame */ | ||
557 | + jmp int_ret_from_sys_call | ||
558 | CFI_ENDPROC | ||
559 | |||
560 | /* | ||
561 | @@ -408,25 +416,9 @@ ENTRY(stub_execve) | ||
562 | CFI_ADJUST_CFA_OFFSET -8 | ||
563 | CFI_REGISTER rip, r11 | ||
564 | SAVE_REST | ||
565 | - movq %r11, %r15 | ||
566 | - CFI_REGISTER rip, r15 | ||
567 | FIXUP_TOP_OF_STACK %r11 | ||
568 | call sys_execve | ||
569 | - GET_THREAD_INFO(%rcx) | ||
570 | - bt $TIF_IA32,threadinfo_flags(%rcx) | ||
571 | - CFI_REMEMBER_STATE | ||
572 | - jc exec_32bit | ||
573 | RESTORE_TOP_OF_STACK %r11 | ||
574 | - movq %r15, %r11 | ||
575 | - CFI_REGISTER rip, r11 | ||
576 | - RESTORE_REST | ||
577 | - pushq %r11 | ||
578 | - CFI_ADJUST_CFA_OFFSET 8 | ||
579 | - CFI_REL_OFFSET rip, 0 | ||
580 | - ret | ||
581 | - | ||
582 | -exec_32bit: | ||
583 | - CFI_RESTORE_STATE | ||
584 | movq %rax,RAX(%rsp) | ||
585 | RESTORE_REST | ||
586 | jmp int_ret_from_sys_call | ||
587 | diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c | ||
588 | index 22a05de..818ab9e 100644 | ||
589 | --- a/arch/x86_64/kernel/process.c | ||
590 | +++ b/arch/x86_64/kernel/process.c | ||
591 | @@ -527,8 +527,6 @@ __switch_to(struct task_struct *prev_p, | ||
592 | int cpu = smp_processor_id(); | ||
593 | struct tss_struct *tss = &per_cpu(init_tss, cpu); | ||
594 | |||
595 | - unlazy_fpu(prev_p); | ||
596 | - | ||
597 | /* | ||
598 | * Reload esp0, LDT and the page table pointer: | ||
599 | */ | ||
600 | @@ -591,6 +589,12 @@ __switch_to(struct task_struct *prev_p, | ||
601 | prev->userrsp = read_pda(oldrsp); | ||
602 | write_pda(oldrsp, next->userrsp); | ||
603 | write_pda(pcurrent, next_p); | ||
604 | + | ||
605 | + /* This must be here to ensure both math_state_restore() and | ||
606 | + kernel_fpu_begin() work consistently. | ||
607 | + And the AMD workaround requires it to be after DS reload. */ | ||
608 | + unlazy_fpu(prev_p); | ||
609 | + | ||
610 | write_pda(kernelstack, | ||
611 | task_stack_page(next_p) + THREAD_SIZE - PDA_STACKOFFSET); | ||
612 | |||
613 | diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c | ||
614 | index aa55e3c..a4a0bb5 100644 | ||
615 | --- a/arch/x86_64/kernel/setup.c | ||
616 | +++ b/arch/x86_64/kernel/setup.c | ||
617 | @@ -909,6 +909,10 @@ #endif | ||
618 | if (c->x86 == 15 && ((level >= 0x0f48 && level < 0x0f50) || level >= 0x0f58)) | ||
619 | set_bit(X86_FEATURE_REP_GOOD, &c->x86_capability); | ||
620 | |||
621 | + /* Enable workaround for FXSAVE leak */ | ||
622 | + if (c->x86 >= 6) | ||
623 | + set_bit(X86_FEATURE_FXSAVE_LEAK, &c->x86_capability); | ||
624 | + | ||
625 | r = get_model_name(c); | ||
626 | if (!r) { | ||
627 | switch (c->x86) { | ||
628 | diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c | ||
629 | index 07a7f97..29f3d75 100644 | ||
630 | --- a/drivers/base/cpu.c | ||
631 | +++ b/drivers/base/cpu.c | ||
632 | @@ -141,7 +141,7 @@ #endif | ||
633 | return error; | ||
634 | } | ||
635 | |||
636 | -struct sys_device *get_cpu_sysdev(int cpu) | ||
637 | +struct sys_device *get_cpu_sysdev(unsigned cpu) | ||
638 | { | ||
639 | if (cpu < NR_CPUS) | ||
640 | return cpu_sys_devices[cpu]; | ||
641 | diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c | ||
642 | index e97e911..4723182 100644 | ||
643 | --- a/drivers/base/firmware_class.c | ||
644 | +++ b/drivers/base/firmware_class.c | ||
645 | @@ -211,18 +211,20 @@ static int | ||
646 | fw_realloc_buffer(struct firmware_priv *fw_priv, int min_size) | ||
647 | { | ||
648 | u8 *new_data; | ||
649 | + int new_size = fw_priv->alloc_size; | ||
650 | |||
651 | if (min_size <= fw_priv->alloc_size) | ||
652 | return 0; | ||
653 | |||
654 | - new_data = vmalloc(fw_priv->alloc_size + PAGE_SIZE); | ||
655 | + new_size = ALIGN(min_size, PAGE_SIZE); | ||
656 | + new_data = vmalloc(new_size); | ||
657 | if (!new_data) { | ||
658 | printk(KERN_ERR "%s: unable to alloc buffer\n", __FUNCTION__); | ||
659 | /* Make sure that we don't keep incomplete data */ | ||
660 | fw_load_abort(fw_priv); | ||
661 | return -ENOMEM; | ||
662 | } | ||
663 | - fw_priv->alloc_size += PAGE_SIZE; | ||
664 | + fw_priv->alloc_size = new_size; | ||
665 | if (fw_priv->fw->data) { | ||
666 | memcpy(new_data, fw_priv->fw->data, fw_priv->fw->size); | ||
667 | vfree(fw_priv->fw->data); | ||
668 | diff --git a/drivers/base/node.c b/drivers/base/node.c | ||
669 | index 16c513a..c80c3ae 100644 | ||
670 | --- a/drivers/base/node.c | ||
671 | +++ b/drivers/base/node.c | ||
672 | @@ -106,7 +106,7 @@ static ssize_t node_read_numastat(struct | ||
673 | other_node = 0; | ||
674 | for (i = 0; i < MAX_NR_ZONES; i++) { | ||
675 | struct zone *z = &pg->node_zones[i]; | ||
676 | - for (cpu = 0; cpu < NR_CPUS; cpu++) { | ||
677 | + for_each_online_cpu(cpu) { | ||
678 | struct per_cpu_pageset *ps = zone_pcp(z,cpu); | ||
679 | numa_hit += ps->numa_hit; | ||
680 | numa_miss += ps->numa_miss; | ||
681 | diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c | ||
682 | index 0d65394..71552e1 100644 | ||
683 | --- a/drivers/block/cciss.c | ||
684 | +++ b/drivers/block/cciss.c | ||
685 | @@ -1181,6 +1181,53 @@ static int revalidate_allvol(ctlr_info_t | ||
686 | return 0; | ||
687 | } | ||
688 | |||
689 | +static inline void complete_buffers(struct bio *bio, int status) | ||
690 | +{ | ||
691 | + while (bio) { | ||
692 | + struct bio *xbh = bio->bi_next; | ||
693 | + int nr_sectors = bio_sectors(bio); | ||
694 | + | ||
695 | + bio->bi_next = NULL; | ||
696 | + blk_finished_io(len); | ||
697 | + bio_endio(bio, nr_sectors << 9, status ? 0 : -EIO); | ||
698 | + bio = xbh; | ||
699 | + } | ||
700 | + | ||
701 | +} | ||
702 | + | ||
703 | +static void cciss_softirq_done(struct request *rq) | ||
704 | +{ | ||
705 | + CommandList_struct *cmd = rq->completion_data; | ||
706 | + ctlr_info_t *h = hba[cmd->ctlr]; | ||
707 | + unsigned long flags; | ||
708 | + u64bit temp64; | ||
709 | + int i, ddir; | ||
710 | + | ||
711 | + if (cmd->Request.Type.Direction == XFER_READ) | ||
712 | + ddir = PCI_DMA_FROMDEVICE; | ||
713 | + else | ||
714 | + ddir = PCI_DMA_TODEVICE; | ||
715 | + | ||
716 | + /* command did not need to be retried */ | ||
717 | + /* unmap the DMA mapping for all the scatter gather elements */ | ||
718 | + for(i=0; i<cmd->Header.SGList; i++) { | ||
719 | + temp64.val32.lower = cmd->SG[i].Addr.lower; | ||
720 | + temp64.val32.upper = cmd->SG[i].Addr.upper; | ||
721 | + pci_unmap_page(h->pdev, temp64.val, cmd->SG[i].Len, ddir); | ||
722 | + } | ||
723 | + | ||
724 | + complete_buffers(rq->bio, rq->errors); | ||
725 | + | ||
726 | +#ifdef CCISS_DEBUG | ||
727 | + printk("Done with %p\n", rq); | ||
728 | +#endif /* CCISS_DEBUG */ | ||
729 | + | ||
730 | + spin_lock_irqsave(&h->lock, flags); | ||
731 | + end_that_request_last(rq, rq->errors); | ||
732 | + cmd_free(h, cmd,1); | ||
733 | + spin_unlock_irqrestore(&h->lock, flags); | ||
734 | +} | ||
735 | + | ||
736 | /* This function will check the usage_count of the drive to be updated/added. | ||
737 | * If the usage_count is zero then the drive information will be updated and | ||
738 | * the disk will be re-registered with the kernel. If not then it will be | ||
739 | @@ -1249,6 +1296,8 @@ static void cciss_update_drive_info(int | ||
740 | |||
741 | blk_queue_max_sectors(disk->queue, 512); | ||
742 | |||
743 | + blk_queue_softirq_done(disk->queue, cciss_softirq_done); | ||
744 | + | ||
745 | disk->queue->queuedata = hba[ctlr]; | ||
746 | |||
747 | blk_queue_hardsect_size(disk->queue, | ||
748 | @@ -2148,20 +2197,6 @@ static void start_io( ctlr_info_t *h) | ||
749 | addQ (&(h->cmpQ), c); | ||
750 | } | ||
751 | } | ||
752 | - | ||
753 | -static inline void complete_buffers(struct bio *bio, int status) | ||
754 | -{ | ||
755 | - while (bio) { | ||
756 | - struct bio *xbh = bio->bi_next; | ||
757 | - int nr_sectors = bio_sectors(bio); | ||
758 | - | ||
759 | - bio->bi_next = NULL; | ||
760 | - blk_finished_io(len); | ||
761 | - bio_endio(bio, nr_sectors << 9, status ? 0 : -EIO); | ||
762 | - bio = xbh; | ||
763 | - } | ||
764 | - | ||
765 | -} | ||
766 | /* Assumes that CCISS_LOCK(h->ctlr) is held. */ | ||
767 | /* Zeros out the error record and then resends the command back */ | ||
768 | /* to the controller */ | ||
769 | @@ -2179,39 +2214,6 @@ static inline void resend_cciss_cmd( ctl | ||
770 | start_io(h); | ||
771 | } | ||
772 | |||
773 | -static void cciss_softirq_done(struct request *rq) | ||
774 | -{ | ||
775 | - CommandList_struct *cmd = rq->completion_data; | ||
776 | - ctlr_info_t *h = hba[cmd->ctlr]; | ||
777 | - unsigned long flags; | ||
778 | - u64bit temp64; | ||
779 | - int i, ddir; | ||
780 | - | ||
781 | - if (cmd->Request.Type.Direction == XFER_READ) | ||
782 | - ddir = PCI_DMA_FROMDEVICE; | ||
783 | - else | ||
784 | - ddir = PCI_DMA_TODEVICE; | ||
785 | - | ||
786 | - /* command did not need to be retried */ | ||
787 | - /* unmap the DMA mapping for all the scatter gather elements */ | ||
788 | - for(i=0; i<cmd->Header.SGList; i++) { | ||
789 | - temp64.val32.lower = cmd->SG[i].Addr.lower; | ||
790 | - temp64.val32.upper = cmd->SG[i].Addr.upper; | ||
791 | - pci_unmap_page(h->pdev, temp64.val, cmd->SG[i].Len, ddir); | ||
792 | - } | ||
793 | - | ||
794 | - complete_buffers(rq->bio, rq->errors); | ||
795 | - | ||
796 | -#ifdef CCISS_DEBUG | ||
797 | - printk("Done with %p\n", rq); | ||
798 | -#endif /* CCISS_DEBUG */ | ||
799 | - | ||
800 | - spin_lock_irqsave(&h->lock, flags); | ||
801 | - end_that_request_last(rq, rq->errors); | ||
802 | - cmd_free(h, cmd,1); | ||
803 | - spin_unlock_irqrestore(&h->lock, flags); | ||
804 | -} | ||
805 | - | ||
806 | /* checks the status of the job and calls complete buffers to mark all | ||
807 | * buffers for the completed job. Note that this function does not need | ||
808 | * to hold the hba/queue lock. | ||
809 | @@ -3269,8 +3271,8 @@ clean2: | ||
810 | unregister_blkdev(hba[i]->major, hba[i]->devname); | ||
811 | clean1: | ||
812 | release_io_mem(hba[i]); | ||
813 | - free_hba(i); | ||
814 | hba[i]->busy_initializing = 0; | ||
815 | + free_hba(i); | ||
816 | return(-1); | ||
817 | } | ||
818 | |||
819 | diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig | ||
820 | index 05ba410..8b72a61 100644 | ||
821 | --- a/drivers/char/Kconfig | ||
822 | +++ b/drivers/char/Kconfig | ||
823 | @@ -187,6 +187,7 @@ config MOXA_SMARTIO | ||
824 | config ISI | ||
825 | tristate "Multi-Tech multiport card support (EXPERIMENTAL)" | ||
826 | depends on SERIAL_NONSTANDARD | ||
827 | + select FW_LOADER | ||
828 | help | ||
829 | This is a driver for the Multi-Tech cards which provide several | ||
830 | serial ports. The driver is experimental and can currently only be | ||
831 | diff --git a/drivers/char/agp/efficeon-agp.c b/drivers/char/agp/efficeon-agp.c | ||
832 | index e7aea77..40dfc29 100644 | ||
833 | --- a/drivers/char/agp/efficeon-agp.c | ||
834 | +++ b/drivers/char/agp/efficeon-agp.c | ||
835 | @@ -64,6 +64,12 @@ static struct gatt_mask efficeon_generic | ||
836 | {.mask = 0x00000001, .type = 0} | ||
837 | }; | ||
838 | |||
839 | +/* This function does the same thing as mask_memory() for this chipset... */ | ||
840 | +static inline unsigned long efficeon_mask_memory(unsigned long addr) | ||
841 | +{ | ||
842 | + return addr | 0x00000001; | ||
843 | +} | ||
844 | + | ||
845 | static struct aper_size_info_lvl2 efficeon_generic_sizes[4] = | ||
846 | { | ||
847 | {256, 65536, 0}, | ||
848 | @@ -251,7 +257,7 @@ static int efficeon_insert_memory(struct | ||
849 | last_page = NULL; | ||
850 | for (i = 0; i < count; i++) { | ||
851 | int index = pg_start + i; | ||
852 | - unsigned long insert = mem->memory[i]; | ||
853 | + unsigned long insert = efficeon_mask_memory(mem->memory[i]); | ||
854 | |||
855 | page = (unsigned int *) efficeon_private.l1_table[index >> 10]; | ||
856 | |||
857 | diff --git a/drivers/char/ipmi/ipmi_bt_sm.c b/drivers/char/ipmi/ipmi_bt_sm.c | ||
858 | index 58dcdee..0030cd8 100644 | ||
859 | --- a/drivers/char/ipmi/ipmi_bt_sm.c | ||
860 | +++ b/drivers/char/ipmi/ipmi_bt_sm.c | ||
861 | @@ -165,7 +165,7 @@ static int bt_start_transaction(struct s | ||
862 | { | ||
863 | unsigned int i; | ||
864 | |||
865 | - if ((size < 2) || (size > IPMI_MAX_MSG_LENGTH)) | ||
866 | + if ((size < 2) || (size > (IPMI_MAX_MSG_LENGTH - 2))) | ||
867 | return -1; | ||
868 | |||
869 | if ((bt->state != BT_STATE_IDLE) && (bt->state != BT_STATE_HOSED)) | ||
870 | diff --git a/drivers/char/tlclk.c b/drivers/char/tlclk.c | ||
871 | index 4c27218..f58ad7f 100644 | ||
872 | --- a/drivers/char/tlclk.c | ||
873 | +++ b/drivers/char/tlclk.c | ||
874 | @@ -327,7 +327,7 @@ static ssize_t store_received_ref_clk3a( | ||
875 | return strnlen(buf, count); | ||
876 | } | ||
877 | |||
878 | -static DEVICE_ATTR(received_ref_clk3a, S_IWUGO, NULL, | ||
879 | +static DEVICE_ATTR(received_ref_clk3a, (S_IWUSR|S_IWGRP), NULL, | ||
880 | store_received_ref_clk3a); | ||
881 | |||
882 | |||
883 | @@ -349,7 +349,7 @@ static ssize_t store_received_ref_clk3b( | ||
884 | return strnlen(buf, count); | ||
885 | } | ||
886 | |||
887 | -static DEVICE_ATTR(received_ref_clk3b, S_IWUGO, NULL, | ||
888 | +static DEVICE_ATTR(received_ref_clk3b, (S_IWUSR|S_IWGRP), NULL, | ||
889 | store_received_ref_clk3b); | ||
890 | |||
891 | |||
892 | @@ -371,7 +371,7 @@ static ssize_t store_enable_clk3b_output | ||
893 | return strnlen(buf, count); | ||
894 | } | ||
895 | |||
896 | -static DEVICE_ATTR(enable_clk3b_output, S_IWUGO, NULL, | ||
897 | +static DEVICE_ATTR(enable_clk3b_output, (S_IWUSR|S_IWGRP), NULL, | ||
898 | store_enable_clk3b_output); | ||
899 | |||
900 | static ssize_t store_enable_clk3a_output(struct device *d, | ||
901 | @@ -392,7 +392,7 @@ static ssize_t store_enable_clk3a_output | ||
902 | return strnlen(buf, count); | ||
903 | } | ||
904 | |||
905 | -static DEVICE_ATTR(enable_clk3a_output, S_IWUGO, NULL, | ||
906 | +static DEVICE_ATTR(enable_clk3a_output, (S_IWUSR|S_IWGRP), NULL, | ||
907 | store_enable_clk3a_output); | ||
908 | |||
909 | static ssize_t store_enable_clkb1_output(struct device *d, | ||
910 | @@ -413,7 +413,7 @@ static ssize_t store_enable_clkb1_output | ||
911 | return strnlen(buf, count); | ||
912 | } | ||
913 | |||
914 | -static DEVICE_ATTR(enable_clkb1_output, S_IWUGO, NULL, | ||
915 | +static DEVICE_ATTR(enable_clkb1_output, (S_IWUSR|S_IWGRP), NULL, | ||
916 | store_enable_clkb1_output); | ||
917 | |||
918 | |||
919 | @@ -435,7 +435,7 @@ static ssize_t store_enable_clka1_output | ||
920 | return strnlen(buf, count); | ||
921 | } | ||
922 | |||
923 | -static DEVICE_ATTR(enable_clka1_output, S_IWUGO, NULL, | ||
924 | +static DEVICE_ATTR(enable_clka1_output, (S_IWUSR|S_IWGRP), NULL, | ||
925 | store_enable_clka1_output); | ||
926 | |||
927 | static ssize_t store_enable_clkb0_output(struct device *d, | ||
928 | @@ -456,7 +456,7 @@ static ssize_t store_enable_clkb0_output | ||
929 | return strnlen(buf, count); | ||
930 | } | ||
931 | |||
932 | -static DEVICE_ATTR(enable_clkb0_output, S_IWUGO, NULL, | ||
933 | +static DEVICE_ATTR(enable_clkb0_output, (S_IWUSR|S_IWGRP), NULL, | ||
934 | store_enable_clkb0_output); | ||
935 | |||
936 | static ssize_t store_enable_clka0_output(struct device *d, | ||
937 | @@ -477,7 +477,7 @@ static ssize_t store_enable_clka0_output | ||
938 | return strnlen(buf, count); | ||
939 | } | ||
940 | |||
941 | -static DEVICE_ATTR(enable_clka0_output, S_IWUGO, NULL, | ||
942 | +static DEVICE_ATTR(enable_clka0_output, (S_IWUSR|S_IWGRP), NULL, | ||
943 | store_enable_clka0_output); | ||
944 | |||
945 | static ssize_t store_select_amcb2_transmit_clock(struct device *d, | ||
946 | @@ -519,7 +519,7 @@ static ssize_t store_select_amcb2_transm | ||
947 | return strnlen(buf, count); | ||
948 | } | ||
949 | |||
950 | -static DEVICE_ATTR(select_amcb2_transmit_clock, S_IWUGO, NULL, | ||
951 | +static DEVICE_ATTR(select_amcb2_transmit_clock, (S_IWUSR|S_IWGRP), NULL, | ||
952 | store_select_amcb2_transmit_clock); | ||
953 | |||
954 | static ssize_t store_select_amcb1_transmit_clock(struct device *d, | ||
955 | @@ -560,7 +560,7 @@ static ssize_t store_select_amcb1_transm | ||
956 | return strnlen(buf, count); | ||
957 | } | ||
958 | |||
959 | -static DEVICE_ATTR(select_amcb1_transmit_clock, S_IWUGO, NULL, | ||
960 | +static DEVICE_ATTR(select_amcb1_transmit_clock, (S_IWUSR|S_IWGRP), NULL, | ||
961 | store_select_amcb1_transmit_clock); | ||
962 | |||
963 | static ssize_t store_select_redundant_clock(struct device *d, | ||
964 | @@ -581,7 +581,7 @@ static ssize_t store_select_redundant_cl | ||
965 | return strnlen(buf, count); | ||
966 | } | ||
967 | |||
968 | -static DEVICE_ATTR(select_redundant_clock, S_IWUGO, NULL, | ||
969 | +static DEVICE_ATTR(select_redundant_clock, (S_IWUSR|S_IWGRP), NULL, | ||
970 | store_select_redundant_clock); | ||
971 | |||
972 | static ssize_t store_select_ref_frequency(struct device *d, | ||
973 | @@ -602,7 +602,7 @@ static ssize_t store_select_ref_frequenc | ||
974 | return strnlen(buf, count); | ||
975 | } | ||
976 | |||
977 | -static DEVICE_ATTR(select_ref_frequency, S_IWUGO, NULL, | ||
978 | +static DEVICE_ATTR(select_ref_frequency, (S_IWUSR|S_IWGRP), NULL, | ||
979 | store_select_ref_frequency); | ||
980 | |||
981 | static ssize_t store_filter_select(struct device *d, | ||
982 | @@ -623,7 +623,7 @@ static ssize_t store_filter_select(struc | ||
983 | return strnlen(buf, count); | ||
984 | } | ||
985 | |||
986 | -static DEVICE_ATTR(filter_select, S_IWUGO, NULL, store_filter_select); | ||
987 | +static DEVICE_ATTR(filter_select, (S_IWUSR|S_IWGRP), NULL, store_filter_select); | ||
988 | |||
989 | static ssize_t store_hardware_switching_mode(struct device *d, | ||
990 | struct device_attribute *attr, const char *buf, size_t count) | ||
991 | @@ -643,7 +643,7 @@ static ssize_t store_hardware_switching_ | ||
992 | return strnlen(buf, count); | ||
993 | } | ||
994 | |||
995 | -static DEVICE_ATTR(hardware_switching_mode, S_IWUGO, NULL, | ||
996 | +static DEVICE_ATTR(hardware_switching_mode, (S_IWUSR|S_IWGRP), NULL, | ||
997 | store_hardware_switching_mode); | ||
998 | |||
999 | static ssize_t store_hardware_switching(struct device *d, | ||
1000 | @@ -664,7 +664,7 @@ static ssize_t store_hardware_switching( | ||
1001 | return strnlen(buf, count); | ||
1002 | } | ||
1003 | |||
1004 | -static DEVICE_ATTR(hardware_switching, S_IWUGO, NULL, | ||
1005 | +static DEVICE_ATTR(hardware_switching, (S_IWUSR|S_IWGRP), NULL, | ||
1006 | store_hardware_switching); | ||
1007 | |||
1008 | static ssize_t store_refalign (struct device *d, | ||
1009 | @@ -684,7 +684,7 @@ static ssize_t store_refalign (struct de | ||
1010 | return strnlen(buf, count); | ||
1011 | } | ||
1012 | |||
1013 | -static DEVICE_ATTR(refalign, S_IWUGO, NULL, store_refalign); | ||
1014 | +static DEVICE_ATTR(refalign, (S_IWUSR|S_IWGRP), NULL, store_refalign); | ||
1015 | |||
1016 | static ssize_t store_mode_select (struct device *d, | ||
1017 | struct device_attribute *attr, const char *buf, size_t count) | ||
1018 | @@ -704,7 +704,7 @@ static ssize_t store_mode_select (struct | ||
1019 | return strnlen(buf, count); | ||
1020 | } | ||
1021 | |||
1022 | -static DEVICE_ATTR(mode_select, S_IWUGO, NULL, store_mode_select); | ||
1023 | +static DEVICE_ATTR(mode_select, (S_IWUSR|S_IWGRP), NULL, store_mode_select); | ||
1024 | |||
1025 | static ssize_t store_reset (struct device *d, | ||
1026 | struct device_attribute *attr, const char *buf, size_t count) | ||
1027 | @@ -724,7 +724,7 @@ static ssize_t store_reset (struct devic | ||
1028 | return strnlen(buf, count); | ||
1029 | } | ||
1030 | |||
1031 | -static DEVICE_ATTR(reset, S_IWUGO, NULL, store_reset); | ||
1032 | +static DEVICE_ATTR(reset, (S_IWUSR|S_IWGRP), NULL, store_reset); | ||
1033 | |||
1034 | static struct attribute *tlclk_sysfs_entries[] = { | ||
1035 | &dev_attr_current_ref.attr, | ||
1036 | @@ -767,6 +767,7 @@ static int __init tlclk_init(void) | ||
1037 | printk(KERN_ERR "tlclk: can't get major %d.\n", tlclk_major); | ||
1038 | return ret; | ||
1039 | } | ||
1040 | + tlclk_major = ret; | ||
1041 | alarm_events = kzalloc( sizeof(struct tlclk_alarms), GFP_KERNEL); | ||
1042 | if (!alarm_events) | ||
1043 | goto out1; | ||
1044 | diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c | ||
1045 | index 53d3d06..edaee70 100644 | ||
1046 | --- a/drivers/char/tty_io.c | ||
1047 | +++ b/drivers/char/tty_io.c | ||
1048 | @@ -2706,7 +2706,11 @@ #else | ||
1049 | } | ||
1050 | task_lock(p); | ||
1051 | if (p->files) { | ||
1052 | - rcu_read_lock(); | ||
1053 | + /* | ||
1054 | + * We don't take a ref to the file, so we must | ||
1055 | + * hold ->file_lock instead. | ||
1056 | + */ | ||
1057 | + spin_lock(&p->files->file_lock); | ||
1058 | fdt = files_fdtable(p->files); | ||
1059 | for (i=0; i < fdt->max_fds; i++) { | ||
1060 | filp = fcheck_files(p->files, i); | ||
1061 | @@ -2721,7 +2725,7 @@ #else | ||
1062 | break; | ||
1063 | } | ||
1064 | } | ||
1065 | - rcu_read_unlock(); | ||
1066 | + spin_unlock(&p->files->file_lock); | ||
1067 | } | ||
1068 | task_unlock(p); | ||
1069 | } while_each_task_pid(session, PIDTYPE_SID, p); | ||
1070 | diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig | ||
1071 | index 52f3eb4..7ecdb1e 100644 | ||
1072 | --- a/drivers/edac/Kconfig | ||
1073 | +++ b/drivers/edac/Kconfig | ||
1074 | @@ -71,7 +71,7 @@ config EDAC_E7XXX | ||
1075 | |||
1076 | config EDAC_E752X | ||
1077 | tristate "Intel e752x (e7520, e7525, e7320)" | ||
1078 | - depends on EDAC_MM_EDAC && PCI | ||
1079 | + depends on EDAC_MM_EDAC && PCI && HOTPLUG | ||
1080 | help | ||
1081 | Support for error detection and correction on the Intel | ||
1082 | E7520, E7525, E7320 server chipsets. | ||
1083 | diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c | ||
1084 | index 8e0f315..dfca749 100644 | ||
1085 | --- a/drivers/i2c/busses/i2c-i801.c | ||
1086 | +++ b/drivers/i2c/busses/i2c-i801.c | ||
1087 | @@ -478,6 +478,11 @@ static s32 i801_access(struct i2c_adapte | ||
1088 | ret = i801_transaction(); | ||
1089 | } | ||
1090 | |||
1091 | + /* Some BIOSes don't like it when PEC is enabled at reboot or resume | ||
1092 | + time, so we forcibly disable it after every transaction. */ | ||
1093 | + if (hwpec) | ||
1094 | + outb_p(0, SMBAUXCTL); | ||
1095 | + | ||
1096 | if(block) | ||
1097 | return ret; | ||
1098 | if(ret) | ||
1099 | diff --git a/drivers/i2c/chips/m41t00.c b/drivers/i2c/chips/m41t00.c | ||
1100 | index 2dc3d48..2836fb3 100644 | ||
1101 | --- a/drivers/i2c/chips/m41t00.c | ||
1102 | +++ b/drivers/i2c/chips/m41t00.c | ||
1103 | @@ -129,13 +129,13 @@ m41t00_set_tlet(ulong arg) | ||
1104 | if ((i2c_smbus_write_byte_data(save_client, 0, tm.tm_sec & 0x7f) < 0) | ||
1105 | || (i2c_smbus_write_byte_data(save_client, 1, tm.tm_min & 0x7f) | ||
1106 | < 0) | ||
1107 | - || (i2c_smbus_write_byte_data(save_client, 2, tm.tm_hour & 0x7f) | ||
1108 | + || (i2c_smbus_write_byte_data(save_client, 2, tm.tm_hour & 0x3f) | ||
1109 | < 0) | ||
1110 | - || (i2c_smbus_write_byte_data(save_client, 4, tm.tm_mday & 0x7f) | ||
1111 | + || (i2c_smbus_write_byte_data(save_client, 4, tm.tm_mday & 0x3f) | ||
1112 | < 0) | ||
1113 | - || (i2c_smbus_write_byte_data(save_client, 5, tm.tm_mon & 0x7f) | ||
1114 | + || (i2c_smbus_write_byte_data(save_client, 5, tm.tm_mon & 0x1f) | ||
1115 | < 0) | ||
1116 | - || (i2c_smbus_write_byte_data(save_client, 6, tm.tm_year & 0x7f) | ||
1117 | + || (i2c_smbus_write_byte_data(save_client, 6, tm.tm_year & 0xff) | ||
1118 | < 0)) | ||
1119 | |||
1120 | dev_warn(&save_client->dev,"m41t00: can't write to rtc chip\n"); | ||
1121 | diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c | ||
1122 | index cf84350..8b24b4f 100644 | ||
1123 | --- a/drivers/ide/pci/alim15x3.c | ||
1124 | +++ b/drivers/ide/pci/alim15x3.c | ||
1125 | @@ -731,6 +731,8 @@ static unsigned int __devinit ata66_ali1 | ||
1126 | |||
1127 | if(m5229_revision <= 0x20) | ||
1128 | tmpbyte = (tmpbyte & (~0x02)) | 0x01; | ||
1129 | + else if (m5229_revision == 0xc7) | ||
1130 | + tmpbyte |= 0x03; | ||
1131 | else | ||
1132 | tmpbyte |= 0x01; | ||
1133 | |||
1134 | diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c | ||
1135 | index eca92eb..d83248e 100644 | ||
1136 | --- a/drivers/ieee1394/sbp2.c | ||
1137 | +++ b/drivers/ieee1394/sbp2.c | ||
1138 | @@ -495,22 +495,17 @@ static struct sbp2_command_info *sbp2uti | ||
1139 | /* | ||
1140 | * This function finds the sbp2_command for a given outstanding SCpnt. | ||
1141 | * Only looks at the inuse list. | ||
1142 | + * Must be called with scsi_id->sbp2_command_orb_lock held. | ||
1143 | */ | ||
1144 | -static struct sbp2_command_info *sbp2util_find_command_for_SCpnt(struct scsi_id_instance_data *scsi_id, void *SCpnt) | ||
1145 | +static struct sbp2_command_info *sbp2util_find_command_for_SCpnt( | ||
1146 | + struct scsi_id_instance_data *scsi_id, void *SCpnt) | ||
1147 | { | ||
1148 | struct sbp2_command_info *command; | ||
1149 | - unsigned long flags; | ||
1150 | |||
1151 | - spin_lock_irqsave(&scsi_id->sbp2_command_orb_lock, flags); | ||
1152 | - if (!list_empty(&scsi_id->sbp2_command_orb_inuse)) { | ||
1153 | - list_for_each_entry(command, &scsi_id->sbp2_command_orb_inuse, list) { | ||
1154 | - if (command->Current_SCpnt == SCpnt) { | ||
1155 | - spin_unlock_irqrestore(&scsi_id->sbp2_command_orb_lock, flags); | ||
1156 | + if (!list_empty(&scsi_id->sbp2_command_orb_inuse)) | ||
1157 | + list_for_each_entry(command, &scsi_id->sbp2_command_orb_inuse, list) | ||
1158 | + if (command->Current_SCpnt == SCpnt) | ||
1159 | return command; | ||
1160 | - } | ||
1161 | - } | ||
1162 | - } | ||
1163 | - spin_unlock_irqrestore(&scsi_id->sbp2_command_orb_lock, flags); | ||
1164 | return NULL; | ||
1165 | } | ||
1166 | |||
1167 | @@ -579,17 +574,15 @@ static void sbp2util_free_command_dma(st | ||
1168 | |||
1169 | /* | ||
1170 | * This function moves a command to the completed orb list. | ||
1171 | + * Must be called with scsi_id->sbp2_command_orb_lock held. | ||
1172 | */ | ||
1173 | -static void sbp2util_mark_command_completed(struct scsi_id_instance_data *scsi_id, | ||
1174 | - struct sbp2_command_info *command) | ||
1175 | +static void sbp2util_mark_command_completed( | ||
1176 | + struct scsi_id_instance_data *scsi_id, | ||
1177 | + struct sbp2_command_info *command) | ||
1178 | { | ||
1179 | - unsigned long flags; | ||
1180 | - | ||
1181 | - spin_lock_irqsave(&scsi_id->sbp2_command_orb_lock, flags); | ||
1182 | list_del(&command->list); | ||
1183 | sbp2util_free_command_dma(command); | ||
1184 | list_add_tail(&command->list, &scsi_id->sbp2_command_orb_completed); | ||
1185 | - spin_unlock_irqrestore(&scsi_id->sbp2_command_orb_lock, flags); | ||
1186 | } | ||
1187 | |||
1188 | /* | ||
1189 | @@ -2177,7 +2170,9 @@ static int sbp2_handle_status_write(stru | ||
1190 | * Matched status with command, now grab scsi command pointers and check status | ||
1191 | */ | ||
1192 | SCpnt = command->Current_SCpnt; | ||
1193 | + spin_lock_irqsave(&scsi_id->sbp2_command_orb_lock, flags); | ||
1194 | sbp2util_mark_command_completed(scsi_id, command); | ||
1195 | + spin_unlock_irqrestore(&scsi_id->sbp2_command_orb_lock, flags); | ||
1196 | |||
1197 | if (SCpnt) { | ||
1198 | |||
1199 | @@ -2513,6 +2508,7 @@ static int sbp2scsi_abort(struct scsi_cm | ||
1200 | (struct scsi_id_instance_data *)SCpnt->device->host->hostdata[0]; | ||
1201 | struct sbp2scsi_host_info *hi = scsi_id->hi; | ||
1202 | struct sbp2_command_info *command; | ||
1203 | + unsigned long flags; | ||
1204 | |||
1205 | SBP2_ERR("aborting sbp2 command"); | ||
1206 | scsi_print_command(SCpnt); | ||
1207 | @@ -2523,6 +2519,7 @@ static int sbp2scsi_abort(struct scsi_cm | ||
1208 | * Right now, just return any matching command structures | ||
1209 | * to the free pool. | ||
1210 | */ | ||
1211 | + spin_lock_irqsave(&scsi_id->sbp2_command_orb_lock, flags); | ||
1212 | command = sbp2util_find_command_for_SCpnt(scsi_id, SCpnt); | ||
1213 | if (command) { | ||
1214 | SBP2_DEBUG("Found command to abort"); | ||
1215 | @@ -2540,6 +2537,7 @@ static int sbp2scsi_abort(struct scsi_cm | ||
1216 | command->Current_done(command->Current_SCpnt); | ||
1217 | } | ||
1218 | } | ||
1219 | + spin_unlock_irqrestore(&scsi_id->sbp2_command_orb_lock, flags); | ||
1220 | |||
1221 | /* | ||
1222 | * Initiate a fetch agent reset. | ||
1223 | diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c | ||
1224 | index 5ebfd1d..5282fec 100644 | ||
1225 | --- a/drivers/macintosh/therm_adt746x.c | ||
1226 | +++ b/drivers/macintosh/therm_adt746x.c | ||
1227 | @@ -627,8 +627,8 @@ thermostat_init(void) | ||
1228 | if(therm_type == ADT7460) | ||
1229 | device_create_file(&of_dev->dev, &dev_attr_sensor2_fan_speed); | ||
1230 | |||
1231 | -#ifndef CONFIG_I2C_KEYWEST | ||
1232 | - request_module("i2c-keywest"); | ||
1233 | +#ifndef CONFIG_I2C_POWERMAC | ||
1234 | + request_module("i2c-powermac"); | ||
1235 | #endif | ||
1236 | |||
1237 | return i2c_add_driver(&thermostat_driver); | ||
1238 | diff --git a/drivers/md/dm.c b/drivers/md/dm.c | ||
1239 | index 745ca1f..d559569 100644 | ||
1240 | --- a/drivers/md/dm.c | ||
1241 | +++ b/drivers/md/dm.c | ||
1242 | @@ -533,30 +533,35 @@ static void __clone_and_map(struct clone | ||
1243 | |||
1244 | } else { | ||
1245 | /* | ||
1246 | - * Create two copy bios to deal with io that has | ||
1247 | - * been split across a target. | ||
1248 | + * Handle a bvec that must be split between two or more targets. | ||
1249 | */ | ||
1250 | struct bio_vec *bv = bio->bi_io_vec + ci->idx; | ||
1251 | + sector_t remaining = to_sector(bv->bv_len); | ||
1252 | + unsigned int offset = 0; | ||
1253 | |||
1254 | - clone = split_bvec(bio, ci->sector, ci->idx, | ||
1255 | - bv->bv_offset, max); | ||
1256 | - __map_bio(ti, clone, tio); | ||
1257 | + do { | ||
1258 | + if (offset) { | ||
1259 | + ti = dm_table_find_target(ci->map, ci->sector); | ||
1260 | + max = max_io_len(ci->md, ci->sector, ti); | ||
1261 | |||
1262 | - ci->sector += max; | ||
1263 | - ci->sector_count -= max; | ||
1264 | - ti = dm_table_find_target(ci->map, ci->sector); | ||
1265 | - | ||
1266 | - len = to_sector(bv->bv_len) - max; | ||
1267 | - clone = split_bvec(bio, ci->sector, ci->idx, | ||
1268 | - bv->bv_offset + to_bytes(max), len); | ||
1269 | - tio = alloc_tio(ci->md); | ||
1270 | - tio->io = ci->io; | ||
1271 | - tio->ti = ti; | ||
1272 | - memset(&tio->info, 0, sizeof(tio->info)); | ||
1273 | - __map_bio(ti, clone, tio); | ||
1274 | + tio = alloc_tio(ci->md); | ||
1275 | + tio->io = ci->io; | ||
1276 | + tio->ti = ti; | ||
1277 | + memset(&tio->info, 0, sizeof(tio->info)); | ||
1278 | + } | ||
1279 | + | ||
1280 | + len = min(remaining, max); | ||
1281 | + | ||
1282 | + clone = split_bvec(bio, ci->sector, ci->idx, | ||
1283 | + bv->bv_offset + offset, len); | ||
1284 | + | ||
1285 | + __map_bio(ti, clone, tio); | ||
1286 | + | ||
1287 | + ci->sector += len; | ||
1288 | + ci->sector_count -= len; | ||
1289 | + offset += to_bytes(len); | ||
1290 | + } while (remaining -= len); | ||
1291 | |||
1292 | - ci->sector += len; | ||
1293 | - ci->sector_count -= len; | ||
1294 | ci->idx++; | ||
1295 | } | ||
1296 | } | ||
1297 | diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig | ||
1298 | index d82c8a3..ef42a26 100644 | ||
1299 | --- a/drivers/media/video/Kconfig | ||
1300 | +++ b/drivers/media/video/Kconfig | ||
1301 | @@ -349,6 +349,7 @@ config VIDEO_AUDIO_DECODER | ||
1302 | config VIDEO_DECODER | ||
1303 | tristate "Add support for additional video chipsets" | ||
1304 | depends on VIDEO_DEV && I2C && EXPERIMENTAL | ||
1305 | + select FW_LOADER | ||
1306 | ---help--- | ||
1307 | Say Y here to compile drivers for SAA7115, SAA7127 and CX25840 | ||
1308 | video decoders. | ||
1309 | diff --git a/drivers/media/video/tuner-types.c b/drivers/media/video/tuner-types.c | ||
1310 | index 6fe7817..5f3d46d 100644 | ||
1311 | --- a/drivers/media/video/tuner-types.c | ||
1312 | +++ b/drivers/media/video/tuner-types.c | ||
1313 | @@ -1087,8 +1087,8 @@ static struct tuner_params tuner_tnf_533 | ||
1314 | /* ------------ TUNER_SAMSUNG_TCPN_2121P30A - Samsung NTSC ------------ */ | ||
1315 | |||
1316 | static struct tuner_range tuner_samsung_tcpn_2121p30a_ntsc_ranges[] = { | ||
1317 | - { 16 * 175.75 /*MHz*/, 0x01, }, | ||
1318 | - { 16 * 410.25 /*MHz*/, 0x02, }, | ||
1319 | + { 16 * 130.00 /*MHz*/, 0x01, }, | ||
1320 | + { 16 * 364.50 /*MHz*/, 0x02, }, | ||
1321 | { 16 * 999.99 , 0x08, }, | ||
1322 | }; | ||
1323 | |||
1324 | diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig | ||
1325 | index 1fc4c13..cfe288a 100644 | ||
1326 | --- a/drivers/mtd/nand/Kconfig | ||
1327 | +++ b/drivers/mtd/nand/Kconfig | ||
1328 | @@ -178,17 +178,16 @@ config MTD_NAND_DISKONCHIP_BBTWRITE | ||
1329 | Even if you leave this disabled, you can enable BBT writes at module | ||
1330 | load time (assuming you build diskonchip as a module) with the module | ||
1331 | parameter "inftl_bbt_write=1". | ||
1332 | - | ||
1333 | - config MTD_NAND_SHARPSL | ||
1334 | - bool "Support for NAND Flash on Sharp SL Series (C7xx + others)" | ||
1335 | - depends on MTD_NAND && ARCH_PXA | ||
1336 | - | ||
1337 | - config MTD_NAND_NANDSIM | ||
1338 | - bool "Support for NAND Flash Simulator" | ||
1339 | - depends on MTD_NAND && MTD_PARTITIONS | ||
1340 | |||
1341 | +config MTD_NAND_SHARPSL | ||
1342 | + tristate "Support for NAND Flash on Sharp SL Series (C7xx + others)" | ||
1343 | + depends on MTD_NAND && ARCH_PXA | ||
1344 | + | ||
1345 | +config MTD_NAND_NANDSIM | ||
1346 | + tristate "Support for NAND Flash Simulator" | ||
1347 | + depends on MTD_NAND && MTD_PARTITIONS | ||
1348 | help | ||
1349 | The simulator may simulate verious NAND flash chips for the | ||
1350 | MTD nand layer. | ||
1351 | - | ||
1352 | + | ||
1353 | endmenu | ||
1354 | diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c | ||
1355 | index 8936058..6e2ec56 100644 | ||
1356 | --- a/drivers/net/irda/irda-usb.c | ||
1357 | +++ b/drivers/net/irda/irda-usb.c | ||
1358 | @@ -740,7 +740,7 @@ static void irda_usb_receive(struct urb | ||
1359 | struct sk_buff *newskb; | ||
1360 | struct sk_buff *dataskb; | ||
1361 | struct urb *next_urb; | ||
1362 | - int docopy; | ||
1363 | + unsigned int len, docopy; | ||
1364 | |||
1365 | IRDA_DEBUG(2, "%s(), len=%d\n", __FUNCTION__, urb->actual_length); | ||
1366 | |||
1367 | @@ -851,10 +851,11 @@ static void irda_usb_receive(struct urb | ||
1368 | dataskb->dev = self->netdev; | ||
1369 | dataskb->mac.raw = dataskb->data; | ||
1370 | dataskb->protocol = htons(ETH_P_IRDA); | ||
1371 | + len = dataskb->len; | ||
1372 | netif_rx(dataskb); | ||
1373 | |||
1374 | /* Keep stats up to date */ | ||
1375 | - self->stats.rx_bytes += dataskb->len; | ||
1376 | + self->stats.rx_bytes += len; | ||
1377 | self->stats.rx_packets++; | ||
1378 | self->netdev->last_rx = jiffies; | ||
1379 | |||
1380 | diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c | ||
1381 | index 7326036..0618cd5 100644 | ||
1382 | --- a/drivers/net/sky2.c | ||
1383 | +++ b/drivers/net/sky2.c | ||
1384 | @@ -579,8 +579,8 @@ static void sky2_mac_init(struct sky2_hw | ||
1385 | reg = gma_read16(hw, port, GM_PHY_ADDR); | ||
1386 | gma_write16(hw, port, GM_PHY_ADDR, reg | GM_PAR_MIB_CLR); | ||
1387 | |||
1388 | - for (i = 0; i < GM_MIB_CNT_SIZE; i++) | ||
1389 | - gma_read16(hw, port, GM_MIB_CNT_BASE + 8 * i); | ||
1390 | + for (i = GM_MIB_CNT_BASE; i <= GM_MIB_CNT_END; i += 4) | ||
1391 | + gma_read16(hw, port, i); | ||
1392 | gma_write16(hw, port, GM_PHY_ADDR, reg); | ||
1393 | |||
1394 | /* transmit control */ | ||
1395 | diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h | ||
1396 | index dce955c..c91e0a4 100644 | ||
1397 | --- a/drivers/net/sky2.h | ||
1398 | +++ b/drivers/net/sky2.h | ||
1399 | @@ -1380,6 +1380,7 @@ enum { | ||
1400 | /* MIB Counters */ | ||
1401 | #define GM_MIB_CNT_BASE 0x0100 /* Base Address of MIB Counters */ | ||
1402 | #define GM_MIB_CNT_SIZE 44 /* Number of MIB Counters */ | ||
1403 | +#define GM_MIB_CNT_END 0x025C /* Last MIB counter */ | ||
1404 | |||
1405 | /* | ||
1406 | * MIB Counters base address definitions (low word) - | ||
1407 | diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig | ||
1408 | index ef85d76..8101657 100644 | ||
1409 | --- a/drivers/net/wireless/Kconfig | ||
1410 | +++ b/drivers/net/wireless/Kconfig | ||
1411 | @@ -239,7 +239,8 @@ config IPW2200_DEBUG | ||
1412 | |||
1413 | config AIRO | ||
1414 | tristate "Cisco/Aironet 34X/35X/4500/4800 ISA and PCI cards" | ||
1415 | - depends on NET_RADIO && ISA_DMA_API && CRYPTO && (PCI || BROKEN) | ||
1416 | + depends on NET_RADIO && ISA_DMA_API && (PCI || BROKEN) | ||
1417 | + select CRYPTO | ||
1418 | ---help--- | ||
1419 | This is the standard Linux driver to support Cisco/Aironet ISA and | ||
1420 | PCI 802.11 wireless cards. | ||
1421 | @@ -374,6 +375,7 @@ config PCMCIA_HERMES | ||
1422 | config PCMCIA_SPECTRUM | ||
1423 | tristate "Symbol Spectrum24 Trilogy PCMCIA card support" | ||
1424 | depends on NET_RADIO && PCMCIA && HERMES | ||
1425 | + select FW_LOADER | ||
1426 | ---help--- | ||
1427 | |||
1428 | This is a driver for 802.11b cards using RAM-loadable Symbol | ||
1429 | @@ -387,6 +389,7 @@ config PCMCIA_SPECTRUM | ||
1430 | config AIRO_CS | ||
1431 | tristate "Cisco/Aironet 34X/35X/4500/4800 PCMCIA cards" | ||
1432 | depends on NET_RADIO && PCMCIA && (BROKEN || !M32R) | ||
1433 | + select CRYPTO | ||
1434 | ---help--- | ||
1435 | This is the standard Linux driver to support Cisco/Aironet PCMCIA | ||
1436 | 802.11 wireless cards. This driver is the same as the Aironet | ||
1437 | diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c | ||
1438 | index 4a85e63..5f398bd 100644 | ||
1439 | --- a/drivers/net/wireless/hostap/hostap_80211_tx.c | ||
1440 | +++ b/drivers/net/wireless/hostap/hostap_80211_tx.c | ||
1441 | @@ -469,7 +469,7 @@ int hostap_master_start_xmit(struct sk_b | ||
1442 | } | ||
1443 | |||
1444 | if (local->ieee_802_1x && meta->ethertype == ETH_P_PAE && tx.crypt && | ||
1445 | - !(fc & IEEE80211_FCTL_VERS)) { | ||
1446 | + !(fc & IEEE80211_FCTL_PROTECTED)) { | ||
1447 | no_encrypt = 1; | ||
1448 | PDEBUG(DEBUG_EXTRA2, "%s: TX: IEEE 802.1X - passing " | ||
1449 | "unencrypted EAPOL frame\n", dev->name); | ||
1450 | diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c | ||
1451 | index 287676a..aa6f3a4 100644 | ||
1452 | --- a/drivers/net/wireless/ipw2200.c | ||
1453 | +++ b/drivers/net/wireless/ipw2200.c | ||
1454 | @@ -9956,9 +9956,8 @@ static int ipw_ethtool_set_eeprom(struct | ||
1455 | return -EINVAL; | ||
1456 | down(&p->sem); | ||
1457 | memcpy(&p->eeprom[eeprom->offset], bytes, eeprom->len); | ||
1458 | - for (i = IPW_EEPROM_DATA; | ||
1459 | - i < IPW_EEPROM_DATA + IPW_EEPROM_IMAGE_SIZE; i++) | ||
1460 | - ipw_write8(p, i, p->eeprom[i]); | ||
1461 | + for (i = 0; i < IPW_EEPROM_IMAGE_SIZE; i++) | ||
1462 | + ipw_write8(p, i + IPW_EEPROM_DATA, p->eeprom[i]); | ||
1463 | up(&p->sem); | ||
1464 | return 0; | ||
1465 | } | ||
1466 | diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c | ||
1467 | index bb96ce1..a4333a8 100644 | ||
1468 | --- a/drivers/pcmcia/ds.c | ||
1469 | +++ b/drivers/pcmcia/ds.c | ||
1470 | @@ -546,7 +546,7 @@ static int pcmcia_device_query(struct pc | ||
1471 | tmp = vers1->str + vers1->ofs[i]; | ||
1472 | |||
1473 | length = strlen(tmp) + 1; | ||
1474 | - if ((length < 3) || (length > 255)) | ||
1475 | + if ((length < 2) || (length > 255)) | ||
1476 | continue; | ||
1477 | |||
1478 | p_dev->prod_id[i] = kmalloc(sizeof(char) * length, | ||
1479 | diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c | ||
1480 | index d9152d0..9132549 100644 | ||
1481 | --- a/drivers/scsi/3w-9xxx.c | ||
1482 | +++ b/drivers/scsi/3w-9xxx.c | ||
1483 | @@ -85,7 +85,7 @@ #include <scsi/scsi_cmnd.h> | ||
1484 | #include "3w-9xxx.h" | ||
1485 | |||
1486 | /* Globals */ | ||
1487 | -#define TW_DRIVER_VERSION "2.26.02.005" | ||
1488 | +#define TW_DRIVER_VERSION "2.26.02.007" | ||
1489 | static TW_Device_Extension *twa_device_extension_list[TW_MAX_SLOT]; | ||
1490 | static unsigned int twa_device_extension_count; | ||
1491 | static int twa_major = -1; | ||
1492 | @@ -1944,9 +1944,13 @@ static void twa_scsiop_execute_scsi_comp | ||
1493 | } | ||
1494 | if (tw_dev->srb[request_id]->use_sg == 1) { | ||
1495 | struct scatterlist *sg = (struct scatterlist *)tw_dev->srb[request_id]->request_buffer; | ||
1496 | - char *buf = kmap_atomic(sg->page, KM_IRQ0) + sg->offset; | ||
1497 | + char *buf; | ||
1498 | + unsigned long flags = 0; | ||
1499 | + local_irq_save(flags); | ||
1500 | + buf = kmap_atomic(sg->page, KM_IRQ0) + sg->offset; | ||
1501 | memcpy(buf, tw_dev->generic_buffer_virt[request_id], sg->length); | ||
1502 | kunmap_atomic(buf - sg->offset, KM_IRQ0); | ||
1503 | + local_irq_restore(flags); | ||
1504 | } | ||
1505 | } | ||
1506 | } /* End twa_scsiop_execute_scsi_complete() */ | ||
1507 | diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c | ||
1508 | index 25f678d..e8e41e6 100644 | ||
1509 | --- a/drivers/scsi/3w-xxxx.c | ||
1510 | +++ b/drivers/scsi/3w-xxxx.c | ||
1511 | @@ -1508,10 +1508,12 @@ static void tw_transfer_internal(TW_Devi | ||
1512 | struct scsi_cmnd *cmd = tw_dev->srb[request_id]; | ||
1513 | void *buf; | ||
1514 | unsigned int transfer_len; | ||
1515 | + unsigned long flags = 0; | ||
1516 | |||
1517 | if (cmd->use_sg) { | ||
1518 | struct scatterlist *sg = | ||
1519 | (struct scatterlist *)cmd->request_buffer; | ||
1520 | + local_irq_save(flags); | ||
1521 | buf = kmap_atomic(sg->page, KM_IRQ0) + sg->offset; | ||
1522 | transfer_len = min(sg->length, len); | ||
1523 | } else { | ||
1524 | @@ -1526,6 +1528,7 @@ static void tw_transfer_internal(TW_Devi | ||
1525 | |||
1526 | sg = (struct scatterlist *)cmd->request_buffer; | ||
1527 | kunmap_atomic(buf - sg->offset, KM_IRQ0); | ||
1528 | + local_irq_restore(flags); | ||
1529 | } | ||
1530 | } | ||
1531 | |||
1532 | diff --git a/drivers/scsi/sata_mv.c b/drivers/scsi/sata_mv.c | ||
1533 | index 2770005..b00af08 100644 | ||
1534 | --- a/drivers/scsi/sata_mv.c | ||
1535 | +++ b/drivers/scsi/sata_mv.c | ||
1536 | @@ -1102,6 +1102,7 @@ static u8 mv_get_crpb_status(struct ata_ | ||
1537 | void __iomem *port_mmio = mv_ap_base(ap); | ||
1538 | struct mv_port_priv *pp = ap->private_data; | ||
1539 | u32 out_ptr; | ||
1540 | + u8 ata_status; | ||
1541 | |||
1542 | out_ptr = readl(port_mmio + EDMA_RSP_Q_OUT_PTR_OFS); | ||
1543 | |||
1544 | @@ -1109,6 +1110,8 @@ static u8 mv_get_crpb_status(struct ata_ | ||
1545 | assert(((out_ptr >> EDMA_RSP_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) == | ||
1546 | pp->rsp_consumer); | ||
1547 | |||
1548 | + ata_status = pp->crpb[pp->rsp_consumer].flags >> CRPB_FLAG_STATUS_SHIFT; | ||
1549 | + | ||
1550 | /* increment our consumer index... */ | ||
1551 | pp->rsp_consumer = mv_inc_q_index(&pp->rsp_consumer); | ||
1552 | |||
1553 | @@ -1123,7 +1126,7 @@ static u8 mv_get_crpb_status(struct ata_ | ||
1554 | writelfl(out_ptr, port_mmio + EDMA_RSP_Q_OUT_PTR_OFS); | ||
1555 | |||
1556 | /* Return ATA status register for completed CRPB */ | ||
1557 | - return (pp->crpb[pp->rsp_consumer].flags >> CRPB_FLAG_STATUS_SHIFT); | ||
1558 | + return ata_status; | ||
1559 | } | ||
1560 | |||
1561 | /** | ||
1562 | @@ -1192,7 +1195,6 @@ static void mv_host_intr(struct ata_host | ||
1563 | u32 hc_irq_cause; | ||
1564 | int shift, port, port0, hard_port, handled; | ||
1565 | unsigned int err_mask; | ||
1566 | - u8 ata_status = 0; | ||
1567 | |||
1568 | if (hc == 0) { | ||
1569 | port0 = 0; | ||
1570 | @@ -1210,6 +1212,7 @@ static void mv_host_intr(struct ata_host | ||
1571 | hc,relevant,hc_irq_cause); | ||
1572 | |||
1573 | for (port = port0; port < port0 + MV_PORTS_PER_HC; port++) { | ||
1574 | + u8 ata_status = 0; | ||
1575 | ap = host_set->ports[port]; | ||
1576 | hard_port = port & MV_PORT_MASK; /* range 0-3 */ | ||
1577 | handled = 0; /* ensure ata_status is set if handled++ */ | ||
1578 | diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c | ||
1579 | index 7135e54..96cabeb 100644 | ||
1580 | --- a/drivers/usb/core/message.c | ||
1581 | +++ b/drivers/usb/core/message.c | ||
1582 | @@ -1388,11 +1388,13 @@ free_interfaces: | ||
1583 | if (dev->state != USB_STATE_ADDRESS) | ||
1584 | usb_disable_device (dev, 1); // Skip ep0 | ||
1585 | |||
1586 | - i = dev->bus_mA - cp->desc.bMaxPower * 2; | ||
1587 | - if (i < 0) | ||
1588 | - dev_warn(&dev->dev, "new config #%d exceeds power " | ||
1589 | - "limit by %dmA\n", | ||
1590 | - configuration, -i); | ||
1591 | + if (cp) { | ||
1592 | + i = dev->bus_mA - cp->desc.bMaxPower * 2; | ||
1593 | + if (i < 0) | ||
1594 | + dev_warn(&dev->dev, "new config #%d exceeds power " | ||
1595 | + "limit by %dmA\n", | ||
1596 | + configuration, -i); | ||
1597 | + } | ||
1598 | |||
1599 | if ((ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), | ||
1600 | USB_REQ_SET_CONFIGURATION, 0, configuration, 0, | ||
1601 | diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c | ||
1602 | index ebcca97..88419c6 100644 | ||
1603 | --- a/drivers/usb/host/ehci-sched.c | ||
1604 | +++ b/drivers/usb/host/ehci-sched.c | ||
1605 | @@ -707,6 +707,7 @@ iso_stream_init ( | ||
1606 | } else { | ||
1607 | u32 addr; | ||
1608 | int think_time; | ||
1609 | + int hs_transfers; | ||
1610 | |||
1611 | addr = dev->ttport << 24; | ||
1612 | if (!ehci_is_TDI(ehci) | ||
1613 | @@ -719,6 +720,7 @@ iso_stream_init ( | ||
1614 | think_time = dev->tt ? dev->tt->think_time : 0; | ||
1615 | stream->tt_usecs = NS_TO_US (think_time + usb_calc_bus_time ( | ||
1616 | dev->speed, is_input, 1, maxp)); | ||
1617 | + hs_transfers = max (1u, (maxp + 187) / 188); | ||
1618 | if (is_input) { | ||
1619 | u32 tmp; | ||
1620 | |||
1621 | @@ -727,12 +729,11 @@ iso_stream_init ( | ||
1622 | stream->usecs = HS_USECS_ISO (1); | ||
1623 | stream->raw_mask = 1; | ||
1624 | |||
1625 | - /* pessimistic c-mask */ | ||
1626 | - tmp = usb_calc_bus_time (USB_SPEED_FULL, 1, 0, maxp) | ||
1627 | - / (125 * 1000); | ||
1628 | - stream->raw_mask |= 3 << (tmp + 9); | ||
1629 | + /* c-mask as specified in USB 2.0 11.18.4 3.c */ | ||
1630 | + tmp = (1 << (hs_transfers + 2)) - 1; | ||
1631 | + stream->raw_mask |= tmp << (8 + 2); | ||
1632 | } else | ||
1633 | - stream->raw_mask = smask_out [maxp / 188]; | ||
1634 | + stream->raw_mask = smask_out [hs_transfers - 1]; | ||
1635 | bandwidth = stream->usecs + stream->c_usecs; | ||
1636 | bandwidth /= 1 << (interval + 2); | ||
1637 | |||
1638 | diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c | ||
1639 | index 167f8ec..8023bb7 100644 | ||
1640 | --- a/drivers/usb/serial/console.c | ||
1641 | +++ b/drivers/usb/serial/console.c | ||
1642 | @@ -54,7 +54,7 @@ static struct console usbcons; | ||
1643 | * serial.c code, except that the specifier is "ttyUSB" instead | ||
1644 | * of "ttyS". | ||
1645 | */ | ||
1646 | -static int __init usb_console_setup(struct console *co, char *options) | ||
1647 | +static int usb_console_setup(struct console *co, char *options) | ||
1648 | { | ||
1649 | struct usbcons_info *info = &usbcons_info; | ||
1650 | int baud = 9600; | ||
1651 | diff --git a/drivers/usb/storage/Kconfig b/drivers/usb/storage/Kconfig | ||
1652 | index 92be101..be9eec2 100644 | ||
1653 | --- a/drivers/usb/storage/Kconfig | ||
1654 | +++ b/drivers/usb/storage/Kconfig | ||
1655 | @@ -48,7 +48,8 @@ config USB_STORAGE_FREECOM | ||
1656 | |||
1657 | config USB_STORAGE_ISD200 | ||
1658 | bool "ISD-200 USB/ATA Bridge support" | ||
1659 | - depends on USB_STORAGE && BLK_DEV_IDE | ||
1660 | + depends on USB_STORAGE | ||
1661 | + depends on BLK_DEV_IDE=y || BLK_DEV_IDE=USB_STORAGE | ||
1662 | ---help--- | ||
1663 | Say Y here if you want to use USB Mass Store devices based | ||
1664 | on the In-Systems Design ISD-200 USB/ATA bridge. | ||
1665 | diff --git a/drivers/video/cfbimgblt.c b/drivers/video/cfbimgblt.c | ||
1666 | index 910e233..8ba6152 100644 | ||
1667 | --- a/drivers/video/cfbimgblt.c | ||
1668 | +++ b/drivers/video/cfbimgblt.c | ||
1669 | @@ -169,7 +169,7 @@ static inline void slow_imageblit(const | ||
1670 | |||
1671 | while (j--) { | ||
1672 | l--; | ||
1673 | - color = (*s & 1 << (FB_BIT_NR(l))) ? fgcolor : bgcolor; | ||
1674 | + color = (*s & (1 << l)) ? fgcolor : bgcolor; | ||
1675 | val |= FB_SHIFT_HIGH(color, shift); | ||
1676 | |||
1677 | /* Did the bitshift spill bits to the next long? */ | ||
1678 | diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c | ||
1679 | index 996c7b5..b3094ae 100644 | ||
1680 | --- a/drivers/video/fbmem.c | ||
1681 | +++ b/drivers/video/fbmem.c | ||
1682 | @@ -669,13 +669,19 @@ fb_write(struct file *file, const char _ | ||
1683 | total_size = info->fix.smem_len; | ||
1684 | |||
1685 | if (p > total_size) | ||
1686 | - return 0; | ||
1687 | + return -EFBIG; | ||
1688 | |||
1689 | - if (count >= total_size) | ||
1690 | + if (count > total_size) { | ||
1691 | + err = -EFBIG; | ||
1692 | count = total_size; | ||
1693 | + } | ||
1694 | + | ||
1695 | + if (count + p > total_size) { | ||
1696 | + if (!err) | ||
1697 | + err = -ENOSPC; | ||
1698 | |||
1699 | - if (count + p > total_size) | ||
1700 | count = total_size - p; | ||
1701 | + } | ||
1702 | |||
1703 | buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count, | ||
1704 | GFP_KERNEL); | ||
1705 | @@ -717,7 +723,7 @@ fb_write(struct file *file, const char _ | ||
1706 | |||
1707 | kfree(buffer); | ||
1708 | |||
1709 | - return (err) ? err : cnt; | ||
1710 | + return (cnt) ? cnt : err; | ||
1711 | } | ||
1712 | |||
1713 | #ifdef CONFIG_KMOD | ||
1714 | diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c | ||
1715 | index d8467c0..788297e 100644 | ||
1716 | --- a/drivers/video/i810/i810_main.c | ||
1717 | +++ b/drivers/video/i810/i810_main.c | ||
1718 | @@ -1508,7 +1508,7 @@ static int i810fb_cursor(struct fb_info | ||
1719 | int size = ((cursor->image.width + 7) >> 3) * | ||
1720 | cursor->image.height; | ||
1721 | int i; | ||
1722 | - u8 *data = kmalloc(64 * 8, GFP_KERNEL); | ||
1723 | + u8 *data = kmalloc(64 * 8, GFP_ATOMIC); | ||
1724 | |||
1725 | if (data == NULL) | ||
1726 | return -ENOMEM; | ||
1727 | diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c | ||
1728 | index 3ad8455..651a9e1 100644 | ||
1729 | --- a/fs/9p/vfs_inode.c | ||
1730 | +++ b/fs/9p/vfs_inode.c | ||
1731 | @@ -614,6 +614,7 @@ static struct dentry *v9fs_vfs_lookup(st | ||
1732 | |||
1733 | sb = dir->i_sb; | ||
1734 | v9ses = v9fs_inode2v9ses(dir); | ||
1735 | + dentry->d_op = &v9fs_dentry_operations; | ||
1736 | dirfid = v9fs_fid_lookup(dentry->d_parent); | ||
1737 | |||
1738 | if (!dirfid) { | ||
1739 | @@ -681,8 +682,6 @@ static struct dentry *v9fs_vfs_lookup(st | ||
1740 | goto FreeFcall; | ||
1741 | |||
1742 | fid->qid = fcall->params.rstat.stat.qid; | ||
1743 | - | ||
1744 | - dentry->d_op = &v9fs_dentry_operations; | ||
1745 | v9fs_stat2inode(&fcall->params.rstat.stat, inode, inode->i_sb); | ||
1746 | |||
1747 | d_add(dentry, inode); | ||
1748 | diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c | ||
1749 | index a2c2485..3f5e38c 100644 | ||
1750 | --- a/fs/cifs/cifsencrypt.c | ||
1751 | +++ b/fs/cifs/cifsencrypt.c | ||
1752 | @@ -56,9 +56,6 @@ int cifs_sign_smb(struct smb_hdr * cifs_ | ||
1753 | int rc = 0; | ||
1754 | char smb_signature[20]; | ||
1755 | |||
1756 | - /* BB remember to initialize sequence number elsewhere and initialize mac_signing key elsewhere BB */ | ||
1757 | - /* BB remember to add code to save expected sequence number in midQ entry BB */ | ||
1758 | - | ||
1759 | if((cifs_pdu == NULL) || (server == NULL)) | ||
1760 | return -EINVAL; | ||
1761 | |||
1762 | @@ -85,20 +82,33 @@ int cifs_sign_smb(struct smb_hdr * cifs_ | ||
1763 | static int cifs_calc_signature2(const struct kvec * iov, int n_vec, | ||
1764 | const char * key, char * signature) | ||
1765 | { | ||
1766 | - struct MD5Context context; | ||
1767 | - | ||
1768 | - if((iov == NULL) || (signature == NULL)) | ||
1769 | - return -EINVAL; | ||
1770 | + struct MD5Context context; | ||
1771 | + int i; | ||
1772 | |||
1773 | - MD5Init(&context); | ||
1774 | - MD5Update(&context,key,CIFS_SESSION_KEY_SIZE+16); | ||
1775 | + if((iov == NULL) || (signature == NULL)) | ||
1776 | + return -EINVAL; | ||
1777 | |||
1778 | -/* MD5Update(&context,cifs_pdu->Protocol,cifs_pdu->smb_buf_length); */ /* BB FIXME BB */ | ||
1779 | + MD5Init(&context); | ||
1780 | + MD5Update(&context,key,CIFS_SESSION_KEY_SIZE+16); | ||
1781 | + for(i=0;i<n_vec;i++) { | ||
1782 | + if(iov[i].iov_base == NULL) { | ||
1783 | + cERROR(1,("null iovec entry")); | ||
1784 | + return -EIO; | ||
1785 | + } else if(iov[i].iov_len == 0) | ||
1786 | + break; /* bail out if we are sent nothing to sign */ | ||
1787 | + /* The first entry includes a length field (which does not get | ||
1788 | + signed that occupies the first 4 bytes before the header */ | ||
1789 | + if(i==0) { | ||
1790 | + if (iov[0].iov_len <= 8 ) /* cmd field at offset 9 */ | ||
1791 | + break; /* nothing to sign or corrupt header */ | ||
1792 | + MD5Update(&context,iov[0].iov_base+4, iov[0].iov_len-4); | ||
1793 | + } else | ||
1794 | + MD5Update(&context,iov[i].iov_base, iov[i].iov_len); | ||
1795 | + } | ||
1796 | |||
1797 | - MD5Final(signature,&context); | ||
1798 | + MD5Final(signature,&context); | ||
1799 | |||
1800 | - return -EOPNOTSUPP; | ||
1801 | -/* return 0; */ | ||
1802 | + return 0; | ||
1803 | } | ||
1804 | |||
1805 | |||
1806 | diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c | ||
1807 | index fed55e3..5e562bc 100644 | ||
1808 | --- a/fs/cifs/dir.c | ||
1809 | +++ b/fs/cifs/dir.c | ||
1810 | @@ -441,6 +441,20 @@ cifs_lookup(struct inode *parent_dir_ino | ||
1811 | cifs_sb = CIFS_SB(parent_dir_inode->i_sb); | ||
1812 | pTcon = cifs_sb->tcon; | ||
1813 | |||
1814 | + /* | ||
1815 | + * Don't allow the separator character in a path component. | ||
1816 | + * The VFS will not allow "/", but "\" is allowed by posix. | ||
1817 | + */ | ||
1818 | + if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)) { | ||
1819 | + int i; | ||
1820 | + for (i = 0; i < direntry->d_name.len; i++) | ||
1821 | + if (direntry->d_name.name[i] == '\\') { | ||
1822 | + cFYI(1, ("Invalid file name")); | ||
1823 | + FreeXid(xid); | ||
1824 | + return ERR_PTR(-EINVAL); | ||
1825 | + } | ||
1826 | + } | ||
1827 | + | ||
1828 | /* can not grab the rename sem here since it would | ||
1829 | deadlock in the cases (beginning of sys_rename itself) | ||
1830 | in which we already have the sb rename sem */ | ||
1831 | diff --git a/fs/ext3/resize.c b/fs/ext3/resize.c | ||
1832 | index 1041dab..14f5f6e 100644 | ||
1833 | --- a/fs/ext3/resize.c | ||
1834 | +++ b/fs/ext3/resize.c | ||
1835 | @@ -974,6 +974,7 @@ int ext3_group_extend(struct super_block | ||
1836 | if (o_blocks_count != le32_to_cpu(es->s_blocks_count)) { | ||
1837 | ext3_warning(sb, __FUNCTION__, | ||
1838 | "multiple resizers run on filesystem!"); | ||
1839 | + unlock_super(sb); | ||
1840 | err = -EBUSY; | ||
1841 | goto exit_put; | ||
1842 | } | ||
1843 | diff --git a/fs/fuse/file.c b/fs/fuse/file.c | ||
1844 | index 6f05379..ce93cf9 100644 | ||
1845 | --- a/fs/fuse/file.c | ||
1846 | +++ b/fs/fuse/file.c | ||
1847 | @@ -397,8 +397,12 @@ static int fuse_readpages(struct file *f | ||
1848 | return -EINTR; | ||
1849 | |||
1850 | err = read_cache_pages(mapping, pages, fuse_readpages_fill, &data); | ||
1851 | - if (!err) | ||
1852 | - fuse_send_readpages(data.req, file, inode); | ||
1853 | + if (!err) { | ||
1854 | + if (data.req->num_pages) | ||
1855 | + fuse_send_readpages(data.req, file, inode); | ||
1856 | + else | ||
1857 | + fuse_put_request(fc, data.req); | ||
1858 | + } | ||
1859 | return err; | ||
1860 | } | ||
1861 | |||
1862 | diff --git a/fs/locks.c b/fs/locks.c | ||
1863 | index 909eab8..e75ac39 100644 | ||
1864 | --- a/fs/locks.c | ||
1865 | +++ b/fs/locks.c | ||
1866 | @@ -2212,7 +2212,12 @@ void steal_locks(fl_owner_t from) | ||
1867 | |||
1868 | lock_kernel(); | ||
1869 | j = 0; | ||
1870 | - rcu_read_lock(); | ||
1871 | + | ||
1872 | + /* | ||
1873 | + * We are not taking a ref to the file structures, so | ||
1874 | + * we need to acquire ->file_lock. | ||
1875 | + */ | ||
1876 | + spin_lock(&files->file_lock); | ||
1877 | fdt = files_fdtable(files); | ||
1878 | for (;;) { | ||
1879 | unsigned long set; | ||
1880 | @@ -2230,7 +2235,7 @@ void steal_locks(fl_owner_t from) | ||
1881 | set >>= 1; | ||
1882 | } | ||
1883 | } | ||
1884 | - rcu_read_unlock(); | ||
1885 | + spin_unlock(&files->file_lock); | ||
1886 | unlock_kernel(); | ||
1887 | } | ||
1888 | EXPORT_SYMBOL(steal_locks); | ||
1889 | diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c | ||
1890 | index 6d2dfed..f61142a 100644 | ||
1891 | --- a/fs/nfsd/nfs3proc.c | ||
1892 | +++ b/fs/nfsd/nfs3proc.c | ||
1893 | @@ -682,7 +682,7 @@ static struct svc_procedure nfsd_proced | ||
1894 | PROC(lookup, dirop, dirop, fhandle2, RC_NOCACHE, ST+FH+pAT+pAT), | ||
1895 | PROC(access, access, access, fhandle, RC_NOCACHE, ST+pAT+1), | ||
1896 | PROC(readlink, readlink, readlink, fhandle, RC_NOCACHE, ST+pAT+1+NFS3_MAXPATHLEN/4), | ||
1897 | - PROC(read, read, read, fhandle, RC_NOCACHE, ST+pAT+4+NFSSVC_MAXBLKSIZE), | ||
1898 | + PROC(read, read, read, fhandle, RC_NOCACHE, ST+pAT+4+NFSSVC_MAXBLKSIZE/4), | ||
1899 | PROC(write, write, write, fhandle, RC_REPLBUFF, ST+WC+4), | ||
1900 | PROC(create, create, create, fhandle2, RC_REPLBUFF, ST+(1+FH+pAT)+WC), | ||
1901 | PROC(mkdir, mkdir, create, fhandle2, RC_REPLBUFF, ST+(1+FH+pAT)+WC), | ||
1902 | diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c | ||
1903 | index 6d63f1d..ca8a4c4 100644 | ||
1904 | --- a/fs/nfsd/nfs4proc.c | ||
1905 | +++ b/fs/nfsd/nfs4proc.c | ||
1906 | @@ -975,7 +975,7 @@ #define PROC(name, argt, rest, relt, cac | ||
1907 | */ | ||
1908 | static struct svc_procedure nfsd_procedures4[2] = { | ||
1909 | PROC(null, void, void, void, RC_NOCACHE, 1), | ||
1910 | - PROC(compound, compound, compound, compound, RC_NOCACHE, NFSD_BUFSIZE) | ||
1911 | + PROC(compound, compound, compound, compound, RC_NOCACHE, NFSD_BUFSIZE/4) | ||
1912 | }; | ||
1913 | |||
1914 | struct svc_version nfsd_version4 = { | ||
1915 | diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c | ||
1916 | index 3e6b75c..06cd0db 100644 | ||
1917 | --- a/fs/nfsd/nfsproc.c | ||
1918 | +++ b/fs/nfsd/nfsproc.c | ||
1919 | @@ -553,7 +553,7 @@ static struct svc_procedure nfsd_proced | ||
1920 | PROC(none, void, void, none, RC_NOCACHE, ST), | ||
1921 | PROC(lookup, diropargs, diropres, fhandle, RC_NOCACHE, ST+FH+AT), | ||
1922 | PROC(readlink, readlinkargs, readlinkres, none, RC_NOCACHE, ST+1+NFS_MAXPATHLEN/4), | ||
1923 | - PROC(read, readargs, readres, fhandle, RC_NOCACHE, ST+AT+1+NFSSVC_MAXBLKSIZE), | ||
1924 | + PROC(read, readargs, readres, fhandle, RC_NOCACHE, ST+AT+1+NFSSVC_MAXBLKSIZE/4), | ||
1925 | PROC(none, void, void, none, RC_NOCACHE, ST), | ||
1926 | PROC(write, writeargs, attrstat, fhandle, RC_REPLBUFF, ST+AT), | ||
1927 | PROC(create, createargs, diropres, fhandle, RC_REPLBUFF, ST+FH+AT), | ||
1928 | diff --git a/fs/open.c b/fs/open.c | ||
1929 | index 70e0230..f697914 100644 | ||
1930 | --- a/fs/open.c | ||
1931 | +++ b/fs/open.c | ||
1932 | @@ -330,7 +330,10 @@ out: | ||
1933 | |||
1934 | asmlinkage long sys_ftruncate(unsigned int fd, unsigned long length) | ||
1935 | { | ||
1936 | - return do_sys_ftruncate(fd, length, 1); | ||
1937 | + long ret = do_sys_ftruncate(fd, length, 1); | ||
1938 | + /* avoid REGPARM breakage on x86: */ | ||
1939 | + prevent_tail_call(ret); | ||
1940 | + return ret; | ||
1941 | } | ||
1942 | |||
1943 | /* LFS versions of truncate are only needed on 32 bit machines */ | ||
1944 | @@ -342,7 +345,10 @@ asmlinkage long sys_truncate64(const cha | ||
1945 | |||
1946 | asmlinkage long sys_ftruncate64(unsigned int fd, loff_t length) | ||
1947 | { | ||
1948 | - return do_sys_ftruncate(fd, length, 0); | ||
1949 | + long ret = do_sys_ftruncate(fd, length, 0); | ||
1950 | + /* avoid REGPARM breakage on x86: */ | ||
1951 | + prevent_tail_call(ret); | ||
1952 | + return ret; | ||
1953 | } | ||
1954 | #endif | ||
1955 | |||
1956 | @@ -1083,20 +1089,30 @@ long do_sys_open(int dfd, const char __u | ||
1957 | |||
1958 | asmlinkage long sys_open(const char __user *filename, int flags, int mode) | ||
1959 | { | ||
1960 | + long ret; | ||
1961 | + | ||
1962 | if (force_o_largefile()) | ||
1963 | flags |= O_LARGEFILE; | ||
1964 | |||
1965 | - return do_sys_open(AT_FDCWD, filename, flags, mode); | ||
1966 | + ret = do_sys_open(AT_FDCWD, filename, flags, mode); | ||
1967 | + /* avoid REGPARM breakage on x86: */ | ||
1968 | + prevent_tail_call(ret); | ||
1969 | + return ret; | ||
1970 | } | ||
1971 | EXPORT_SYMBOL_GPL(sys_open); | ||
1972 | |||
1973 | asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, | ||
1974 | int mode) | ||
1975 | { | ||
1976 | + long ret; | ||
1977 | + | ||
1978 | if (force_o_largefile()) | ||
1979 | flags |= O_LARGEFILE; | ||
1980 | |||
1981 | - return do_sys_open(dfd, filename, flags, mode); | ||
1982 | + ret = do_sys_open(dfd, filename, flags, mode); | ||
1983 | + /* avoid REGPARM breakage on x86: */ | ||
1984 | + prevent_tail_call(ret); | ||
1985 | + return ret; | ||
1986 | } | ||
1987 | EXPORT_SYMBOL_GPL(sys_openat); | ||
1988 | |||
1989 | diff --git a/fs/partitions/check.c b/fs/partitions/check.c | ||
1990 | index f924f45..2ef03aa 100644 | ||
1991 | --- a/fs/partitions/check.c | ||
1992 | +++ b/fs/partitions/check.c | ||
1993 | @@ -345,6 +345,7 @@ static char *make_block_name(struct gend | ||
1994 | char *name; | ||
1995 | static char *block_str = "block:"; | ||
1996 | int size; | ||
1997 | + char *s; | ||
1998 | |||
1999 | size = strlen(block_str) + strlen(disk->disk_name) + 1; | ||
2000 | name = kmalloc(size, GFP_KERNEL); | ||
2001 | @@ -352,6 +353,10 @@ static char *make_block_name(struct gend | ||
2002 | return NULL; | ||
2003 | strcpy(name, block_str); | ||
2004 | strcat(name, disk->disk_name); | ||
2005 | + /* ewww... some of these buggers have / in name... */ | ||
2006 | + s = strchr(name, '/'); | ||
2007 | + if (s) | ||
2008 | + *s = '!'; | ||
2009 | return name; | ||
2010 | } | ||
2011 | |||
2012 | diff --git a/fs/proc/base.c b/fs/proc/base.c | ||
2013 | index 20feb75..c192cb2 100644 | ||
2014 | --- a/fs/proc/base.c | ||
2015 | +++ b/fs/proc/base.c | ||
2016 | @@ -294,16 +294,20 @@ static int proc_fd_link(struct inode *in | ||
2017 | |||
2018 | files = get_files_struct(task); | ||
2019 | if (files) { | ||
2020 | - rcu_read_lock(); | ||
2021 | + /* | ||
2022 | + * We are not taking a ref to the file structure, so we must | ||
2023 | + * hold ->file_lock. | ||
2024 | + */ | ||
2025 | + spin_lock(&files->file_lock); | ||
2026 | file = fcheck_files(files, fd); | ||
2027 | if (file) { | ||
2028 | *mnt = mntget(file->f_vfsmnt); | ||
2029 | *dentry = dget(file->f_dentry); | ||
2030 | - rcu_read_unlock(); | ||
2031 | + spin_unlock(&files->file_lock); | ||
2032 | put_files_struct(files); | ||
2033 | return 0; | ||
2034 | } | ||
2035 | - rcu_read_unlock(); | ||
2036 | + spin_unlock(&files->file_lock); | ||
2037 | put_files_struct(files); | ||
2038 | } | ||
2039 | return -ENOENT; | ||
2040 | @@ -1485,7 +1489,12 @@ static struct dentry *proc_lookupfd(stru | ||
2041 | if (!files) | ||
2042 | goto out_unlock; | ||
2043 | inode->i_mode = S_IFLNK; | ||
2044 | - rcu_read_lock(); | ||
2045 | + | ||
2046 | + /* | ||
2047 | + * We are not taking a ref to the file structure, so we must | ||
2048 | + * hold ->file_lock. | ||
2049 | + */ | ||
2050 | + spin_lock(&files->file_lock); | ||
2051 | file = fcheck_files(files, fd); | ||
2052 | if (!file) | ||
2053 | goto out_unlock2; | ||
2054 | @@ -1493,7 +1502,7 @@ static struct dentry *proc_lookupfd(stru | ||
2055 | inode->i_mode |= S_IRUSR | S_IXUSR; | ||
2056 | if (file->f_mode & 2) | ||
2057 | inode->i_mode |= S_IWUSR | S_IXUSR; | ||
2058 | - rcu_read_unlock(); | ||
2059 | + spin_unlock(&files->file_lock); | ||
2060 | put_files_struct(files); | ||
2061 | inode->i_op = &proc_pid_link_inode_operations; | ||
2062 | inode->i_size = 64; | ||
2063 | @@ -1503,7 +1512,7 @@ static struct dentry *proc_lookupfd(stru | ||
2064 | return NULL; | ||
2065 | |||
2066 | out_unlock2: | ||
2067 | - rcu_read_unlock(); | ||
2068 | + spin_unlock(&files->file_lock); | ||
2069 | put_files_struct(files); | ||
2070 | out_unlock: | ||
2071 | iput(inode); | ||
2072 | diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c | ||
2073 | index 1d24fea..826c131 100644 | ||
2074 | --- a/fs/proc/proc_misc.c | ||
2075 | +++ b/fs/proc/proc_misc.c | ||
2076 | @@ -312,7 +312,7 @@ static void *devinfo_next(struct seq_fil | ||
2077 | case BLK_HDR: | ||
2078 | info->state = BLK_LIST; | ||
2079 | (*pos)++; | ||
2080 | - break; | ||
2081 | + /*fallthrough*/ | ||
2082 | case BLK_LIST: | ||
2083 | if (get_blkdev_info(info->blkdev,&idummy,&ndummy)) { | ||
2084 | /* | ||
2085 | diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c | ||
2086 | index 4063fb3..164a7d0 100644 | ||
2087 | --- a/fs/proc/vmcore.c | ||
2088 | +++ b/fs/proc/vmcore.c | ||
2089 | @@ -103,8 +103,8 @@ static ssize_t read_vmcore(struct file * | ||
2090 | size_t buflen, loff_t *fpos) | ||
2091 | { | ||
2092 | ssize_t acc = 0, tmp; | ||
2093 | - size_t tsz, nr_bytes; | ||
2094 | - u64 start; | ||
2095 | + size_t tsz; | ||
2096 | + u64 start, nr_bytes; | ||
2097 | struct vmcore *curr_m = NULL; | ||
2098 | |||
2099 | if (buflen == 0 || *fpos >= vmcore_size) | ||
2100 | diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c | ||
2101 | index 49bd219..cfd290d 100644 | ||
2102 | --- a/fs/sysfs/dir.c | ||
2103 | +++ b/fs/sysfs/dir.c | ||
2104 | @@ -302,6 +302,7 @@ void sysfs_remove_dir(struct kobject * k | ||
2105 | * Drop reference from dget() on entrance. | ||
2106 | */ | ||
2107 | dput(dentry); | ||
2108 | + kobj->dentry = NULL; | ||
2109 | } | ||
2110 | |||
2111 | int sysfs_rename_dir(struct kobject * kobj, const char *new_name) | ||
2112 | diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c | ||
2113 | index d0e3d84..2ecc58c 100644 | ||
2114 | --- a/fs/sysfs/file.c | ||
2115 | +++ b/fs/sysfs/file.c | ||
2116 | @@ -183,7 +183,7 @@ fill_write_buffer(struct sysfs_buffer * | ||
2117 | return -ENOMEM; | ||
2118 | |||
2119 | if (count >= PAGE_SIZE) | ||
2120 | - count = PAGE_SIZE; | ||
2121 | + count = PAGE_SIZE - 1; | ||
2122 | error = copy_from_user(buffer->page,buf,count); | ||
2123 | buffer->needs_read_fill = 1; | ||
2124 | return error ? -EFAULT : count; | ||
2125 | diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c | ||
2126 | index 689f7bc..6beee6f 100644 | ||
2127 | --- a/fs/sysfs/inode.c | ||
2128 | +++ b/fs/sysfs/inode.c | ||
2129 | @@ -227,12 +227,16 @@ void sysfs_drop_dentry(struct sysfs_dire | ||
2130 | void sysfs_hash_and_remove(struct dentry * dir, const char * name) | ||
2131 | { | ||
2132 | struct sysfs_dirent * sd; | ||
2133 | - struct sysfs_dirent * parent_sd = dir->d_fsdata; | ||
2134 | + struct sysfs_dirent * parent_sd; | ||
2135 | + | ||
2136 | + if (!dir) | ||
2137 | + return; | ||
2138 | |||
2139 | if (dir->d_inode == NULL) | ||
2140 | /* no inode means this hasn't been made visible yet */ | ||
2141 | return; | ||
2142 | |||
2143 | + parent_sd = dir->d_fsdata; | ||
2144 | mutex_lock(&dir->d_inode->i_mutex); | ||
2145 | list_for_each_entry(sd, &parent_sd->s_children, s_sibling) { | ||
2146 | if (!sd->s_element) | ||
2147 | diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c | ||
2148 | index e38d633..e5ce6e7 100644 | ||
2149 | --- a/fs/sysfs/symlink.c | ||
2150 | +++ b/fs/sysfs/symlink.c | ||
2151 | @@ -66,6 +66,7 @@ static int sysfs_add_link(struct dentry | ||
2152 | if (!error) | ||
2153 | return 0; | ||
2154 | |||
2155 | + kobject_put(target); | ||
2156 | kfree(sl->link_name); | ||
2157 | exit2: | ||
2158 | kfree(sl); | ||
2159 | diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c | ||
2160 | index 74d8be8..a980736 100644 | ||
2161 | --- a/fs/xfs/linux-2.6/xfs_aops.c | ||
2162 | +++ b/fs/xfs/linux-2.6/xfs_aops.c | ||
2163 | @@ -616,7 +616,7 @@ xfs_is_delayed_page( | ||
2164 | acceptable = (type == IOMAP_UNWRITTEN); | ||
2165 | else if (buffer_delay(bh)) | ||
2166 | acceptable = (type == IOMAP_DELAY); | ||
2167 | - else if (buffer_mapped(bh)) | ||
2168 | + else if (buffer_dirty(bh) && buffer_mapped(bh)) | ||
2169 | acceptable = (type == 0); | ||
2170 | else | ||
2171 | break; | ||
2172 | diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c | ||
2173 | index d7f6f2d..43808e2 100644 | ||
2174 | --- a/fs/xfs/linux-2.6/xfs_iops.c | ||
2175 | +++ b/fs/xfs/linux-2.6/xfs_iops.c | ||
2176 | @@ -673,8 +673,7 @@ linvfs_setattr( | ||
2177 | if (ia_valid & ATTR_ATIME) { | ||
2178 | vattr.va_mask |= XFS_AT_ATIME; | ||
2179 | vattr.va_atime = attr->ia_atime; | ||
2180 | - if (ia_valid & ATTR_ATIME_SET) | ||
2181 | - inode->i_atime = attr->ia_atime; | ||
2182 | + inode->i_atime = attr->ia_atime; | ||
2183 | } | ||
2184 | if (ia_valid & ATTR_MTIME) { | ||
2185 | vattr.va_mask |= XFS_AT_MTIME; | ||
2186 | diff --git a/include/asm-i386/cpufeature.h b/include/asm-i386/cpufeature.h | ||
2187 | index c4ec2a4..9d15eec 100644 | ||
2188 | --- a/include/asm-i386/cpufeature.h | ||
2189 | +++ b/include/asm-i386/cpufeature.h | ||
2190 | @@ -70,6 +70,7 @@ #define X86_FEATURE_K7 (3*32+ 5) /* Ath | ||
2191 | #define X86_FEATURE_P3 (3*32+ 6) /* P3 */ | ||
2192 | #define X86_FEATURE_P4 (3*32+ 7) /* P4 */ | ||
2193 | #define X86_FEATURE_CONSTANT_TSC (3*32+ 8) /* TSC ticks at a constant rate */ | ||
2194 | +#define X86_FEATURE_FXSAVE_LEAK (3*32+10) /* FXSAVE leaks FOP/FIP/FOP */ | ||
2195 | |||
2196 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ | ||
2197 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ | ||
2198 | diff --git a/include/asm-i386/i387.h b/include/asm-i386/i387.h | ||
2199 | index 152d0ba..7b1f011 100644 | ||
2200 | --- a/include/asm-i386/i387.h | ||
2201 | +++ b/include/asm-i386/i387.h | ||
2202 | @@ -13,6 +13,7 @@ #define __ASM_I386_I387_H | ||
2203 | |||
2204 | #include <linux/sched.h> | ||
2205 | #include <linux/init.h> | ||
2206 | +#include <linux/kernel_stat.h> | ||
2207 | #include <asm/processor.h> | ||
2208 | #include <asm/sigcontext.h> | ||
2209 | #include <asm/user.h> | ||
2210 | @@ -38,17 +39,38 @@ #define restore_fpu(tsk) \ | ||
2211 | extern void kernel_fpu_begin(void); | ||
2212 | #define kernel_fpu_end() do { stts(); preempt_enable(); } while(0) | ||
2213 | |||
2214 | +/* We need a safe address that is cheap to find and that is already | ||
2215 | + in L1 during context switch. The best choices are unfortunately | ||
2216 | + different for UP and SMP */ | ||
2217 | +#ifdef CONFIG_SMP | ||
2218 | +#define safe_address (__per_cpu_offset[0]) | ||
2219 | +#else | ||
2220 | +#define safe_address (kstat_cpu(0).cpustat.user) | ||
2221 | +#endif | ||
2222 | + | ||
2223 | /* | ||
2224 | * These must be called with preempt disabled | ||
2225 | */ | ||
2226 | static inline void __save_init_fpu( struct task_struct *tsk ) | ||
2227 | { | ||
2228 | + /* Use more nops than strictly needed in case the compiler | ||
2229 | + varies code */ | ||
2230 | alternative_input( | ||
2231 | - "fnsave %1 ; fwait ;" GENERIC_NOP2, | ||
2232 | - "fxsave %1 ; fnclex", | ||
2233 | + "fnsave %[fx] ;fwait;" GENERIC_NOP8 GENERIC_NOP4, | ||
2234 | + "fxsave %[fx]\n" | ||
2235 | + "bt $7,%[fsw] ; jc 1f ; fnclex\n1:", | ||
2236 | X86_FEATURE_FXSR, | ||
2237 | - "m" (tsk->thread.i387.fxsave) | ||
2238 | - :"memory"); | ||
2239 | + [fx] "m" (tsk->thread.i387.fxsave), | ||
2240 | + [fsw] "m" (tsk->thread.i387.fxsave.swd) : "memory"); | ||
2241 | + /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception | ||
2242 | + is pending. Clear the x87 state here by setting it to fixed | ||
2243 | + values. __per_cpu_offset[0] is a random variable that should be in L1 */ | ||
2244 | + alternative_input( | ||
2245 | + GENERIC_NOP8 GENERIC_NOP2, | ||
2246 | + "emms\n\t" /* clear stack tags */ | ||
2247 | + "fildl %[addr]", /* set F?P to defined value */ | ||
2248 | + X86_FEATURE_FXSAVE_LEAK, | ||
2249 | + [addr] "m" (safe_address)); | ||
2250 | task_thread_info(tsk)->status &= ~TS_USEDFPU; | ||
2251 | } | ||
2252 | |||
2253 | diff --git a/include/asm-m32r/smp.h b/include/asm-m32r/smp.h | ||
2254 | index 7885b7d..1184293 100644 | ||
2255 | --- a/include/asm-m32r/smp.h | ||
2256 | +++ b/include/asm-m32r/smp.h | ||
2257 | @@ -67,7 +67,8 @@ #define cpu_to_physid(cpu_id) cpu_2_phys | ||
2258 | #define raw_smp_processor_id() (current_thread_info()->cpu) | ||
2259 | |||
2260 | extern cpumask_t cpu_callout_map; | ||
2261 | -#define cpu_possible_map cpu_callout_map | ||
2262 | +extern cpumask_t cpu_possible_map; | ||
2263 | +extern cpumask_t cpu_present_map; | ||
2264 | |||
2265 | static __inline__ int hard_smp_processor_id(void) | ||
2266 | { | ||
2267 | diff --git a/include/asm-m32r/uaccess.h b/include/asm-m32r/uaccess.h | ||
2268 | index e8ae619..819cc28 100644 | ||
2269 | --- a/include/asm-m32r/uaccess.h | ||
2270 | +++ b/include/asm-m32r/uaccess.h | ||
2271 | @@ -5,17 +5,9 @@ #define _ASM_M32R_UACCESS_H | ||
2272 | * linux/include/asm-m32r/uaccess.h | ||
2273 | * | ||
2274 | * M32R version. | ||
2275 | - * Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org> | ||
2276 | + * Copyright (C) 2004, 2006 Hirokazu Takata <takata at linux-m32r.org> | ||
2277 | */ | ||
2278 | |||
2279 | -#undef UACCESS_DEBUG | ||
2280 | - | ||
2281 | -#ifdef UACCESS_DEBUG | ||
2282 | -#define UAPRINTK(args...) printk(args) | ||
2283 | -#else | ||
2284 | -#define UAPRINTK(args...) | ||
2285 | -#endif /* UACCESS_DEBUG */ | ||
2286 | - | ||
2287 | /* | ||
2288 | * User space memory access functions | ||
2289 | */ | ||
2290 | @@ -38,27 +30,29 @@ #define VERIFY_WRITE 1 | ||
2291 | #define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) | ||
2292 | |||
2293 | #ifdef CONFIG_MMU | ||
2294 | + | ||
2295 | #define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFF) | ||
2296 | #define USER_DS MAKE_MM_SEG(PAGE_OFFSET) | ||
2297 | -#else | ||
2298 | -#define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFF) | ||
2299 | -#define USER_DS MAKE_MM_SEG(0xFFFFFFFF) | ||
2300 | -#endif /* CONFIG_MMU */ | ||
2301 | - | ||
2302 | #define get_ds() (KERNEL_DS) | ||
2303 | -#ifdef CONFIG_MMU | ||
2304 | #define get_fs() (current_thread_info()->addr_limit) | ||
2305 | #define set_fs(x) (current_thread_info()->addr_limit = (x)) | ||
2306 | -#else | ||
2307 | + | ||
2308 | +#else /* not CONFIG_MMU */ | ||
2309 | + | ||
2310 | +#define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFF) | ||
2311 | +#define USER_DS MAKE_MM_SEG(0xFFFFFFFF) | ||
2312 | +#define get_ds() (KERNEL_DS) | ||
2313 | + | ||
2314 | static inline mm_segment_t get_fs(void) | ||
2315 | { | ||
2316 | - return USER_DS; | ||
2317 | + return USER_DS; | ||
2318 | } | ||
2319 | |||
2320 | static inline void set_fs(mm_segment_t s) | ||
2321 | { | ||
2322 | } | ||
2323 | -#endif /* CONFIG_MMU */ | ||
2324 | + | ||
2325 | +#endif /* not CONFIG_MMU */ | ||
2326 | |||
2327 | #define segment_eq(a,b) ((a).seg == (b).seg) | ||
2328 | |||
2329 | @@ -83,9 +77,9 @@ #define __range_ok(addr,size) ({ \ | ||
2330 | " subx %0, %0\n" \ | ||
2331 | " cmpu %4, %1\n" \ | ||
2332 | " subx %0, %5\n" \ | ||
2333 | - : "=&r"(flag), "=r"(sum) \ | ||
2334 | - : "1"(addr), "r"((int)(size)), \ | ||
2335 | - "r"(current_thread_info()->addr_limit.seg), "r"(0) \ | ||
2336 | + : "=&r" (flag), "=r" (sum) \ | ||
2337 | + : "1" (addr), "r" ((int)(size)), \ | ||
2338 | + "r" (current_thread_info()->addr_limit.seg), "r" (0) \ | ||
2339 | : "cbit" ); \ | ||
2340 | flag; }) | ||
2341 | |||
2342 | @@ -113,10 +107,10 @@ #define access_ok(type,addr,size) (likel | ||
2343 | #else | ||
2344 | static inline int access_ok(int type, const void *addr, unsigned long size) | ||
2345 | { | ||
2346 | - extern unsigned long memory_start, memory_end; | ||
2347 | - unsigned long val = (unsigned long)addr; | ||
2348 | + extern unsigned long memory_start, memory_end; | ||
2349 | + unsigned long val = (unsigned long)addr; | ||
2350 | |||
2351 | - return ((val >= memory_start) && ((val + size) < memory_end)); | ||
2352 | + return ((val >= memory_start) && ((val + size) < memory_end)); | ||
2353 | } | ||
2354 | #endif /* CONFIG_MMU */ | ||
2355 | |||
2356 | @@ -155,39 +149,6 @@ extern int fixup_exception(struct pt_reg | ||
2357 | * accesses to the same area of user memory). | ||
2358 | */ | ||
2359 | |||
2360 | -extern void __get_user_1(void); | ||
2361 | -extern void __get_user_2(void); | ||
2362 | -extern void __get_user_4(void); | ||
2363 | - | ||
2364 | -#ifndef MODULE | ||
2365 | -#define __get_user_x(size,ret,x,ptr) \ | ||
2366 | - __asm__ __volatile__( \ | ||
2367 | - " mv r0, %0\n" \ | ||
2368 | - " mv r1, %1\n" \ | ||
2369 | - " bl __get_user_" #size "\n" \ | ||
2370 | - " mv %0, r0\n" \ | ||
2371 | - " mv %1, r1\n" \ | ||
2372 | - : "=r"(ret), "=r"(x) \ | ||
2373 | - : "0"(ptr) \ | ||
2374 | - : "r0", "r1", "r14" ) | ||
2375 | -#else /* MODULE */ | ||
2376 | -/* | ||
2377 | - * Use "jl" instead of "bl" for MODULE | ||
2378 | - */ | ||
2379 | -#define __get_user_x(size,ret,x,ptr) \ | ||
2380 | - __asm__ __volatile__( \ | ||
2381 | - " mv r0, %0\n" \ | ||
2382 | - " mv r1, %1\n" \ | ||
2383 | - " seth lr, #high(__get_user_" #size ")\n" \ | ||
2384 | - " or3 lr, lr, #low(__get_user_" #size ")\n" \ | ||
2385 | - " jl lr\n" \ | ||
2386 | - " mv %0, r0\n" \ | ||
2387 | - " mv %1, r1\n" \ | ||
2388 | - : "=r"(ret), "=r"(x) \ | ||
2389 | - : "0"(ptr) \ | ||
2390 | - : "r0", "r1", "r14" ) | ||
2391 | -#endif | ||
2392 | - | ||
2393 | /* Careful: we have to cast the result to the type of the pointer for sign | ||
2394 | reasons */ | ||
2395 | /** | ||
2396 | @@ -208,20 +169,7 @@ #endif | ||
2397 | * On error, the variable @x is set to zero. | ||
2398 | */ | ||
2399 | #define get_user(x,ptr) \ | ||
2400 | -({ int __ret_gu; \ | ||
2401 | - unsigned long __val_gu; \ | ||
2402 | - __chk_user_ptr(ptr); \ | ||
2403 | - switch(sizeof (*(ptr))) { \ | ||
2404 | - case 1: __get_user_x(1,__ret_gu,__val_gu,ptr); break; \ | ||
2405 | - case 2: __get_user_x(2,__ret_gu,__val_gu,ptr); break; \ | ||
2406 | - case 4: __get_user_x(4,__ret_gu,__val_gu,ptr); break; \ | ||
2407 | - default: __get_user_x(X,__ret_gu,__val_gu,ptr); break; \ | ||
2408 | - } \ | ||
2409 | - (x) = (__typeof__(*(ptr)))__val_gu; \ | ||
2410 | - __ret_gu; \ | ||
2411 | -}) | ||
2412 | - | ||
2413 | -extern void __put_user_bad(void); | ||
2414 | + __get_user_check((x),(ptr),sizeof(*(ptr))) | ||
2415 | |||
2416 | /** | ||
2417 | * put_user: - Write a simple value into user space. | ||
2418 | @@ -240,8 +188,7 @@ extern void __put_user_bad(void); | ||
2419 | * Returns zero on success, or -EFAULT on error. | ||
2420 | */ | ||
2421 | #define put_user(x,ptr) \ | ||
2422 | - __put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr))) | ||
2423 | - | ||
2424 | + __put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr))) | ||
2425 | |||
2426 | /** | ||
2427 | * __get_user: - Get a simple variable from user space, with less checking. | ||
2428 | @@ -264,8 +211,64 @@ #define put_user(x,ptr) \ | ||
2429 | * On error, the variable @x is set to zero. | ||
2430 | */ | ||
2431 | #define __get_user(x,ptr) \ | ||
2432 | - __get_user_nocheck((x),(ptr),sizeof(*(ptr))) | ||
2433 | + __get_user_nocheck((x),(ptr),sizeof(*(ptr))) | ||
2434 | |||
2435 | +#define __get_user_nocheck(x,ptr,size) \ | ||
2436 | +({ \ | ||
2437 | + long __gu_err = 0; \ | ||
2438 | + unsigned long __gu_val; \ | ||
2439 | + might_sleep(); \ | ||
2440 | + __get_user_size(__gu_val,(ptr),(size),__gu_err); \ | ||
2441 | + (x) = (__typeof__(*(ptr)))__gu_val; \ | ||
2442 | + __gu_err; \ | ||
2443 | +}) | ||
2444 | + | ||
2445 | +#define __get_user_check(x,ptr,size) \ | ||
2446 | +({ \ | ||
2447 | + long __gu_err = -EFAULT; \ | ||
2448 | + unsigned long __gu_val = 0; \ | ||
2449 | + const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ | ||
2450 | + might_sleep(); \ | ||
2451 | + if (access_ok(VERIFY_READ,__gu_addr,size)) \ | ||
2452 | + __get_user_size(__gu_val,__gu_addr,(size),__gu_err); \ | ||
2453 | + (x) = (__typeof__(*(ptr)))__gu_val; \ | ||
2454 | + __gu_err; \ | ||
2455 | +}) | ||
2456 | + | ||
2457 | +extern long __get_user_bad(void); | ||
2458 | + | ||
2459 | +#define __get_user_size(x,ptr,size,retval) \ | ||
2460 | +do { \ | ||
2461 | + retval = 0; \ | ||
2462 | + __chk_user_ptr(ptr); \ | ||
2463 | + switch (size) { \ | ||
2464 | + case 1: __get_user_asm(x,ptr,retval,"ub"); break; \ | ||
2465 | + case 2: __get_user_asm(x,ptr,retval,"uh"); break; \ | ||
2466 | + case 4: __get_user_asm(x,ptr,retval,""); break; \ | ||
2467 | + default: (x) = __get_user_bad(); \ | ||
2468 | + } \ | ||
2469 | +} while (0) | ||
2470 | + | ||
2471 | +#define __get_user_asm(x, addr, err, itype) \ | ||
2472 | + __asm__ __volatile__( \ | ||
2473 | + " .fillinsn\n" \ | ||
2474 | + "1: ld"itype" %1,@%2\n" \ | ||
2475 | + " .fillinsn\n" \ | ||
2476 | + "2:\n" \ | ||
2477 | + ".section .fixup,\"ax\"\n" \ | ||
2478 | + " .balign 4\n" \ | ||
2479 | + "3: ldi %0,%3\n" \ | ||
2480 | + " seth r14,#high(2b)\n" \ | ||
2481 | + " or3 r14,r14,#low(2b)\n" \ | ||
2482 | + " jmp r14\n" \ | ||
2483 | + ".previous\n" \ | ||
2484 | + ".section __ex_table,\"a\"\n" \ | ||
2485 | + " .balign 4\n" \ | ||
2486 | + " .long 1b,3b\n" \ | ||
2487 | + ".previous" \ | ||
2488 | + : "=&r" (err), "=&r" (x) \ | ||
2489 | + : "r" (addr), "i" (-EFAULT), "0" (err) \ | ||
2490 | + : "r14", "memory") | ||
2491 | |||
2492 | /** | ||
2493 | * __put_user: - Write a simple value into user space, with less checking. | ||
2494 | @@ -287,11 +290,13 @@ #define __get_user(x,ptr) \ | ||
2495 | * Returns zero on success, or -EFAULT on error. | ||
2496 | */ | ||
2497 | #define __put_user(x,ptr) \ | ||
2498 | - __put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr))) | ||
2499 | + __put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr))) | ||
2500 | + | ||
2501 | |||
2502 | #define __put_user_nocheck(x,ptr,size) \ | ||
2503 | ({ \ | ||
2504 | long __pu_err; \ | ||
2505 | + might_sleep(); \ | ||
2506 | __put_user_size((x),(ptr),(size),__pu_err); \ | ||
2507 | __pu_err; \ | ||
2508 | }) | ||
2509 | @@ -308,28 +313,28 @@ ({ \ | ||
2510 | }) | ||
2511 | |||
2512 | #if defined(__LITTLE_ENDIAN__) | ||
2513 | -#define __put_user_u64(x, addr, err) \ | ||
2514 | - __asm__ __volatile__( \ | ||
2515 | - " .fillinsn\n" \ | ||
2516 | - "1: st %L1,@%2\n" \ | ||
2517 | - " .fillinsn\n" \ | ||
2518 | - "2: st %H1,@(4,%2)\n" \ | ||
2519 | - " .fillinsn\n" \ | ||
2520 | - "3:\n" \ | ||
2521 | - ".section .fixup,\"ax\"\n" \ | ||
2522 | - " .balign 4\n" \ | ||
2523 | - "4: ldi %0,%3\n" \ | ||
2524 | - " seth r14,#high(3b)\n" \ | ||
2525 | - " or3 r14,r14,#low(3b)\n" \ | ||
2526 | - " jmp r14\n" \ | ||
2527 | - ".previous\n" \ | ||
2528 | - ".section __ex_table,\"a\"\n" \ | ||
2529 | - " .balign 4\n" \ | ||
2530 | - " .long 1b,4b\n" \ | ||
2531 | - " .long 2b,4b\n" \ | ||
2532 | - ".previous" \ | ||
2533 | - : "=&r"(err) \ | ||
2534 | - : "r"(x), "r"(addr), "i"(-EFAULT), "0"(err) \ | ||
2535 | +#define __put_user_u64(x, addr, err) \ | ||
2536 | + __asm__ __volatile__( \ | ||
2537 | + " .fillinsn\n" \ | ||
2538 | + "1: st %L1,@%2\n" \ | ||
2539 | + " .fillinsn\n" \ | ||
2540 | + "2: st %H1,@(4,%2)\n" \ | ||
2541 | + " .fillinsn\n" \ | ||
2542 | + "3:\n" \ | ||
2543 | + ".section .fixup,\"ax\"\n" \ | ||
2544 | + " .balign 4\n" \ | ||
2545 | + "4: ldi %0,%3\n" \ | ||
2546 | + " seth r14,#high(3b)\n" \ | ||
2547 | + " or3 r14,r14,#low(3b)\n" \ | ||
2548 | + " jmp r14\n" \ | ||
2549 | + ".previous\n" \ | ||
2550 | + ".section __ex_table,\"a\"\n" \ | ||
2551 | + " .balign 4\n" \ | ||
2552 | + " .long 1b,4b\n" \ | ||
2553 | + " .long 2b,4b\n" \ | ||
2554 | + ".previous" \ | ||
2555 | + : "=&r" (err) \ | ||
2556 | + : "r" (x), "r" (addr), "i" (-EFAULT), "0" (err) \ | ||
2557 | : "r14", "memory") | ||
2558 | |||
2559 | #elif defined(__BIG_ENDIAN__) | ||
2560 | @@ -353,13 +358,15 @@ #define __put_user_u64(x, addr, err) | ||
2561 | " .long 1b,4b\n" \ | ||
2562 | " .long 2b,4b\n" \ | ||
2563 | ".previous" \ | ||
2564 | - : "=&r"(err) \ | ||
2565 | - : "r"(x), "r"(addr), "i"(-EFAULT), "0"(err) \ | ||
2566 | + : "=&r" (err) \ | ||
2567 | + : "r" (x), "r" (addr), "i" (-EFAULT), "0" (err) \ | ||
2568 | : "r14", "memory") | ||
2569 | #else | ||
2570 | #error no endian defined | ||
2571 | #endif | ||
2572 | |||
2573 | +extern void __put_user_bad(void); | ||
2574 | + | ||
2575 | #define __put_user_size(x,ptr,size,retval) \ | ||
2576 | do { \ | ||
2577 | retval = 0; \ | ||
2578 | @@ -398,52 +405,8 @@ #define __put_user_asm(x, addr, err, ity | ||
2579 | " .balign 4\n" \ | ||
2580 | " .long 1b,3b\n" \ | ||
2581 | ".previous" \ | ||
2582 | - : "=&r"(err) \ | ||
2583 | - : "r"(x), "r"(addr), "i"(-EFAULT), "0"(err) \ | ||
2584 | - : "r14", "memory") | ||
2585 | - | ||
2586 | -#define __get_user_nocheck(x,ptr,size) \ | ||
2587 | -({ \ | ||
2588 | - long __gu_err; \ | ||
2589 | - unsigned long __gu_val; \ | ||
2590 | - __get_user_size(__gu_val,(ptr),(size),__gu_err); \ | ||
2591 | - (x) = (__typeof__(*(ptr)))__gu_val; \ | ||
2592 | - __gu_err; \ | ||
2593 | -}) | ||
2594 | - | ||
2595 | -extern long __get_user_bad(void); | ||
2596 | - | ||
2597 | -#define __get_user_size(x,ptr,size,retval) \ | ||
2598 | -do { \ | ||
2599 | - retval = 0; \ | ||
2600 | - __chk_user_ptr(ptr); \ | ||
2601 | - switch (size) { \ | ||
2602 | - case 1: __get_user_asm(x,ptr,retval,"ub"); break; \ | ||
2603 | - case 2: __get_user_asm(x,ptr,retval,"uh"); break; \ | ||
2604 | - case 4: __get_user_asm(x,ptr,retval,""); break; \ | ||
2605 | - default: (x) = __get_user_bad(); \ | ||
2606 | - } \ | ||
2607 | -} while (0) | ||
2608 | - | ||
2609 | -#define __get_user_asm(x, addr, err, itype) \ | ||
2610 | - __asm__ __volatile__( \ | ||
2611 | - " .fillinsn\n" \ | ||
2612 | - "1: ld"itype" %1,@%2\n" \ | ||
2613 | - " .fillinsn\n" \ | ||
2614 | - "2:\n" \ | ||
2615 | - ".section .fixup,\"ax\"\n" \ | ||
2616 | - " .balign 4\n" \ | ||
2617 | - "3: ldi %0,%3\n" \ | ||
2618 | - " seth r14,#high(2b)\n" \ | ||
2619 | - " or3 r14,r14,#low(2b)\n" \ | ||
2620 | - " jmp r14\n" \ | ||
2621 | - ".previous\n" \ | ||
2622 | - ".section __ex_table,\"a\"\n" \ | ||
2623 | - " .balign 4\n" \ | ||
2624 | - " .long 1b,3b\n" \ | ||
2625 | - ".previous" \ | ||
2626 | - : "=&r"(err), "=&r"(x) \ | ||
2627 | - : "r"(addr), "i"(-EFAULT), "0"(err) \ | ||
2628 | + : "=&r" (err) \ | ||
2629 | + : "r" (x), "r" (addr), "i" (-EFAULT), "0" (err) \ | ||
2630 | : "r14", "memory") | ||
2631 | |||
2632 | /* | ||
2633 | @@ -453,7 +416,6 @@ #define __get_user_asm(x, addr, err, ity | ||
2634 | * anything, so this is accurate. | ||
2635 | */ | ||
2636 | |||
2637 | - | ||
2638 | /* | ||
2639 | * Copy To/From Userspace | ||
2640 | */ | ||
2641 | @@ -511,8 +473,9 @@ do { \ | ||
2642 | " .long 2b,9b\n" \ | ||
2643 | " .long 3b,9b\n" \ | ||
2644 | ".previous\n" \ | ||
2645 | - : "=&r"(__dst), "=&r"(__src), "=&r"(size), "=&r"(__c) \ | ||
2646 | - : "0"(to), "1"(from), "2"(size), "3"(size / 4) \ | ||
2647 | + : "=&r" (__dst), "=&r" (__src), "=&r" (size), \ | ||
2648 | + "=&r" (__c) \ | ||
2649 | + : "0" (to), "1" (from), "2" (size), "3" (size / 4) \ | ||
2650 | : "r14", "memory"); \ | ||
2651 | } while (0) | ||
2652 | |||
2653 | @@ -573,8 +536,9 @@ do { \ | ||
2654 | " .long 2b,7b\n" \ | ||
2655 | " .long 3b,7b\n" \ | ||
2656 | ".previous\n" \ | ||
2657 | - : "=&r"(__dst), "=&r"(__src), "=&r"(size), "=&r"(__c) \ | ||
2658 | - : "0"(to), "1"(from), "2"(size), "3"(size / 4) \ | ||
2659 | + : "=&r" (__dst), "=&r" (__src), "=&r" (size), \ | ||
2660 | + "=&r" (__c) \ | ||
2661 | + : "0" (to), "1" (from), "2" (size), "3" (size / 4) \ | ||
2662 | : "r14", "memory"); \ | ||
2663 | } while (0) | ||
2664 | |||
2665 | @@ -676,7 +640,7 @@ #define __copy_from_user(to,from,n) \ | ||
2666 | #define copy_from_user(to,from,n) \ | ||
2667 | ({ \ | ||
2668 | might_sleep(); \ | ||
2669 | -__generic_copy_from_user((to),(from),(n)); \ | ||
2670 | + __generic_copy_from_user((to),(from),(n)); \ | ||
2671 | }) | ||
2672 | |||
2673 | long __must_check strncpy_from_user(char *dst, const char __user *src, | ||
2674 | diff --git a/include/asm-powerpc/floppy.h b/include/asm-powerpc/floppy.h | ||
2675 | index e258778..608164c 100644 | ||
2676 | --- a/include/asm-powerpc/floppy.h | ||
2677 | +++ b/include/asm-powerpc/floppy.h | ||
2678 | @@ -35,6 +35,7 @@ #define fd_free_irq() free_irq | ||
2679 | #ifdef CONFIG_PCI | ||
2680 | |||
2681 | #include <linux/pci.h> | ||
2682 | +#include <asm/ppc-pci.h> /* for ppc64_isabridge_dev */ | ||
2683 | |||
2684 | #define fd_dma_setup(addr,size,mode,io) powerpc_fd_dma_setup(addr,size,mode,io) | ||
2685 | |||
2686 | @@ -52,12 +53,12 @@ static __inline__ int powerpc_fd_dma_set | ||
2687 | if (bus_addr | ||
2688 | && (addr != prev_addr || size != prev_size || dir != prev_dir)) { | ||
2689 | /* different from last time -- unmap prev */ | ||
2690 | - pci_unmap_single(NULL, bus_addr, prev_size, prev_dir); | ||
2691 | + pci_unmap_single(ppc64_isabridge_dev, bus_addr, prev_size, prev_dir); | ||
2692 | bus_addr = 0; | ||
2693 | } | ||
2694 | |||
2695 | if (!bus_addr) /* need to map it */ | ||
2696 | - bus_addr = pci_map_single(NULL, addr, size, dir); | ||
2697 | + bus_addr = pci_map_single(ppc64_isabridge_dev, addr, size, dir); | ||
2698 | |||
2699 | /* remember this one as prev */ | ||
2700 | prev_addr = addr; | ||
2701 | diff --git a/include/asm-x86_64/cpufeature.h b/include/asm-x86_64/cpufeature.h | ||
2702 | index 76bb619..662964b 100644 | ||
2703 | --- a/include/asm-x86_64/cpufeature.h | ||
2704 | +++ b/include/asm-x86_64/cpufeature.h | ||
2705 | @@ -64,6 +64,7 @@ #define X86_FEATURE_CENTAUR_MCR (3*32+ 3 | ||
2706 | #define X86_FEATURE_REP_GOOD (3*32+ 4) /* rep microcode works well on this CPU */ | ||
2707 | #define X86_FEATURE_CONSTANT_TSC (3*32+5) /* TSC runs at constant rate */ | ||
2708 | #define X86_FEATURE_SYNC_RDTSC (3*32+6) /* RDTSC syncs CPU core */ | ||
2709 | +#define X86_FEATURE_FXSAVE_LEAK (3*32+7) /* FIP/FOP/FDP leaks through FXSAVE */ | ||
2710 | |||
2711 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ | ||
2712 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ | ||
2713 | diff --git a/include/asm-x86_64/i387.h b/include/asm-x86_64/i387.h | ||
2714 | index 876eb9a..cba8a3b 100644 | ||
2715 | --- a/include/asm-x86_64/i387.h | ||
2716 | +++ b/include/asm-x86_64/i387.h | ||
2717 | @@ -72,6 +72,23 @@ #define set_fpu_cwd(t,val) ((t)->thread. | ||
2718 | #define set_fpu_swd(t,val) ((t)->thread.i387.fxsave.swd = (val)) | ||
2719 | #define set_fpu_fxsr_twd(t,val) ((t)->thread.i387.fxsave.twd = (val)) | ||
2720 | |||
2721 | +#define X87_FSW_ES (1 << 7) /* Exception Summary */ | ||
2722 | + | ||
2723 | +/* AMD CPUs don't save/restore FDP/FIP/FOP unless an exception | ||
2724 | + is pending. Clear the x87 state here by setting it to fixed | ||
2725 | + values. The kernel data segment can be sometimes 0 and sometimes | ||
2726 | + new user value. Both should be ok. | ||
2727 | + Use the PDA as safe address because it should be already in L1. */ | ||
2728 | +static inline void clear_fpu_state(struct i387_fxsave_struct *fx) | ||
2729 | +{ | ||
2730 | + if (unlikely(fx->swd & X87_FSW_ES)) | ||
2731 | + asm volatile("fnclex"); | ||
2732 | + alternative_input(ASM_NOP8 ASM_NOP2, | ||
2733 | + " emms\n" /* clear stack tags */ | ||
2734 | + " fildl %%gs:0", /* load to clear state */ | ||
2735 | + X86_FEATURE_FXSAVE_LEAK); | ||
2736 | +} | ||
2737 | + | ||
2738 | static inline int restore_fpu_checking(struct i387_fxsave_struct *fx) | ||
2739 | { | ||
2740 | int err; | ||
2741 | @@ -119,6 +136,7 @@ #else | ||
2742 | #endif | ||
2743 | if (unlikely(err)) | ||
2744 | __clear_user(fx, sizeof(struct i387_fxsave_struct)); | ||
2745 | + /* No need to clear here because the caller clears USED_MATH */ | ||
2746 | return err; | ||
2747 | } | ||
2748 | |||
2749 | @@ -149,7 +167,7 @@ #else | ||
2750 | "i" (offsetof(__typeof__(*tsk), | ||
2751 | thread.i387.fxsave))); | ||
2752 | #endif | ||
2753 | - __asm__ __volatile__("fnclex"); | ||
2754 | + clear_fpu_state(&tsk->thread.i387.fxsave); | ||
2755 | } | ||
2756 | |||
2757 | static inline void kernel_fpu_begin(void) | ||
2758 | diff --git a/include/linux/cpu.h b/include/linux/cpu.h | ||
2759 | index 0ed1d48..d612b89 100644 | ||
2760 | --- a/include/linux/cpu.h | ||
2761 | +++ b/include/linux/cpu.h | ||
2762 | @@ -32,7 +32,7 @@ struct cpu { | ||
2763 | }; | ||
2764 | |||
2765 | extern int register_cpu(struct cpu *, int, struct node *); | ||
2766 | -extern struct sys_device *get_cpu_sysdev(int cpu); | ||
2767 | +extern struct sys_device *get_cpu_sysdev(unsigned cpu); | ||
2768 | #ifdef CONFIG_HOTPLUG_CPU | ||
2769 | extern void unregister_cpu(struct cpu *, struct node *); | ||
2770 | #endif | ||
2771 | diff --git a/include/linux/fb.h b/include/linux/fb.h | ||
2772 | index 2cb19e6..2fdd8ae 100644 | ||
2773 | --- a/include/linux/fb.h | ||
2774 | +++ b/include/linux/fb.h | ||
2775 | @@ -839,12 +839,10 @@ #if defined (__BIG_ENDIAN) | ||
2776 | #define FB_LEFT_POS(bpp) (32 - bpp) | ||
2777 | #define FB_SHIFT_HIGH(val, bits) ((val) >> (bits)) | ||
2778 | #define FB_SHIFT_LOW(val, bits) ((val) << (bits)) | ||
2779 | -#define FB_BIT_NR(b) (7 - (b)) | ||
2780 | #else | ||
2781 | #define FB_LEFT_POS(bpp) (0) | ||
2782 | #define FB_SHIFT_HIGH(val, bits) ((val) << (bits)) | ||
2783 | #define FB_SHIFT_LOW(val, bits) ((val) >> (bits)) | ||
2784 | -#define FB_BIT_NR(b) (b) | ||
2785 | #endif | ||
2786 | |||
2787 | /* | ||
2788 | diff --git a/include/linux/mm.h b/include/linux/mm.h | ||
2789 | index 498ff87..279446e 100644 | ||
2790 | --- a/include/linux/mm.h | ||
2791 | +++ b/include/linux/mm.h | ||
2792 | @@ -229,10 +229,9 @@ struct page { | ||
2793 | unsigned long private; /* Mapping-private opaque data: | ||
2794 | * usually used for buffer_heads | ||
2795 | * if PagePrivate set; used for | ||
2796 | - * swp_entry_t if PageSwapCache. | ||
2797 | - * When page is free, this | ||
2798 | + * swp_entry_t if PageSwapCache; | ||
2799 | * indicates order in the buddy | ||
2800 | - * system. | ||
2801 | + * system if PG_buddy is set. | ||
2802 | */ | ||
2803 | struct address_space *mapping; /* If low bit clear, points to | ||
2804 | * inode address_space, or NULL. | ||
2805 | --- linux-2.6.16/include/linux/page-flags.h 2006-04-25 19:04:00.000000000 +0200 | ||
2806 | +++ linux-2.6.16-magellan-r7/include/linux/page-flags.h 2006-04-25 19:01:23.000000000 +0200 | ||
2807 | @@ -74,8 +74,9 @@ | ||
2808 | #define PG_mappedtodisk 16 /* Has blocks allocated on-disk */ | ||
2809 | #define PG_reclaim 17 /* To be reclaimed asap */ | ||
2810 | #define PG_nosave_free 18 /* Free, should not be written */ | ||
2811 | -#define PG_uncached 19 /* Page has been mapped as uncached */ | ||
2812 | +#define PG_buddy 19 /* Page is free, on buddy lists */ | ||
2813 | #define PG_readahead 20 /* Reminder to do readahead */ | ||
2814 | +#define PG_uncached 21 /* Page has been mapped as uncached */ | ||
2815 | |||
2816 | /* | ||
2817 | * Global page accounting. One instance per CPU. Only unsigned longs are | ||
2818 | @@ -320,6 +321,10 @@ | ||
2819 | #define SetPageNosaveFree(page) set_bit(PG_nosave_free, &(page)->flags) | ||
2820 | #define ClearPageNosaveFree(page) clear_bit(PG_nosave_free, &(page)->flags) | ||
2821 | |||
2822 | +#define PageBuddy(page) test_bit(PG_buddy, &(page)->flags) | ||
2823 | +#define __SetPageBuddy(page) __set_bit(PG_buddy, &(page)->flags) | ||
2824 | +#define __ClearPageBuddy(page) __clear_bit(PG_buddy, &(page)->flags) | ||
2825 | + | ||
2826 | #define PageMappedToDisk(page) test_bit(PG_mappedtodisk, &(page)->flags) | ||
2827 | #define SetPageMappedToDisk(page) set_bit(PG_mappedtodisk, &(page)->flags) | ||
2828 | #define ClearPageMappedToDisk(page) clear_bit(PG_mappedtodisk, &(page)->flags) | ||
2829 | |||
2830 | diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h | ||
2831 | index aa6322d..6c1e347 100644 | ||
2832 | --- a/include/linux/proc_fs.h | ||
2833 | +++ b/include/linux/proc_fs.h | ||
2834 | @@ -78,7 +78,7 @@ struct kcore_list { | ||
2835 | struct vmcore { | ||
2836 | struct list_head list; | ||
2837 | unsigned long long paddr; | ||
2838 | - unsigned long size; | ||
2839 | + unsigned long long size; | ||
2840 | loff_t offset; | ||
2841 | }; | ||
2842 | |||
2843 | diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h | ||
2844 | index 9d5494a..3009c81 100644 | ||
2845 | --- a/include/linux/raid/raid1.h | ||
2846 | +++ b/include/linux/raid/raid1.h | ||
2847 | @@ -130,6 +130,6 @@ #define R1BIO_BarrierRetry 5 | ||
2848 | * with failure when last write completes (and all failed). | ||
2849 | * Record that bi_end_io was called with this flag... | ||
2850 | */ | ||
2851 | -#define R1BIO_Returned 4 | ||
2852 | +#define R1BIO_Returned 6 | ||
2853 | |||
2854 | #endif | ||
2855 | diff --git a/include/linux/rtc.h b/include/linux/rtc.h | ||
2856 | index 0b2ba67..b739ac1 100644 | ||
2857 | --- a/include/linux/rtc.h | ||
2858 | +++ b/include/linux/rtc.h | ||
2859 | @@ -11,8 +11,6 @@ | ||
2860 | #ifndef _LINUX_RTC_H_ | ||
2861 | #define _LINUX_RTC_H_ | ||
2862 | |||
2863 | -#include <linux/interrupt.h> | ||
2864 | - | ||
2865 | /* | ||
2866 | * The struct used to pass data via the following ioctl. Similar to the | ||
2867 | * struct tm in <time.h>, but it needs to be here so that the kernel | ||
2868 | @@ -95,6 +93,8 @@ #define RTC_PLL_SET _IOW('p', 0x12, stru | ||
2869 | |||
2870 | #ifdef __KERNEL__ | ||
2871 | |||
2872 | +#include <linux/interrupt.h> | ||
2873 | + | ||
2874 | typedef struct rtc_task { | ||
2875 | void (*func)(void *private_data); | ||
2876 | void *private_data; | ||
2877 | diff --git a/include/net/ip.h b/include/net/ip.h | ||
2878 | index fab3d5b..ed84d04 100644 | ||
2879 | --- a/include/net/ip.h | ||
2880 | +++ b/include/net/ip.h | ||
2881 | @@ -95,6 +95,7 @@ extern int ip_local_deliver(struct sk_b | ||
2882 | extern int ip_mr_input(struct sk_buff *skb); | ||
2883 | extern int ip_output(struct sk_buff *skb); | ||
2884 | extern int ip_mc_output(struct sk_buff *skb); | ||
2885 | +extern int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); | ||
2886 | extern int ip_do_nat(struct sk_buff *skb); | ||
2887 | extern void ip_send_check(struct iphdr *ip); | ||
2888 | extern int ip_queue_xmit(struct sk_buff *skb, int ipfragok); | ||
2889 | diff --git a/ipc/shm.c b/ipc/shm.c | ||
2890 | index 9162123..f409726 100644 | ||
2891 | --- a/ipc/shm.c | ||
2892 | +++ b/ipc/shm.c | ||
2893 | @@ -161,6 +161,8 @@ static int shm_mmap(struct file * file, | ||
2894 | ret = shmem_mmap(file, vma); | ||
2895 | if (ret == 0) { | ||
2896 | vma->vm_ops = &shm_vm_ops; | ||
2897 | + if (!(vma->vm_flags & VM_WRITE)) | ||
2898 | + vma->vm_flags &= ~VM_MAYWRITE; | ||
2899 | shm_inc(file->f_dentry->d_inode->i_ino); | ||
2900 | } | ||
2901 | |||
2902 | diff --git a/ipc/util.c b/ipc/util.c | ||
2903 | index 8626219..303b058 100644 | ||
2904 | --- a/ipc/util.c | ||
2905 | +++ b/ipc/util.c | ||
2906 | @@ -182,8 +182,7 @@ static int grow_ary(struct ipc_ids* ids, | ||
2907 | if(new == NULL) | ||
2908 | return size; | ||
2909 | new->size = newsize; | ||
2910 | - memcpy(new->p, ids->entries->p, sizeof(struct kern_ipc_perm *)*size + | ||
2911 | - sizeof(struct ipc_id_ary)); | ||
2912 | + memcpy(new->p, ids->entries->p, sizeof(struct kern_ipc_perm *)*size); | ||
2913 | for(i=size;i<newsize;i++) { | ||
2914 | new->p[i] = NULL; | ||
2915 | } | ||
2916 | diff --git a/kernel/exec_domain.c b/kernel/exec_domain.c | ||
2917 | index 867d6db..c01cead 100644 | ||
2918 | --- a/kernel/exec_domain.c | ||
2919 | +++ b/kernel/exec_domain.c | ||
2920 | @@ -140,6 +140,7 @@ __set_personality(u_long personality) | ||
2921 | ep = lookup_exec_domain(personality); | ||
2922 | if (ep == current_thread_info()->exec_domain) { | ||
2923 | current->personality = personality; | ||
2924 | + module_put(ep->module); | ||
2925 | return 0; | ||
2926 | } | ||
2927 | |||
2928 | diff --git a/kernel/fork.c b/kernel/fork.c | ||
2929 | index b373322..9d4e0d8 100644 | ||
2930 | --- a/kernel/fork.c | ||
2931 | +++ b/kernel/fork.c | ||
2932 | @@ -720,7 +720,7 @@ out_release: | ||
2933 | free_fdset (new_fdt->open_fds, new_fdt->max_fdset); | ||
2934 | free_fd_array(new_fdt->fd, new_fdt->max_fds); | ||
2935 | kmem_cache_free(files_cachep, newf); | ||
2936 | - goto out; | ||
2937 | + return NULL; | ||
2938 | } | ||
2939 | |||
2940 | static int copy_files(unsigned long clone_flags, struct task_struct * tsk) | ||
2941 | diff --git a/kernel/power/process.c b/kernel/power/process.c | ||
2942 | index 28de118..67b2cdd 100644 | ||
2943 | --- a/kernel/power/process.c | ||
2944 | +++ b/kernel/power/process.c | ||
2945 | @@ -25,8 +25,7 @@ static inline int freezeable(struct task | ||
2946 | (p->flags & PF_NOFREEZE) || | ||
2947 | (p->exit_state == EXIT_ZOMBIE) || | ||
2948 | (p->exit_state == EXIT_DEAD) || | ||
2949 | - (p->state == TASK_STOPPED) || | ||
2950 | - (p->state == TASK_TRACED)) | ||
2951 | + (p->state == TASK_STOPPED)) | ||
2952 | return 0; | ||
2953 | return 1; | ||
2954 | } | ||
2955 | diff --git a/kernel/ptrace.c b/kernel/ptrace.c | ||
2956 | index d95a72c..b5eaeb9 100644 | ||
2957 | --- a/kernel/ptrace.c | ||
2958 | +++ b/kernel/ptrace.c | ||
2959 | @@ -57,10 +57,6 @@ void ptrace_untrace(task_t *child) | ||
2960 | signal_wake_up(child, 1); | ||
2961 | } | ||
2962 | } | ||
2963 | - if (child->signal->flags & SIGNAL_GROUP_EXIT) { | ||
2964 | - sigaddset(&child->pending.signal, SIGKILL); | ||
2965 | - signal_wake_up(child, 1); | ||
2966 | - } | ||
2967 | spin_unlock(&child->sighand->siglock); | ||
2968 | } | ||
2969 | |||
2970 | @@ -82,7 +78,8 @@ void __ptrace_unlink(task_t *child) | ||
2971 | SET_LINKS(child); | ||
2972 | } | ||
2973 | |||
2974 | - ptrace_untrace(child); | ||
2975 | + if (child->state == TASK_TRACED) | ||
2976 | + ptrace_untrace(child); | ||
2977 | } | ||
2978 | |||
2979 | /* | ||
2980 | diff --git a/kernel/sched.c b/kernel/sched.c | ||
2981 | index 4d46e90..4e7efac 100644 | ||
2982 | --- a/kernel/sched.c | ||
2983 | +++ b/kernel/sched.c | ||
2984 | @@ -237,6 +237,7 @@ #ifdef CONFIG_SMP | ||
2985 | |||
2986 | task_t *migration_thread; | ||
2987 | struct list_head migration_queue; | ||
2988 | + int cpu; | ||
2989 | #endif | ||
2990 | |||
2991 | #ifdef CONFIG_SCHEDSTATS | ||
2992 | @@ -1660,6 +1661,9 @@ #ifdef CONFIG_SMP | ||
2993 | /* | ||
2994 | * double_rq_lock - safely lock two runqueues | ||
2995 | * | ||
2996 | + * We must take them in cpu order to match code in | ||
2997 | + * dependent_sleeper and wake_dependent_sleeper. | ||
2998 | + * | ||
2999 | * Note this does not disable interrupts like task_rq_lock, | ||
3000 | * you need to do so manually before calling. | ||
3001 | */ | ||
3002 | @@ -1671,7 +1675,7 @@ static void double_rq_lock(runqueue_t *r | ||
3003 | spin_lock(&rq1->lock); | ||
3004 | __acquire(rq2->lock); /* Fake it out ;) */ | ||
3005 | } else { | ||
3006 | - if (rq1 < rq2) { | ||
3007 | + if (rq1->cpu < rq2->cpu) { | ||
3008 | spin_lock(&rq1->lock); | ||
3009 | spin_lock(&rq2->lock); | ||
3010 | } else { | ||
3011 | @@ -1707,7 +1711,7 @@ static void double_lock_balance(runqueue | ||
3012 | __acquires(this_rq->lock) | ||
3013 | { | ||
3014 | if (unlikely(!spin_trylock(&busiest->lock))) { | ||
3015 | - if (busiest < this_rq) { | ||
3016 | + if (busiest->cpu < this_rq->cpu) { | ||
3017 | spin_unlock(&this_rq->lock); | ||
3018 | spin_lock(&busiest->lock); | ||
3019 | spin_lock(&this_rq->lock); | ||
3020 | @@ -6035,6 +6039,7 @@ #ifdef CONFIG_SMP | ||
3021 | rq->push_cpu = 0; | ||
3022 | rq->migration_thread = NULL; | ||
3023 | INIT_LIST_HEAD(&rq->migration_queue); | ||
3024 | + rq->cpu = i; | ||
3025 | #endif | ||
3026 | atomic_set(&rq->nr_iowait, 0); | ||
3027 | |||
3028 | diff --git a/kernel/signal.c b/kernel/signal.c | ||
3029 | index ea15410..acbccf7 100644 | ||
3030 | --- a/kernel/signal.c | ||
3031 | +++ b/kernel/signal.c | ||
3032 | @@ -975,7 +975,6 @@ __group_complete_signal(int sig, struct | ||
3033 | if (t == NULL) | ||
3034 | /* restart balancing at this thread */ | ||
3035 | t = p->signal->curr_target = p; | ||
3036 | - BUG_ON(t->tgid != p->tgid); | ||
3037 | |||
3038 | while (!wants_signal(sig, t)) { | ||
3039 | t = next_thread(t); | ||
3040 | @@ -1689,6 +1688,7 @@ static void ptrace_stop(int exit_code, i | ||
3041 | /* Let the debugger run. */ | ||
3042 | set_current_state(TASK_TRACED); | ||
3043 | spin_unlock_irq(¤t->sighand->siglock); | ||
3044 | + try_to_freeze(); | ||
3045 | read_lock(&tasklist_lock); | ||
3046 | if (likely(current->ptrace & PT_PTRACED) && | ||
3047 | likely(current->parent != current->real_parent || | ||
3048 | @@ -1942,9 +1942,9 @@ relock: | ||
3049 | /* Let the debugger run. */ | ||
3050 | ptrace_stop(signr, signr, info); | ||
3051 | |||
3052 | - /* We're back. Did the debugger cancel the sig or group_exit? */ | ||
3053 | + /* We're back. Did the debugger cancel the sig? */ | ||
3054 | signr = current->exit_code; | ||
3055 | - if (signr == 0 || current->signal->flags & SIGNAL_GROUP_EXIT) | ||
3056 | + if (signr == 0) | ||
3057 | continue; | ||
3058 | |||
3059 | current->exit_code = 0; | ||
3060 | diff --git a/kernel/sys.c b/kernel/sys.c | ||
3061 | index f91218a..105e102 100644 | ||
3062 | --- a/kernel/sys.c | ||
3063 | +++ b/kernel/sys.c | ||
3064 | @@ -1657,7 +1657,19 @@ asmlinkage long sys_setrlimit(unsigned i | ||
3065 | (cputime_eq(current->signal->it_prof_expires, cputime_zero) || | ||
3066 | new_rlim.rlim_cur <= cputime_to_secs( | ||
3067 | current->signal->it_prof_expires))) { | ||
3068 | - cputime_t cputime = secs_to_cputime(new_rlim.rlim_cur); | ||
3069 | + unsigned long rlim_cur = new_rlim.rlim_cur; | ||
3070 | + cputime_t cputime; | ||
3071 | + | ||
3072 | + if (rlim_cur == 0) { | ||
3073 | + /* | ||
3074 | + * The caller is asking for an immediate RLIMIT_CPU | ||
3075 | + * expiry. But we use the zero value to mean "it was | ||
3076 | + * never set". So let's cheat and make it one second | ||
3077 | + * instead | ||
3078 | + */ | ||
3079 | + rlim_cur = 1; | ||
3080 | + } | ||
3081 | + cputime = secs_to_cputime(rlim_cur); | ||
3082 | read_lock(&tasklist_lock); | ||
3083 | spin_lock_irq(¤t->sighand->siglock); | ||
3084 | set_process_cpu_timer(current, CPUCLOCK_PROF, | ||
3085 | diff --git a/kernel/uid16.c b/kernel/uid16.c | ||
3086 | index aa25605..187e2a4 100644 | ||
3087 | --- a/kernel/uid16.c | ||
3088 | +++ b/kernel/uid16.c | ||
3089 | @@ -20,43 +20,67 @@ #include <asm/uaccess.h> | ||
3090 | |||
3091 | asmlinkage long sys_chown16(const char __user * filename, old_uid_t user, old_gid_t group) | ||
3092 | { | ||
3093 | - return sys_chown(filename, low2highuid(user), low2highgid(group)); | ||
3094 | + long ret = sys_chown(filename, low2highuid(user), low2highgid(group)); | ||
3095 | + /* avoid REGPARM breakage on x86: */ | ||
3096 | + prevent_tail_call(ret); | ||
3097 | + return ret; | ||
3098 | } | ||
3099 | |||
3100 | asmlinkage long sys_lchown16(const char __user * filename, old_uid_t user, old_gid_t group) | ||
3101 | { | ||
3102 | - return sys_lchown(filename, low2highuid(user), low2highgid(group)); | ||
3103 | + long ret = sys_lchown(filename, low2highuid(user), low2highgid(group)); | ||
3104 | + /* avoid REGPARM breakage on x86: */ | ||
3105 | + prevent_tail_call(ret); | ||
3106 | + return ret; | ||
3107 | } | ||
3108 | |||
3109 | asmlinkage long sys_fchown16(unsigned int fd, old_uid_t user, old_gid_t group) | ||
3110 | { | ||
3111 | - return sys_fchown(fd, low2highuid(user), low2highgid(group)); | ||
3112 | + long ret = sys_fchown(fd, low2highuid(user), low2highgid(group)); | ||
3113 | + /* avoid REGPARM breakage on x86: */ | ||
3114 | + prevent_tail_call(ret); | ||
3115 | + return ret; | ||
3116 | } | ||
3117 | |||
3118 | asmlinkage long sys_setregid16(old_gid_t rgid, old_gid_t egid) | ||
3119 | { | ||
3120 | - return sys_setregid(low2highgid(rgid), low2highgid(egid)); | ||
3121 | + long ret = sys_setregid(low2highgid(rgid), low2highgid(egid)); | ||
3122 | + /* avoid REGPARM breakage on x86: */ | ||
3123 | + prevent_tail_call(ret); | ||
3124 | + return ret; | ||
3125 | } | ||
3126 | |||
3127 | asmlinkage long sys_setgid16(old_gid_t gid) | ||
3128 | { | ||
3129 | - return sys_setgid(low2highgid(gid)); | ||
3130 | + long ret = sys_setgid(low2highgid(gid)); | ||
3131 | + /* avoid REGPARM breakage on x86: */ | ||
3132 | + prevent_tail_call(ret); | ||
3133 | + return ret; | ||
3134 | } | ||
3135 | |||
3136 | asmlinkage long sys_setreuid16(old_uid_t ruid, old_uid_t euid) | ||
3137 | { | ||
3138 | - return sys_setreuid(low2highuid(ruid), low2highuid(euid)); | ||
3139 | + long ret = sys_setreuid(low2highuid(ruid), low2highuid(euid)); | ||
3140 | + /* avoid REGPARM breakage on x86: */ | ||
3141 | + prevent_tail_call(ret); | ||
3142 | + return ret; | ||
3143 | } | ||
3144 | |||
3145 | asmlinkage long sys_setuid16(old_uid_t uid) | ||
3146 | { | ||
3147 | - return sys_setuid(low2highuid(uid)); | ||
3148 | + long ret = sys_setuid(low2highuid(uid)); | ||
3149 | + /* avoid REGPARM breakage on x86: */ | ||
3150 | + prevent_tail_call(ret); | ||
3151 | + return ret; | ||
3152 | } | ||
3153 | |||
3154 | asmlinkage long sys_setresuid16(old_uid_t ruid, old_uid_t euid, old_uid_t suid) | ||
3155 | { | ||
3156 | - return sys_setresuid(low2highuid(ruid), low2highuid(euid), | ||
3157 | - low2highuid(suid)); | ||
3158 | + long ret = sys_setresuid(low2highuid(ruid), low2highuid(euid), | ||
3159 | + low2highuid(suid)); | ||
3160 | + /* avoid REGPARM breakage on x86: */ | ||
3161 | + prevent_tail_call(ret); | ||
3162 | + return ret; | ||
3163 | } | ||
3164 | |||
3165 | asmlinkage long sys_getresuid16(old_uid_t __user *ruid, old_uid_t __user *euid, old_uid_t __user *suid) | ||
3166 | @@ -72,8 +96,11 @@ asmlinkage long sys_getresuid16(old_uid_ | ||
3167 | |||
3168 | asmlinkage long sys_setresgid16(old_gid_t rgid, old_gid_t egid, old_gid_t sgid) | ||
3169 | { | ||
3170 | - return sys_setresgid(low2highgid(rgid), low2highgid(egid), | ||
3171 | - low2highgid(sgid)); | ||
3172 | + long ret = sys_setresgid(low2highgid(rgid), low2highgid(egid), | ||
3173 | + low2highgid(sgid)); | ||
3174 | + /* avoid REGPARM breakage on x86: */ | ||
3175 | + prevent_tail_call(ret); | ||
3176 | + return ret; | ||
3177 | } | ||
3178 | |||
3179 | asmlinkage long sys_getresgid16(old_gid_t __user *rgid, old_gid_t __user *egid, old_gid_t __user *sgid) | ||
3180 | @@ -89,12 +116,18 @@ asmlinkage long sys_getresgid16(old_gid_ | ||
3181 | |||
3182 | asmlinkage long sys_setfsuid16(old_uid_t uid) | ||
3183 | { | ||
3184 | - return sys_setfsuid(low2highuid(uid)); | ||
3185 | + long ret = sys_setfsuid(low2highuid(uid)); | ||
3186 | + /* avoid REGPARM breakage on x86: */ | ||
3187 | + prevent_tail_call(ret); | ||
3188 | + return ret; | ||
3189 | } | ||
3190 | |||
3191 | asmlinkage long sys_setfsgid16(old_gid_t gid) | ||
3192 | { | ||
3193 | - return sys_setfsgid(low2highgid(gid)); | ||
3194 | + long ret = sys_setfsgid(low2highgid(gid)); | ||
3195 | + /* avoid REGPARM breakage on x86: */ | ||
3196 | + prevent_tail_call(ret); | ||
3197 | + return ret; | ||
3198 | } | ||
3199 | |||
3200 | static int groups16_to_user(old_gid_t __user *grouplist, | ||
3201 | diff --git a/mm/madvise.c b/mm/madvise.c | ||
3202 | index af3d573..4e19615 100644 | ||
3203 | --- a/mm/madvise.c | ||
3204 | +++ b/mm/madvise.c | ||
3205 | @@ -168,6 +168,9 @@ static long madvise_remove(struct vm_are | ||
3206 | return -EINVAL; | ||
3207 | } | ||
3208 | |||
3209 | + if ((vma->vm_flags & (VM_SHARED|VM_WRITE)) != (VM_SHARED|VM_WRITE)) | ||
3210 | + return -EACCES; | ||
3211 | + | ||
3212 | mapping = vma->vm_file->f_mapping; | ||
3213 | |||
3214 | offset = (loff_t)(start - vma->vm_start) | ||
3215 | diff --git a/mm/page_alloc.c b/mm/page_alloc.c | ||
3216 | index 234bd48..61de222 100644 | ||
3217 | --- a/mm/page_alloc.c | ||
3218 | +++ b/mm/page_alloc.c | ||
3219 | @@ -153,7 +153,8 @@ static void bad_page(struct page *page) | ||
3220 | 1 << PG_reclaim | | ||
3221 | 1 << PG_slab | | ||
3222 | 1 << PG_swapcache | | ||
3223 | - 1 << PG_writeback ); | ||
3224 | + 1 << PG_writeback | | ||
3225 | + 1 << PG_buddy ); | ||
3226 | set_page_count(page, 0); | ||
3227 | reset_page_mapcount(page); | ||
3228 | page->mapping = NULL; | ||
3229 | @@ -224,12 +225,12 @@ static inline unsigned long page_order(s | ||
3230 | |||
3231 | static inline void set_page_order(struct page *page, int order) { | ||
3232 | set_page_private(page, order); | ||
3233 | - __SetPagePrivate(page); | ||
3234 | + __SetPageBuddy(page); | ||
3235 | } | ||
3236 | |||
3237 | static inline void rmv_page_order(struct page *page) | ||
3238 | { | ||
3239 | - __ClearPagePrivate(page); | ||
3240 | + __ClearPageBuddy(page); | ||
3241 | set_page_private(page, 0); | ||
3242 | } | ||
3243 | |||
3244 | @@ -268,11 +269,13 @@ __find_combined_index(unsigned long page | ||
3245 | * This function checks whether a page is free && is the buddy | ||
3246 | * we can do coalesce a page and its buddy if | ||
3247 | * (a) the buddy is not in a hole && | ||
3248 | - * (b) the buddy is free && | ||
3249 | - * (c) the buddy is on the buddy system && | ||
3250 | - * (d) a page and its buddy have the same order. | ||
3251 | - * for recording page's order, we use page_private(page) and PG_private. | ||
3252 | + * (b) the buddy is in the buddy system && | ||
3253 | + * (c) a page and its buddy have the same order. | ||
3254 | + * | ||
3255 | + * For recording whether a page is in the buddy system, we use PG_buddy. | ||
3256 | + * Setting, clearing, and testing PG_buddy is serialized by zone->lock. | ||
3257 | * | ||
3258 | + * For recording page's order, we use page_private(page). | ||
3259 | */ | ||
3260 | static inline int page_is_buddy(struct page *page, int order) | ||
3261 | { | ||
3262 | @@ -281,10 +284,10 @@ #ifdef CONFIG_HOLES_IN_ZONE | ||
3263 | return 0; | ||
3264 | #endif | ||
3265 | |||
3266 | - if (PagePrivate(page) && | ||
3267 | - (page_order(page) == order) && | ||
3268 | - page_count(page) == 0) | ||
3269 | + if (PageBuddy(page) && page_order(page) == order) { | ||
3270 | + BUG_ON(page_count(page) != 0); | ||
3271 | return 1; | ||
3272 | + } | ||
3273 | return 0; | ||
3274 | } | ||
3275 | |||
3276 | @@ -301,7 +304,7 @@ #endif | ||
3277 | * as necessary, plus some accounting needed to play nicely with other | ||
3278 | * parts of the VM system. | ||
3279 | * At each level, we keep a list of pages, which are heads of continuous | ||
3280 | - * free pages of length of (1 << order) and marked with PG_Private.Page's | ||
3281 | + * free pages of length of (1 << order) and marked with PG_buddy. Page's | ||
3282 | * order is recorded in page_private(page) field. | ||
3283 | * So when we are allocating or freeing one, we can derive the state of the | ||
3284 | * other. That is, if we allocate a small block, and both were | ||
3285 | @@ -364,7 +367,8 @@ static inline int free_pages_check(struc | ||
3286 | 1 << PG_slab | | ||
3287 | 1 << PG_swapcache | | ||
3288 | 1 << PG_writeback | | ||
3289 | - 1 << PG_reserved )))) | ||
3290 | + 1 << PG_reserved | | ||
3291 | + 1 << PG_buddy )))) | ||
3292 | bad_page(page); | ||
3293 | if (PageDirty(page)) | ||
3294 | __ClearPageDirty(page); | ||
3295 | @@ -522,7 +526,8 @@ static int prep_new_page(struct page *pa | ||
3296 | 1 << PG_slab | | ||
3297 | 1 << PG_swapcache | | ||
3298 | 1 << PG_writeback | | ||
3299 | - 1 << PG_reserved )))) | ||
3300 | + 1 << PG_reserved | | ||
3301 | + 1 << PG_buddy )))) | ||
3302 | bad_page(page); | ||
3303 | |||
3304 | /* | ||
3305 | diff --git a/net/atm/clip.c b/net/atm/clip.c | ||
3306 | index 73370de..1842a4e 100644 | ||
3307 | --- a/net/atm/clip.c | ||
3308 | +++ b/net/atm/clip.c | ||
3309 | @@ -613,12 +613,19 @@ static int clip_create(int number) | ||
3310 | |||
3311 | |||
3312 | static int clip_device_event(struct notifier_block *this,unsigned long event, | ||
3313 | - void *dev) | ||
3314 | + void *arg) | ||
3315 | { | ||
3316 | + struct net_device *dev = arg; | ||
3317 | + | ||
3318 | + if (event == NETDEV_UNREGISTER) { | ||
3319 | + neigh_ifdown(&clip_tbl, dev); | ||
3320 | + return NOTIFY_DONE; | ||
3321 | + } | ||
3322 | + | ||
3323 | /* ignore non-CLIP devices */ | ||
3324 | - if (((struct net_device *) dev)->type != ARPHRD_ATM || | ||
3325 | - ((struct net_device *) dev)->hard_start_xmit != clip_start_xmit) | ||
3326 | + if (dev->type != ARPHRD_ATM || dev->hard_start_xmit != clip_start_xmit) | ||
3327 | return NOTIFY_DONE; | ||
3328 | + | ||
3329 | switch (event) { | ||
3330 | case NETDEV_UP: | ||
3331 | DPRINTK("clip_device_event NETDEV_UP\n"); | ||
3332 | @@ -686,14 +693,12 @@ static struct notifier_block clip_inet_n | ||
3333 | static void atmarpd_close(struct atm_vcc *vcc) | ||
3334 | { | ||
3335 | DPRINTK("atmarpd_close\n"); | ||
3336 | - atmarpd = NULL; /* assumed to be atomic */ | ||
3337 | - barrier(); | ||
3338 | - unregister_inetaddr_notifier(&clip_inet_notifier); | ||
3339 | - unregister_netdevice_notifier(&clip_dev_notifier); | ||
3340 | - if (skb_peek(&sk_atm(vcc)->sk_receive_queue)) | ||
3341 | - printk(KERN_ERR "atmarpd_close: closing with requests " | ||
3342 | - "pending\n"); | ||
3343 | + | ||
3344 | + rtnl_lock(); | ||
3345 | + atmarpd = NULL; | ||
3346 | skb_queue_purge(&sk_atm(vcc)->sk_receive_queue); | ||
3347 | + rtnl_unlock(); | ||
3348 | + | ||
3349 | DPRINTK("(done)\n"); | ||
3350 | module_put(THIS_MODULE); | ||
3351 | } | ||
3352 | @@ -714,7 +719,12 @@ static struct atm_dev atmarpd_dev = { | ||
3353 | |||
3354 | static int atm_init_atmarp(struct atm_vcc *vcc) | ||
3355 | { | ||
3356 | - if (atmarpd) return -EADDRINUSE; | ||
3357 | + rtnl_lock(); | ||
3358 | + if (atmarpd) { | ||
3359 | + rtnl_unlock(); | ||
3360 | + return -EADDRINUSE; | ||
3361 | + } | ||
3362 | + | ||
3363 | if (start_timer) { | ||
3364 | start_timer = 0; | ||
3365 | init_timer(&idle_timer); | ||
3366 | @@ -731,10 +741,7 @@ static int atm_init_atmarp(struct atm_vc | ||
3367 | vcc->push = NULL; | ||
3368 | vcc->pop = NULL; /* crash */ | ||
3369 | vcc->push_oam = NULL; /* crash */ | ||
3370 | - if (register_netdevice_notifier(&clip_dev_notifier)) | ||
3371 | - printk(KERN_ERR "register_netdevice_notifier failed\n"); | ||
3372 | - if (register_inetaddr_notifier(&clip_inet_notifier)) | ||
3373 | - printk(KERN_ERR "register_inetaddr_notifier failed\n"); | ||
3374 | + rtnl_unlock(); | ||
3375 | return 0; | ||
3376 | } | ||
3377 | |||
3378 | @@ -992,6 +999,8 @@ static int __init atm_clip_init(void) | ||
3379 | |||
3380 | clip_tbl_hook = &clip_tbl; | ||
3381 | register_atm_ioctl(&clip_ioctl_ops); | ||
3382 | + register_netdevice_notifier(&clip_dev_notifier); | ||
3383 | + register_inetaddr_notifier(&clip_inet_notifier); | ||
3384 | |||
3385 | #ifdef CONFIG_PROC_FS | ||
3386 | { | ||
3387 | @@ -1012,6 +1021,9 @@ static void __exit atm_clip_exit(void) | ||
3388 | |||
3389 | remove_proc_entry("arp", atm_proc_root); | ||
3390 | |||
3391 | + unregister_inetaddr_notifier(&clip_inet_notifier); | ||
3392 | + unregister_netdevice_notifier(&clip_dev_notifier); | ||
3393 | + | ||
3394 | deregister_atm_ioctl(&clip_ioctl_ops); | ||
3395 | |||
3396 | /* First, stop the idle timer, so it stops banging | ||
3397 | diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c | ||
3398 | index e060aad..9e27373 100644 | ||
3399 | --- a/net/bridge/br_netfilter.c | ||
3400 | +++ b/net/bridge/br_netfilter.c | ||
3401 | @@ -739,6 +739,15 @@ out: | ||
3402 | return NF_STOLEN; | ||
3403 | } | ||
3404 | |||
3405 | +static int br_nf_dev_queue_xmit(struct sk_buff *skb) | ||
3406 | +{ | ||
3407 | + if (skb->protocol == htons(ETH_P_IP) && | ||
3408 | + skb->len > skb->dev->mtu && | ||
3409 | + !(skb_shinfo(skb)->ufo_size || skb_shinfo(skb)->tso_size)) | ||
3410 | + return ip_fragment(skb, br_dev_queue_push_xmit); | ||
3411 | + else | ||
3412 | + return br_dev_queue_push_xmit(skb); | ||
3413 | +} | ||
3414 | |||
3415 | /* PF_BRIDGE/POST_ROUTING ********************************************/ | ||
3416 | static unsigned int br_nf_post_routing(unsigned int hook, struct sk_buff **pskb, | ||
3417 | @@ -798,7 +807,7 @@ #if defined(CONFIG_VLAN_8021Q) || define | ||
3418 | realoutdev = nf_bridge->netoutdev; | ||
3419 | #endif | ||
3420 | NF_HOOK(pf, NF_IP_POST_ROUTING, skb, NULL, realoutdev, | ||
3421 | - br_dev_queue_push_xmit); | ||
3422 | + br_nf_dev_queue_xmit); | ||
3423 | |||
3424 | return NF_STOLEN; | ||
3425 | |||
3426 | @@ -843,7 +852,7 @@ static unsigned int ip_sabotage_out(unsi | ||
3427 | if ((out->hard_start_xmit == br_dev_xmit && | ||
3428 | okfn != br_nf_forward_finish && | ||
3429 | okfn != br_nf_local_out_finish && | ||
3430 | - okfn != br_dev_queue_push_xmit) | ||
3431 | + okfn != br_nf_dev_queue_xmit) | ||
3432 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | ||
3433 | || ((out->priv_flags & IFF_802_1Q_VLAN) && | ||
3434 | VLAN_DEV_INFO(out)->real_dev->hard_start_xmit == br_dev_xmit) | ||
3435 | diff --git a/net/core/dev.c b/net/core/dev.c | ||
3436 | index 2afb0de..12a214c 100644 | ||
3437 | --- a/net/core/dev.c | ||
3438 | +++ b/net/core/dev.c | ||
3439 | @@ -2932,11 +2932,11 @@ void netdev_run_todo(void) | ||
3440 | |||
3441 | switch(dev->reg_state) { | ||
3442 | case NETREG_REGISTERING: | ||
3443 | + dev->reg_state = NETREG_REGISTERED; | ||
3444 | err = netdev_register_sysfs(dev); | ||
3445 | if (err) | ||
3446 | printk(KERN_ERR "%s: failed sysfs registration (%d)\n", | ||
3447 | dev->name, err); | ||
3448 | - dev->reg_state = NETREG_REGISTERED; | ||
3449 | break; | ||
3450 | |||
3451 | case NETREG_UNREGISTERING: | ||
3452 | diff --git a/net/core/sock.c b/net/core/sock.c | ||
3453 | index 6e00811..5621198 100644 | ||
3454 | --- a/net/core/sock.c | ||
3455 | +++ b/net/core/sock.c | ||
3456 | @@ -404,8 +404,9 @@ #ifdef CONFIG_NETDEVICES | ||
3457 | if (!valbool) { | ||
3458 | sk->sk_bound_dev_if = 0; | ||
3459 | } else { | ||
3460 | - if (optlen > IFNAMSIZ) | ||
3461 | - optlen = IFNAMSIZ; | ||
3462 | + if (optlen > IFNAMSIZ - 1) | ||
3463 | + optlen = IFNAMSIZ - 1; | ||
3464 | + memset(devname, 0, sizeof(devname)); | ||
3465 | if (copy_from_user(devname, optval, optlen)) { | ||
3466 | ret = -EFAULT; | ||
3467 | break; | ||
3468 | diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c | ||
3469 | index e320b32..24009be 100644 | ||
3470 | --- a/net/ipv4/fib_trie.c | ||
3471 | +++ b/net/ipv4/fib_trie.c | ||
3472 | @@ -314,11 +314,6 @@ static void __leaf_free_rcu(struct rcu_h | ||
3473 | kfree(container_of(head, struct leaf, rcu)); | ||
3474 | } | ||
3475 | |||
3476 | -static inline void free_leaf(struct leaf *leaf) | ||
3477 | -{ | ||
3478 | - call_rcu(&leaf->rcu, __leaf_free_rcu); | ||
3479 | -} | ||
3480 | - | ||
3481 | static void __leaf_info_free_rcu(struct rcu_head *head) | ||
3482 | { | ||
3483 | kfree(container_of(head, struct leaf_info, rcu)); | ||
3484 | @@ -357,7 +352,12 @@ static void __tnode_free_rcu(struct rcu_ | ||
3485 | |||
3486 | static inline void tnode_free(struct tnode *tn) | ||
3487 | { | ||
3488 | - call_rcu(&tn->rcu, __tnode_free_rcu); | ||
3489 | + if(IS_LEAF(tn)) { | ||
3490 | + struct leaf *l = (struct leaf *) tn; | ||
3491 | + call_rcu_bh(&l->rcu, __leaf_free_rcu); | ||
3492 | + } | ||
3493 | + else | ||
3494 | + call_rcu(&tn->rcu, __tnode_free_rcu); | ||
3495 | } | ||
3496 | |||
3497 | static struct leaf *leaf_new(void) | ||
3498 | diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c | ||
3499 | index 8ee4d01..8dcba38 100644 | ||
3500 | --- a/net/ipv4/ip_output.c | ||
3501 | +++ b/net/ipv4/ip_output.c | ||
3502 | @@ -86,8 +86,6 @@ #include <linux/tcp.h> | ||
3503 | |||
3504 | int sysctl_ip_default_ttl = IPDEFTTL; | ||
3505 | |||
3506 | -static int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*)); | ||
3507 | - | ||
3508 | /* Generate a checksum for an outgoing IP datagram. */ | ||
3509 | __inline__ void ip_send_check(struct iphdr *iph) | ||
3510 | { | ||
3511 | @@ -421,7 +419,7 @@ #endif | ||
3512 | * single device frame, and queue such a frame for sending. | ||
3513 | */ | ||
3514 | |||
3515 | -static int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*)) | ||
3516 | +int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*)) | ||
3517 | { | ||
3518 | struct iphdr *iph; | ||
3519 | int raw = 0; | ||
3520 | @@ -673,6 +671,8 @@ fail: | ||
3521 | return err; | ||
3522 | } | ||
3523 | |||
3524 | +EXPORT_SYMBOL(ip_fragment); | ||
3525 | + | ||
3526 | int | ||
3527 | ip_generic_getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb) | ||
3528 | { | ||
3529 | @@ -1249,11 +1249,7 @@ int ip_push_pending_frames(struct sock * | ||
3530 | iph->tos = inet->tos; | ||
3531 | iph->tot_len = htons(skb->len); | ||
3532 | iph->frag_off = df; | ||
3533 | - if (!df) { | ||
3534 | - __ip_select_ident(iph, &rt->u.dst, 0); | ||
3535 | - } else { | ||
3536 | - iph->id = htons(inet->id++); | ||
3537 | - } | ||
3538 | + ip_select_ident(iph, &rt->u.dst, sk); | ||
3539 | iph->ttl = ttl; | ||
3540 | iph->protocol = sk->sk_protocol; | ||
3541 | iph->saddr = rt->rt_src; | ||
3542 | diff --git a/net/ipv4/netfilter/ip_conntrack_netlink.c b/net/ipv4/netfilter/ip_conntrack_netlink.c | ||
3543 | index e0b5926..d4e6d0a 100644 | ||
3544 | --- a/net/ipv4/netfilter/ip_conntrack_netlink.c | ||
3545 | +++ b/net/ipv4/netfilter/ip_conntrack_netlink.c | ||
3546 | @@ -1619,7 +1619,7 @@ static void __exit ctnetlink_exit(void) | ||
3547 | printk("ctnetlink: unregistering from nfnetlink.\n"); | ||
3548 | |||
3549 | #ifdef CONFIG_IP_NF_CONNTRACK_EVENTS | ||
3550 | - ip_conntrack_unregister_notifier(&ctnl_notifier_exp); | ||
3551 | + ip_conntrack_expect_unregister_notifier(&ctnl_notifier_exp); | ||
3552 | ip_conntrack_unregister_notifier(&ctnl_notifier); | ||
3553 | #endif | ||
3554 | |||
3555 | diff --git a/net/ipv4/route.c b/net/ipv4/route.c | ||
3556 | index fca5fe0..a67955e 100644 | ||
3557 | --- a/net/ipv4/route.c | ||
3558 | +++ b/net/ipv4/route.c | ||
3559 | @@ -2750,7 +2750,10 @@ int inet_rtm_getroute(struct sk_buff *in | ||
3560 | /* Reserve room for dummy headers, this skb can pass | ||
3561 | through good chunk of routing engine. | ||
3562 | */ | ||
3563 | - skb->mac.raw = skb->data; | ||
3564 | + skb->mac.raw = skb->nh.raw = skb->data; | ||
3565 | + | ||
3566 | + /* Bugfix: need to give ip_route_input enough of an IP header to not gag. */ | ||
3567 | + skb->nh.iph->protocol = IPPROTO_ICMP; | ||
3568 | skb_reserve(skb, MAX_HEADER + sizeof(struct iphdr)); | ||
3569 | |||
3570 | if (rta[RTA_SRC - 1]) | ||
3571 | diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c | ||
3572 | index 9f498a6..310f2e6 100644 | ||
3573 | --- a/net/ipv4/tcp_output.c | ||
3574 | +++ b/net/ipv4/tcp_output.c | ||
3575 | @@ -537,7 +537,9 @@ int tcp_fragment(struct sock *sk, struct | ||
3576 | buff = sk_stream_alloc_skb(sk, nsize, GFP_ATOMIC); | ||
3577 | if (buff == NULL) | ||
3578 | return -ENOMEM; /* We'll just try again later. */ | ||
3579 | - sk_charge_skb(sk, buff); | ||
3580 | + | ||
3581 | + buff->truesize = skb->len - len; | ||
3582 | + skb->truesize -= buff->truesize; | ||
3583 | |||
3584 | /* Correct the sequence numbers. */ | ||
3585 | TCP_SKB_CB(buff)->seq = TCP_SKB_CB(skb)->seq + len; | ||
3586 | diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c | ||
3587 | index 2a1e7e4..d88cab7 100644 | ||
3588 | --- a/net/ipv6/exthdrs.c | ||
3589 | +++ b/net/ipv6/exthdrs.c | ||
3590 | @@ -489,6 +489,18 @@ int ipv6_parse_hopopts(struct sk_buff *s | ||
3591 | { | ||
3592 | struct inet6_skb_parm *opt = IP6CB(skb); | ||
3593 | |||
3594 | + /* | ||
3595 | + * skb->nh.raw is equal to skb->data, and | ||
3596 | + * skb->h.raw - skb->nh.raw is always equal to | ||
3597 | + * sizeof(struct ipv6hdr) by definition of | ||
3598 | + * hop-by-hop options. | ||
3599 | + */ | ||
3600 | + if (!pskb_may_pull(skb, sizeof(struct ipv6hdr) + 8) || | ||
3601 | + !pskb_may_pull(skb, sizeof(struct ipv6hdr) + ((skb->h.raw[1] + 1) << 3))) { | ||
3602 | + kfree_skb(skb); | ||
3603 | + return -1; | ||
3604 | + } | ||
3605 | + | ||
3606 | opt->hop = sizeof(struct ipv6hdr); | ||
3607 | if (ip6_parse_tlv(tlvprochopopt_lst, skb)) { | ||
3608 | skb->h.raw += (skb->h.raw[1]+1)<<3; | ||
3609 | diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c | ||
3610 | index 91cce8b..88c840f 100644 | ||
3611 | --- a/net/ipv6/xfrm6_policy.c | ||
3612 | +++ b/net/ipv6/xfrm6_policy.c | ||
3613 | @@ -191,16 +191,18 @@ error: | ||
3614 | static inline void | ||
3615 | _decode_session6(struct sk_buff *skb, struct flowi *fl) | ||
3616 | { | ||
3617 | - u16 offset = sizeof(struct ipv6hdr); | ||
3618 | + u16 offset = skb->h.raw - skb->nh.raw; | ||
3619 | struct ipv6hdr *hdr = skb->nh.ipv6h; | ||
3620 | - struct ipv6_opt_hdr *exthdr = (struct ipv6_opt_hdr*)(skb->nh.raw + offset); | ||
3621 | - u8 nexthdr = skb->nh.ipv6h->nexthdr; | ||
3622 | + struct ipv6_opt_hdr *exthdr; | ||
3623 | + u8 nexthdr = skb->nh.raw[IP6CB(skb)->nhoff]; | ||
3624 | |||
3625 | memset(fl, 0, sizeof(struct flowi)); | ||
3626 | ipv6_addr_copy(&fl->fl6_dst, &hdr->daddr); | ||
3627 | ipv6_addr_copy(&fl->fl6_src, &hdr->saddr); | ||
3628 | |||
3629 | while (pskb_may_pull(skb, skb->nh.raw + offset + 1 - skb->data)) { | ||
3630 | + exthdr = (struct ipv6_opt_hdr*)(skb->nh.raw + offset); | ||
3631 | + | ||
3632 | switch (nexthdr) { | ||
3633 | case NEXTHDR_ROUTING: | ||
3634 | case NEXTHDR_HOP: | ||
3635 | diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c | ||
3636 | index 9ff3463..40edeef 100644 | ||
3637 | --- a/net/netfilter/nf_conntrack_netlink.c | ||
3638 | +++ b/net/netfilter/nf_conntrack_netlink.c | ||
3639 | @@ -1641,7 +1641,7 @@ static void __exit ctnetlink_exit(void) | ||
3640 | printk("ctnetlink: unregistering from nfnetlink.\n"); | ||
3641 | |||
3642 | #ifdef CONFIG_NF_CONNTRACK_EVENTS | ||
3643 | - nf_conntrack_unregister_notifier(&ctnl_notifier_exp); | ||
3644 | + nf_conntrack_expect_unregister_notifier(&ctnl_notifier_exp); | ||
3645 | nf_conntrack_unregister_notifier(&ctnl_notifier); | ||
3646 | #endif | ||
3647 | |||
3648 | diff --git a/security/keys/key.c b/security/keys/key.c | ||
3649 | index 99781b7..0e2584e 100644 | ||
3650 | --- a/security/keys/key.c | ||
3651 | +++ b/security/keys/key.c | ||
3652 | @@ -785,6 +785,10 @@ key_ref_t key_create_or_update(key_ref_t | ||
3653 | |||
3654 | key_check(keyring); | ||
3655 | |||
3656 | + key_ref = ERR_PTR(-ENOTDIR); | ||
3657 | + if (keyring->type != &key_type_keyring) | ||
3658 | + goto error_2; | ||
3659 | + | ||
3660 | down_write(&keyring->sem); | ||
3661 | |||
3662 | /* if we're going to allocate a new key, we're going to have | ||
3663 | diff --git a/security/keys/keyring.c b/security/keys/keyring.c | ||
3664 | index d65a180..bffa924 100644 | ||
3665 | --- a/security/keys/keyring.c | ||
3666 | +++ b/security/keys/keyring.c | ||
3667 | @@ -437,6 +437,7 @@ EXPORT_SYMBOL(keyring_search); | ||
3668 | /* | ||
3669 | * search the given keyring only (no recursion) | ||
3670 | * - keyring must be locked by caller | ||
3671 | + * - caller must guarantee that the keyring is a keyring | ||
3672 | */ | ||
3673 | key_ref_t __keyring_search_one(key_ref_t keyring_ref, | ||
3674 | const struct key_type *ktype, | ||
3675 | diff --git a/security/selinux/ss/mls.c b/security/selinux/ss/mls.c | ||
3676 | index 640d0bf..84047f6 100644 | ||
3677 | --- a/security/selinux/ss/mls.c | ||
3678 | +++ b/security/selinux/ss/mls.c | ||
3679 | @@ -264,7 +264,7 @@ int mls_context_to_sid(char oldc, | ||
3680 | |||
3681 | if (!selinux_mls_enabled) { | ||
3682 | if (def_sid != SECSID_NULL && oldc) | ||
3683 | - *scontext += strlen(*scontext); | ||
3684 | + *scontext += strlen(*scontext)+1; | ||
3685 | return 0; | ||
3686 | } | ||
3687 | |||
3688 | diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c | ||
3689 | index 63d96be..65b28cb 100644 | ||
3690 | --- a/sound/isa/opti9xx/opti92x-ad1848.c | ||
3691 | +++ b/sound/isa/opti9xx/opti92x-ad1848.c | ||
3692 | @@ -2088,9 +2088,11 @@ static int __init alsa_card_opti9xx_init | ||
3693 | int error; | ||
3694 | struct platform_device *device; | ||
3695 | |||
3696 | +#ifdef CONFIG_PNP | ||
3697 | pnp_register_card_driver(&opti9xx_pnpc_driver); | ||
3698 | if (snd_opti9xx_pnp_is_probed) | ||
3699 | return 0; | ||
3700 | +#endif | ||
3701 | if (! is_isapnp_selected()) { | ||
3702 | error = platform_driver_register(&snd_opti9xx_driver); | ||
3703 | if (error < 0) | ||
3704 | @@ -2102,7 +2104,9 @@ static int __init alsa_card_opti9xx_init | ||
3705 | } | ||
3706 | platform_driver_unregister(&snd_opti9xx_driver); | ||
3707 | } | ||
3708 | +#ifdef CONFIG_PNP | ||
3709 | pnp_unregister_card_driver(&opti9xx_pnpc_driver); | ||
3710 | +#endif | ||
3711 | #ifdef MODULE | ||
3712 | printk(KERN_ERR "no OPTi " CHIP_NAME " soundcard found\n"); | ||
3713 | #endif | ||
3714 | @@ -2115,7 +2119,9 @@ static void __exit alsa_card_opti9xx_exi | ||
3715 | platform_device_unregister(snd_opti9xx_platform_device); | ||
3716 | platform_driver_unregister(&snd_opti9xx_driver); | ||
3717 | } | ||
3718 | +#ifdef CONFIG_PNP | ||
3719 | pnp_unregister_card_driver(&opti9xx_pnpc_driver); | ||
3720 | +#endif | ||
3721 | } | ||
3722 | |||
3723 | module_init(alsa_card_opti9xx_init) | ||
3724 | diff --git a/sound/oss/dmasound/tas_common.c b/sound/oss/dmasound/tas_common.c | ||
3725 | index 8131599..882ae98 100644 | ||
3726 | --- a/sound/oss/dmasound/tas_common.c | ||
3727 | +++ b/sound/oss/dmasound/tas_common.c | ||
3728 | @@ -195,8 +195,8 @@ tas_init(int driver_id, const char *driv | ||
3729 | |||
3730 | printk(KERN_INFO "tas driver [%s])\n", driver_name); | ||
3731 | |||
3732 | -#ifndef CONFIG_I2C_KEYWEST | ||
3733 | - request_module("i2c-keywest"); | ||
3734 | +#ifndef CONFIG_I2C_POWERMAC | ||
3735 | + request_module("i2c-powermac"); | ||
3736 | #endif | ||
3737 | tas_node = find_devices("deq"); | ||
3738 | if (tas_node == NULL) | ||
3739 | diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c | ||
3740 | index b767552..d5cd3a1 100644 | ||
3741 | --- a/sound/pci/hda/patch_realtek.c | ||
3742 | +++ b/sound/pci/hda/patch_realtek.c | ||
3743 | @@ -2948,6 +2948,8 @@ static struct hda_board_config alc260_cf | ||
3744 | { .modelname = "basic", .config = ALC260_BASIC }, | ||
3745 | { .pci_subvendor = 0x104d, .pci_subdevice = 0x81bb, | ||
3746 | .config = ALC260_BASIC }, /* Sony VAIO */ | ||
3747 | + { .pci_subvendor = 0x152d, .pci_subdevice = 0x0729, | ||
3748 | + .config = ALC260_BASIC }, /* CTL Travel Master U553W */ | ||
3749 | { .modelname = "hp", .config = ALC260_HP }, | ||
3750 | { .pci_subvendor = 0x103c, .pci_subdevice = 0x3010, .config = ALC260_HP }, | ||
3751 | { .pci_subvendor = 0x103c, .pci_subdevice = 0x3011, .config = ALC260_HP }, | ||
3752 | diff --git a/sound/ppc/daca.c b/sound/ppc/daca.c | ||
3753 | index 08cde51..b96cd94 100644 | ||
3754 | --- a/sound/ppc/daca.c | ||
3755 | +++ b/sound/ppc/daca.c | ||
3756 | @@ -256,7 +256,7 @@ int __init snd_pmac_daca_init(struct snd | ||
3757 | |||
3758 | #ifdef CONFIG_KMOD | ||
3759 | if (current->fs->root) | ||
3760 | - request_module("i2c-keywest"); | ||
3761 | + request_module("i2c-powermac"); | ||
3762 | #endif /* CONFIG_KMOD */ | ||
3763 | |||
3764 | mix = kmalloc(sizeof(*mix), GFP_KERNEL); | ||
3765 | diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c | ||
3766 | index 838fc11..39d4cde 100644 | ||
3767 | --- a/sound/ppc/tumbler.c | ||
3768 | +++ b/sound/ppc/tumbler.c | ||
3769 | @@ -1314,7 +1314,7 @@ int __init snd_pmac_tumbler_init(struct | ||
3770 | |||
3771 | #ifdef CONFIG_KMOD | ||
3772 | if (current->fs->root) | ||
3773 | - request_module("i2c-keywest"); | ||
3774 | + request_module("i2c-powermac"); | ||
3775 | #endif /* CONFIG_KMOD */ | ||
3776 | |||
3777 | mix = kmalloc(sizeof(*mix), GFP_KERNEL); |