diff options
67 files changed, 459 insertions, 377 deletions
diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt index 2803f63c1a27..687104bfd09a 100644 --- a/Documentation/vm/hugetlbpage.txt +++ b/Documentation/vm/hugetlbpage.txt | |||
@@ -32,7 +32,16 @@ The output of "cat /proc/meminfo" will have lines like: | |||
32 | ..... | 32 | ..... |
33 | HugePages_Total: xxx | 33 | HugePages_Total: xxx |
34 | HugePages_Free: yyy | 34 | HugePages_Free: yyy |
35 | Hugepagesize: zzz KB | 35 | HugePages_Rsvd: www |
36 | Hugepagesize: zzz kB | ||
37 | |||
38 | where: | ||
39 | HugePages_Total is the size of the pool of hugepages. | ||
40 | HugePages_Free is the number of hugepages in the pool that are not yet | ||
41 | allocated. | ||
42 | HugePages_Rsvd is short for "reserved," and is the number of hugepages | ||
43 | for which a commitment to allocate from the pool has been made, but no | ||
44 | allocation has yet been made. It's vaguely analogous to overcommit. | ||
36 | 45 | ||
37 | /proc/filesystems should also show a filesystem of type "hugetlbfs" configured | 46 | /proc/filesystems should also show a filesystem of type "hugetlbfs" configured |
38 | in the kernel. | 47 | in the kernel. |
@@ -165,10 +165,31 @@ CONFIGURING the kernel: | |||
165 | "make xconfig" X windows (Qt) based configuration tool. | 165 | "make xconfig" X windows (Qt) based configuration tool. |
166 | "make gconfig" X windows (Gtk) based configuration tool. | 166 | "make gconfig" X windows (Gtk) based configuration tool. |
167 | "make oldconfig" Default all questions based on the contents of | 167 | "make oldconfig" Default all questions based on the contents of |
168 | your existing ./.config file. | 168 | your existing ./.config file and asking about |
169 | new config symbols. | ||
169 | "make silentoldconfig" | 170 | "make silentoldconfig" |
170 | Like above, but avoids cluttering the screen | 171 | Like above, but avoids cluttering the screen |
171 | with questions already answered. | 172 | with questions already answered. |
173 | "make defconfig" Create a ./.config file by using the default | ||
174 | symbol values from arch/$ARCH/defconfig. | ||
175 | "make allyesconfig" | ||
176 | Create a ./.config file by setting symbol | ||
177 | values to 'y' as much as possible. | ||
178 | "make allmodconfig" | ||
179 | Create a ./.config file by setting symbol | ||
180 | values to 'm' as much as possible. | ||
181 | "make allnoconfig" Create a ./.config file by setting symbol | ||
182 | values to 'n' as much as possible. | ||
183 | "make randconfig" Create a ./.config file by setting symbol | ||
184 | values to random values. | ||
185 | |||
186 | The allyesconfig/allmodconfig/allnoconfig/randconfig variants can | ||
187 | also use the environment variable KCONFIG_ALLCONFIG to specify a | ||
188 | filename that contains config options that the user requires to be | ||
189 | set to a specific value. If KCONFIG_ALLCONFIG=filename is not used, | ||
190 | "make *config" checks for a file named "all{yes/mod/no/random}.config" | ||
191 | for symbol values that are to be forced. If this file is not found, | ||
192 | it checks for a file named "all.config" to contain forced values. | ||
172 | 193 | ||
173 | NOTES on "make config": | 194 | NOTES on "make config": |
174 | - having unnecessary drivers will make the kernel bigger, and can | 195 | - having unnecessary drivers will make the kernel bigger, and can |
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c index da30a374dd4e..df0e1745f189 100644 --- a/arch/i386/kernel/apm.c +++ b/arch/i386/kernel/apm.c | |||
@@ -1079,7 +1079,7 @@ static int apm_console_blank(int blank) | |||
1079 | break; | 1079 | break; |
1080 | } | 1080 | } |
1081 | 1081 | ||
1082 | if (error == APM_NOT_ENGAGED && state != APM_STATE_READY) { | 1082 | if (error == APM_NOT_ENGAGED) { |
1083 | static int tried; | 1083 | static int tried; |
1084 | int eng_error; | 1084 | int eng_error; |
1085 | if (tried++ == 0) { | 1085 | if (tried++ == 0) { |
diff --git a/arch/i386/kernel/cpuid.c b/arch/i386/kernel/cpuid.c index 006141d1c12a..1d9a4abcdfc7 100644 --- a/arch/i386/kernel/cpuid.c +++ b/arch/i386/kernel/cpuid.c | |||
@@ -168,7 +168,7 @@ static int cpuid_class_device_create(int i) | |||
168 | return err; | 168 | return err; |
169 | } | 169 | } |
170 | 170 | ||
171 | static int __devinit cpuid_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) | 171 | static int cpuid_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) |
172 | { | 172 | { |
173 | unsigned int cpu = (unsigned long)hcpu; | 173 | unsigned int cpu = (unsigned long)hcpu; |
174 | 174 | ||
diff --git a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c index f19768789e8a..043f5292e70a 100644 --- a/arch/i386/kernel/kprobes.c +++ b/arch/i386/kernel/kprobes.c | |||
@@ -43,7 +43,7 @@ DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; | |||
43 | DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); | 43 | DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); |
44 | 44 | ||
45 | /* insert a jmp code */ | 45 | /* insert a jmp code */ |
46 | static inline void set_jmp_op(void *from, void *to) | 46 | static __always_inline void set_jmp_op(void *from, void *to) |
47 | { | 47 | { |
48 | struct __arch_jmp_op { | 48 | struct __arch_jmp_op { |
49 | char op; | 49 | char op; |
@@ -57,7 +57,7 @@ static inline void set_jmp_op(void *from, void *to) | |||
57 | /* | 57 | /* |
58 | * returns non-zero if opcodes can be boosted. | 58 | * returns non-zero if opcodes can be boosted. |
59 | */ | 59 | */ |
60 | static inline int can_boost(kprobe_opcode_t opcode) | 60 | static __always_inline int can_boost(kprobe_opcode_t opcode) |
61 | { | 61 | { |
62 | switch (opcode & 0xf0 ) { | 62 | switch (opcode & 0xf0 ) { |
63 | case 0x70: | 63 | case 0x70: |
@@ -88,7 +88,7 @@ static inline int can_boost(kprobe_opcode_t opcode) | |||
88 | /* | 88 | /* |
89 | * returns non-zero if opcode modifies the interrupt flag. | 89 | * returns non-zero if opcode modifies the interrupt flag. |
90 | */ | 90 | */ |
91 | static inline int is_IF_modifier(kprobe_opcode_t opcode) | 91 | static int __kprobes is_IF_modifier(kprobe_opcode_t opcode) |
92 | { | 92 | { |
93 | switch (opcode) { | 93 | switch (opcode) { |
94 | case 0xfa: /* cli */ | 94 | case 0xfa: /* cli */ |
@@ -138,7 +138,7 @@ void __kprobes arch_remove_kprobe(struct kprobe *p) | |||
138 | mutex_unlock(&kprobe_mutex); | 138 | mutex_unlock(&kprobe_mutex); |
139 | } | 139 | } |
140 | 140 | ||
141 | static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb) | 141 | static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) |
142 | { | 142 | { |
143 | kcb->prev_kprobe.kp = kprobe_running(); | 143 | kcb->prev_kprobe.kp = kprobe_running(); |
144 | kcb->prev_kprobe.status = kcb->kprobe_status; | 144 | kcb->prev_kprobe.status = kcb->kprobe_status; |
@@ -146,7 +146,7 @@ static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb) | |||
146 | kcb->prev_kprobe.saved_eflags = kcb->kprobe_saved_eflags; | 146 | kcb->prev_kprobe.saved_eflags = kcb->kprobe_saved_eflags; |
147 | } | 147 | } |
148 | 148 | ||
149 | static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb) | 149 | static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb) |
150 | { | 150 | { |
151 | __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; | 151 | __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; |
152 | kcb->kprobe_status = kcb->prev_kprobe.status; | 152 | kcb->kprobe_status = kcb->prev_kprobe.status; |
@@ -154,7 +154,7 @@ static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb) | |||
154 | kcb->kprobe_saved_eflags = kcb->prev_kprobe.saved_eflags; | 154 | kcb->kprobe_saved_eflags = kcb->prev_kprobe.saved_eflags; |
155 | } | 155 | } |
156 | 156 | ||
157 | static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs, | 157 | static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs, |
158 | struct kprobe_ctlblk *kcb) | 158 | struct kprobe_ctlblk *kcb) |
159 | { | 159 | { |
160 | __get_cpu_var(current_kprobe) = p; | 160 | __get_cpu_var(current_kprobe) = p; |
@@ -164,7 +164,7 @@ static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs, | |||
164 | kcb->kprobe_saved_eflags &= ~IF_MASK; | 164 | kcb->kprobe_saved_eflags &= ~IF_MASK; |
165 | } | 165 | } |
166 | 166 | ||
167 | static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs) | 167 | static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs) |
168 | { | 168 | { |
169 | regs->eflags |= TF_MASK; | 169 | regs->eflags |= TF_MASK; |
170 | regs->eflags &= ~IF_MASK; | 170 | regs->eflags &= ~IF_MASK; |
@@ -507,7 +507,7 @@ no_change: | |||
507 | * Interrupts are disabled on entry as trap1 is an interrupt gate and they | 507 | * Interrupts are disabled on entry as trap1 is an interrupt gate and they |
508 | * remain disabled thoroughout this function. | 508 | * remain disabled thoroughout this function. |
509 | */ | 509 | */ |
510 | static inline int post_kprobe_handler(struct pt_regs *regs) | 510 | static int __kprobes post_kprobe_handler(struct pt_regs *regs) |
511 | { | 511 | { |
512 | struct kprobe *cur = kprobe_running(); | 512 | struct kprobe *cur = kprobe_running(); |
513 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); | 513 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); |
@@ -543,7 +543,7 @@ out: | |||
543 | return 1; | 543 | return 1; |
544 | } | 544 | } |
545 | 545 | ||
546 | static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr) | 546 | static int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) |
547 | { | 547 | { |
548 | struct kprobe *cur = kprobe_running(); | 548 | struct kprobe *cur = kprobe_running(); |
549 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); | 549 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); |
diff --git a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c index 1d0a55e68760..7a328230e540 100644 --- a/arch/i386/kernel/msr.c +++ b/arch/i386/kernel/msr.c | |||
@@ -251,7 +251,7 @@ static int msr_class_device_create(int i) | |||
251 | return err; | 251 | return err; |
252 | } | 252 | } |
253 | 253 | ||
254 | static int __devinit msr_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) | 254 | static int msr_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) |
255 | { | 255 | { |
256 | unsigned int cpu = (unsigned long)hcpu; | 256 | unsigned int cpu = (unsigned long)hcpu; |
257 | 257 | ||
diff --git a/arch/i386/mach-voyager/voyager_cat.c b/arch/i386/mach-voyager/voyager_cat.c index 3039539de51e..10d21df14531 100644 --- a/arch/i386/mach-voyager/voyager_cat.c +++ b/arch/i386/mach-voyager/voyager_cat.c | |||
@@ -120,7 +120,6 @@ static struct resource qic_res = { | |||
120 | * It writes num_bits of the data buffer in msg starting at start_bit. | 120 | * It writes num_bits of the data buffer in msg starting at start_bit. |
121 | * Note: This function assumes that any unused bit in the data stream | 121 | * Note: This function assumes that any unused bit in the data stream |
122 | * is set to zero so that the ors will work correctly */ | 122 | * is set to zero so that the ors will work correctly */ |
123 | #define BITS_PER_BYTE 8 | ||
124 | static void | 123 | static void |
125 | cat_pack(__u8 *msg, const __u16 start_bit, __u8 *data, const __u16 num_bits) | 124 | cat_pack(__u8 *msg, const __u16 start_bit, __u8 *data, const __u16 num_bits) |
126 | { | 125 | { |
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c index 789881ca83d4..f9039f88d01d 100644 --- a/arch/ia64/kernel/kprobes.c +++ b/arch/ia64/kernel/kprobes.c | |||
@@ -251,7 +251,7 @@ static void __kprobes prepare_break_inst(uint template, uint slot, | |||
251 | update_kprobe_inst_flag(template, slot, major_opcode, kprobe_inst, p); | 251 | update_kprobe_inst_flag(template, slot, major_opcode, kprobe_inst, p); |
252 | } | 252 | } |
253 | 253 | ||
254 | static inline void get_kprobe_inst(bundle_t *bundle, uint slot, | 254 | static void __kprobes get_kprobe_inst(bundle_t *bundle, uint slot, |
255 | unsigned long *kprobe_inst, uint *major_opcode) | 255 | unsigned long *kprobe_inst, uint *major_opcode) |
256 | { | 256 | { |
257 | unsigned long kprobe_inst_p0, kprobe_inst_p1; | 257 | unsigned long kprobe_inst_p0, kprobe_inst_p1; |
@@ -278,7 +278,7 @@ static inline void get_kprobe_inst(bundle_t *bundle, uint slot, | |||
278 | } | 278 | } |
279 | 279 | ||
280 | /* Returns non-zero if the addr is in the Interrupt Vector Table */ | 280 | /* Returns non-zero if the addr is in the Interrupt Vector Table */ |
281 | static inline int in_ivt_functions(unsigned long addr) | 281 | static int __kprobes in_ivt_functions(unsigned long addr) |
282 | { | 282 | { |
283 | return (addr >= (unsigned long)__start_ivt_text | 283 | return (addr >= (unsigned long)__start_ivt_text |
284 | && addr < (unsigned long)__end_ivt_text); | 284 | && addr < (unsigned long)__end_ivt_text); |
@@ -308,19 +308,19 @@ static int __kprobes valid_kprobe_addr(int template, int slot, | |||
308 | return 0; | 308 | return 0; |
309 | } | 309 | } |
310 | 310 | ||
311 | static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb) | 311 | static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) |
312 | { | 312 | { |
313 | kcb->prev_kprobe.kp = kprobe_running(); | 313 | kcb->prev_kprobe.kp = kprobe_running(); |
314 | kcb->prev_kprobe.status = kcb->kprobe_status; | 314 | kcb->prev_kprobe.status = kcb->kprobe_status; |
315 | } | 315 | } |
316 | 316 | ||
317 | static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb) | 317 | static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb) |
318 | { | 318 | { |
319 | __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; | 319 | __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; |
320 | kcb->kprobe_status = kcb->prev_kprobe.status; | 320 | kcb->kprobe_status = kcb->prev_kprobe.status; |
321 | } | 321 | } |
322 | 322 | ||
323 | static inline void set_current_kprobe(struct kprobe *p, | 323 | static void __kprobes set_current_kprobe(struct kprobe *p, |
324 | struct kprobe_ctlblk *kcb) | 324 | struct kprobe_ctlblk *kcb) |
325 | { | 325 | { |
326 | __get_cpu_var(current_kprobe) = p; | 326 | __get_cpu_var(current_kprobe) = p; |
diff --git a/arch/m32r/kernel/entry.S b/arch/m32r/kernel/entry.S index 3871b65f0c82..920bb742b7a2 100644 --- a/arch/m32r/kernel/entry.S +++ b/arch/m32r/kernel/entry.S | |||
@@ -20,7 +20,7 @@ | |||
20 | * Stack layout in 'ret_from_system_call': | 20 | * Stack layout in 'ret_from_system_call': |
21 | * ptrace needs to have all regs on the stack. | 21 | * ptrace needs to have all regs on the stack. |
22 | * if the order here is changed, it needs to be | 22 | * if the order here is changed, it needs to be |
23 | * updated in fork.c:copy_process, signal.c:do_signal, | 23 | * updated in fork.c:copy_thread, signal.c:do_signal, |
24 | * ptrace.c and ptrace.h | 24 | * ptrace.c and ptrace.h |
25 | * | 25 | * |
26 | * M32Rx/M32R2 M32R | 26 | * M32Rx/M32R2 M32R |
@@ -41,18 +41,17 @@ | |||
41 | * @(0x38,sp) - syscall_nr ditto | 41 | * @(0x38,sp) - syscall_nr ditto |
42 | * @(0x3c,sp) - acc0h @(0x3c,sp) - acch | 42 | * @(0x3c,sp) - acc0h @(0x3c,sp) - acch |
43 | * @(0x40,sp) - acc0l @(0x40,sp) - accl | 43 | * @(0x40,sp) - acc0l @(0x40,sp) - accl |
44 | * @(0x44,sp) - acc1h @(0x44,sp) - psw | 44 | * @(0x44,sp) - acc1h @(0x44,sp) - dummy_acc1h |
45 | * @(0x48,sp) - acc1l @(0x48,sp) - bpc | 45 | * @(0x48,sp) - acc1l @(0x48,sp) - dummy_acc1l |
46 | * @(0x4c,sp) - psw @(0x4c,sp) - bbpsw | 46 | * @(0x4c,sp) - psw ditto |
47 | * @(0x50,sp) - bpc @(0x50,sp) - bbpc | 47 | * @(0x50,sp) - bpc ditto |
48 | * @(0x54,sp) - bbpsw @(0x54,sp) - spu (cr3) | 48 | * @(0x54,sp) - bbpsw ditto |
49 | * @(0x58,sp) - bbpc @(0x58,sp) - fp (r13) | 49 | * @(0x58,sp) - bbpc ditto |
50 | * @(0x5c,sp) - spu (cr3) @(0x5c,sp) - lr (r14) | 50 | * @(0x5c,sp) - spu (cr3) ditto |
51 | * @(0x60,sp) - fp (r13) @(0x60,sp) - spi (cr12) | 51 | * @(0x60,sp) - fp (r13) ditto |
52 | * @(0x64,sp) - lr (r14) @(0x64,sp) - orig_r0 | 52 | * @(0x64,sp) - lr (r14) ditto |
53 | * @(0x68,sp) - spi (cr2) | 53 | * @(0x68,sp) - spi (cr2) ditto |
54 | * @(0x6c,sp) - orig_r0 | 54 | * @(0x6c,sp) - orig_r0 ditto |
55 | * | ||
56 | */ | 55 | */ |
57 | 56 | ||
58 | #include <linux/config.h> | 57 | #include <linux/config.h> |
@@ -102,6 +101,12 @@ | |||
102 | #define ACC0L(reg) @(0x40,reg) | 101 | #define ACC0L(reg) @(0x40,reg) |
103 | #define ACC1H(reg) @(0x44,reg) | 102 | #define ACC1H(reg) @(0x44,reg) |
104 | #define ACC1L(reg) @(0x48,reg) | 103 | #define ACC1L(reg) @(0x48,reg) |
104 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) | ||
105 | #define ACCH(reg) @(0x3C,reg) | ||
106 | #define ACCL(reg) @(0x40,reg) | ||
107 | #else | ||
108 | #error unknown isa configuration | ||
109 | #endif | ||
105 | #define PSW(reg) @(0x4C,reg) | 110 | #define PSW(reg) @(0x4C,reg) |
106 | #define BPC(reg) @(0x50,reg) | 111 | #define BPC(reg) @(0x50,reg) |
107 | #define BBPSW(reg) @(0x54,reg) | 112 | #define BBPSW(reg) @(0x54,reg) |
@@ -111,21 +116,6 @@ | |||
111 | #define LR(reg) @(0x64,reg) | 116 | #define LR(reg) @(0x64,reg) |
112 | #define SP(reg) @(0x68,reg) | 117 | #define SP(reg) @(0x68,reg) |
113 | #define ORIG_R0(reg) @(0x6C,reg) | 118 | #define ORIG_R0(reg) @(0x6C,reg) |
114 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) | ||
115 | #define ACCH(reg) @(0x3C,reg) | ||
116 | #define ACCL(reg) @(0x40,reg) | ||
117 | #define PSW(reg) @(0x44,reg) | ||
118 | #define BPC(reg) @(0x48,reg) | ||
119 | #define BBPSW(reg) @(0x4C,reg) | ||
120 | #define BBPC(reg) @(0x50,reg) | ||
121 | #define SPU(reg) @(0x54,reg) | ||
122 | #define FP(reg) @(0x58,reg) /* FP = R13 */ | ||
123 | #define LR(reg) @(0x5C,reg) | ||
124 | #define SP(reg) @(0x60,reg) | ||
125 | #define ORIG_R0(reg) @(0x64,reg) | ||
126 | #else | ||
127 | #error unknown isa configuration | ||
128 | #endif | ||
129 | 119 | ||
130 | CF_MASK = 0x00000001 | 120 | CF_MASK = 0x00000001 |
131 | TF_MASK = 0x00000100 | 121 | TF_MASK = 0x00000100 |
@@ -142,7 +132,7 @@ VM_MASK = 0x00020000 | |||
142 | #endif | 132 | #endif |
143 | 133 | ||
144 | ENTRY(ret_from_fork) | 134 | ENTRY(ret_from_fork) |
145 | ld r0, @sp+ | 135 | pop r0 |
146 | bl schedule_tail | 136 | bl schedule_tail |
147 | GET_THREAD_INFO(r8) | 137 | GET_THREAD_INFO(r8) |
148 | bra syscall_exit | 138 | bra syscall_exit |
@@ -231,7 +221,7 @@ restore_all: | |||
231 | RESTORE_ALL | 221 | RESTORE_ALL |
232 | 222 | ||
233 | # perform work that needs to be done immediately before resumption | 223 | # perform work that needs to be done immediately before resumption |
234 | # r9 : frags | 224 | # r9 : flags |
235 | ALIGN | 225 | ALIGN |
236 | work_pending: | 226 | work_pending: |
237 | and3 r4, r9, #_TIF_NEED_RESCHED | 227 | and3 r4, r9, #_TIF_NEED_RESCHED |
@@ -320,7 +310,7 @@ ENTRY(ei_handler) | |||
320 | ; GET_ICU_STATUS; | 310 | ; GET_ICU_STATUS; |
321 | seth r0, #shigh(M32R_ICU_ISTS_ADDR) | 311 | seth r0, #shigh(M32R_ICU_ISTS_ADDR) |
322 | ld r0, @(low(M32R_ICU_ISTS_ADDR),r0) | 312 | ld r0, @(low(M32R_ICU_ISTS_ADDR),r0) |
323 | st r0, @-sp | 313 | push r0 |
324 | #if defined(CONFIG_SMP) | 314 | #if defined(CONFIG_SMP) |
325 | /* | 315 | /* |
326 | * If IRQ == 0 --> Nothing to do, Not write IMASK | 316 | * If IRQ == 0 --> Nothing to do, Not write IMASK |
@@ -557,7 +547,7 @@ check_end: | |||
557 | #endif /* CONFIG_PLAT_M32104UT */ | 547 | #endif /* CONFIG_PLAT_M32104UT */ |
558 | bl do_IRQ | 548 | bl do_IRQ |
559 | #endif /* CONFIG_SMP */ | 549 | #endif /* CONFIG_SMP */ |
560 | ld r14, @sp+ | 550 | pop r14 |
561 | seth r0, #shigh(M32R_ICU_IMASK_ADDR) | 551 | seth r0, #shigh(M32R_ICU_IMASK_ADDR) |
562 | st r14, @(low(M32R_ICU_IMASK_ADDR),r0) | 552 | st r14, @(low(M32R_ICU_IMASK_ADDR),r0) |
563 | #else | 553 | #else |
@@ -1015,4 +1005,3 @@ ENTRY(sys_call_table) | |||
1015 | .long sys_waitid | 1005 | .long sys_waitid |
1016 | 1006 | ||
1017 | syscall_table_size=(.-sys_call_table) | 1007 | syscall_table_size=(.-sys_call_table) |
1018 | |||
diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c index 5dfc7ea45cf7..065f5e719058 100644 --- a/arch/m32r/kernel/process.c +++ b/arch/m32r/kernel/process.c | |||
@@ -116,6 +116,10 @@ void cpu_idle (void) | |||
116 | 116 | ||
117 | void machine_restart(char *__unused) | 117 | void machine_restart(char *__unused) |
118 | { | 118 | { |
119 | #if defined(CONFIG_PLAT_MAPPI3) | ||
120 | outw(1, (unsigned long)PLD_REBOOT); | ||
121 | #endif | ||
122 | |||
119 | printk("Please push reset button!\n"); | 123 | printk("Please push reset button!\n"); |
120 | while (1) | 124 | while (1) |
121 | cpu_relax(); | 125 | cpu_relax(); |
diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c index cb33097fefc4..6498ee70bb73 100644 --- a/arch/m32r/kernel/signal.c +++ b/arch/m32r/kernel/signal.c | |||
@@ -118,6 +118,8 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, | |||
118 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) | 118 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) |
119 | COPY(acch); | 119 | COPY(acch); |
120 | COPY(accl); | 120 | COPY(accl); |
121 | COPY(dummy_acc1h); | ||
122 | COPY(dummy_acc1l); | ||
121 | #else | 123 | #else |
122 | #error unknown isa configuration | 124 | #error unknown isa configuration |
123 | #endif | 125 | #endif |
@@ -203,6 +205,8 @@ setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, | |||
203 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) | 205 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) |
204 | COPY(acch); | 206 | COPY(acch); |
205 | COPY(accl); | 207 | COPY(accl); |
208 | COPY(dummy_acc1h); | ||
209 | COPY(dummy_acc1l); | ||
206 | #else | 210 | #else |
207 | #error unknown isa configuration | 211 | #error unknown isa configuration |
208 | #endif | 212 | #endif |
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c index ad7a90212204..856ef1a832b9 100644 --- a/arch/powerpc/kernel/kprobes.c +++ b/arch/powerpc/kernel/kprobes.c | |||
@@ -88,7 +88,7 @@ void __kprobes arch_remove_kprobe(struct kprobe *p) | |||
88 | mutex_unlock(&kprobe_mutex); | 88 | mutex_unlock(&kprobe_mutex); |
89 | } | 89 | } |
90 | 90 | ||
91 | static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs) | 91 | static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs) |
92 | { | 92 | { |
93 | kprobe_opcode_t insn = *p->ainsn.insn; | 93 | kprobe_opcode_t insn = *p->ainsn.insn; |
94 | 94 | ||
@@ -101,21 +101,21 @@ static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs) | |||
101 | regs->nip = (unsigned long)p->ainsn.insn; | 101 | regs->nip = (unsigned long)p->ainsn.insn; |
102 | } | 102 | } |
103 | 103 | ||
104 | static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb) | 104 | static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) |
105 | { | 105 | { |
106 | kcb->prev_kprobe.kp = kprobe_running(); | 106 | kcb->prev_kprobe.kp = kprobe_running(); |
107 | kcb->prev_kprobe.status = kcb->kprobe_status; | 107 | kcb->prev_kprobe.status = kcb->kprobe_status; |
108 | kcb->prev_kprobe.saved_msr = kcb->kprobe_saved_msr; | 108 | kcb->prev_kprobe.saved_msr = kcb->kprobe_saved_msr; |
109 | } | 109 | } |
110 | 110 | ||
111 | static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb) | 111 | static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb) |
112 | { | 112 | { |
113 | __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; | 113 | __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; |
114 | kcb->kprobe_status = kcb->prev_kprobe.status; | 114 | kcb->kprobe_status = kcb->prev_kprobe.status; |
115 | kcb->kprobe_saved_msr = kcb->prev_kprobe.saved_msr; | 115 | kcb->kprobe_saved_msr = kcb->prev_kprobe.saved_msr; |
116 | } | 116 | } |
117 | 117 | ||
118 | static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs, | 118 | static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs, |
119 | struct kprobe_ctlblk *kcb) | 119 | struct kprobe_ctlblk *kcb) |
120 | { | 120 | { |
121 | __get_cpu_var(current_kprobe) = p; | 121 | __get_cpu_var(current_kprobe) = p; |
@@ -141,7 +141,7 @@ void __kprobes arch_prepare_kretprobe(struct kretprobe *rp, | |||
141 | } | 141 | } |
142 | } | 142 | } |
143 | 143 | ||
144 | static inline int kprobe_handler(struct pt_regs *regs) | 144 | static int __kprobes kprobe_handler(struct pt_regs *regs) |
145 | { | 145 | { |
146 | struct kprobe *p; | 146 | struct kprobe *p; |
147 | int ret = 0; | 147 | int ret = 0; |
@@ -334,7 +334,7 @@ static void __kprobes resume_execution(struct kprobe *p, struct pt_regs *regs) | |||
334 | regs->nip = (unsigned long)p->addr + 4; | 334 | regs->nip = (unsigned long)p->addr + 4; |
335 | } | 335 | } |
336 | 336 | ||
337 | static inline int post_kprobe_handler(struct pt_regs *regs) | 337 | static int __kprobes post_kprobe_handler(struct pt_regs *regs) |
338 | { | 338 | { |
339 | struct kprobe *cur = kprobe_running(); | 339 | struct kprobe *cur = kprobe_running(); |
340 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); | 340 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); |
@@ -370,7 +370,7 @@ out: | |||
370 | return 1; | 370 | return 1; |
371 | } | 371 | } |
372 | 372 | ||
373 | static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr) | 373 | static int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) |
374 | { | 374 | { |
375 | struct kprobe *cur = kprobe_running(); | 375 | struct kprobe *cur = kprobe_running(); |
376 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); | 376 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); |
diff --git a/arch/sparc64/kernel/kprobes.c b/arch/sparc64/kernel/kprobes.c index ffc7309e9f22..2e1c824c1cc9 100644 --- a/arch/sparc64/kernel/kprobes.c +++ b/arch/sparc64/kernel/kprobes.c | |||
@@ -63,7 +63,7 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p) | |||
63 | flushi(p->addr); | 63 | flushi(p->addr); |
64 | } | 64 | } |
65 | 65 | ||
66 | static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb) | 66 | static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) |
67 | { | 67 | { |
68 | kcb->prev_kprobe.kp = kprobe_running(); | 68 | kcb->prev_kprobe.kp = kprobe_running(); |
69 | kcb->prev_kprobe.status = kcb->kprobe_status; | 69 | kcb->prev_kprobe.status = kcb->kprobe_status; |
@@ -71,7 +71,7 @@ static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb) | |||
71 | kcb->prev_kprobe.orig_tstate_pil = kcb->kprobe_orig_tstate_pil; | 71 | kcb->prev_kprobe.orig_tstate_pil = kcb->kprobe_orig_tstate_pil; |
72 | } | 72 | } |
73 | 73 | ||
74 | static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb) | 74 | static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb) |
75 | { | 75 | { |
76 | __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; | 76 | __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; |
77 | kcb->kprobe_status = kcb->prev_kprobe.status; | 77 | kcb->kprobe_status = kcb->prev_kprobe.status; |
@@ -79,7 +79,7 @@ static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb) | |||
79 | kcb->kprobe_orig_tstate_pil = kcb->prev_kprobe.orig_tstate_pil; | 79 | kcb->kprobe_orig_tstate_pil = kcb->prev_kprobe.orig_tstate_pil; |
80 | } | 80 | } |
81 | 81 | ||
82 | static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs, | 82 | static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs, |
83 | struct kprobe_ctlblk *kcb) | 83 | struct kprobe_ctlblk *kcb) |
84 | { | 84 | { |
85 | __get_cpu_var(current_kprobe) = p; | 85 | __get_cpu_var(current_kprobe) = p; |
@@ -87,7 +87,7 @@ static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs, | |||
87 | kcb->kprobe_orig_tstate_pil = (regs->tstate & TSTATE_PIL); | 87 | kcb->kprobe_orig_tstate_pil = (regs->tstate & TSTATE_PIL); |
88 | } | 88 | } |
89 | 89 | ||
90 | static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs, | 90 | static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs, |
91 | struct kprobe_ctlblk *kcb) | 91 | struct kprobe_ctlblk *kcb) |
92 | { | 92 | { |
93 | regs->tstate |= TSTATE_PIL; | 93 | regs->tstate |= TSTATE_PIL; |
@@ -273,7 +273,7 @@ static void __kprobes resume_execution(struct kprobe *p, | |||
273 | kcb->kprobe_orig_tstate_pil); | 273 | kcb->kprobe_orig_tstate_pil); |
274 | } | 274 | } |
275 | 275 | ||
276 | static inline int post_kprobe_handler(struct pt_regs *regs) | 276 | static int __kprobes post_kprobe_handler(struct pt_regs *regs) |
277 | { | 277 | { |
278 | struct kprobe *cur = kprobe_running(); | 278 | struct kprobe *cur = kprobe_running(); |
279 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); | 279 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); |
@@ -300,7 +300,7 @@ out: | |||
300 | return 1; | 300 | return 1; |
301 | } | 301 | } |
302 | 302 | ||
303 | static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr) | 303 | static int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) |
304 | { | 304 | { |
305 | struct kprobe *cur = kprobe_running(); | 305 | struct kprobe *cur = kprobe_running(); |
306 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); | 306 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); |
diff --git a/arch/um/drivers/cow_user.c b/arch/um/drivers/cow_user.c index 0ec4052db9c5..6ab852bfcd3a 100644 --- a/arch/um/drivers/cow_user.c +++ b/arch/um/drivers/cow_user.c | |||
@@ -100,7 +100,7 @@ struct cow_header_v3_broken { | |||
100 | __u32 alignment; | 100 | __u32 alignment; |
101 | __u32 cow_format; | 101 | __u32 cow_format; |
102 | char backing_file[PATH_LEN_V3]; | 102 | char backing_file[PATH_LEN_V3]; |
103 | }; | 103 | } __attribute__((packed)); |
104 | 104 | ||
105 | /* COW format definitions - for now, we have only the usual COW bitmap */ | 105 | /* COW format definitions - for now, we have only the usual COW bitmap */ |
106 | #define COW_BITMAP 0 | 106 | #define COW_BITMAP 0 |
diff --git a/arch/um/include/longjmp.h b/arch/um/include/longjmp.h index 018b3819ab0b..8e7053013f7b 100644 --- a/arch/um/include/longjmp.h +++ b/arch/um/include/longjmp.h | |||
@@ -4,11 +4,11 @@ | |||
4 | #include <setjmp.h> | 4 | #include <setjmp.h> |
5 | #include "os.h" | 5 | #include "os.h" |
6 | 6 | ||
7 | #define UML_SIGLONGJMP(buf, val) do { \ | 7 | #define UML_LONGJMP(buf, val) do { \ |
8 | longjmp(*buf, val); \ | 8 | longjmp(*buf, val); \ |
9 | } while(0) | 9 | } while(0) |
10 | 10 | ||
11 | #define UML_SIGSETJMP(buf, enable) ({ \ | 11 | #define UML_SETJMP(buf, enable) ({ \ |
12 | int n; \ | 12 | int n; \ |
13 | enable = get_signals(); \ | 13 | enable = get_signals(); \ |
14 | n = setjmp(*buf); \ | 14 | n = setjmp(*buf); \ |
diff --git a/arch/um/include/sysdep-i386/kernel-offsets.h b/arch/um/include/sysdep-i386/kernel-offsets.h index 82f96c574144..2c13de321f2f 100644 --- a/arch/um/include/sysdep-i386/kernel-offsets.h +++ b/arch/um/include/sysdep-i386/kernel-offsets.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #include <linux/stddef.h> | 1 | #include <linux/stddef.h> |
2 | #include <linux/sched.h> | 2 | #include <linux/sched.h> |
3 | #include <linux/elf.h> | 3 | #include <linux/elf.h> |
4 | #include <asm/mman.h> | ||
4 | 5 | ||
5 | #define DEFINE(sym, val) \ | 6 | #define DEFINE(sym, val) \ |
6 | asm volatile("\n->" #sym " %0 " #val : : "i" (val)) | 7 | asm volatile("\n->" #sym " %0 " #val : : "i" (val)) |
@@ -16,6 +17,7 @@ | |||
16 | void foo(void) | 17 | void foo(void) |
17 | { | 18 | { |
18 | OFFSET(HOST_TASK_DEBUGREGS, task_struct, thread.arch.debugregs); | 19 | OFFSET(HOST_TASK_DEBUGREGS, task_struct, thread.arch.debugregs); |
20 | DEFINE(KERNEL_MADV_REMOVE, MADV_REMOVE); | ||
19 | #ifdef CONFIG_MODE_TT | 21 | #ifdef CONFIG_MODE_TT |
20 | OFFSET(HOST_TASK_EXTERN_PID, task_struct, thread.mode.tt.extern_pid); | 22 | OFFSET(HOST_TASK_EXTERN_PID, task_struct, thread.mode.tt.extern_pid); |
21 | #endif | 23 | #endif |
diff --git a/arch/um/include/sysdep-x86_64/kernel-offsets.h b/arch/um/include/sysdep-x86_64/kernel-offsets.h index 5ce93abd0b54..939cc475757a 100644 --- a/arch/um/include/sysdep-x86_64/kernel-offsets.h +++ b/arch/um/include/sysdep-x86_64/kernel-offsets.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/time.h> | 4 | #include <linux/time.h> |
5 | #include <linux/elf.h> | 5 | #include <linux/elf.h> |
6 | #include <asm/page.h> | 6 | #include <asm/page.h> |
7 | #include <asm/mman.h> | ||
7 | 8 | ||
8 | #define DEFINE(sym, val) \ | 9 | #define DEFINE(sym, val) \ |
9 | asm volatile("\n->" #sym " %0 " #val : : "i" (val)) | 10 | asm volatile("\n->" #sym " %0 " #val : : "i" (val)) |
@@ -18,6 +19,7 @@ | |||
18 | 19 | ||
19 | void foo(void) | 20 | void foo(void) |
20 | { | 21 | { |
22 | DEFINE(KERNEL_MADV_REMOVE, MADV_REMOVE); | ||
21 | #ifdef CONFIG_MODE_TT | 23 | #ifdef CONFIG_MODE_TT |
22 | OFFSET(HOST_TASK_EXTERN_PID, task_struct, thread.mode.tt.extern_pid); | 24 | OFFSET(HOST_TASK_EXTERN_PID, task_struct, thread.mode.tt.extern_pid); |
23 | #endif | 25 | #endif |
diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c index 71bb90a7606d..c6432e729241 100644 --- a/arch/um/os-Linux/mem.c +++ b/arch/um/os-Linux/mem.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <fcntl.h> | 8 | #include <fcntl.h> |
9 | #include <sys/types.h> | 9 | #include <sys/types.h> |
10 | #include <sys/mman.h> | 10 | #include <sys/mman.h> |
11 | #include <sys/statfs.h> | ||
11 | #include "kern_util.h" | 12 | #include "kern_util.h" |
12 | #include "user.h" | 13 | #include "user.h" |
13 | #include "user_util.h" | 14 | #include "user_util.h" |
@@ -19,6 +20,7 @@ | |||
19 | 20 | ||
20 | #include <sys/param.h> | 21 | #include <sys/param.h> |
21 | 22 | ||
23 | static char *default_tmpdir = "/tmp"; | ||
22 | static char *tempdir = NULL; | 24 | static char *tempdir = NULL; |
23 | 25 | ||
24 | static void __init find_tempdir(void) | 26 | static void __init find_tempdir(void) |
@@ -34,7 +36,7 @@ static void __init find_tempdir(void) | |||
34 | break; | 36 | break; |
35 | } | 37 | } |
36 | if((dir == NULL) || (*dir == '\0')) | 38 | if((dir == NULL) || (*dir == '\0')) |
37 | dir = "/tmp"; | 39 | dir = default_tmpdir; |
38 | 40 | ||
39 | tempdir = malloc(strlen(dir) + 2); | 41 | tempdir = malloc(strlen(dir) + 2); |
40 | if(tempdir == NULL){ | 42 | if(tempdir == NULL){ |
@@ -46,6 +48,96 @@ static void __init find_tempdir(void) | |||
46 | strcat(tempdir, "/"); | 48 | strcat(tempdir, "/"); |
47 | } | 49 | } |
48 | 50 | ||
51 | /* This will return 1, with the first character in buf being the | ||
52 | * character following the next instance of c in the file. This will | ||
53 | * read the file as needed. If there's an error, -errno is returned; | ||
54 | * if the end of the file is reached, 0 is returned. | ||
55 | */ | ||
56 | static int next(int fd, char *buf, int size, char c) | ||
57 | { | ||
58 | int n; | ||
59 | char *ptr; | ||
60 | |||
61 | while((ptr = strchr(buf, c)) == NULL){ | ||
62 | n = read(fd, buf, size - 1); | ||
63 | if(n == 0) | ||
64 | return 0; | ||
65 | else if(n < 0) | ||
66 | return -errno; | ||
67 | |||
68 | buf[n] = '\0'; | ||
69 | } | ||
70 | |||
71 | ptr++; | ||
72 | memmove(buf, ptr, strlen(ptr) + 1); | ||
73 | return 1; | ||
74 | } | ||
75 | |||
76 | static int checked_tmpdir = 0; | ||
77 | |||
78 | /* Look for a tmpfs mounted at /dev/shm. I couldn't find a cleaner | ||
79 | * way to do this than to parse /proc/mounts. statfs will return the | ||
80 | * same filesystem magic number and fs id for both /dev and /dev/shm | ||
81 | * when they are both tmpfs, so you can't tell if they are different | ||
82 | * filesystems. Also, there seems to be no other way of finding the | ||
83 | * mount point of a filesystem from within it. | ||
84 | * | ||
85 | * If a /dev/shm tmpfs entry is found, then we switch to using it. | ||
86 | * Otherwise, we stay with the default /tmp. | ||
87 | */ | ||
88 | static void which_tmpdir(void) | ||
89 | { | ||
90 | int fd, found; | ||
91 | char buf[128] = { '\0' }; | ||
92 | |||
93 | if(checked_tmpdir) | ||
94 | return; | ||
95 | |||
96 | checked_tmpdir = 1; | ||
97 | |||
98 | printf("Checking for tmpfs mount on /dev/shm..."); | ||
99 | |||
100 | fd = open("/proc/mounts", O_RDONLY); | ||
101 | if(fd < 0){ | ||
102 | printf("failed to open /proc/mounts, errno = %d\n", errno); | ||
103 | return; | ||
104 | } | ||
105 | |||
106 | while(1){ | ||
107 | found = next(fd, buf, sizeof(buf) / sizeof(buf[0]), ' '); | ||
108 | if(found != 1) | ||
109 | break; | ||
110 | |||
111 | if(!strncmp(buf, "/dev/shm", strlen("/dev/shm"))) | ||
112 | goto found; | ||
113 | |||
114 | found = next(fd, buf, sizeof(buf) / sizeof(buf[0]), '\n'); | ||
115 | if(found != 1) | ||
116 | break; | ||
117 | } | ||
118 | |||
119 | err: | ||
120 | if(found == 0) | ||
121 | printf("nothing mounted on /dev/shm\n"); | ||
122 | else if(found < 0) | ||
123 | printf("read returned errno %d\n", -found); | ||
124 | |||
125 | return; | ||
126 | |||
127 | found: | ||
128 | found = next(fd, buf, sizeof(buf) / sizeof(buf[0]), ' '); | ||
129 | if(found != 1) | ||
130 | goto err; | ||
131 | |||
132 | if(strncmp(buf, "tmpfs", strlen("tmpfs"))){ | ||
133 | printf("not tmpfs\n"); | ||
134 | return; | ||
135 | } | ||
136 | |||
137 | printf("OK\n"); | ||
138 | default_tmpdir = "/dev/shm"; | ||
139 | } | ||
140 | |||
49 | /* | 141 | /* |
50 | * This proc still used in tt-mode | 142 | * This proc still used in tt-mode |
51 | * (file: kernel/tt/ptproxy/proxy.c, proc: start_debugger). | 143 | * (file: kernel/tt/ptproxy/proxy.c, proc: start_debugger). |
@@ -56,6 +148,7 @@ int make_tempfile(const char *template, char **out_tempname, int do_unlink) | |||
56 | char *tempname; | 148 | char *tempname; |
57 | int fd; | 149 | int fd; |
58 | 150 | ||
151 | which_tmpdir(); | ||
59 | tempname = malloc(MAXPATHLEN); | 152 | tempname = malloc(MAXPATHLEN); |
60 | 153 | ||
61 | find_tempdir(); | 154 | find_tempdir(); |
@@ -137,3 +230,26 @@ int create_mem_file(unsigned long long len) | |||
137 | } | 230 | } |
138 | return(fd); | 231 | return(fd); |
139 | } | 232 | } |
233 | |||
234 | |||
235 | void check_tmpexec(void) | ||
236 | { | ||
237 | void *addr; | ||
238 | int err, fd = create_tmp_file(UM_KERN_PAGE_SIZE); | ||
239 | |||
240 | addr = mmap(NULL, UM_KERN_PAGE_SIZE, | ||
241 | PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, fd, 0); | ||
242 | printf("Checking PROT_EXEC mmap in %s...",tempdir); | ||
243 | fflush(stdout); | ||
244 | if(addr == MAP_FAILED){ | ||
245 | err = errno; | ||
246 | perror("failed"); | ||
247 | if(err == EPERM) | ||
248 | printf("%s must be not mounted noexec\n",tempdir); | ||
249 | exit(1); | ||
250 | } | ||
251 | printf("OK\n"); | ||
252 | munmap(addr, UM_KERN_PAGE_SIZE); | ||
253 | |||
254 | close(fd); | ||
255 | } | ||
diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c index 8176b0b52047..3505f44f8a25 100644 --- a/arch/um/os-Linux/process.c +++ b/arch/um/os-Linux/process.c | |||
@@ -190,7 +190,7 @@ int os_unmap_memory(void *addr, int len) | |||
190 | } | 190 | } |
191 | 191 | ||
192 | #ifndef MADV_REMOVE | 192 | #ifndef MADV_REMOVE |
193 | #define MADV_REMOVE 0x5 /* remove these pages & resources */ | 193 | #define MADV_REMOVE KERNEL_MADV_REMOVE |
194 | #endif | 194 | #endif |
195 | 195 | ||
196 | int os_drop_memory(void *addr, int length) | 196 | int os_drop_memory(void *addr, int length) |
@@ -216,7 +216,7 @@ int can_drop_memory(void) | |||
216 | } | 216 | } |
217 | 217 | ||
218 | addr = mmap64(NULL, UM_KERN_PAGE_SIZE, PROT_READ | PROT_WRITE, | 218 | addr = mmap64(NULL, UM_KERN_PAGE_SIZE, PROT_READ | PROT_WRITE, |
219 | MAP_PRIVATE, fd, 0); | 219 | MAP_SHARED, fd, 0); |
220 | if(addr == MAP_FAILED){ | 220 | if(addr == MAP_FAILED){ |
221 | printk("Mapping test memory file failed, err = %d\n", -errno); | 221 | printk("Mapping test memory file failed, err = %d\n", -errno); |
222 | return 0; | 222 | return 0; |
@@ -266,11 +266,11 @@ void init_new_thread_signals(int altstack) | |||
266 | 266 | ||
267 | int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr) | 267 | int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr) |
268 | { | 268 | { |
269 | sigjmp_buf buf; | 269 | jmp_buf buf; |
270 | int n, enable; | 270 | int n, enable; |
271 | 271 | ||
272 | *jmp_ptr = &buf; | 272 | *jmp_ptr = &buf; |
273 | n = UML_SIGSETJMP(&buf, enable); | 273 | n = UML_SETJMP(&buf, enable); |
274 | if(n != 0) | 274 | if(n != 0) |
275 | return(n); | 275 | return(n); |
276 | (*fn)(arg); | 276 | (*fn)(arg); |
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c index 045ae0037456..0776bc18ca85 100644 --- a/arch/um/os-Linux/skas/process.c +++ b/arch/um/os-Linux/skas/process.c | |||
@@ -434,7 +434,7 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr, | |||
434 | void (*handler)(int)) | 434 | void (*handler)(int)) |
435 | { | 435 | { |
436 | unsigned long flags; | 436 | unsigned long flags; |
437 | sigjmp_buf switch_buf, fork_buf; | 437 | jmp_buf switch_buf, fork_buf; |
438 | int enable; | 438 | int enable; |
439 | 439 | ||
440 | *switch_buf_ptr = &switch_buf; | 440 | *switch_buf_ptr = &switch_buf; |
@@ -450,7 +450,7 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr, | |||
450 | */ | 450 | */ |
451 | flags = get_signals(); | 451 | flags = get_signals(); |
452 | block_signals(); | 452 | block_signals(); |
453 | if(UML_SIGSETJMP(&fork_buf, enable) == 0) | 453 | if(UML_SETJMP(&fork_buf, enable) == 0) |
454 | new_thread_proc(stack, handler); | 454 | new_thread_proc(stack, handler); |
455 | 455 | ||
456 | remove_sigstack(); | 456 | remove_sigstack(); |
@@ -466,35 +466,35 @@ void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr, | |||
466 | 466 | ||
467 | void thread_wait(void *sw, void *fb) | 467 | void thread_wait(void *sw, void *fb) |
468 | { | 468 | { |
469 | sigjmp_buf buf, **switch_buf = sw, *fork_buf; | 469 | jmp_buf buf, **switch_buf = sw, *fork_buf; |
470 | int enable; | 470 | int enable; |
471 | 471 | ||
472 | *switch_buf = &buf; | 472 | *switch_buf = &buf; |
473 | fork_buf = fb; | 473 | fork_buf = fb; |
474 | if(UML_SIGSETJMP(&buf, enable) == 0) | 474 | if(UML_SETJMP(&buf, enable) == 0) |
475 | siglongjmp(*fork_buf, INIT_JMP_REMOVE_SIGSTACK); | 475 | siglongjmp(*fork_buf, INIT_JMP_REMOVE_SIGSTACK); |
476 | } | 476 | } |
477 | 477 | ||
478 | void switch_threads(void *me, void *next) | 478 | void switch_threads(void *me, void *next) |
479 | { | 479 | { |
480 | sigjmp_buf my_buf, **me_ptr = me, *next_buf = next; | 480 | jmp_buf my_buf, **me_ptr = me, *next_buf = next; |
481 | int enable; | 481 | int enable; |
482 | 482 | ||
483 | *me_ptr = &my_buf; | 483 | *me_ptr = &my_buf; |
484 | if(UML_SIGSETJMP(&my_buf, enable) == 0) | 484 | if(UML_SETJMP(&my_buf, enable) == 0) |
485 | UML_SIGLONGJMP(next_buf, 1); | 485 | UML_LONGJMP(next_buf, 1); |
486 | } | 486 | } |
487 | 487 | ||
488 | static sigjmp_buf initial_jmpbuf; | 488 | static jmp_buf initial_jmpbuf; |
489 | 489 | ||
490 | /* XXX Make these percpu */ | 490 | /* XXX Make these percpu */ |
491 | static void (*cb_proc)(void *arg); | 491 | static void (*cb_proc)(void *arg); |
492 | static void *cb_arg; | 492 | static void *cb_arg; |
493 | static sigjmp_buf *cb_back; | 493 | static jmp_buf *cb_back; |
494 | 494 | ||
495 | int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr) | 495 | int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr) |
496 | { | 496 | { |
497 | sigjmp_buf **switch_buf = switch_buf_ptr; | 497 | jmp_buf **switch_buf = switch_buf_ptr; |
498 | int n, enable; | 498 | int n, enable; |
499 | 499 | ||
500 | set_handler(SIGWINCH, (__sighandler_t) sig_handler, | 500 | set_handler(SIGWINCH, (__sighandler_t) sig_handler, |
@@ -502,7 +502,7 @@ int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr) | |||
502 | SIGVTALRM, -1); | 502 | SIGVTALRM, -1); |
503 | 503 | ||
504 | *fork_buf_ptr = &initial_jmpbuf; | 504 | *fork_buf_ptr = &initial_jmpbuf; |
505 | n = UML_SIGSETJMP(&initial_jmpbuf, enable); | 505 | n = UML_SETJMP(&initial_jmpbuf, enable); |
506 | switch(n){ | 506 | switch(n){ |
507 | case INIT_JMP_NEW_THREAD: | 507 | case INIT_JMP_NEW_THREAD: |
508 | new_thread_proc((void *) stack, new_thread_handler); | 508 | new_thread_proc((void *) stack, new_thread_handler); |
@@ -512,7 +512,7 @@ int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr) | |||
512 | break; | 512 | break; |
513 | case INIT_JMP_CALLBACK: | 513 | case INIT_JMP_CALLBACK: |
514 | (*cb_proc)(cb_arg); | 514 | (*cb_proc)(cb_arg); |
515 | UML_SIGLONGJMP(cb_back, 1); | 515 | UML_LONGJMP(cb_back, 1); |
516 | break; | 516 | break; |
517 | case INIT_JMP_HALT: | 517 | case INIT_JMP_HALT: |
518 | kmalloc_ok = 0; | 518 | kmalloc_ok = 0; |
@@ -523,12 +523,12 @@ int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr) | |||
523 | default: | 523 | default: |
524 | panic("Bad sigsetjmp return in start_idle_thread - %d\n", n); | 524 | panic("Bad sigsetjmp return in start_idle_thread - %d\n", n); |
525 | } | 525 | } |
526 | UML_SIGLONGJMP(*switch_buf, 1); | 526 | UML_LONGJMP(*switch_buf, 1); |
527 | } | 527 | } |
528 | 528 | ||
529 | void initial_thread_cb_skas(void (*proc)(void *), void *arg) | 529 | void initial_thread_cb_skas(void (*proc)(void *), void *arg) |
530 | { | 530 | { |
531 | sigjmp_buf here; | 531 | jmp_buf here; |
532 | int enable; | 532 | int enable; |
533 | 533 | ||
534 | cb_proc = proc; | 534 | cb_proc = proc; |
@@ -536,8 +536,8 @@ void initial_thread_cb_skas(void (*proc)(void *), void *arg) | |||
536 | cb_back = &here; | 536 | cb_back = &here; |
537 | 537 | ||
538 | block_signals(); | 538 | block_signals(); |
539 | if(UML_SIGSETJMP(&here, enable) == 0) | 539 | if(UML_SETJMP(&here, enable) == 0) |
540 | UML_SIGLONGJMP(&initial_jmpbuf, INIT_JMP_CALLBACK); | 540 | UML_LONGJMP(&initial_jmpbuf, INIT_JMP_CALLBACK); |
541 | unblock_signals(); | 541 | unblock_signals(); |
542 | 542 | ||
543 | cb_proc = NULL; | 543 | cb_proc = NULL; |
@@ -548,13 +548,13 @@ void initial_thread_cb_skas(void (*proc)(void *), void *arg) | |||
548 | void halt_skas(void) | 548 | void halt_skas(void) |
549 | { | 549 | { |
550 | block_signals(); | 550 | block_signals(); |
551 | UML_SIGLONGJMP(&initial_jmpbuf, INIT_JMP_HALT); | 551 | UML_LONGJMP(&initial_jmpbuf, INIT_JMP_HALT); |
552 | } | 552 | } |
553 | 553 | ||
554 | void reboot_skas(void) | 554 | void reboot_skas(void) |
555 | { | 555 | { |
556 | block_signals(); | 556 | block_signals(); |
557 | UML_SIGLONGJMP(&initial_jmpbuf, INIT_JMP_REBOOT); | 557 | UML_LONGJMP(&initial_jmpbuf, INIT_JMP_REBOOT); |
558 | } | 558 | } |
559 | 559 | ||
560 | void switch_mm_skas(struct mm_id *mm_idp) | 560 | void switch_mm_skas(struct mm_id *mm_idp) |
diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c index 387e26af301a..503148504009 100644 --- a/arch/um/os-Linux/start_up.c +++ b/arch/um/os-Linux/start_up.c | |||
@@ -296,29 +296,7 @@ static void __init check_ptrace(void) | |||
296 | check_sysemu(); | 296 | check_sysemu(); |
297 | } | 297 | } |
298 | 298 | ||
299 | extern int create_tmp_file(unsigned long long len); | 299 | extern void check_tmpexec(void); |
300 | |||
301 | static void check_tmpexec(void) | ||
302 | { | ||
303 | void *addr; | ||
304 | int err, fd = create_tmp_file(UM_KERN_PAGE_SIZE); | ||
305 | |||
306 | addr = mmap(NULL, UM_KERN_PAGE_SIZE, | ||
307 | PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, fd, 0); | ||
308 | printf("Checking PROT_EXEC mmap in /tmp..."); | ||
309 | fflush(stdout); | ||
310 | if(addr == MAP_FAILED){ | ||
311 | err = errno; | ||
312 | perror("failed"); | ||
313 | if(err == EPERM) | ||
314 | printf("/tmp must be not mounted noexec\n"); | ||
315 | exit(1); | ||
316 | } | ||
317 | printf("OK\n"); | ||
318 | munmap(addr, UM_KERN_PAGE_SIZE); | ||
319 | |||
320 | close(fd); | ||
321 | } | ||
322 | 300 | ||
323 | void os_early_checks(void) | 301 | void os_early_checks(void) |
324 | { | 302 | { |
diff --git a/arch/um/os-Linux/trap.c b/arch/um/os-Linux/trap.c index a9f6b26f9828..90b29ae9af46 100644 --- a/arch/um/os-Linux/trap.c +++ b/arch/um/os-Linux/trap.c | |||
@@ -35,7 +35,7 @@ void os_fill_handlinfo(struct kern_handlers h) | |||
35 | 35 | ||
36 | void do_longjmp(void *b, int val) | 36 | void do_longjmp(void *b, int val) |
37 | { | 37 | { |
38 | sigjmp_buf *buf = b; | 38 | jmp_buf *buf = b; |
39 | 39 | ||
40 | UML_SIGLONGJMP(buf, val); | 40 | UML_LONGJMP(buf, val); |
41 | } | 41 | } |
diff --git a/arch/um/os-Linux/uaccess.c b/arch/um/os-Linux/uaccess.c index 166fb66995df..e523719330b2 100644 --- a/arch/um/os-Linux/uaccess.c +++ b/arch/um/os-Linux/uaccess.c | |||
@@ -16,9 +16,9 @@ unsigned long __do_user_copy(void *to, const void *from, int n, | |||
16 | unsigned long *faddrp = (unsigned long *) fault_addr, ret; | 16 | unsigned long *faddrp = (unsigned long *) fault_addr, ret; |
17 | int enable; | 17 | int enable; |
18 | 18 | ||
19 | sigjmp_buf jbuf; | 19 | jmp_buf jbuf; |
20 | *fault_catcher = &jbuf; | 20 | *fault_catcher = &jbuf; |
21 | if(UML_SIGSETJMP(&jbuf, enable) == 0){ | 21 | if(UML_SETJMP(&jbuf, enable) == 0){ |
22 | (*op)(to, from, n); | 22 | (*op)(to, from, n); |
23 | ret = 0; | 23 | ret = 0; |
24 | *faulted_out = 0; | 24 | *faulted_out = 0; |
diff --git a/arch/um/os-Linux/util.c b/arch/um/os-Linux/util.c index e32065e2fdc8..c47a2a7ce70e 100644 --- a/arch/um/os-Linux/util.c +++ b/arch/um/os-Linux/util.c | |||
@@ -104,7 +104,7 @@ void setup_hostinfo(void) | |||
104 | int setjmp_wrapper(void (*proc)(void *, void *), ...) | 104 | int setjmp_wrapper(void (*proc)(void *, void *), ...) |
105 | { | 105 | { |
106 | va_list args; | 106 | va_list args; |
107 | sigjmp_buf buf; | 107 | jmp_buf buf; |
108 | int n; | 108 | int n; |
109 | 109 | ||
110 | n = sigsetjmp(buf, 1); | 110 | n = sigsetjmp(buf, 1); |
diff --git a/arch/um/sys-i386/signal.c b/arch/um/sys-i386/signal.c index 618fd8594643..0709fc6670c2 100644 --- a/arch/um/sys-i386/signal.c +++ b/arch/um/sys-i386/signal.c | |||
@@ -57,7 +57,7 @@ static int copy_sc_from_user_skas(struct pt_regs *regs, | |||
57 | return(0); | 57 | return(0); |
58 | } | 58 | } |
59 | 59 | ||
60 | int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate __user *to_fp, | 60 | int copy_sc_to_user_skas(struct sigcontext __user *to, struct _fpstate __user *to_fp, |
61 | struct pt_regs *regs, unsigned long sp) | 61 | struct pt_regs *regs, unsigned long sp) |
62 | { | 62 | { |
63 | struct sigcontext sc; | 63 | struct sigcontext sc; |
@@ -132,7 +132,7 @@ int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext __user *from, | |||
132 | return(err); | 132 | return(err); |
133 | } | 133 | } |
134 | 134 | ||
135 | int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate __user *fp, | 135 | int copy_sc_to_user_tt(struct sigcontext __user *to, struct _fpstate __user *fp, |
136 | struct sigcontext *from, int fpsize, unsigned long sp) | 136 | struct sigcontext *from, int fpsize, unsigned long sp) |
137 | { | 137 | { |
138 | struct _fpstate __user *to_fp; | 138 | struct _fpstate __user *to_fp; |
@@ -167,7 +167,7 @@ static int copy_sc_from_user(struct pt_regs *to, void __user *from) | |||
167 | return(ret); | 167 | return(ret); |
168 | } | 168 | } |
169 | 169 | ||
170 | static int copy_sc_to_user(struct sigcontext *to, struct _fpstate __user *fp, | 170 | static int copy_sc_to_user(struct sigcontext __user *to, struct _fpstate __user *fp, |
171 | struct pt_regs *from, unsigned long sp) | 171 | struct pt_regs *from, unsigned long sp) |
172 | { | 172 | { |
173 | return(CHOOSE_MODE(copy_sc_to_user_tt(to, fp, UPT_SC(&from->regs), | 173 | return(CHOOSE_MODE(copy_sc_to_user_tt(to, fp, UPT_SC(&from->regs), |
diff --git a/arch/um/sys-i386/stub_segv.c b/arch/um/sys-i386/stub_segv.c index a37f672ec964..2355dc19c46c 100644 --- a/arch/um/sys-i386/stub_segv.c +++ b/arch/um/sys-i386/stub_segv.c | |||
@@ -27,6 +27,6 @@ stub_segv_handler(int sig) | |||
27 | * the stack in its original form when we do the sigreturn here, by | 27 | * the stack in its original form when we do the sigreturn here, by |
28 | * hand. | 28 | * hand. |
29 | */ | 29 | */ |
30 | __asm__("mov %0,%%esp ; movl %1, %%eax ; " | 30 | __asm__ __volatile__("mov %0,%%esp ; movl %1, %%eax ; " |
31 | "int $0x80" : : "a" (sc), "g" (__NR_sigreturn)); | 31 | "int $0x80" : : "a" (sc), "g" (__NR_sigreturn)); |
32 | } | 32 | } |
diff --git a/arch/um/sys-x86_64/stub_segv.c b/arch/um/sys-x86_64/stub_segv.c index a27099533198..1c967026c957 100644 --- a/arch/um/sys-x86_64/stub_segv.c +++ b/arch/um/sys-x86_64/stub_segv.c | |||
@@ -33,7 +33,7 @@ stub_segv_handler(int sig) | |||
33 | struct ucontext *uc; | 33 | struct ucontext *uc; |
34 | int pid; | 34 | int pid; |
35 | 35 | ||
36 | __asm__("movq %%rdx, %0" : "=g" (uc) :); | 36 | __asm__ __volatile__("movq %%rdx, %0" : "=g" (uc) :); |
37 | GET_FAULTINFO_FROM_SC(*((struct faultinfo *) UML_CONFIG_STUB_DATA), | 37 | GET_FAULTINFO_FROM_SC(*((struct faultinfo *) UML_CONFIG_STUB_DATA), |
38 | &uc->uc_mcontext); | 38 | &uc->uc_mcontext); |
39 | 39 | ||
@@ -44,8 +44,8 @@ stub_segv_handler(int sig) | |||
44 | * the signal frame. So, we use the ucontext pointer, which we know | 44 | * the signal frame. So, we use the ucontext pointer, which we know |
45 | * already, to get the signal frame pointer, and add 8 to that. | 45 | * already, to get the signal frame pointer, and add 8 to that. |
46 | */ | 46 | */ |
47 | __asm__("movq %0, %%rsp; movq %1, %%rax ; syscall": : | 47 | __asm__ __volatile__("movq %0, %%rsp; movq %1, %%rax ; syscall": : |
48 | "g" ((unsigned long) container_of(uc, struct rt_sigframe, | 48 | "g" ((unsigned long) |
49 | uc) + 8), | 49 | container_of(uc, struct rt_sigframe, uc) + 8), |
50 | "g" (__NR_rt_sigreturn)); | 50 | "g" (__NR_rt_sigreturn)); |
51 | } | 51 | } |
diff --git a/arch/x86_64/kernel/kprobes.c b/arch/x86_64/kernel/kprobes.c index accbff3fec49..1eaa5dae6174 100644 --- a/arch/x86_64/kernel/kprobes.c +++ b/arch/x86_64/kernel/kprobes.c | |||
@@ -53,7 +53,7 @@ DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); | |||
53 | /* | 53 | /* |
54 | * returns non-zero if opcode modifies the interrupt flag. | 54 | * returns non-zero if opcode modifies the interrupt flag. |
55 | */ | 55 | */ |
56 | static inline int is_IF_modifier(kprobe_opcode_t *insn) | 56 | static __always_inline int is_IF_modifier(kprobe_opcode_t *insn) |
57 | { | 57 | { |
58 | switch (*insn) { | 58 | switch (*insn) { |
59 | case 0xfa: /* cli */ | 59 | case 0xfa: /* cli */ |
@@ -84,7 +84,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p) | |||
84 | * If it does, return the address of the 32-bit displacement word. | 84 | * If it does, return the address of the 32-bit displacement word. |
85 | * If not, return null. | 85 | * If not, return null. |
86 | */ | 86 | */ |
87 | static inline s32 *is_riprel(u8 *insn) | 87 | static s32 __kprobes *is_riprel(u8 *insn) |
88 | { | 88 | { |
89 | #define W(row,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,ba,bb,bc,bd,be,bf) \ | 89 | #define W(row,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,ba,bb,bc,bd,be,bf) \ |
90 | (((b0##UL << 0x0)|(b1##UL << 0x1)|(b2##UL << 0x2)|(b3##UL << 0x3) | \ | 90 | (((b0##UL << 0x0)|(b1##UL << 0x1)|(b2##UL << 0x2)|(b3##UL << 0x3) | \ |
@@ -229,7 +229,7 @@ void __kprobes arch_remove_kprobe(struct kprobe *p) | |||
229 | mutex_unlock(&kprobe_mutex); | 229 | mutex_unlock(&kprobe_mutex); |
230 | } | 230 | } |
231 | 231 | ||
232 | static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb) | 232 | static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) |
233 | { | 233 | { |
234 | kcb->prev_kprobe.kp = kprobe_running(); | 234 | kcb->prev_kprobe.kp = kprobe_running(); |
235 | kcb->prev_kprobe.status = kcb->kprobe_status; | 235 | kcb->prev_kprobe.status = kcb->kprobe_status; |
@@ -237,7 +237,7 @@ static inline void save_previous_kprobe(struct kprobe_ctlblk *kcb) | |||
237 | kcb->prev_kprobe.saved_rflags = kcb->kprobe_saved_rflags; | 237 | kcb->prev_kprobe.saved_rflags = kcb->kprobe_saved_rflags; |
238 | } | 238 | } |
239 | 239 | ||
240 | static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb) | 240 | static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb) |
241 | { | 241 | { |
242 | __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; | 242 | __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; |
243 | kcb->kprobe_status = kcb->prev_kprobe.status; | 243 | kcb->kprobe_status = kcb->prev_kprobe.status; |
@@ -245,7 +245,7 @@ static inline void restore_previous_kprobe(struct kprobe_ctlblk *kcb) | |||
245 | kcb->kprobe_saved_rflags = kcb->prev_kprobe.saved_rflags; | 245 | kcb->kprobe_saved_rflags = kcb->prev_kprobe.saved_rflags; |
246 | } | 246 | } |
247 | 247 | ||
248 | static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs, | 248 | static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs, |
249 | struct kprobe_ctlblk *kcb) | 249 | struct kprobe_ctlblk *kcb) |
250 | { | 250 | { |
251 | __get_cpu_var(current_kprobe) = p; | 251 | __get_cpu_var(current_kprobe) = p; |
diff --git a/drivers/char/ipmi/ipmi_bt_sm.c b/drivers/char/ipmi/ipmi_bt_sm.c index 58dcdee1cd71..0030cd8e2e95 100644 --- a/drivers/char/ipmi/ipmi_bt_sm.c +++ b/drivers/char/ipmi/ipmi_bt_sm.c | |||
@@ -165,7 +165,7 @@ static int bt_start_transaction(struct si_sm_data *bt, | |||
165 | { | 165 | { |
166 | unsigned int i; | 166 | unsigned int i; |
167 | 167 | ||
168 | if ((size < 2) || (size > IPMI_MAX_MSG_LENGTH)) | 168 | if ((size < 2) || (size > (IPMI_MAX_MSG_LENGTH - 2))) |
169 | return -1; | 169 | return -1; |
170 | 170 | ||
171 | if ((bt->state != BT_STATE_IDLE) && (bt->state != BT_STATE_HOSED)) | 171 | if ((bt->state != BT_STATE_IDLE) && (bt->state != BT_STATE_HOSED)) |
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index a86c0f29953e..b36eef0e9d19 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -2198,11 +2198,11 @@ static inline void wait_for_timer_and_thread(struct smi_info *smi_info) | |||
2198 | } | 2198 | } |
2199 | } | 2199 | } |
2200 | 2200 | ||
2201 | static struct ipmi_default_vals | 2201 | static __devinitdata struct ipmi_default_vals |
2202 | { | 2202 | { |
2203 | int type; | 2203 | int type; |
2204 | int port; | 2204 | int port; |
2205 | } __devinit ipmi_defaults[] = | 2205 | } ipmi_defaults[] = |
2206 | { | 2206 | { |
2207 | { .type = SI_KCS, .port = 0xca2 }, | 2207 | { .type = SI_KCS, .port = 0xca2 }, |
2208 | { .type = SI_SMIC, .port = 0xca9 }, | 2208 | { .type = SI_SMIC, .port = 0xca9 }, |
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 841f0bd3eaaf..f07637a8f88f 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c | |||
@@ -2723,7 +2723,11 @@ static void __do_SAK(void *arg) | |||
2723 | } | 2723 | } |
2724 | task_lock(p); | 2724 | task_lock(p); |
2725 | if (p->files) { | 2725 | if (p->files) { |
2726 | rcu_read_lock(); | 2726 | /* |
2727 | * We don't take a ref to the file, so we must | ||
2728 | * hold ->file_lock instead. | ||
2729 | */ | ||
2730 | spin_lock(&p->files->file_lock); | ||
2727 | fdt = files_fdtable(p->files); | 2731 | fdt = files_fdtable(p->files); |
2728 | for (i=0; i < fdt->max_fds; i++) { | 2732 | for (i=0; i < fdt->max_fds; i++) { |
2729 | filp = fcheck_files(p->files, i); | 2733 | filp = fcheck_files(p->files, i); |
@@ -2738,7 +2742,7 @@ static void __do_SAK(void *arg) | |||
2738 | break; | 2742 | break; |
2739 | } | 2743 | } |
2740 | } | 2744 | } |
2741 | rcu_read_unlock(); | 2745 | spin_unlock(&p->files->file_lock); |
2742 | } | 2746 | } |
2743 | task_unlock(p); | 2747 | task_unlock(p); |
2744 | } while_each_thread(g, p); | 2748 | } while_each_thread(g, p); |
diff --git a/drivers/i2c/chips/m41t00.c b/drivers/i2c/chips/m41t00.c index 27fc9ff2961a..99ab4ec34390 100644 --- a/drivers/i2c/chips/m41t00.c +++ b/drivers/i2c/chips/m41t00.c | |||
@@ -131,13 +131,13 @@ m41t00_set(void *arg) | |||
131 | if ((i2c_smbus_write_byte_data(save_client, 0, tm.tm_sec & 0x7f) < 0) | 131 | if ((i2c_smbus_write_byte_data(save_client, 0, tm.tm_sec & 0x7f) < 0) |
132 | || (i2c_smbus_write_byte_data(save_client, 1, tm.tm_min & 0x7f) | 132 | || (i2c_smbus_write_byte_data(save_client, 1, tm.tm_min & 0x7f) |
133 | < 0) | 133 | < 0) |
134 | || (i2c_smbus_write_byte_data(save_client, 2, tm.tm_hour & 0x7f) | 134 | || (i2c_smbus_write_byte_data(save_client, 2, tm.tm_hour & 0x3f) |
135 | < 0) | 135 | < 0) |
136 | || (i2c_smbus_write_byte_data(save_client, 4, tm.tm_mday & 0x7f) | 136 | || (i2c_smbus_write_byte_data(save_client, 4, tm.tm_mday & 0x3f) |
137 | < 0) | 137 | < 0) |
138 | || (i2c_smbus_write_byte_data(save_client, 5, tm.tm_mon & 0x7f) | 138 | || (i2c_smbus_write_byte_data(save_client, 5, tm.tm_mon & 0x1f) |
139 | < 0) | 139 | < 0) |
140 | || (i2c_smbus_write_byte_data(save_client, 6, tm.tm_year & 0x7f) | 140 | || (i2c_smbus_write_byte_data(save_client, 6, tm.tm_year & 0xff) |
141 | < 0)) | 141 | < 0)) |
142 | 142 | ||
143 | dev_warn(&save_client->dev,"m41t00: can't write to rtc chip\n"); | 143 | dev_warn(&save_client->dev,"m41t00: can't write to rtc chip\n"); |
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c index cf84350efc55..8b24b4f2a839 100644 --- a/drivers/ide/pci/alim15x3.c +++ b/drivers/ide/pci/alim15x3.c | |||
@@ -731,6 +731,8 @@ static unsigned int __devinit ata66_ali15x3 (ide_hwif_t *hwif) | |||
731 | 731 | ||
732 | if(m5229_revision <= 0x20) | 732 | if(m5229_revision <= 0x20) |
733 | tmpbyte = (tmpbyte & (~0x02)) | 0x01; | 733 | tmpbyte = (tmpbyte & (~0x02)) | 0x01; |
734 | else if (m5229_revision == 0xc7) | ||
735 | tmpbyte |= 0x03; | ||
734 | else | 736 | else |
735 | tmpbyte |= 0x01; | 737 | tmpbyte |= 0x01; |
736 | 738 | ||
diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c index df9ee9a78435..900efd1da587 100644 --- a/drivers/ide/pci/atiixp.c +++ b/drivers/ide/pci/atiixp.c | |||
@@ -348,6 +348,7 @@ static struct pci_device_id atiixp_pci_tbl[] = { | |||
348 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP200_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 348 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP200_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, |
349 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 349 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, |
350 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 350 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, |
351 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | ||
351 | { 0, }, | 352 | { 0, }, |
352 | }; | 353 | }; |
353 | MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl); | 354 | MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl); |
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c index 6f8f8645b02c..7ce5bf783688 100644 --- a/drivers/ide/pci/pdc202xx_old.c +++ b/drivers/ide/pci/pdc202xx_old.c | |||
@@ -798,7 +798,6 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = { | |||
798 | .autodma = AUTODMA, | 798 | .autodma = AUTODMA, |
799 | .bootable = OFF_BOARD, | 799 | .bootable = OFF_BOARD, |
800 | .extra = 48, | 800 | .extra = 48, |
801 | .flags = IDEPCI_FLAG_FORCE_PDC, | ||
802 | },{ /* 2 */ | 801 | },{ /* 2 */ |
803 | .name = "PDC20263", | 802 | .name = "PDC20263", |
804 | .init_setup = init_setup_pdc202ata4, | 803 | .init_setup = init_setup_pdc202ata4, |
@@ -819,7 +818,6 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = { | |||
819 | .autodma = AUTODMA, | 818 | .autodma = AUTODMA, |
820 | .bootable = OFF_BOARD, | 819 | .bootable = OFF_BOARD, |
821 | .extra = 48, | 820 | .extra = 48, |
822 | .flags = IDEPCI_FLAG_FORCE_PDC, | ||
823 | },{ /* 4 */ | 821 | },{ /* 4 */ |
824 | .name = "PDC20267", | 822 | .name = "PDC20267", |
825 | .init_setup = init_setup_pdc202xx, | 823 | .init_setup = init_setup_pdc202xx, |
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index 7ebf992e8c2f..462ed3006c30 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c | |||
@@ -580,7 +580,6 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, a | |||
580 | int port; | 580 | int port; |
581 | int at_least_one_hwif_enabled = 0; | 581 | int at_least_one_hwif_enabled = 0; |
582 | ide_hwif_t *hwif, *mate = NULL; | 582 | ide_hwif_t *hwif, *mate = NULL; |
583 | static int secondpdc = 0; | ||
584 | u8 tmp; | 583 | u8 tmp; |
585 | 584 | ||
586 | index->all = 0xf0f0; | 585 | index->all = 0xf0f0; |
@@ -592,21 +591,9 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, a | |||
592 | for (port = 0; port <= 1; ++port) { | 591 | for (port = 0; port <= 1; ++port) { |
593 | ide_pci_enablebit_t *e = &(d->enablebits[port]); | 592 | ide_pci_enablebit_t *e = &(d->enablebits[port]); |
594 | 593 | ||
595 | /* | ||
596 | * If this is a Promise FakeRaid controller, | ||
597 | * the 2nd controller will be marked as | ||
598 | * disabled while it is actually there and enabled | ||
599 | * by the bios for raid purposes. | ||
600 | * Skip the normal "is it enabled" test for those. | ||
601 | */ | ||
602 | if ((d->flags & IDEPCI_FLAG_FORCE_PDC) && | ||
603 | (secondpdc++==1) && (port==1)) | ||
604 | goto controller_ok; | ||
605 | |||
606 | if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) || | 594 | if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) || |
607 | (tmp & e->mask) != e->val)) | 595 | (tmp & e->mask) != e->val)) |
608 | continue; /* port not enabled */ | 596 | continue; /* port not enabled */ |
609 | controller_ok: | ||
610 | 597 | ||
611 | if (d->channels <= port) | 598 | if (d->channels <= port) |
612 | break; | 599 | break; |
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c index d5890027f8af..48bbf32fd980 100644 --- a/drivers/parport/parport_pc.c +++ b/drivers/parport/parport_pc.c | |||
@@ -97,7 +97,7 @@ static struct superio_struct { /* For Super-IO chips autodetection */ | |||
97 | int io; | 97 | int io; |
98 | int irq; | 98 | int irq; |
99 | int dma; | 99 | int dma; |
100 | } superios[NR_SUPERIOS] __devinitdata = { {0,},}; | 100 | } superios[NR_SUPERIOS] = { {0,},}; |
101 | 101 | ||
102 | static int user_specified; | 102 | static int user_specified; |
103 | #if defined(CONFIG_PARPORT_PC_SUPERIO) || \ | 103 | #if defined(CONFIG_PARPORT_PC_SUPERIO) || \ |
@@ -1557,7 +1557,7 @@ static int __devinit get_superio_dma (struct parport *p) | |||
1557 | return PARPORT_DMA_NONE; | 1557 | return PARPORT_DMA_NONE; |
1558 | } | 1558 | } |
1559 | 1559 | ||
1560 | static int __devinit get_superio_irq (struct parport *p) | 1560 | static int get_superio_irq (struct parport *p) |
1561 | { | 1561 | { |
1562 | int i=0; | 1562 | int i=0; |
1563 | while( (superios[i].io != p->base) && (i<NR_SUPERIOS)) | 1563 | while( (superios[i].io != p->base) && (i<NR_SUPERIOS)) |
@@ -1579,7 +1579,7 @@ static int __devinit get_superio_irq (struct parport *p) | |||
1579 | * this shall always be the case!) | 1579 | * this shall always be the case!) |
1580 | * | 1580 | * |
1581 | */ | 1581 | */ |
1582 | static int __devinit parport_SPP_supported(struct parport *pb) | 1582 | static int parport_SPP_supported(struct parport *pb) |
1583 | { | 1583 | { |
1584 | unsigned char r, w; | 1584 | unsigned char r, w; |
1585 | 1585 | ||
@@ -1660,7 +1660,7 @@ static int __devinit parport_SPP_supported(struct parport *pb) | |||
1660 | * two bits of ECR aren't writable, so we check by writing ECR and | 1660 | * two bits of ECR aren't writable, so we check by writing ECR and |
1661 | * reading it back to see if it's what we expect. | 1661 | * reading it back to see if it's what we expect. |
1662 | */ | 1662 | */ |
1663 | static int __devinit parport_ECR_present(struct parport *pb) | 1663 | static int parport_ECR_present(struct parport *pb) |
1664 | { | 1664 | { |
1665 | struct parport_pc_private *priv = pb->private_data; | 1665 | struct parport_pc_private *priv = pb->private_data; |
1666 | unsigned char r = 0xc; | 1666 | unsigned char r = 0xc; |
@@ -1712,7 +1712,7 @@ static int __devinit parport_ECR_present(struct parport *pb) | |||
1712 | * be misdetected here is rather academic. | 1712 | * be misdetected here is rather academic. |
1713 | */ | 1713 | */ |
1714 | 1714 | ||
1715 | static int __devinit parport_PS2_supported(struct parport *pb) | 1715 | static int parport_PS2_supported(struct parport *pb) |
1716 | { | 1716 | { |
1717 | int ok = 0; | 1717 | int ok = 0; |
1718 | 1718 | ||
@@ -1868,7 +1868,7 @@ static int __devinit parport_ECP_supported(struct parport *pb) | |||
1868 | } | 1868 | } |
1869 | #endif | 1869 | #endif |
1870 | 1870 | ||
1871 | static int __devinit parport_ECPPS2_supported(struct parport *pb) | 1871 | static int parport_ECPPS2_supported(struct parport *pb) |
1872 | { | 1872 | { |
1873 | const struct parport_pc_private *priv = pb->private_data; | 1873 | const struct parport_pc_private *priv = pb->private_data; |
1874 | int result; | 1874 | int result; |
@@ -1886,7 +1886,7 @@ static int __devinit parport_ECPPS2_supported(struct parport *pb) | |||
1886 | 1886 | ||
1887 | /* EPP mode detection */ | 1887 | /* EPP mode detection */ |
1888 | 1888 | ||
1889 | static int __devinit parport_EPP_supported(struct parport *pb) | 1889 | static int parport_EPP_supported(struct parport *pb) |
1890 | { | 1890 | { |
1891 | const struct parport_pc_private *priv = pb->private_data; | 1891 | const struct parport_pc_private *priv = pb->private_data; |
1892 | 1892 | ||
@@ -1931,7 +1931,7 @@ static int __devinit parport_EPP_supported(struct parport *pb) | |||
1931 | return 1; | 1931 | return 1; |
1932 | } | 1932 | } |
1933 | 1933 | ||
1934 | static int __devinit parport_ECPEPP_supported(struct parport *pb) | 1934 | static int parport_ECPEPP_supported(struct parport *pb) |
1935 | { | 1935 | { |
1936 | struct parport_pc_private *priv = pb->private_data; | 1936 | struct parport_pc_private *priv = pb->private_data; |
1937 | int result; | 1937 | int result; |
@@ -2073,7 +2073,7 @@ static int __devinit irq_probe_SPP(struct parport *pb) | |||
2073 | * When ECP is available we can autoprobe for IRQs. | 2073 | * When ECP is available we can autoprobe for IRQs. |
2074 | * NOTE: If we can autoprobe it, we can register the IRQ. | 2074 | * NOTE: If we can autoprobe it, we can register the IRQ. |
2075 | */ | 2075 | */ |
2076 | static int __devinit parport_irq_probe(struct parport *pb) | 2076 | static int parport_irq_probe(struct parport *pb) |
2077 | { | 2077 | { |
2078 | struct parport_pc_private *priv = pb->private_data; | 2078 | struct parport_pc_private *priv = pb->private_data; |
2079 | 2079 | ||
@@ -2779,7 +2779,7 @@ static struct parport_pc_pci { | |||
2779 | /* If set, this is called after probing for ports. If 'failed' | 2779 | /* If set, this is called after probing for ports. If 'failed' |
2780 | * is non-zero we couldn't use any of the ports. */ | 2780 | * is non-zero we couldn't use any of the ports. */ |
2781 | void (*postinit_hook) (struct pci_dev *pdev, int failed); | 2781 | void (*postinit_hook) (struct pci_dev *pdev, int failed); |
2782 | } cards[] __devinitdata = { | 2782 | } cards[] = { |
2783 | /* siig_1p_10x */ { 1, { { 2, 3 }, } }, | 2783 | /* siig_1p_10x */ { 1, { { 2, 3 }, } }, |
2784 | /* siig_2p_10x */ { 2, { { 2, 3 }, { 4, 5 }, } }, | 2784 | /* siig_2p_10x */ { 2, { { 2, 3 }, { 4, 5 }, } }, |
2785 | /* siig_1p_20x */ { 1, { { 0, 1 }, } }, | 2785 | /* siig_1p_20x */ { 1, { { 0, 1 }, } }, |
diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c index c4256aa32bcb..6fff109bdab6 100644 --- a/drivers/pnp/manager.c +++ b/drivers/pnp/manager.c | |||
@@ -479,7 +479,7 @@ int pnp_auto_config_dev(struct pnp_dev *dev) | |||
479 | int pnp_start_dev(struct pnp_dev *dev) | 479 | int pnp_start_dev(struct pnp_dev *dev) |
480 | { | 480 | { |
481 | if (!pnp_can_write(dev)) { | 481 | if (!pnp_can_write(dev)) { |
482 | pnp_info("Device %s does not supported activation.", dev->dev.bus_id); | 482 | pnp_info("Device %s does not support activation.", dev->dev.bus_id); |
483 | return -EINVAL; | 483 | return -EINVAL; |
484 | } | 484 | } |
485 | 485 | ||
@@ -503,7 +503,7 @@ int pnp_start_dev(struct pnp_dev *dev) | |||
503 | int pnp_stop_dev(struct pnp_dev *dev) | 503 | int pnp_stop_dev(struct pnp_dev *dev) |
504 | { | 504 | { |
505 | if (!pnp_can_disable(dev)) { | 505 | if (!pnp_can_disable(dev)) { |
506 | pnp_info("Device %s does not supported disabling.", dev->dev.bus_id); | 506 | pnp_info("Device %s does not support disabling.", dev->dev.bus_id); |
507 | return -EINVAL; | 507 | return -EINVAL; |
508 | } | 508 | } |
509 | if (dev->protocol->disable(dev)<0) { | 509 | if (dev->protocol->disable(dev)<0) { |
diff --git a/drivers/serial/m32r_sio.c b/drivers/serial/m32r_sio.c index e9c10c0a30fc..321a40f33b50 100644 --- a/drivers/serial/m32r_sio.c +++ b/drivers/serial/m32r_sio.c | |||
@@ -1057,7 +1057,6 @@ static void m32r_sio_console_write(struct console *co, const char *s, | |||
1057 | { | 1057 | { |
1058 | struct uart_sio_port *up = &m32r_sio_ports[co->index]; | 1058 | struct uart_sio_port *up = &m32r_sio_ports[co->index]; |
1059 | unsigned int ier; | 1059 | unsigned int ier; |
1060 | int i; | ||
1061 | 1060 | ||
1062 | /* | 1061 | /* |
1063 | * First save the UER then disable the interrupts | 1062 | * First save the UER then disable the interrupts |
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c index 9a6b5b39b88e..387a18a47ac2 100644 --- a/drivers/video/aty/radeon_base.c +++ b/drivers/video/aty/radeon_base.c | |||
@@ -2265,7 +2265,7 @@ static struct bin_attribute edid2_attr = { | |||
2265 | }; | 2265 | }; |
2266 | 2266 | ||
2267 | 2267 | ||
2268 | static int radeonfb_pci_register (struct pci_dev *pdev, | 2268 | static int __devinit radeonfb_pci_register (struct pci_dev *pdev, |
2269 | const struct pci_device_id *ent) | 2269 | const struct pci_device_id *ent) |
2270 | { | 2270 | { |
2271 | struct fb_info *info; | 2271 | struct fb_info *info; |
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 8d8eadb64853..372aa1776827 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -674,13 +674,19 @@ fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) | |||
674 | total_size = info->fix.smem_len; | 674 | total_size = info->fix.smem_len; |
675 | 675 | ||
676 | if (p > total_size) | 676 | if (p > total_size) |
677 | return 0; | 677 | return -EFBIG; |
678 | 678 | ||
679 | if (count >= total_size) | 679 | if (count > total_size) { |
680 | err = -EFBIG; | ||
680 | count = total_size; | 681 | count = total_size; |
682 | } | ||
683 | |||
684 | if (count + p > total_size) { | ||
685 | if (!err) | ||
686 | err = -ENOSPC; | ||
681 | 687 | ||
682 | if (count + p > total_size) | ||
683 | count = total_size - p; | 688 | count = total_size - p; |
689 | } | ||
684 | 690 | ||
685 | buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count, | 691 | buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count, |
686 | GFP_KERNEL); | 692 | GFP_KERNEL); |
@@ -722,7 +728,7 @@ fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) | |||
722 | 728 | ||
723 | kfree(buffer); | 729 | kfree(buffer); |
724 | 730 | ||
725 | return (err) ? err : cnt; | 731 | return (cnt) ? cnt : err; |
726 | } | 732 | } |
727 | 733 | ||
728 | #ifdef CONFIG_KMOD | 734 | #ifdef CONFIG_KMOD |
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c index 10e6b3aab9ea..0da624e6524f 100644 --- a/drivers/video/savage/savagefb_driver.c +++ b/drivers/video/savage/savagefb_driver.c | |||
@@ -73,7 +73,7 @@ | |||
73 | /* --------------------------------------------------------------------- */ | 73 | /* --------------------------------------------------------------------- */ |
74 | 74 | ||
75 | 75 | ||
76 | static char *mode_option __initdata = NULL; | 76 | static char *mode_option __devinitdata = NULL; |
77 | 77 | ||
78 | #ifdef MODULE | 78 | #ifdef MODULE |
79 | 79 | ||
@@ -1545,7 +1545,7 @@ static int __devinit savage_map_mmio (struct fb_info *info) | |||
1545 | return 0; | 1545 | return 0; |
1546 | } | 1546 | } |
1547 | 1547 | ||
1548 | static void __devinit savage_unmap_mmio (struct fb_info *info) | 1548 | static void savage_unmap_mmio (struct fb_info *info) |
1549 | { | 1549 | { |
1550 | struct savagefb_par *par = info->par; | 1550 | struct savagefb_par *par = info->par; |
1551 | DBG ("savage_unmap_mmio"); | 1551 | DBG ("savage_unmap_mmio"); |
@@ -1597,7 +1597,7 @@ static int __devinit savage_map_video (struct fb_info *info, | |||
1597 | return 0; | 1597 | return 0; |
1598 | } | 1598 | } |
1599 | 1599 | ||
1600 | static void __devinit savage_unmap_video (struct fb_info *info) | 1600 | static void savage_unmap_video (struct fb_info *info) |
1601 | { | 1601 | { |
1602 | struct savagefb_par *par = info->par; | 1602 | struct savagefb_par *par = info->par; |
1603 | 1603 | ||
@@ -1614,7 +1614,7 @@ static void __devinit savage_unmap_video (struct fb_info *info) | |||
1614 | } | 1614 | } |
1615 | } | 1615 | } |
1616 | 1616 | ||
1617 | static int __devinit savage_init_hw (struct savagefb_par *par) | 1617 | static int savage_init_hw (struct savagefb_par *par) |
1618 | { | 1618 | { |
1619 | unsigned char config1, m, n, n1, n2, sr8, cr3f, cr66 = 0, tmp; | 1619 | unsigned char config1, m, n, n1, n2, sr8, cr3f, cr66 = 0, tmp; |
1620 | 1620 | ||
diff --git a/fs/Kconfig b/fs/Kconfig index 2524629dc835..f9b5842c8d2d 100644 --- a/fs/Kconfig +++ b/fs/Kconfig | |||
@@ -842,6 +842,12 @@ config TMPFS | |||
842 | config HUGETLBFS | 842 | config HUGETLBFS |
843 | bool "HugeTLB file system support" | 843 | bool "HugeTLB file system support" |
844 | depends X86 || IA64 || PPC64 || SPARC64 || SUPERH || BROKEN | 844 | depends X86 || IA64 || PPC64 || SPARC64 || SUPERH || BROKEN |
845 | help | ||
846 | hugetlbfs is a filesystem backing for HugeTLB pages, based on | ||
847 | ramfs. For architectures that support it, say Y here and read | ||
848 | <file:Documentation/vm/hugetlbpage.txt> for details. | ||
849 | |||
850 | If unsure, say N. | ||
845 | 851 | ||
846 | config HUGETLB_PAGE | 852 | config HUGETLB_PAGE |
847 | def_bool HUGETLBFS | 853 | def_bool HUGETLBFS |
@@ -712,7 +712,7 @@ static int de_thread(struct task_struct *tsk) | |||
712 | attach_pid(current, PIDTYPE_PID, current->pid); | 712 | attach_pid(current, PIDTYPE_PID, current->pid); |
713 | attach_pid(current, PIDTYPE_PGID, current->signal->pgrp); | 713 | attach_pid(current, PIDTYPE_PGID, current->signal->pgrp); |
714 | attach_pid(current, PIDTYPE_SID, current->signal->session); | 714 | attach_pid(current, PIDTYPE_SID, current->signal->session); |
715 | list_add_tail(¤t->tasks, &init_task.tasks); | 715 | list_add_tail_rcu(¤t->tasks, &init_task.tasks); |
716 | 716 | ||
717 | current->group_leader = current; | 717 | current->group_leader = current; |
718 | leader->group_leader = current; | 718 | leader->group_leader = current; |
diff --git a/fs/locks.c b/fs/locks.c index dda83d6cd48b..efad798824dc 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -2230,7 +2230,12 @@ void steal_locks(fl_owner_t from) | |||
2230 | 2230 | ||
2231 | lock_kernel(); | 2231 | lock_kernel(); |
2232 | j = 0; | 2232 | j = 0; |
2233 | rcu_read_lock(); | 2233 | |
2234 | /* | ||
2235 | * We are not taking a ref to the file structures, so | ||
2236 | * we need to acquire ->file_lock. | ||
2237 | */ | ||
2238 | spin_lock(&files->file_lock); | ||
2234 | fdt = files_fdtable(files); | 2239 | fdt = files_fdtable(files); |
2235 | for (;;) { | 2240 | for (;;) { |
2236 | unsigned long set; | 2241 | unsigned long set; |
@@ -2248,7 +2253,7 @@ void steal_locks(fl_owner_t from) | |||
2248 | set >>= 1; | 2253 | set >>= 1; |
2249 | } | 2254 | } |
2250 | } | 2255 | } |
2251 | rcu_read_unlock(); | 2256 | spin_unlock(&files->file_lock); |
2252 | unlock_kernel(); | 2257 | unlock_kernel(); |
2253 | } | 2258 | } |
2254 | EXPORT_SYMBOL(steal_locks); | 2259 | EXPORT_SYMBOL(steal_locks); |
diff --git a/fs/proc/base.c b/fs/proc/base.c index a3a3eecef689..6cc77dc3f3ff 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -297,16 +297,20 @@ static int proc_fd_link(struct inode *inode, struct dentry **dentry, struct vfsm | |||
297 | 297 | ||
298 | files = get_files_struct(task); | 298 | files = get_files_struct(task); |
299 | if (files) { | 299 | if (files) { |
300 | rcu_read_lock(); | 300 | /* |
301 | * We are not taking a ref to the file structure, so we must | ||
302 | * hold ->file_lock. | ||
303 | */ | ||
304 | spin_lock(&files->file_lock); | ||
301 | file = fcheck_files(files, fd); | 305 | file = fcheck_files(files, fd); |
302 | if (file) { | 306 | if (file) { |
303 | *mnt = mntget(file->f_vfsmnt); | 307 | *mnt = mntget(file->f_vfsmnt); |
304 | *dentry = dget(file->f_dentry); | 308 | *dentry = dget(file->f_dentry); |
305 | rcu_read_unlock(); | 309 | spin_unlock(&files->file_lock); |
306 | put_files_struct(files); | 310 | put_files_struct(files); |
307 | return 0; | 311 | return 0; |
308 | } | 312 | } |
309 | rcu_read_unlock(); | 313 | spin_unlock(&files->file_lock); |
310 | put_files_struct(files); | 314 | put_files_struct(files); |
311 | } | 315 | } |
312 | return -ENOENT; | 316 | return -ENOENT; |
@@ -1523,7 +1527,12 @@ static struct dentry *proc_lookupfd(struct inode * dir, struct dentry * dentry, | |||
1523 | if (!files) | 1527 | if (!files) |
1524 | goto out_unlock; | 1528 | goto out_unlock; |
1525 | inode->i_mode = S_IFLNK; | 1529 | inode->i_mode = S_IFLNK; |
1526 | rcu_read_lock(); | 1530 | |
1531 | /* | ||
1532 | * We are not taking a ref to the file structure, so we must | ||
1533 | * hold ->file_lock. | ||
1534 | */ | ||
1535 | spin_lock(&files->file_lock); | ||
1527 | file = fcheck_files(files, fd); | 1536 | file = fcheck_files(files, fd); |
1528 | if (!file) | 1537 | if (!file) |
1529 | goto out_unlock2; | 1538 | goto out_unlock2; |
@@ -1531,7 +1540,7 @@ static struct dentry *proc_lookupfd(struct inode * dir, struct dentry * dentry, | |||
1531 | inode->i_mode |= S_IRUSR | S_IXUSR; | 1540 | inode->i_mode |= S_IRUSR | S_IXUSR; |
1532 | if (file->f_mode & 2) | 1541 | if (file->f_mode & 2) |
1533 | inode->i_mode |= S_IWUSR | S_IXUSR; | 1542 | inode->i_mode |= S_IWUSR | S_IXUSR; |
1534 | rcu_read_unlock(); | 1543 | spin_unlock(&files->file_lock); |
1535 | put_files_struct(files); | 1544 | put_files_struct(files); |
1536 | inode->i_op = &proc_pid_link_inode_operations; | 1545 | inode->i_op = &proc_pid_link_inode_operations; |
1537 | inode->i_size = 64; | 1546 | inode->i_size = 64; |
@@ -1541,7 +1550,7 @@ static struct dentry *proc_lookupfd(struct inode * dir, struct dentry * dentry, | |||
1541 | return NULL; | 1550 | return NULL; |
1542 | 1551 | ||
1543 | out_unlock2: | 1552 | out_unlock2: |
1544 | rcu_read_unlock(); | 1553 | spin_unlock(&files->file_lock); |
1545 | put_files_struct(files); | 1554 | put_files_struct(files); |
1546 | out_unlock: | 1555 | out_unlock: |
1547 | iput(inode); | 1556 | iput(inode); |
diff --git a/include/asm-i386/atomic.h b/include/asm-i386/atomic.h index 22d80ece95cb..4ddce5296a78 100644 --- a/include/asm-i386/atomic.h +++ b/include/asm-i386/atomic.h | |||
@@ -183,6 +183,7 @@ static __inline__ int atomic_add_return(int i, atomic_t *v) | |||
183 | { | 183 | { |
184 | int __i; | 184 | int __i; |
185 | #ifdef CONFIG_M386 | 185 | #ifdef CONFIG_M386 |
186 | unsigned long flags; | ||
186 | if(unlikely(boot_cpu_data.x86==3)) | 187 | if(unlikely(boot_cpu_data.x86==3)) |
187 | goto no_xadd; | 188 | goto no_xadd; |
188 | #endif | 189 | #endif |
@@ -196,10 +197,10 @@ static __inline__ int atomic_add_return(int i, atomic_t *v) | |||
196 | 197 | ||
197 | #ifdef CONFIG_M386 | 198 | #ifdef CONFIG_M386 |
198 | no_xadd: /* Legacy 386 processor */ | 199 | no_xadd: /* Legacy 386 processor */ |
199 | local_irq_disable(); | 200 | local_irq_save(flags); |
200 | __i = atomic_read(v); | 201 | __i = atomic_read(v); |
201 | atomic_set(v, i + __i); | 202 | atomic_set(v, i + __i); |
202 | local_irq_enable(); | 203 | local_irq_restore(flags); |
203 | return i + __i; | 204 | return i + __i; |
204 | #endif | 205 | #endif |
205 | } | 206 | } |
diff --git a/include/asm-m32r/assembler.h b/include/asm-m32r/assembler.h index b7f4d8aaeb46..1a1aa17edd33 100644 --- a/include/asm-m32r/assembler.h +++ b/include/asm-m32r/assembler.h | |||
@@ -109,6 +109,9 @@ | |||
109 | push r13 | 109 | push r13 |
110 | mvfachi r13 | 110 | mvfachi r13 |
111 | push r13 | 111 | push r13 |
112 | ldi r13, #0 | ||
113 | push r13 ; dummy push acc1h | ||
114 | push r13 ; dummy push acc1l | ||
112 | #else | 115 | #else |
113 | #error unknown isa configuration | 116 | #error unknown isa configuration |
114 | #endif | 117 | #endif |
@@ -156,6 +159,8 @@ | |||
156 | pop r13 | 159 | pop r13 |
157 | mvtaclo r13, a1 | 160 | mvtaclo r13, a1 |
158 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) | 161 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) |
162 | pop r13 ; dummy pop acc1h | ||
163 | pop r13 ; dummy pop acc1l | ||
159 | pop r13 | 164 | pop r13 |
160 | mvtachi r13 | 165 | mvtachi r13 |
161 | pop r13 | 166 | pop r13 |
diff --git a/include/asm-m32r/mappi3/mappi3_pld.h b/include/asm-m32r/mappi3/mappi3_pld.h index 1d3c25d61bcb..031369a7afc8 100644 --- a/include/asm-m32r/mappi3/mappi3_pld.h +++ b/include/asm-m32r/mappi3/mappi3_pld.h | |||
@@ -53,16 +53,14 @@ | |||
53 | /* Power Control of MMC and CF */ | 53 | /* Power Control of MMC and CF */ |
54 | #define PLD_CPCR __reg16(PLD_BASE + 0x14000) | 54 | #define PLD_CPCR __reg16(PLD_BASE + 0x14000) |
55 | 55 | ||
56 | 56 | /* ICU */ | |
57 | /*==== ICU ====*/ | 57 | #define M32R_IRQ_PC104 (5) /* INT4(PC/104) */ |
58 | #define M32R_IRQ_PC104 (5) /* INT4(PC/104) */ | 58 | #define M32R_IRQ_I2C (28) /* I2C-BUS */ |
59 | #define M32R_IRQ_I2C (28) /* I2C-BUS */ | 59 | #define PLD_IRQ_CFIREQ (6) /* INT5 CFC Card Interrupt */ |
60 | #define PLD_IRQ_CFIREQ (6) /* INT5 CFC Card Interrupt */ | 60 | #define PLD_IRQ_CFC_INSERT (7) /* INT6 CFC Card Insert & Eject */ |
61 | #define PLD_IRQ_CFC_INSERT (7) /* INT6 CFC Card Insert */ | 61 | #define PLD_IRQ_IDEIREQ (8) /* INT7 IDE Interrupt */ |
62 | #define PLD_IRQ_IDEIREQ (8) /* INT7 IDE Interrupt */ | 62 | #define PLD_IRQ_MMCCARD (43) /* MMC Card Insert */ |
63 | #define PLD_IRQ_MMCCARD (43) /* MMC Card Insert */ | 63 | #define PLD_IRQ_MMCIRQ (44) /* MMC Transfer Done */ |
64 | #define PLD_IRQ_MMCIRQ (44) /* MMC Transfer Done */ | ||
65 | |||
66 | 64 | ||
67 | #if 0 | 65 | #if 0 |
68 | /* LED Control | 66 | /* LED Control |
@@ -97,7 +95,6 @@ | |||
97 | #define PLD_CRC16ADATA __reg16(PLD_BASE + 0x18008) | 95 | #define PLD_CRC16ADATA __reg16(PLD_BASE + 0x18008) |
98 | #define PLD_CRC16AINDATA __reg16(PLD_BASE + 0x1800a) | 96 | #define PLD_CRC16AINDATA __reg16(PLD_BASE + 0x1800a) |
99 | 97 | ||
100 | |||
101 | #if 0 | 98 | #if 0 |
102 | /* RTC */ | 99 | /* RTC */ |
103 | #define PLD_RTCCR __reg16(PLD_BASE + 0x1c000) | 100 | #define PLD_RTCCR __reg16(PLD_BASE + 0x1c000) |
@@ -140,4 +137,7 @@ | |||
140 | 137 | ||
141 | #endif | 138 | #endif |
142 | 139 | ||
140 | /* Reset Control */ | ||
141 | #define PLD_REBOOT __reg16(PLD_BASE + 0x38000) | ||
142 | |||
143 | #endif /* _MAPPI3_PLD.H */ | 143 | #endif /* _MAPPI3_PLD.H */ |
diff --git a/include/asm-m32r/ptrace.h b/include/asm-m32r/ptrace.h index 0d058b2d844e..53c792452dfc 100644 --- a/include/asm-m32r/ptrace.h +++ b/include/asm-m32r/ptrace.h | |||
@@ -43,6 +43,14 @@ | |||
43 | #define PT_ACC1L 18 | 43 | #define PT_ACC1L 18 |
44 | #define PT_ACCH PT_ACC0H | 44 | #define PT_ACCH PT_ACC0H |
45 | #define PT_ACCL PT_ACC0L | 45 | #define PT_ACCL PT_ACC0L |
46 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) | ||
47 | #define PT_ACCH 15 | ||
48 | #define PT_ACCL 16 | ||
49 | #define PT_DUMMY_ACC1H 17 | ||
50 | #define PT_DUMMY_ACC1L 18 | ||
51 | #else | ||
52 | #error unknown isa conifiguration | ||
53 | #endif | ||
46 | #define PT_PSW 19 | 54 | #define PT_PSW 19 |
47 | #define PT_BPC 20 | 55 | #define PT_BPC 20 |
48 | #define PT_BBPSW 21 | 56 | #define PT_BBPSW 21 |
@@ -52,21 +60,6 @@ | |||
52 | #define PT_LR 25 | 60 | #define PT_LR 25 |
53 | #define PT_SPI 26 | 61 | #define PT_SPI 26 |
54 | #define PT_ORIGR0 27 | 62 | #define PT_ORIGR0 27 |
55 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) | ||
56 | #define PT_ACCH 15 | ||
57 | #define PT_ACCL 16 | ||
58 | #define PT_PSW 17 | ||
59 | #define PT_BPC 18 | ||
60 | #define PT_BBPSW 19 | ||
61 | #define PT_BBPC 20 | ||
62 | #define PT_SPU 21 | ||
63 | #define PT_FP 22 | ||
64 | #define PT_LR 23 | ||
65 | #define PT_SPI 24 | ||
66 | #define PT_ORIGR0 25 | ||
67 | #else | ||
68 | #error unknown isa conifiguration | ||
69 | #endif | ||
70 | 63 | ||
71 | /* virtual pt_reg entry for gdb */ | 64 | /* virtual pt_reg entry for gdb */ |
72 | #define PT_PC 30 | 65 | #define PT_PC 30 |
@@ -121,6 +114,8 @@ struct pt_regs { | |||
121 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) | 114 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) |
122 | unsigned long acch; | 115 | unsigned long acch; |
123 | unsigned long accl; | 116 | unsigned long accl; |
117 | unsigned long dummy_acc1h; | ||
118 | unsigned long dummy_acc1l; | ||
124 | #else | 119 | #else |
125 | #error unknown isa configuration | 120 | #error unknown isa configuration |
126 | #endif | 121 | #endif |
diff --git a/include/asm-m32r/semaphore.h b/include/asm-m32r/semaphore.h index bf447c52a0a1..81750edc8916 100644 --- a/include/asm-m32r/semaphore.h +++ b/include/asm-m32r/semaphore.h | |||
@@ -9,7 +9,7 @@ | |||
9 | * SMP- and interrupt-safe semaphores.. | 9 | * SMP- and interrupt-safe semaphores.. |
10 | * | 10 | * |
11 | * Copyright (C) 1996 Linus Torvalds | 11 | * Copyright (C) 1996 Linus Torvalds |
12 | * Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org> | 12 | * Copyright (C) 2004, 2006 Hirokazu Takata <takata at linux-m32r.org> |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <linux/config.h> | 15 | #include <linux/config.h> |
@@ -77,27 +77,8 @@ asmlinkage void __up(struct semaphore * sem); | |||
77 | */ | 77 | */ |
78 | static inline void down(struct semaphore * sem) | 78 | static inline void down(struct semaphore * sem) |
79 | { | 79 | { |
80 | unsigned long flags; | ||
81 | long count; | ||
82 | |||
83 | might_sleep(); | 80 | might_sleep(); |
84 | local_irq_save(flags); | 81 | if (unlikely(atomic_dec_return(&sem->count) < 0)) |
85 | __asm__ __volatile__ ( | ||
86 | "# down \n\t" | ||
87 | DCACHE_CLEAR("%0", "r4", "%1") | ||
88 | M32R_LOCK" %0, @%1; \n\t" | ||
89 | "addi %0, #-1; \n\t" | ||
90 | M32R_UNLOCK" %0, @%1; \n\t" | ||
91 | : "=&r" (count) | ||
92 | : "r" (&sem->count) | ||
93 | : "memory" | ||
94 | #ifdef CONFIG_CHIP_M32700_TS1 | ||
95 | , "r4" | ||
96 | #endif /* CONFIG_CHIP_M32700_TS1 */ | ||
97 | ); | ||
98 | local_irq_restore(flags); | ||
99 | |||
100 | if (unlikely(count < 0)) | ||
101 | __down(sem); | 82 | __down(sem); |
102 | } | 83 | } |
103 | 84 | ||
@@ -107,28 +88,10 @@ static inline void down(struct semaphore * sem) | |||
107 | */ | 88 | */ |
108 | static inline int down_interruptible(struct semaphore * sem) | 89 | static inline int down_interruptible(struct semaphore * sem) |
109 | { | 90 | { |
110 | unsigned long flags; | ||
111 | long count; | ||
112 | int result = 0; | 91 | int result = 0; |
113 | 92 | ||
114 | might_sleep(); | 93 | might_sleep(); |
115 | local_irq_save(flags); | 94 | if (unlikely(atomic_dec_return(&sem->count) < 0)) |
116 | __asm__ __volatile__ ( | ||
117 | "# down_interruptible \n\t" | ||
118 | DCACHE_CLEAR("%0", "r4", "%1") | ||
119 | M32R_LOCK" %0, @%1; \n\t" | ||
120 | "addi %0, #-1; \n\t" | ||
121 | M32R_UNLOCK" %0, @%1; \n\t" | ||
122 | : "=&r" (count) | ||
123 | : "r" (&sem->count) | ||
124 | : "memory" | ||
125 | #ifdef CONFIG_CHIP_M32700_TS1 | ||
126 | , "r4" | ||
127 | #endif /* CONFIG_CHIP_M32700_TS1 */ | ||
128 | ); | ||
129 | local_irq_restore(flags); | ||
130 | |||
131 | if (unlikely(count < 0)) | ||
132 | result = __down_interruptible(sem); | 95 | result = __down_interruptible(sem); |
133 | 96 | ||
134 | return result; | 97 | return result; |
@@ -174,26 +137,7 @@ static inline int down_trylock(struct semaphore * sem) | |||
174 | */ | 137 | */ |
175 | static inline void up(struct semaphore * sem) | 138 | static inline void up(struct semaphore * sem) |
176 | { | 139 | { |
177 | unsigned long flags; | 140 | if (unlikely(atomic_inc_return(&sem->count) <= 0)) |
178 | long count; | ||
179 | |||
180 | local_irq_save(flags); | ||
181 | __asm__ __volatile__ ( | ||
182 | "# up \n\t" | ||
183 | DCACHE_CLEAR("%0", "r4", "%1") | ||
184 | M32R_LOCK" %0, @%1; \n\t" | ||
185 | "addi %0, #1; \n\t" | ||
186 | M32R_UNLOCK" %0, @%1; \n\t" | ||
187 | : "=&r" (count) | ||
188 | : "r" (&sem->count) | ||
189 | : "memory" | ||
190 | #ifdef CONFIG_CHIP_M32700_TS1 | ||
191 | , "r4" | ||
192 | #endif /* CONFIG_CHIP_M32700_TS1 */ | ||
193 | ); | ||
194 | local_irq_restore(flags); | ||
195 | |||
196 | if (unlikely(count <= 0)) | ||
197 | __up(sem); | 141 | __up(sem); |
198 | } | 142 | } |
199 | 143 | ||
diff --git a/include/asm-m32r/sigcontext.h b/include/asm-m32r/sigcontext.h index c233e2def2a3..942b8a30937d 100644 --- a/include/asm-m32r/sigcontext.h +++ b/include/asm-m32r/sigcontext.h | |||
@@ -32,6 +32,8 @@ struct sigcontext { | |||
32 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) | 32 | #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) |
33 | unsigned long sc_acch; | 33 | unsigned long sc_acch; |
34 | unsigned long sc_accl; | 34 | unsigned long sc_accl; |
35 | unsigned long sc_dummy_acc1h; | ||
36 | unsigned long sc_dummy_acc1l; | ||
35 | #else | 37 | #else |
36 | #error unknown isa configuration | 38 | #error unknown isa configuration |
37 | #endif | 39 | #endif |
diff --git a/include/asm-m32r/system.h b/include/asm-m32r/system.h index c5ab5da56d21..e55013f378e5 100644 --- a/include/asm-m32r/system.h +++ b/include/asm-m32r/system.h | |||
@@ -6,8 +6,8 @@ | |||
6 | * License. See the file "COPYING" in the main directory of this archive | 6 | * License. See the file "COPYING" in the main directory of this archive |
7 | * for more details. | 7 | * for more details. |
8 | * | 8 | * |
9 | * Copyright (C) 2001 by Hiroyuki Kondo, Hirokazu Takata, and Hitoshi Yamamoto | 9 | * Copyright (C) 2001 Hiroyuki Kondo, Hirokazu Takata, and Hitoshi Yamamoto |
10 | * Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org> | 10 | * Copyright (C) 2004, 2006 Hirokazu Takata <takata at linux-m32r.org> |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/config.h> | 13 | #include <linux/config.h> |
@@ -19,49 +19,28 @@ | |||
19 | * switch_to(prev, next) should switch from task `prev' to `next' | 19 | * switch_to(prev, next) should switch from task `prev' to `next' |
20 | * `prev' will never be the same as `next'. | 20 | * `prev' will never be the same as `next'. |
21 | * | 21 | * |
22 | * `next' and `prev' should be struct task_struct, but it isn't always defined | 22 | * `next' and `prev' should be task_t, but it isn't always defined |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #define switch_to(prev, next, last) do { \ | 25 | #define switch_to(prev, next, last) do { \ |
26 | register unsigned long arg0 __asm__ ("r0") = (unsigned long)prev; \ | ||
27 | register unsigned long arg1 __asm__ ("r1") = (unsigned long)next; \ | ||
28 | register unsigned long *oldsp __asm__ ("r2") = &(prev->thread.sp); \ | ||
29 | register unsigned long *newsp __asm__ ("r3") = &(next->thread.sp); \ | ||
30 | register unsigned long *oldlr __asm__ ("r4") = &(prev->thread.lr); \ | ||
31 | register unsigned long *newlr __asm__ ("r5") = &(next->thread.lr); \ | ||
32 | register struct task_struct *__last __asm__ ("r6"); \ | ||
33 | __asm__ __volatile__ ( \ | 26 | __asm__ __volatile__ ( \ |
34 | "st r8, @-r15 \n\t" \ | 27 | " seth lr, #high(1f) \n" \ |
35 | "st r9, @-r15 \n\t" \ | 28 | " or3 lr, lr, #low(1f) \n" \ |
36 | "st r10, @-r15 \n\t" \ | 29 | " st lr, @%4 ; store old LR \n" \ |
37 | "st r11, @-r15 \n\t" \ | 30 | " ld lr, @%5 ; load new LR \n" \ |
38 | "st r12, @-r15 \n\t" \ | 31 | " st sp, @%2 ; store old SP \n" \ |
39 | "st r13, @-r15 \n\t" \ | 32 | " ld sp, @%3 ; load new SP \n" \ |
40 | "st r14, @-r15 \n\t" \ | 33 | " push %1 ; store `prev' on new stack \n" \ |
41 | "seth r14, #high(1f) \n\t" \ | 34 | " jmp lr \n" \ |
42 | "or3 r14, r14, #low(1f) \n\t" \ | 35 | " .fillinsn \n" \ |
43 | "st r14, @r4 ; store old LR \n\t" \ | 36 | "1: \n" \ |
44 | "st r15, @r2 ; store old SP \n\t" \ | 37 | " pop %0 ; restore `__last' from new stack \n" \ |
45 | "ld r15, @r3 ; load new SP \n\t" \ | 38 | : "=r" (last) \ |
46 | "st r0, @-r15 ; store 'prev' onto new stack \n\t" \ | 39 | : "0" (prev), \ |
47 | "ld r14, @r5 ; load new LR \n\t" \ | 40 | "r" (&(prev->thread.sp)), "r" (&(next->thread.sp)), \ |
48 | "jmp r14 \n\t" \ | 41 | "r" (&(prev->thread.lr)), "r" (&(next->thread.lr)) \ |
49 | ".fillinsn \n " \ | 42 | : "memory", "lr" \ |
50 | "1: \n\t" \ | ||
51 | "ld r6, @r15+ ; load 'prev' from new stack \n\t" \ | ||
52 | "ld r14, @r15+ \n\t" \ | ||
53 | "ld r13, @r15+ \n\t" \ | ||
54 | "ld r12, @r15+ \n\t" \ | ||
55 | "ld r11, @r15+ \n\t" \ | ||
56 | "ld r10, @r15+ \n\t" \ | ||
57 | "ld r9, @r15+ \n\t" \ | ||
58 | "ld r8, @r15+ \n\t" \ | ||
59 | : "=&r" (__last) \ | ||
60 | : "r" (arg0), "r" (arg1), "r" (oldsp), "r" (newsp), \ | ||
61 | "r" (oldlr), "r" (newlr) \ | ||
62 | : "memory" \ | ||
63 | ); \ | 43 | ); \ |
64 | last = __last; \ | ||
65 | } while(0) | 44 | } while(0) |
66 | 45 | ||
67 | /* | 46 | /* |
@@ -167,8 +146,8 @@ extern void __xchg_called_with_bad_pointer(void); | |||
167 | #define DCACHE_CLEAR(reg0, reg1, addr) | 146 | #define DCACHE_CLEAR(reg0, reg1, addr) |
168 | #endif /* CONFIG_CHIP_M32700_TS1 */ | 147 | #endif /* CONFIG_CHIP_M32700_TS1 */ |
169 | 148 | ||
170 | static __inline__ unsigned long __xchg(unsigned long x, volatile void * ptr, | 149 | static inline unsigned long |
171 | int size) | 150 | __xchg(unsigned long x, volatile void * ptr, int size) |
172 | { | 151 | { |
173 | unsigned long flags; | 152 | unsigned long flags; |
174 | unsigned long tmp = 0; | 153 | unsigned long tmp = 0; |
@@ -220,7 +199,7 @@ static __inline__ unsigned long __xchg(unsigned long x, volatile void * ptr, | |||
220 | 199 | ||
221 | #define __HAVE_ARCH_CMPXCHG 1 | 200 | #define __HAVE_ARCH_CMPXCHG 1 |
222 | 201 | ||
223 | static __inline__ unsigned long | 202 | static inline unsigned long |
224 | __cmpxchg_u32(volatile unsigned int *p, unsigned int old, unsigned int new) | 203 | __cmpxchg_u32(volatile unsigned int *p, unsigned int old, unsigned int new) |
225 | { | 204 | { |
226 | unsigned long flags; | 205 | unsigned long flags; |
@@ -254,7 +233,7 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned int old, unsigned int new) | |||
254 | if something tries to do an invalid cmpxchg(). */ | 233 | if something tries to do an invalid cmpxchg(). */ |
255 | extern void __cmpxchg_called_with_bad_pointer(void); | 234 | extern void __cmpxchg_called_with_bad_pointer(void); |
256 | 235 | ||
257 | static __inline__ unsigned long | 236 | static inline unsigned long |
258 | __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) | 237 | __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) |
259 | { | 238 | { |
260 | switch (size) { | 239 | switch (size) { |
diff --git a/include/asm-x86_64/percpu.h b/include/asm-x86_64/percpu.h index 4405b4adeaba..7f33aaf9f7b1 100644 --- a/include/asm-x86_64/percpu.h +++ b/include/asm-x86_64/percpu.h | |||
@@ -26,7 +26,7 @@ | |||
26 | #define percpu_modcopy(pcpudst, src, size) \ | 26 | #define percpu_modcopy(pcpudst, src, size) \ |
27 | do { \ | 27 | do { \ |
28 | unsigned int __i; \ | 28 | unsigned int __i; \ |
29 | for_each_cpu(__i) \ | 29 | for_each_possible_cpu(__i) \ |
30 | memcpy((pcpudst)+__per_cpu_offset(__i), \ | 30 | memcpy((pcpudst)+__per_cpu_offset(__i), \ |
31 | (src), (size)); \ | 31 | (src), (size)); \ |
32 | } while (0) | 32 | } while (0) |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 8d2db412ba9c..a8bef1d1371c 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -1220,7 +1220,6 @@ typedef struct ide_pci_enablebit_s { | |||
1220 | enum { | 1220 | enum { |
1221 | /* Uses ISA control ports not PCI ones. */ | 1221 | /* Uses ISA control ports not PCI ones. */ |
1222 | IDEPCI_FLAG_ISA_PORTS = (1 << 0), | 1222 | IDEPCI_FLAG_ISA_PORTS = (1 << 0), |
1223 | IDEPCI_FLAG_FORCE_PDC = (1 << 1), | ||
1224 | }; | 1223 | }; |
1225 | 1224 | ||
1226 | typedef struct ide_pci_device_s { | 1225 | typedef struct ide_pci_device_s { |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 8d03e10212f5..d6fe048376ab 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -356,6 +356,10 @@ | |||
356 | #define PCI_DEVICE_ID_ATI_IXP300_SATA 0x436e | 356 | #define PCI_DEVICE_ID_ATI_IXP300_SATA 0x436e |
357 | #define PCI_DEVICE_ID_ATI_IXP400_IDE 0x4376 | 357 | #define PCI_DEVICE_ID_ATI_IXP400_IDE 0x4376 |
358 | #define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379 | 358 | #define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379 |
359 | #define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a | ||
360 | #define PCI_DEVICE_ID_ATI_IXP600_SATA 0x4380 | ||
361 | #define PCI_DEVICE_ID_ATI_IXP600_SRAID 0x4381 | ||
362 | #define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c | ||
359 | 363 | ||
360 | #define PCI_VENDOR_ID_VLSI 0x1004 | 364 | #define PCI_VENDOR_ID_VLSI 0x1004 |
361 | #define PCI_DEVICE_ID_VLSI_82C592 0x0005 | 365 | #define PCI_DEVICE_ID_VLSI_82C592 0x0005 |
diff --git a/include/linux/sched.h b/include/linux/sched.h index b7d31e2e1729..29b7d4f87d20 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1192,8 +1192,7 @@ extern void wait_task_inactive(task_t * p); | |||
1192 | #define remove_parent(p) list_del_init(&(p)->sibling) | 1192 | #define remove_parent(p) list_del_init(&(p)->sibling) |
1193 | #define add_parent(p) list_add_tail(&(p)->sibling,&(p)->parent->children) | 1193 | #define add_parent(p) list_add_tail(&(p)->sibling,&(p)->parent->children) |
1194 | 1194 | ||
1195 | #define next_task(p) list_entry((p)->tasks.next, struct task_struct, tasks) | 1195 | #define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks) |
1196 | #define prev_task(p) list_entry((p)->tasks.prev, struct task_struct, tasks) | ||
1197 | 1196 | ||
1198 | #define for_each_process(p) \ | 1197 | #define for_each_process(p) \ |
1199 | for (p = &init_task ; (p = next_task(p)) != &init_task ; ) | 1198 | for (p = &init_task ; (p = next_task(p)) != &init_task ; ) |
diff --git a/kernel/exit.c b/kernel/exit.c index 1a9787ac6173..f86434d7b3d1 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -56,7 +56,7 @@ static void __unhash_process(struct task_struct *p) | |||
56 | detach_pid(p, PIDTYPE_PGID); | 56 | detach_pid(p, PIDTYPE_PGID); |
57 | detach_pid(p, PIDTYPE_SID); | 57 | detach_pid(p, PIDTYPE_SID); |
58 | 58 | ||
59 | list_del_init(&p->tasks); | 59 | list_del_rcu(&p->tasks); |
60 | __get_cpu_var(process_counts)--; | 60 | __get_cpu_var(process_counts)--; |
61 | } | 61 | } |
62 | list_del_rcu(&p->thread_group); | 62 | list_del_rcu(&p->thread_group); |
diff --git a/kernel/fork.c b/kernel/fork.c index 54b15f8cda53..34515772611e 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -1204,7 +1204,7 @@ static task_t *copy_process(unsigned long clone_flags, | |||
1204 | attach_pid(p, PIDTYPE_PGID, process_group(p)); | 1204 | attach_pid(p, PIDTYPE_PGID, process_group(p)); |
1205 | attach_pid(p, PIDTYPE_SID, p->signal->session); | 1205 | attach_pid(p, PIDTYPE_SID, p->signal->session); |
1206 | 1206 | ||
1207 | list_add_tail(&p->tasks, &init_task.tasks); | 1207 | list_add_tail_rcu(&p->tasks, &init_task.tasks); |
1208 | __get_cpu_var(process_counts)++; | 1208 | __get_cpu_var(process_counts)++; |
1209 | } | 1209 | } |
1210 | attach_pid(p, PIDTYPE_PID, p->pid); | 1210 | attach_pid(p, PIDTYPE_PID, p->pid); |
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index c5863d02c89e..3eeedbb13b78 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c | |||
@@ -240,14 +240,15 @@ static void copy_data_pages(struct pbe *pblist) | |||
240 | * free_pagedir - free pages allocated with alloc_pagedir() | 240 | * free_pagedir - free pages allocated with alloc_pagedir() |
241 | */ | 241 | */ |
242 | 242 | ||
243 | static void free_pagedir(struct pbe *pblist) | 243 | static void free_pagedir(struct pbe *pblist, int clear_nosave_free) |
244 | { | 244 | { |
245 | struct pbe *pbe; | 245 | struct pbe *pbe; |
246 | 246 | ||
247 | while (pblist) { | 247 | while (pblist) { |
248 | pbe = (pblist + PB_PAGE_SKIP)->next; | 248 | pbe = (pblist + PB_PAGE_SKIP)->next; |
249 | ClearPageNosave(virt_to_page(pblist)); | 249 | ClearPageNosave(virt_to_page(pblist)); |
250 | ClearPageNosaveFree(virt_to_page(pblist)); | 250 | if (clear_nosave_free) |
251 | ClearPageNosaveFree(virt_to_page(pblist)); | ||
251 | free_page((unsigned long)pblist); | 252 | free_page((unsigned long)pblist); |
252 | pblist = pbe; | 253 | pblist = pbe; |
253 | } | 254 | } |
@@ -389,7 +390,7 @@ struct pbe *alloc_pagedir(unsigned int nr_pages, gfp_t gfp_mask, int safe_needed | |||
389 | pbe->next = alloc_image_page(gfp_mask, safe_needed); | 390 | pbe->next = alloc_image_page(gfp_mask, safe_needed); |
390 | } | 391 | } |
391 | if (!pbe) { /* get_zeroed_page() failed */ | 392 | if (!pbe) { /* get_zeroed_page() failed */ |
392 | free_pagedir(pblist); | 393 | free_pagedir(pblist, 1); |
393 | pblist = NULL; | 394 | pblist = NULL; |
394 | } else | 395 | } else |
395 | create_pbe_list(pblist, nr_pages); | 396 | create_pbe_list(pblist, nr_pages); |
@@ -736,7 +737,7 @@ static int create_image(struct snapshot_handle *handle) | |||
736 | pblist = alloc_pagedir(nr_copy_pages, GFP_ATOMIC, 1); | 737 | pblist = alloc_pagedir(nr_copy_pages, GFP_ATOMIC, 1); |
737 | if (pblist) | 738 | if (pblist) |
738 | copy_page_backup_list(pblist, p); | 739 | copy_page_backup_list(pblist, p); |
739 | free_pagedir(p); | 740 | free_pagedir(p, 0); |
740 | if (!pblist) | 741 | if (!pblist) |
741 | error = -ENOMEM; | 742 | error = -ENOMEM; |
742 | } | 743 | } |
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index d57fd9181b18..6ecc180beb71 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -101,7 +101,7 @@ config DEBUG_PREEMPT | |||
101 | 101 | ||
102 | config DEBUG_MUTEXES | 102 | config DEBUG_MUTEXES |
103 | bool "Mutex debugging, deadlock detection" | 103 | bool "Mutex debugging, deadlock detection" |
104 | default y | 104 | default n |
105 | depends on DEBUG_KERNEL | 105 | depends on DEBUG_KERNEL |
106 | help | 106 | help |
107 | This allows mutex semantics violations and mutex related deadlocks | 107 | This allows mutex semantics violations and mutex related deadlocks |
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 78747afad6b0..042e6436c3ee 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c | |||
@@ -46,15 +46,25 @@ | |||
46 | unsigned long badness(struct task_struct *p, unsigned long uptime) | 46 | unsigned long badness(struct task_struct *p, unsigned long uptime) |
47 | { | 47 | { |
48 | unsigned long points, cpu_time, run_time, s; | 48 | unsigned long points, cpu_time, run_time, s; |
49 | struct list_head *tsk; | 49 | struct mm_struct *mm; |
50 | struct task_struct *child; | ||
50 | 51 | ||
51 | if (!p->mm) | 52 | task_lock(p); |
53 | mm = p->mm; | ||
54 | if (!mm) { | ||
55 | task_unlock(p); | ||
52 | return 0; | 56 | return 0; |
57 | } | ||
53 | 58 | ||
54 | /* | 59 | /* |
55 | * The memory size of the process is the basis for the badness. | 60 | * The memory size of the process is the basis for the badness. |
56 | */ | 61 | */ |
57 | points = p->mm->total_vm; | 62 | points = mm->total_vm; |
63 | |||
64 | /* | ||
65 | * After this unlock we can no longer dereference local variable `mm' | ||
66 | */ | ||
67 | task_unlock(p); | ||
58 | 68 | ||
59 | /* | 69 | /* |
60 | * Processes which fork a lot of child processes are likely | 70 | * Processes which fork a lot of child processes are likely |
@@ -64,11 +74,11 @@ unsigned long badness(struct task_struct *p, unsigned long uptime) | |||
64 | * child is eating the vast majority of memory, adding only half | 74 | * child is eating the vast majority of memory, adding only half |
65 | * to the parents will make the child our kill candidate of choice. | 75 | * to the parents will make the child our kill candidate of choice. |
66 | */ | 76 | */ |
67 | list_for_each(tsk, &p->children) { | 77 | list_for_each_entry(child, &p->children, sibling) { |
68 | struct task_struct *chld; | 78 | task_lock(child); |
69 | chld = list_entry(tsk, struct task_struct, sibling); | 79 | if (child->mm != mm && child->mm) |
70 | if (chld->mm != p->mm && chld->mm) | 80 | points += child->mm->total_vm/2 + 1; |
71 | points += chld->mm->total_vm/2 + 1; | 81 | task_unlock(child); |
72 | } | 82 | } |
73 | 83 | ||
74 | /* | 84 | /* |
@@ -244,17 +254,24 @@ static void __oom_kill_task(task_t *p, const char *message) | |||
244 | force_sig(SIGKILL, p); | 254 | force_sig(SIGKILL, p); |
245 | } | 255 | } |
246 | 256 | ||
247 | static struct mm_struct *oom_kill_task(task_t *p, const char *message) | 257 | static int oom_kill_task(task_t *p, const char *message) |
248 | { | 258 | { |
249 | struct mm_struct *mm = get_task_mm(p); | 259 | struct mm_struct *mm; |
250 | task_t * g, * q; | 260 | task_t * g, * q; |
251 | 261 | ||
252 | if (!mm) | 262 | mm = p->mm; |
253 | return NULL; | 263 | |
254 | if (mm == &init_mm) { | 264 | /* WARNING: mm may not be dereferenced since we did not obtain its |
255 | mmput(mm); | 265 | * value from get_task_mm(p). This is OK since all we need to do is |
256 | return NULL; | 266 | * compare mm to q->mm below. |
257 | } | 267 | * |
268 | * Furthermore, even if mm contains a non-NULL value, p->mm may | ||
269 | * change to NULL at any time since we do not hold task_lock(p). | ||
270 | * However, this is of no concern to us. | ||
271 | */ | ||
272 | |||
273 | if (mm == NULL || mm == &init_mm) | ||
274 | return 1; | ||
258 | 275 | ||
259 | __oom_kill_task(p, message); | 276 | __oom_kill_task(p, message); |
260 | /* | 277 | /* |
@@ -266,13 +283,12 @@ static struct mm_struct *oom_kill_task(task_t *p, const char *message) | |||
266 | __oom_kill_task(q, message); | 283 | __oom_kill_task(q, message); |
267 | while_each_thread(g, q); | 284 | while_each_thread(g, q); |
268 | 285 | ||
269 | return mm; | 286 | return 0; |
270 | } | 287 | } |
271 | 288 | ||
272 | static struct mm_struct *oom_kill_process(struct task_struct *p, | 289 | static int oom_kill_process(struct task_struct *p, unsigned long points, |
273 | unsigned long points, const char *message) | 290 | const char *message) |
274 | { | 291 | { |
275 | struct mm_struct *mm; | ||
276 | struct task_struct *c; | 292 | struct task_struct *c; |
277 | struct list_head *tsk; | 293 | struct list_head *tsk; |
278 | 294 | ||
@@ -283,9 +299,8 @@ static struct mm_struct *oom_kill_process(struct task_struct *p, | |||
283 | c = list_entry(tsk, struct task_struct, sibling); | 299 | c = list_entry(tsk, struct task_struct, sibling); |
284 | if (c->mm == p->mm) | 300 | if (c->mm == p->mm) |
285 | continue; | 301 | continue; |
286 | mm = oom_kill_task(c, message); | 302 | if (!oom_kill_task(c, message)) |
287 | if (mm) | 303 | return 0; |
288 | return mm; | ||
289 | } | 304 | } |
290 | return oom_kill_task(p, message); | 305 | return oom_kill_task(p, message); |
291 | } | 306 | } |
@@ -300,7 +315,6 @@ static struct mm_struct *oom_kill_process(struct task_struct *p, | |||
300 | */ | 315 | */ |
301 | void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order) | 316 | void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order) |
302 | { | 317 | { |
303 | struct mm_struct *mm = NULL; | ||
304 | task_t *p; | 318 | task_t *p; |
305 | unsigned long points = 0; | 319 | unsigned long points = 0; |
306 | 320 | ||
@@ -320,12 +334,12 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order) | |||
320 | */ | 334 | */ |
321 | switch (constrained_alloc(zonelist, gfp_mask)) { | 335 | switch (constrained_alloc(zonelist, gfp_mask)) { |
322 | case CONSTRAINT_MEMORY_POLICY: | 336 | case CONSTRAINT_MEMORY_POLICY: |
323 | mm = oom_kill_process(current, points, | 337 | oom_kill_process(current, points, |
324 | "No available memory (MPOL_BIND)"); | 338 | "No available memory (MPOL_BIND)"); |
325 | break; | 339 | break; |
326 | 340 | ||
327 | case CONSTRAINT_CPUSET: | 341 | case CONSTRAINT_CPUSET: |
328 | mm = oom_kill_process(current, points, | 342 | oom_kill_process(current, points, |
329 | "No available memory in cpuset"); | 343 | "No available memory in cpuset"); |
330 | break; | 344 | break; |
331 | 345 | ||
@@ -347,8 +361,7 @@ retry: | |||
347 | panic("Out of memory and no killable processes...\n"); | 361 | panic("Out of memory and no killable processes...\n"); |
348 | } | 362 | } |
349 | 363 | ||
350 | mm = oom_kill_process(p, points, "Out of memory"); | 364 | if (oom_kill_process(p, points, "Out of memory")) |
351 | if (!mm) | ||
352 | goto retry; | 365 | goto retry; |
353 | 366 | ||
354 | break; | 367 | break; |
@@ -357,8 +370,6 @@ retry: | |||
357 | out: | 370 | out: |
358 | read_unlock(&tasklist_lock); | 371 | read_unlock(&tasklist_lock); |
359 | cpuset_unlock(); | 372 | cpuset_unlock(); |
360 | if (mm) | ||
361 | mmput(mm); | ||
362 | 373 | ||
363 | /* | 374 | /* |
364 | * Give "p" a good chance of killing itself before we | 375 | * Give "p" a good chance of killing itself before we |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 97d6827c7d66..123c60586740 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -232,11 +232,13 @@ static inline void prep_zero_page(struct page *page, int order, gfp_t gfp_flags) | |||
232 | * zone->lock is already acquired when we use these. | 232 | * zone->lock is already acquired when we use these. |
233 | * So, we don't need atomic page->flags operations here. | 233 | * So, we don't need atomic page->flags operations here. |
234 | */ | 234 | */ |
235 | static inline unsigned long page_order(struct page *page) { | 235 | static inline unsigned long page_order(struct page *page) |
236 | { | ||
236 | return page_private(page); | 237 | return page_private(page); |
237 | } | 238 | } |
238 | 239 | ||
239 | static inline void set_page_order(struct page *page, int order) { | 240 | static inline void set_page_order(struct page *page, int order) |
241 | { | ||
240 | set_page_private(page, order); | 242 | set_page_private(page, order); |
241 | __SetPageBuddy(page); | 243 | __SetPageBuddy(page); |
242 | } | 244 | } |
@@ -299,9 +301,9 @@ static inline int page_is_buddy(struct page *page, int order) | |||
299 | 301 | ||
300 | if (PageBuddy(page) && page_order(page) == order) { | 302 | if (PageBuddy(page) && page_order(page) == order) { |
301 | BUG_ON(page_count(page) != 0); | 303 | BUG_ON(page_count(page) != 0); |
302 | return 1; | 304 | return 1; |
303 | } | 305 | } |
304 | return 0; | 306 | return 0; |
305 | } | 307 | } |
306 | 308 | ||
307 | /* | 309 | /* |
@@ -354,9 +354,7 @@ void *__alloc_percpu(size_t size) | |||
354 | if (!pdata) | 354 | if (!pdata) |
355 | return NULL; | 355 | return NULL; |
356 | 356 | ||
357 | for (i = 0; i < NR_CPUS; i++) { | 357 | for_each_possible_cpu(i) { |
358 | if (!cpu_possible(i)) | ||
359 | continue; | ||
360 | pdata->ptrs[i] = kmalloc(size, GFP_KERNEL); | 358 | pdata->ptrs[i] = kmalloc(size, GFP_KERNEL); |
361 | if (!pdata->ptrs[i]) | 359 | if (!pdata->ptrs[i]) |
362 | goto unwind_oom; | 360 | goto unwind_oom; |
@@ -383,11 +381,9 @@ free_percpu(const void *objp) | |||
383 | int i; | 381 | int i; |
384 | struct percpu_data *p = (struct percpu_data *) (~(unsigned long) objp); | 382 | struct percpu_data *p = (struct percpu_data *) (~(unsigned long) objp); |
385 | 383 | ||
386 | for (i = 0; i < NR_CPUS; i++) { | 384 | for_each_possible_cpu(i) |
387 | if (!cpu_possible(i)) | ||
388 | continue; | ||
389 | kfree(p->ptrs[i]); | 385 | kfree(p->ptrs[i]); |
390 | } | 386 | |
391 | kfree(p); | 387 | kfree(p); |
392 | } | 388 | } |
393 | EXPORT_SYMBOL(free_percpu); | 389 | EXPORT_SYMBOL(free_percpu); |
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index ae5ab981bb1d..8012d1076876 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c | |||
@@ -5,6 +5,7 @@ | |||
5 | 5 | ||
6 | #include <ctype.h> | 6 | #include <ctype.h> |
7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
8 | #include <stdio.h> | ||
8 | #include <string.h> | 9 | #include <string.h> |
9 | #include <unistd.h> | 10 | #include <unistd.h> |
10 | #include <time.h> | 11 | #include <time.h> |
@@ -531,7 +532,7 @@ int main(int ac, char **av) | |||
531 | break; | 532 | break; |
532 | case 'h': | 533 | case 'h': |
533 | case '?': | 534 | case '?': |
534 | printf("%s [-o|-s] config\n", av[0]); | 535 | fprintf(stderr, "See README for usage info\n"); |
535 | exit(0); | 536 | exit(0); |
536 | } | 537 | } |
537 | } | 538 | } |
diff --git a/security/selinux/ss/mls.c b/security/selinux/ss/mls.c index 640d0bfdbc68..84047f69f9c1 100644 --- a/security/selinux/ss/mls.c +++ b/security/selinux/ss/mls.c | |||
@@ -264,7 +264,7 @@ int mls_context_to_sid(char oldc, | |||
264 | 264 | ||
265 | if (!selinux_mls_enabled) { | 265 | if (!selinux_mls_enabled) { |
266 | if (def_sid != SECSID_NULL && oldc) | 266 | if (def_sid != SECSID_NULL && oldc) |
267 | *scontext += strlen(*scontext); | 267 | *scontext += strlen(*scontext)+1; |
268 | return 0; | 268 | return 0; |
269 | } | 269 | } |
270 | 270 | ||
diff --git a/usr/gen_init_cpio.c b/usr/gen_init_cpio.c index 33dbcbf77c5b..83acd6cc0b3c 100644 --- a/usr/gen_init_cpio.c +++ b/usr/gen_init_cpio.c | |||
@@ -471,6 +471,7 @@ int main (int argc, char *argv[]) | |||
471 | "ERROR: incorrect format, could not locate file type line %d: '%s'\n", | 471 | "ERROR: incorrect format, could not locate file type line %d: '%s'\n", |
472 | line_nr, line); | 472 | line_nr, line); |
473 | ec = -1; | 473 | ec = -1; |
474 | break; | ||
474 | } | 475 | } |
475 | 476 | ||
476 | if ('\n' == *type) { | 477 | if ('\n' == *type) { |
@@ -506,7 +507,8 @@ int main (int argc, char *argv[]) | |||
506 | line_nr, line); | 507 | line_nr, line); |
507 | } | 508 | } |
508 | } | 509 | } |
509 | cpio_trailer(); | 510 | if (ec == 0) |
511 | cpio_trailer(); | ||
510 | 512 | ||
511 | exit(ec); | 513 | exit(ec); |
512 | } | 514 | } |