diff options
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/check.c | 20 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/intel_cacheinfo.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/dumpstack.c | 23 | ||||
-rw-r--r-- | arch/x86/kernel/dumpstack_32.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/dumpstack_64.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/kprobes.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/microcode_core.c | 9 | ||||
-rw-r--r-- | arch/x86/kernel/nmi.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/pci-calgary_64.c | 8 | ||||
-rw-r--r-- | arch/x86/kernel/process.c | 6 | ||||
-rw-r--r-- | arch/x86/kernel/setup.c | 7 |
11 files changed, 53 insertions, 34 deletions
diff --git a/arch/x86/kernel/check.c b/arch/x86/kernel/check.c index 5da1269e8ddc..e2dbcb7dabdd 100644 --- a/arch/x86/kernel/check.c +++ b/arch/x86/kernel/check.c | |||
@@ -27,21 +27,29 @@ static int num_scan_areas; | |||
27 | 27 | ||
28 | static __init int set_corruption_check(char *arg) | 28 | static __init int set_corruption_check(char *arg) |
29 | { | 29 | { |
30 | char *end; | 30 | ssize_t ret; |
31 | unsigned long val; | ||
31 | 32 | ||
32 | memory_corruption_check = simple_strtol(arg, &end, 10); | 33 | ret = kstrtoul(arg, 10, &val); |
34 | if (ret) | ||
35 | return ret; | ||
33 | 36 | ||
34 | return (*end == 0) ? 0 : -EINVAL; | 37 | memory_corruption_check = val; |
38 | return 0; | ||
35 | } | 39 | } |
36 | early_param("memory_corruption_check", set_corruption_check); | 40 | early_param("memory_corruption_check", set_corruption_check); |
37 | 41 | ||
38 | static __init int set_corruption_check_period(char *arg) | 42 | static __init int set_corruption_check_period(char *arg) |
39 | { | 43 | { |
40 | char *end; | 44 | ssize_t ret; |
45 | unsigned long val; | ||
41 | 46 | ||
42 | corruption_check_period = simple_strtoul(arg, &end, 10); | 47 | ret = kstrtoul(arg, 10, &val); |
48 | if (ret) | ||
49 | return ret; | ||
43 | 50 | ||
44 | return (*end == 0) ? 0 : -EINVAL; | 51 | corruption_check_period = val; |
52 | return 0; | ||
45 | } | 53 | } |
46 | early_param("memory_corruption_check_period", set_corruption_check_period); | 54 | early_param("memory_corruption_check_period", set_corruption_check_period); |
47 | 55 | ||
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index b8f3653dddbc..9a7c90d80bc4 100644 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c | |||
@@ -615,14 +615,14 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c) | |||
615 | new_l2 = this_leaf.size/1024; | 615 | new_l2 = this_leaf.size/1024; |
616 | num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing; | 616 | num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing; |
617 | index_msb = get_count_order(num_threads_sharing); | 617 | index_msb = get_count_order(num_threads_sharing); |
618 | l2_id = c->apicid >> index_msb; | 618 | l2_id = c->apicid & ~((1 << index_msb) - 1); |
619 | break; | 619 | break; |
620 | case 3: | 620 | case 3: |
621 | new_l3 = this_leaf.size/1024; | 621 | new_l3 = this_leaf.size/1024; |
622 | num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing; | 622 | num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing; |
623 | index_msb = get_count_order( | 623 | index_msb = get_count_order( |
624 | num_threads_sharing); | 624 | num_threads_sharing); |
625 | l3_id = c->apicid >> index_msb; | 625 | l3_id = c->apicid & ~((1 << index_msb) - 1); |
626 | break; | 626 | break; |
627 | default: | 627 | default: |
628 | break; | 628 | break; |
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index 1b81839b6c88..571246d81edf 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c | |||
@@ -271,7 +271,7 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err) | |||
271 | current->thread.trap_nr, SIGSEGV) == NOTIFY_STOP) | 271 | current->thread.trap_nr, SIGSEGV) == NOTIFY_STOP) |
272 | return 1; | 272 | return 1; |
273 | 273 | ||
274 | show_registers(regs); | 274 | show_regs(regs); |
275 | #ifdef CONFIG_X86_32 | 275 | #ifdef CONFIG_X86_32 |
276 | if (user_mode_vm(regs)) { | 276 | if (user_mode_vm(regs)) { |
277 | sp = regs->sp; | 277 | sp = regs->sp; |
@@ -311,16 +311,33 @@ void die(const char *str, struct pt_regs *regs, long err) | |||
311 | 311 | ||
312 | static int __init kstack_setup(char *s) | 312 | static int __init kstack_setup(char *s) |
313 | { | 313 | { |
314 | ssize_t ret; | ||
315 | unsigned long val; | ||
316 | |||
314 | if (!s) | 317 | if (!s) |
315 | return -EINVAL; | 318 | return -EINVAL; |
316 | kstack_depth_to_print = simple_strtoul(s, NULL, 0); | 319 | |
320 | ret = kstrtoul(s, 0, &val); | ||
321 | if (ret) | ||
322 | return ret; | ||
323 | kstack_depth_to_print = val; | ||
317 | return 0; | 324 | return 0; |
318 | } | 325 | } |
319 | early_param("kstack", kstack_setup); | 326 | early_param("kstack", kstack_setup); |
320 | 327 | ||
321 | static int __init code_bytes_setup(char *s) | 328 | static int __init code_bytes_setup(char *s) |
322 | { | 329 | { |
323 | code_bytes = simple_strtoul(s, NULL, 0); | 330 | ssize_t ret; |
331 | unsigned long val; | ||
332 | |||
333 | if (!s) | ||
334 | return -EINVAL; | ||
335 | |||
336 | ret = kstrtoul(s, 0, &val); | ||
337 | if (ret) | ||
338 | return ret; | ||
339 | |||
340 | code_bytes = val; | ||
324 | if (code_bytes > 8192) | 341 | if (code_bytes > 8192) |
325 | code_bytes = 8192; | 342 | code_bytes = 8192; |
326 | 343 | ||
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c index 88ec9129271d..e0b1d783daab 100644 --- a/arch/x86/kernel/dumpstack_32.c +++ b/arch/x86/kernel/dumpstack_32.c | |||
@@ -82,7 +82,7 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs, | |||
82 | } | 82 | } |
83 | 83 | ||
84 | 84 | ||
85 | void show_registers(struct pt_regs *regs) | 85 | void show_regs(struct pt_regs *regs) |
86 | { | 86 | { |
87 | int i; | 87 | int i; |
88 | 88 | ||
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c index 17107bd6e1f0..791b76122aa8 100644 --- a/arch/x86/kernel/dumpstack_64.c +++ b/arch/x86/kernel/dumpstack_64.c | |||
@@ -245,7 +245,7 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs, | |||
245 | show_trace_log_lvl(task, regs, sp, bp, log_lvl); | 245 | show_trace_log_lvl(task, regs, sp, bp, log_lvl); |
246 | } | 246 | } |
247 | 247 | ||
248 | void show_registers(struct pt_regs *regs) | 248 | void show_regs(struct pt_regs *regs) |
249 | { | 249 | { |
250 | int i; | 250 | int i; |
251 | unsigned long sp; | 251 | unsigned long sp; |
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c index e213fc8408d2..e2f751efb7b1 100644 --- a/arch/x86/kernel/kprobes.c +++ b/arch/x86/kernel/kprobes.c | |||
@@ -1037,9 +1037,9 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) | |||
1037 | "current sp %p does not match saved sp %p\n", | 1037 | "current sp %p does not match saved sp %p\n", |
1038 | stack_addr(regs), kcb->jprobe_saved_sp); | 1038 | stack_addr(regs), kcb->jprobe_saved_sp); |
1039 | printk(KERN_ERR "Saved registers for jprobe %p\n", jp); | 1039 | printk(KERN_ERR "Saved registers for jprobe %p\n", jp); |
1040 | show_registers(saved_regs); | 1040 | show_regs(saved_regs); |
1041 | printk(KERN_ERR "Current registers\n"); | 1041 | printk(KERN_ERR "Current registers\n"); |
1042 | show_registers(regs); | 1042 | show_regs(regs); |
1043 | BUG(); | 1043 | BUG(); |
1044 | } | 1044 | } |
1045 | *regs = kcb->jprobe_saved_regs; | 1045 | *regs = kcb->jprobe_saved_regs; |
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c index c9bda6d6035c..fbdfc6917180 100644 --- a/arch/x86/kernel/microcode_core.c +++ b/arch/x86/kernel/microcode_core.c | |||
@@ -299,12 +299,11 @@ static ssize_t reload_store(struct device *dev, | |||
299 | { | 299 | { |
300 | unsigned long val; | 300 | unsigned long val; |
301 | int cpu = dev->id; | 301 | int cpu = dev->id; |
302 | int ret = 0; | 302 | ssize_t ret = 0; |
303 | char *end; | ||
304 | 303 | ||
305 | val = simple_strtoul(buf, &end, 0); | 304 | ret = kstrtoul(buf, 0, &val); |
306 | if (end == buf) | 305 | if (ret) |
307 | return -EINVAL; | 306 | return ret; |
308 | 307 | ||
309 | if (val == 1) { | 308 | if (val == 1) { |
310 | get_online_cpus(); | 309 | get_online_cpus(); |
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c index a1faed5ac6a2..bffdfd48c1f2 100644 --- a/arch/x86/kernel/nmi.c +++ b/arch/x86/kernel/nmi.c | |||
@@ -209,7 +209,7 @@ io_check_error(unsigned char reason, struct pt_regs *regs) | |||
209 | pr_emerg( | 209 | pr_emerg( |
210 | "NMI: IOCK error (debug interrupt?) for reason %02x on CPU %d.\n", | 210 | "NMI: IOCK error (debug interrupt?) for reason %02x on CPU %d.\n", |
211 | reason, smp_processor_id()); | 211 | reason, smp_processor_id()); |
212 | show_registers(regs); | 212 | show_regs(regs); |
213 | 213 | ||
214 | if (panic_on_io_nmi) | 214 | if (panic_on_io_nmi) |
215 | panic("NMI IOCK error: Not continuing"); | 215 | panic("NMI IOCK error: Not continuing"); |
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c index d0b2fb9ccbb1..b72838bae64a 100644 --- a/arch/x86/kernel/pci-calgary_64.c +++ b/arch/x86/kernel/pci-calgary_64.c | |||
@@ -1480,8 +1480,9 @@ cleanup: | |||
1480 | static int __init calgary_parse_options(char *p) | 1480 | static int __init calgary_parse_options(char *p) |
1481 | { | 1481 | { |
1482 | unsigned int bridge; | 1482 | unsigned int bridge; |
1483 | unsigned long val; | ||
1483 | size_t len; | 1484 | size_t len; |
1484 | char* endp; | 1485 | ssize_t ret; |
1485 | 1486 | ||
1486 | while (*p) { | 1487 | while (*p) { |
1487 | if (!strncmp(p, "64k", 3)) | 1488 | if (!strncmp(p, "64k", 3)) |
@@ -1512,10 +1513,11 @@ static int __init calgary_parse_options(char *p) | |||
1512 | ++p; | 1513 | ++p; |
1513 | if (*p == '\0') | 1514 | if (*p == '\0') |
1514 | break; | 1515 | break; |
1515 | bridge = simple_strtoul(p, &endp, 0); | 1516 | ret = kstrtoul(p, 0, &val); |
1516 | if (p == endp) | 1517 | if (ret) |
1517 | break; | 1518 | break; |
1518 | 1519 | ||
1520 | bridge = val; | ||
1519 | if (bridge < MAX_PHB_BUS_NUM) { | 1521 | if (bridge < MAX_PHB_BUS_NUM) { |
1520 | printk(KERN_INFO "Calgary: disabling " | 1522 | printk(KERN_INFO "Calgary: disabling " |
1521 | "translation for PHB %#x\n", bridge); | 1523 | "translation for PHB %#x\n", bridge); |
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 8040b752ee4f..f2e8c0f951d6 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -113,12 +113,6 @@ void exit_thread(void) | |||
113 | } | 113 | } |
114 | } | 114 | } |
115 | 115 | ||
116 | void show_regs(struct pt_regs *regs) | ||
117 | { | ||
118 | show_registers(regs); | ||
119 | show_trace(NULL, regs, (unsigned long *)kernel_stack_pointer(regs), 0); | ||
120 | } | ||
121 | |||
122 | void show_regs_common(void) | 116 | void show_regs_common(void) |
123 | { | 117 | { |
124 | const char *vendor, *product, *board; | 118 | const char *vendor, *product, *board; |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 7e67c5a71061..9b4204e06665 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -393,10 +393,9 @@ static void __init reserve_initrd(void) | |||
393 | initrd_start = 0; | 393 | initrd_start = 0; |
394 | 394 | ||
395 | if (ramdisk_size >= (end_of_lowmem>>1)) { | 395 | if (ramdisk_size >= (end_of_lowmem>>1)) { |
396 | memblock_free(ramdisk_image, ramdisk_end - ramdisk_image); | 396 | panic("initrd too large to handle, " |
397 | printk(KERN_ERR "initrd too large to handle, " | 397 | "disabling initrd (%lld needed, %lld available)\n", |
398 | "disabling initrd\n"); | 398 | ramdisk_size, end_of_lowmem>>1); |
399 | return; | ||
400 | } | 399 | } |
401 | 400 | ||
402 | printk(KERN_INFO "RAMDISK: %08llx - %08llx\n", ramdisk_image, | 401 | printk(KERN_INFO "RAMDISK: %08llx - %08llx\n", ramdisk_image, |