aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-12 12:26:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-12 12:26:32 -0400
commitdb8e7f10ed67933ca272f4030eb7057b7f13de07 (patch)
tree0e0ef8b5fc4357fc91d34b75ee4603468439d348 /arch
parent8ebf975608aaebd7feb33d77f07ba21a6380e086 (diff)
parent1260866a271abc84274345580f3d613d3bceff87 (diff)
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: x86: Provide _sdata in the vmlinux.lds.S file x86: handle initrd that extends into unusable memory
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/setup.c15
-rw-r--r--arch/x86/kernel/vmlinux.lds.S2
2 files changed, 5 insertions, 12 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index d1c636bf31a7..be5ae80f897f 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -301,15 +301,13 @@ static void __init reserve_brk(void)
301 301
302#ifdef CONFIG_BLK_DEV_INITRD 302#ifdef CONFIG_BLK_DEV_INITRD
303 303
304#ifdef CONFIG_X86_32
305
306#define MAX_MAP_CHUNK (NR_FIX_BTMAPS << PAGE_SHIFT) 304#define MAX_MAP_CHUNK (NR_FIX_BTMAPS << PAGE_SHIFT)
307static void __init relocate_initrd(void) 305static void __init relocate_initrd(void)
308{ 306{
309 307
310 u64 ramdisk_image = boot_params.hdr.ramdisk_image; 308 u64 ramdisk_image = boot_params.hdr.ramdisk_image;
311 u64 ramdisk_size = boot_params.hdr.ramdisk_size; 309 u64 ramdisk_size = boot_params.hdr.ramdisk_size;
312 u64 end_of_lowmem = max_low_pfn << PAGE_SHIFT; 310 u64 end_of_lowmem = max_low_pfn_mapped << PAGE_SHIFT;
313 u64 ramdisk_here; 311 u64 ramdisk_here;
314 unsigned long slop, clen, mapaddr; 312 unsigned long slop, clen, mapaddr;
315 char *p, *q; 313 char *p, *q;
@@ -365,14 +363,13 @@ static void __init relocate_initrd(void)
365 ramdisk_image, ramdisk_image + ramdisk_size - 1, 363 ramdisk_image, ramdisk_image + ramdisk_size - 1,
366 ramdisk_here, ramdisk_here + ramdisk_size - 1); 364 ramdisk_here, ramdisk_here + ramdisk_size - 1);
367} 365}
368#endif
369 366
370static void __init reserve_initrd(void) 367static void __init reserve_initrd(void)
371{ 368{
372 u64 ramdisk_image = boot_params.hdr.ramdisk_image; 369 u64 ramdisk_image = boot_params.hdr.ramdisk_image;
373 u64 ramdisk_size = boot_params.hdr.ramdisk_size; 370 u64 ramdisk_size = boot_params.hdr.ramdisk_size;
374 u64 ramdisk_end = ramdisk_image + ramdisk_size; 371 u64 ramdisk_end = ramdisk_image + ramdisk_size;
375 u64 end_of_lowmem = max_low_pfn << PAGE_SHIFT; 372 u64 end_of_lowmem = max_low_pfn_mapped << PAGE_SHIFT;
376 373
377 if (!boot_params.hdr.type_of_loader || 374 if (!boot_params.hdr.type_of_loader ||
378 !ramdisk_image || !ramdisk_size) 375 !ramdisk_image || !ramdisk_size)
@@ -402,14 +399,8 @@ static void __init reserve_initrd(void)
402 return; 399 return;
403 } 400 }
404 401
405#ifdef CONFIG_X86_32
406 relocate_initrd(); 402 relocate_initrd();
407#else 403
408 printk(KERN_ERR "initrd extends beyond end of memory "
409 "(0x%08llx > 0x%08llx)\ndisabling initrd\n",
410 ramdisk_end, end_of_lowmem);
411 initrd_start = 0;
412#endif
413 free_early(ramdisk_image, ramdisk_end); 404 free_early(ramdisk_image, ramdisk_end);
414} 405}
415#else 406#else
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 4c85b2e2bb65..367e87882041 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -108,6 +108,8 @@ SECTIONS
108 /* Data */ 108 /* Data */
109 . = ALIGN(PAGE_SIZE); 109 . = ALIGN(PAGE_SIZE);
110 .data : AT(ADDR(.data) - LOAD_OFFSET) { 110 .data : AT(ADDR(.data) - LOAD_OFFSET) {
111 /* Start of data section */
112 _sdata = .;
111 DATA_DATA 113 DATA_DATA
112 CONSTRUCTORS 114 CONSTRUCTORS
113 115