diff options
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/crash_dump_32.c | 1 | ||||
-rw-r--r-- | arch/x86/kernel/e820_32.c | 3 | ||||
-rw-r--r-- | arch/x86/kernel/e820_64.c | 3 | ||||
-rw-r--r-- | arch/x86/kernel/machine_kexec_32.c | 22 | ||||
-rw-r--r-- | arch/x86/kernel/machine_kexec_64.c | 27 | ||||
-rw-r--r-- | arch/x86/kernel/process_32.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/setup_32.c | 49 | ||||
-rw-r--r-- | arch/x86/kernel/setup_64.c | 39 | ||||
-rw-r--r-- | arch/x86/kernel/signal_32.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/traps_32.c | 4 |
10 files changed, 86 insertions, 68 deletions
diff --git a/arch/x86/kernel/crash_dump_32.c b/arch/x86/kernel/crash_dump_32.c index 32e75d0731a9..72d0c56c1b48 100644 --- a/arch/x86/kernel/crash_dump_32.c +++ b/arch/x86/kernel/crash_dump_32.c | |||
@@ -47,6 +47,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf, | |||
47 | if (!kdump_buf_page) { | 47 | if (!kdump_buf_page) { |
48 | printk(KERN_WARNING "Kdump: Kdump buffer page not" | 48 | printk(KERN_WARNING "Kdump: Kdump buffer page not" |
49 | " allocated\n"); | 49 | " allocated\n"); |
50 | kunmap_atomic(vaddr, KM_PTE0); | ||
50 | return -EFAULT; | 51 | return -EFAULT; |
51 | } | 52 | } |
52 | copy_page(kdump_buf_page, vaddr); | 53 | copy_page(kdump_buf_page, vaddr); |
diff --git a/arch/x86/kernel/e820_32.c b/arch/x86/kernel/e820_32.c index 3c86b979a40a..d58039e8de74 100644 --- a/arch/x86/kernel/e820_32.c +++ b/arch/x86/kernel/e820_32.c | |||
@@ -288,7 +288,8 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat | |||
288 | request_resource(res, code_resource); | 288 | request_resource(res, code_resource); |
289 | request_resource(res, data_resource); | 289 | request_resource(res, data_resource); |
290 | #ifdef CONFIG_KEXEC | 290 | #ifdef CONFIG_KEXEC |
291 | request_resource(res, &crashk_res); | 291 | if (crashk_res.start != crashk_res.end) |
292 | request_resource(res, &crashk_res); | ||
292 | #endif | 293 | #endif |
293 | } | 294 | } |
294 | } | 295 | } |
diff --git a/arch/x86/kernel/e820_64.c b/arch/x86/kernel/e820_64.c index e422b8159f69..57616865d8a0 100644 --- a/arch/x86/kernel/e820_64.c +++ b/arch/x86/kernel/e820_64.c | |||
@@ -226,7 +226,8 @@ void __init e820_reserve_resources(void) | |||
226 | request_resource(res, &code_resource); | 226 | request_resource(res, &code_resource); |
227 | request_resource(res, &data_resource); | 227 | request_resource(res, &data_resource); |
228 | #ifdef CONFIG_KEXEC | 228 | #ifdef CONFIG_KEXEC |
229 | request_resource(res, &crashk_res); | 229 | if (crashk_res.start != crashk_res.end) |
230 | request_resource(res, &crashk_res); | ||
230 | #endif | 231 | #endif |
231 | } | 232 | } |
232 | } | 233 | } |
diff --git a/arch/x86/kernel/machine_kexec_32.c b/arch/x86/kernel/machine_kexec_32.c index 8459ca64bc2f..11b935f4f886 100644 --- a/arch/x86/kernel/machine_kexec_32.c +++ b/arch/x86/kernel/machine_kexec_32.c | |||
@@ -149,28 +149,6 @@ NORET_TYPE void machine_kexec(struct kimage *image) | |||
149 | image->start, cpu_has_pae); | 149 | image->start, cpu_has_pae); |
150 | } | 150 | } |
151 | 151 | ||
152 | /* crashkernel=size@addr specifies the location to reserve for | ||
153 | * a crash kernel. By reserving this memory we guarantee | ||
154 | * that linux never sets it up as a DMA target. | ||
155 | * Useful for holding code to do something appropriate | ||
156 | * after a kernel panic. | ||
157 | */ | ||
158 | static int __init parse_crashkernel(char *arg) | ||
159 | { | ||
160 | unsigned long size, base; | ||
161 | size = memparse(arg, &arg); | ||
162 | if (*arg == '@') { | ||
163 | base = memparse(arg+1, &arg); | ||
164 | /* FIXME: Do I want a sanity check | ||
165 | * to validate the memory range? | ||
166 | */ | ||
167 | crashk_res.start = base; | ||
168 | crashk_res.end = base + size - 1; | ||
169 | } | ||
170 | return 0; | ||
171 | } | ||
172 | early_param("crashkernel", parse_crashkernel); | ||
173 | |||
174 | void arch_crash_save_vmcoreinfo(void) | 152 | void arch_crash_save_vmcoreinfo(void) |
175 | { | 153 | { |
176 | #ifdef CONFIG_ARCH_DISCONTIGMEM_ENABLE | 154 | #ifdef CONFIG_ARCH_DISCONTIGMEM_ENABLE |
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index 7450b69710b5..0d8577f05422 100644 --- a/arch/x86/kernel/machine_kexec_64.c +++ b/arch/x86/kernel/machine_kexec_64.c | |||
@@ -231,33 +231,6 @@ NORET_TYPE void machine_kexec(struct kimage *image) | |||
231 | image->start); | 231 | image->start); |
232 | } | 232 | } |
233 | 233 | ||
234 | /* crashkernel=size@addr specifies the location to reserve for | ||
235 | * a crash kernel. By reserving this memory we guarantee | ||
236 | * that linux never set's it up as a DMA target. | ||
237 | * Useful for holding code to do something appropriate | ||
238 | * after a kernel panic. | ||
239 | */ | ||
240 | static int __init setup_crashkernel(char *arg) | ||
241 | { | ||
242 | unsigned long size, base; | ||
243 | char *p; | ||
244 | if (!arg) | ||
245 | return -EINVAL; | ||
246 | size = memparse(arg, &p); | ||
247 | if (arg == p) | ||
248 | return -EINVAL; | ||
249 | if (*p == '@') { | ||
250 | base = memparse(p+1, &p); | ||
251 | /* FIXME: Do I want a sanity check to validate the | ||
252 | * memory range? Yes you do, but it's too early for | ||
253 | * e820 -AK */ | ||
254 | crashk_res.start = base; | ||
255 | crashk_res.end = base + size - 1; | ||
256 | } | ||
257 | return 0; | ||
258 | } | ||
259 | early_param("crashkernel", setup_crashkernel); | ||
260 | |||
261 | void arch_crash_save_vmcoreinfo(void) | 234 | void arch_crash_save_vmcoreinfo(void) |
262 | { | 235 | { |
263 | #ifdef CONFIG_ARCH_DISCONTIGMEM_ENABLE | 236 | #ifdef CONFIG_ARCH_DISCONTIGMEM_ENABLE |
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index 097aeafce5ff..044a47745a5c 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c | |||
@@ -301,7 +301,7 @@ void show_regs(struct pt_regs * regs) | |||
301 | unsigned long d0, d1, d2, d3, d6, d7; | 301 | unsigned long d0, d1, d2, d3, d6, d7; |
302 | 302 | ||
303 | printk("\n"); | 303 | printk("\n"); |
304 | printk("Pid: %d, comm: %20s\n", current->pid, current->comm); | 304 | printk("Pid: %d, comm: %20s\n", task_pid_nr(current), current->comm); |
305 | printk("EIP: %04x:[<%08lx>] CPU: %d\n",0xffff & regs->xcs,regs->eip, smp_processor_id()); | 305 | printk("EIP: %04x:[<%08lx>] CPU: %d\n",0xffff & regs->xcs,regs->eip, smp_processor_id()); |
306 | print_symbol("EIP is at %s\n", regs->eip); | 306 | print_symbol("EIP is at %s\n", regs->eip); |
307 | 307 | ||
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c index b87a6fd5ba48..978dc0196a0f 100644 --- a/arch/x86/kernel/setup_32.c +++ b/arch/x86/kernel/setup_32.c | |||
@@ -378,6 +378,49 @@ extern unsigned long __init setup_memory(void); | |||
378 | extern void zone_sizes_init(void); | 378 | extern void zone_sizes_init(void); |
379 | #endif /* !CONFIG_NEED_MULTIPLE_NODES */ | 379 | #endif /* !CONFIG_NEED_MULTIPLE_NODES */ |
380 | 380 | ||
381 | static inline unsigned long long get_total_mem(void) | ||
382 | { | ||
383 | unsigned long long total; | ||
384 | |||
385 | total = max_low_pfn - min_low_pfn; | ||
386 | #ifdef CONFIG_HIGHMEM | ||
387 | total += highend_pfn - highstart_pfn; | ||
388 | #endif | ||
389 | |||
390 | return total << PAGE_SHIFT; | ||
391 | } | ||
392 | |||
393 | #ifdef CONFIG_KEXEC | ||
394 | static void __init reserve_crashkernel(void) | ||
395 | { | ||
396 | unsigned long long total_mem; | ||
397 | unsigned long long crash_size, crash_base; | ||
398 | int ret; | ||
399 | |||
400 | total_mem = get_total_mem(); | ||
401 | |||
402 | ret = parse_crashkernel(boot_command_line, total_mem, | ||
403 | &crash_size, &crash_base); | ||
404 | if (ret == 0 && crash_size > 0) { | ||
405 | if (crash_base > 0) { | ||
406 | printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " | ||
407 | "for crashkernel (System RAM: %ldMB)\n", | ||
408 | (unsigned long)(crash_size >> 20), | ||
409 | (unsigned long)(crash_base >> 20), | ||
410 | (unsigned long)(total_mem >> 20)); | ||
411 | crashk_res.start = crash_base; | ||
412 | crashk_res.end = crash_base + crash_size - 1; | ||
413 | reserve_bootmem(crash_base, crash_size); | ||
414 | } else | ||
415 | printk(KERN_INFO "crashkernel reservation failed - " | ||
416 | "you have to specify a base address\n"); | ||
417 | } | ||
418 | } | ||
419 | #else | ||
420 | static inline void __init reserve_crashkernel(void) | ||
421 | {} | ||
422 | #endif | ||
423 | |||
381 | void __init setup_bootmem_allocator(void) | 424 | void __init setup_bootmem_allocator(void) |
382 | { | 425 | { |
383 | unsigned long bootmap_size; | 426 | unsigned long bootmap_size; |
@@ -453,11 +496,7 @@ void __init setup_bootmem_allocator(void) | |||
453 | } | 496 | } |
454 | } | 497 | } |
455 | #endif | 498 | #endif |
456 | #ifdef CONFIG_KEXEC | 499 | reserve_crashkernel(); |
457 | if (crashk_res.start != crashk_res.end) | ||
458 | reserve_bootmem(crashk_res.start, | ||
459 | crashk_res.end - crashk_res.start + 1); | ||
460 | #endif | ||
461 | } | 500 | } |
462 | 501 | ||
463 | /* | 502 | /* |
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c index 5a19f0cc5b67..cdcba6975226 100644 --- a/arch/x86/kernel/setup_64.c +++ b/arch/x86/kernel/setup_64.c | |||
@@ -191,6 +191,37 @@ static inline void copy_edd(void) | |||
191 | } | 191 | } |
192 | #endif | 192 | #endif |
193 | 193 | ||
194 | #ifdef CONFIG_KEXEC | ||
195 | static void __init reserve_crashkernel(void) | ||
196 | { | ||
197 | unsigned long long free_mem; | ||
198 | unsigned long long crash_size, crash_base; | ||
199 | int ret; | ||
200 | |||
201 | free_mem = ((unsigned long long)max_low_pfn - min_low_pfn) << PAGE_SHIFT; | ||
202 | |||
203 | ret = parse_crashkernel(boot_command_line, free_mem, | ||
204 | &crash_size, &crash_base); | ||
205 | if (ret == 0 && crash_size) { | ||
206 | if (crash_base > 0) { | ||
207 | printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " | ||
208 | "for crashkernel (System RAM: %ldMB)\n", | ||
209 | (unsigned long)(crash_size >> 20), | ||
210 | (unsigned long)(crash_base >> 20), | ||
211 | (unsigned long)(free_mem >> 20)); | ||
212 | crashk_res.start = crash_base; | ||
213 | crashk_res.end = crash_base + crash_size - 1; | ||
214 | reserve_bootmem(crash_base, crash_size); | ||
215 | } else | ||
216 | printk(KERN_INFO "crashkernel reservation failed - " | ||
217 | "you have to specify a base address\n"); | ||
218 | } | ||
219 | } | ||
220 | #else | ||
221 | static inline void __init reserve_crashkernel(void) | ||
222 | {} | ||
223 | #endif | ||
224 | |||
194 | #define EBDA_ADDR_POINTER 0x40E | 225 | #define EBDA_ADDR_POINTER 0x40E |
195 | 226 | ||
196 | unsigned __initdata ebda_addr; | 227 | unsigned __initdata ebda_addr; |
@@ -357,13 +388,7 @@ void __init setup_arch(char **cmdline_p) | |||
357 | } | 388 | } |
358 | } | 389 | } |
359 | #endif | 390 | #endif |
360 | #ifdef CONFIG_KEXEC | 391 | reserve_crashkernel(); |
361 | if (crashk_res.start != crashk_res.end) { | ||
362 | reserve_bootmem_generic(crashk_res.start, | ||
363 | crashk_res.end - crashk_res.start + 1); | ||
364 | } | ||
365 | #endif | ||
366 | |||
367 | paging_init(); | 392 | paging_init(); |
368 | 393 | ||
369 | #ifdef CONFIG_PCI | 394 | #ifdef CONFIG_PCI |
diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c index 0d79df3c5631..6dc394b87255 100644 --- a/arch/x86/kernel/signal_32.c +++ b/arch/x86/kernel/signal_32.c | |||
@@ -200,8 +200,8 @@ badframe: | |||
200 | if (show_unhandled_signals && printk_ratelimit()) | 200 | if (show_unhandled_signals && printk_ratelimit()) |
201 | printk("%s%s[%d] bad frame in sigreturn frame:%p eip:%lx" | 201 | printk("%s%s[%d] bad frame in sigreturn frame:%p eip:%lx" |
202 | " esp:%lx oeax:%lx\n", | 202 | " esp:%lx oeax:%lx\n", |
203 | current->pid > 1 ? KERN_INFO : KERN_EMERG, | 203 | task_pid_nr(current) > 1 ? KERN_INFO : KERN_EMERG, |
204 | current->comm, current->pid, frame, regs->eip, | 204 | current->comm, task_pid_nr(current), frame, regs->eip, |
205 | regs->esp, regs->orig_eax); | 205 | regs->esp, regs->orig_eax); |
206 | 206 | ||
207 | force_sig(SIGSEGV, current); | 207 | force_sig(SIGSEGV, current); |
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c index b132d3957dfc..1e9d57256eb1 100644 --- a/arch/x86/kernel/traps_32.c +++ b/arch/x86/kernel/traps_32.c | |||
@@ -316,7 +316,7 @@ void show_registers(struct pt_regs *regs) | |||
316 | printk(KERN_EMERG "ds: %04x es: %04x fs: %04x gs: %04x ss: %04x\n", | 316 | printk(KERN_EMERG "ds: %04x es: %04x fs: %04x gs: %04x ss: %04x\n", |
317 | regs->xds & 0xffff, regs->xes & 0xffff, regs->xfs & 0xffff, gs, ss); | 317 | regs->xds & 0xffff, regs->xes & 0xffff, regs->xfs & 0xffff, gs, ss); |
318 | printk(KERN_EMERG "Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)", | 318 | printk(KERN_EMERG "Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)", |
319 | TASK_COMM_LEN, current->comm, current->pid, | 319 | TASK_COMM_LEN, current->comm, task_pid_nr(current), |
320 | current_thread_info(), current, task_thread_info(current)); | 320 | current_thread_info(), current, task_thread_info(current)); |
321 | /* | 321 | /* |
322 | * When in-kernel, we also print out the stack and code at the | 322 | * When in-kernel, we also print out the stack and code at the |
@@ -622,7 +622,7 @@ fastcall void __kprobes do_general_protection(struct pt_regs * regs, | |||
622 | printk_ratelimit()) | 622 | printk_ratelimit()) |
623 | printk(KERN_INFO | 623 | printk(KERN_INFO |
624 | "%s[%d] general protection eip:%lx esp:%lx error:%lx\n", | 624 | "%s[%d] general protection eip:%lx esp:%lx error:%lx\n", |
625 | current->comm, current->pid, | 625 | current->comm, task_pid_nr(current), |
626 | regs->eip, regs->esp, error_code); | 626 | regs->eip, regs->esp, error_code); |
627 | 627 | ||
628 | force_sig(SIGSEGV, current); | 628 | force_sig(SIGSEGV, current); |