aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2005-06-25 17:57:52 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-25 19:24:48 -0400
commitd0537508a9921efced238b20967e50e519ac34af (patch)
tree80f2743e9299da07c07625af45807e16a7d7f85a /arch
parent8a9190853c34289d9181acd9c620c76143bf88ca (diff)
[PATCH] kexec: x86_64: add CONFIG_PHYSICAL_START
For one kernel to report a crash another kernel has created we need to have 2 kernels loaded simultaneously in memory. To accomplish this the two kernels need to built to run at different physical addresses. This patch adds the CONFIG_PHYSICAL_START option to the x86_64 kernel so we can do just that. You need to know what you are doing and the ramifications are before changing this value, and most users won't care so I have made it depend on CONFIG_EMBEDDED bzImage kernels will work and run at a different address when compiled with this option but they will still load at 1MB. If you need a kernel loaded at a different address as well you need to boot a vmlinux. Signed-off-by: Eric Biederman <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86_64/Kconfig11
-rw-r--r--arch/x86_64/boot/compressed/head.S7
-rw-r--r--arch/x86_64/boot/compressed/misc.c7
-rw-r--r--arch/x86_64/kernel/head.S18
4 files changed, 28 insertions, 15 deletions
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index a853d87ff7e3..56c02cf6397d 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -369,6 +369,17 @@ config X86_MCE_INTEL
369 Additional support for intel specific MCE features such as 369 Additional support for intel specific MCE features such as
370 the thermal monitor. 370 the thermal monitor.
371 371
372config PHYSICAL_START
373 hex "Physical address where the kernel is loaded" if EMBEDDED
374 default "0x100000"
375 help
376 This gives the physical address where the kernel is loaded.
377 Primarily used in the case of kexec on panic where the
378 fail safe kernel needs to run at a different address than
379 the panic-ed kernel.
380
381 Don't change this unless you know what you are doing.
382
372config SECCOMP 383config SECCOMP
373 bool "Enable seccomp to safely compute untrusted bytecode" 384 bool "Enable seccomp to safely compute untrusted bytecode"
374 depends on PROC_FS 385 depends on PROC_FS
diff --git a/arch/x86_64/boot/compressed/head.S b/arch/x86_64/boot/compressed/head.S
index 27264dbd575c..b0df2aeff5dc 100644
--- a/arch/x86_64/boot/compressed/head.S
+++ b/arch/x86_64/boot/compressed/head.S
@@ -28,6 +28,7 @@
28 28
29#include <linux/linkage.h> 29#include <linux/linkage.h>
30#include <asm/segment.h> 30#include <asm/segment.h>
31#include <asm/page.h>
31 32
32 .code32 33 .code32
33 .globl startup_32 34 .globl startup_32
@@ -77,7 +78,7 @@ startup_32:
77 jnz 3f 78 jnz 3f
78 addl $8,%esp 79 addl $8,%esp
79 xorl %ebx,%ebx 80 xorl %ebx,%ebx
80 ljmp $(__KERNEL_CS), $0x100000 81 ljmp $(__KERNEL_CS), $__PHYSICAL_START
81 82
82/* 83/*
83 * We come here, if we were loaded high. 84 * We come here, if we were loaded high.
@@ -103,7 +104,7 @@ startup_32:
103 popl %ecx # lcount 104 popl %ecx # lcount
104 popl %edx # high_buffer_start 105 popl %edx # high_buffer_start
105 popl %eax # hcount 106 popl %eax # hcount
106 movl $0x100000,%edi 107 movl $__PHYSICAL_START,%edi
107 cli # make sure we don't get interrupted 108 cli # make sure we don't get interrupted
108 ljmp $(__KERNEL_CS), $0x1000 # and jump to the move routine 109 ljmp $(__KERNEL_CS), $0x1000 # and jump to the move routine
109 110
@@ -128,7 +129,7 @@ move_routine_start:
128 movsl 129 movsl
129 movl %ebx,%esi # Restore setup pointer 130 movl %ebx,%esi # Restore setup pointer
130 xorl %ebx,%ebx 131 xorl %ebx,%ebx
131 ljmp $(__KERNEL_CS), $0x100000 132 ljmp $(__KERNEL_CS), $__PHYSICAL_START
132move_routine_end: 133move_routine_end:
133 134
134 135
diff --git a/arch/x86_64/boot/compressed/misc.c b/arch/x86_64/boot/compressed/misc.c
index c8b9216f9e63..c43cedb5c1d7 100644
--- a/arch/x86_64/boot/compressed/misc.c
+++ b/arch/x86_64/boot/compressed/misc.c
@@ -11,6 +11,7 @@
11 11
12#include "miscsetup.h" 12#include "miscsetup.h"
13#include <asm/io.h> 13#include <asm/io.h>
14#include <asm/page.h>
14 15
15/* 16/*
16 * gzip declarations 17 * gzip declarations
@@ -284,7 +285,7 @@ void setup_normal_output_buffer(void)
284#else 285#else
285 if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < 1024) error("Less than 2MB of memory"); 286 if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < 1024) error("Less than 2MB of memory");
286#endif 287#endif
287 output_data = (char *)0x100000; /* Points to 1M */ 288 output_data = (char *)__PHYSICAL_START; /* Normally Points to 1M */
288 free_mem_end_ptr = (long)real_mode; 289 free_mem_end_ptr = (long)real_mode;
289} 290}
290 291
@@ -307,8 +308,8 @@ void setup_output_buffer_if_we_run_high(struct moveparams *mv)
307 low_buffer_size = low_buffer_end - LOW_BUFFER_START; 308 low_buffer_size = low_buffer_end - LOW_BUFFER_START;
308 high_loaded = 1; 309 high_loaded = 1;
309 free_mem_end_ptr = (long)high_buffer_start; 310 free_mem_end_ptr = (long)high_buffer_start;
310 if ( (0x100000 + low_buffer_size) > ((ulg)high_buffer_start)) { 311 if ( (__PHYSICAL_START + low_buffer_size) > ((ulg)high_buffer_start)) {
311 high_buffer_start = (uch *)(0x100000 + low_buffer_size); 312 high_buffer_start = (uch *)(__PHYSICAL_START + low_buffer_size);
312 mv->hcount = 0; /* say: we need not to move high_buffer */ 313 mv->hcount = 0; /* say: we need not to move high_buffer */
313 } 314 }
314 else mv->hcount = -1; 315 else mv->hcount = -1;
diff --git a/arch/x86_64/kernel/head.S b/arch/x86_64/kernel/head.S
index 9bd2e7a4b81e..8d765aa77a26 100644
--- a/arch/x86_64/kernel/head.S
+++ b/arch/x86_64/kernel/head.S
@@ -248,23 +248,23 @@ ENTRY(_stext)
248 */ 248 */
249.org 0x1000 249.org 0x1000
250ENTRY(init_level4_pgt) 250ENTRY(init_level4_pgt)
251 .quad 0x0000000000102007 /* -> level3_ident_pgt */ 251 .quad 0x0000000000002007 + __PHYSICAL_START /* -> level3_ident_pgt */
252 .fill 255,8,0 252 .fill 255,8,0
253 .quad 0x000000000010a007 253 .quad 0x000000000000a007 + __PHYSICAL_START
254 .fill 254,8,0 254 .fill 254,8,0
255 /* (2^48-(2*1024*1024*1024))/(2^39) = 511 */ 255 /* (2^48-(2*1024*1024*1024))/(2^39) = 511 */
256 .quad 0x0000000000103007 /* -> level3_kernel_pgt */ 256 .quad 0x0000000000003007 + __PHYSICAL_START /* -> level3_kernel_pgt */
257 257
258.org 0x2000 258.org 0x2000
259ENTRY(level3_ident_pgt) 259ENTRY(level3_ident_pgt)
260 .quad 0x0000000000104007 260 .quad 0x0000000000004007 + __PHYSICAL_START
261 .fill 511,8,0 261 .fill 511,8,0
262 262
263.org 0x3000 263.org 0x3000
264ENTRY(level3_kernel_pgt) 264ENTRY(level3_kernel_pgt)
265 .fill 510,8,0 265 .fill 510,8,0
266 /* (2^48-(2*1024*1024*1024)-((2^39)*511))/(2^30) = 510 */ 266 /* (2^48-(2*1024*1024*1024)-((2^39)*511))/(2^30) = 510 */
267 .quad 0x0000000000105007 /* -> level2_kernel_pgt */ 267 .quad 0x0000000000005007 + __PHYSICAL_START /* -> level2_kernel_pgt */
268 .fill 1,8,0 268 .fill 1,8,0
269 269
270.org 0x4000 270.org 0x4000
@@ -337,17 +337,17 @@ ENTRY(empty_bad_pmd_table)
337 337
338.org 0xa000 338.org 0xa000
339ENTRY(level3_physmem_pgt) 339ENTRY(level3_physmem_pgt)
340 .quad 0x0000000000105007 /* -> level2_kernel_pgt (so that __va works even before pagetable_init) */ 340 .quad 0x0000000000005007 + __PHYSICAL_START /* -> level2_kernel_pgt (so that __va works even before pagetable_init) */
341 341
342 .org 0xb000 342 .org 0xb000
343#ifdef CONFIG_ACPI_SLEEP 343#ifdef CONFIG_ACPI_SLEEP
344ENTRY(wakeup_level4_pgt) 344ENTRY(wakeup_level4_pgt)
345 .quad 0x0000000000102007 /* -> level3_ident_pgt */ 345 .quad 0x0000000000002007 + __PHYSICAL_START /* -> level3_ident_pgt */
346 .fill 255,8,0 346 .fill 255,8,0
347 .quad 0x000000000010a007 347 .quad 0x000000000000a007 + __PHYSICAL_START
348 .fill 254,8,0 348 .fill 254,8,0
349 /* (2^48-(2*1024*1024*1024))/(2^39) = 511 */ 349 /* (2^48-(2*1024*1024*1024))/(2^39) = 511 */
350 .quad 0x0000000000103007 /* -> level3_kernel_pgt */ 350 .quad 0x0000000000003007 + __PHYSICAL_START /* -> level3_kernel_pgt */
351#endif 351#endif
352 352
353 .data 353 .data