Re: Re. [SPARC32]: Fix bogus ramdisk image location check.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Robert,

I beleive that the attached+inserted patch should have the desired characteristics. Can you check it out to ensure it does nothing silly.

(This same check may also be valid for SPARC64)

--- linux-2.6/arch/sparc/mm/init.c	2007-08-14 23:24:41.000000000 +0100
+++ linux-mark/arch/sparc/mm/init.c	2007-08-27 13:09:21.000000000 +0100
@@ -206,7 +206,7 @@ unsigned long __init bootmem_init(unsign
 #ifdef CONFIG_BLK_DEV_INITRD
 	/* Now have to check initial ramdisk, so that bootmap does not overwrite it */
 	if (sparc_ramdisk_image) {
-		if (sparc_ramdisk_image >= (unsigned long)&_end - 2 * PAGE_SIZE)
+		if (sparc_ramdisk_image >= KERNBASE)
 			sparc_ramdisk_image -= KERNBASE;
 		initrd_start = sparc_ramdisk_image + phys_base;
 		initrd_end = initrd_start + sparc_ramdisk_size;

From: Mark Fortescue <mark@xxxxxxxxxxxxxxxxxx>

[SPARC32]: Fix bogus ramdisk image location check.

It was originally thought that sparc_ramdisk_image should always be decremented
by KERNBASE so the check could just be dropped, but it turns out that this is
not the case. Just checking if the image is greater than KERNBASE should be
sufficient to correctly identify if the correction is needed and avoids any
posible issues with changes to the linker script ordering that are present if
&end is used with a fixed 2 page offset.

Signed-off-by: Mark Fortescue <mark@xxxxxxxxxxxxxxxxxx>
---
This same check may also be valid for SPARC64

--- linux-2.6/arch/sparc/mm/init.c	2007-08-14 23:24:41.000000000 +0100
+++ linux-mark/arch/sparc/mm/init.c	2007-08-27 13:09:21.000000000 +0100
@@ -206,7 +206,7 @@ unsigned long __init bootmem_init(unsign
 #ifdef CONFIG_BLK_DEV_INITRD
 	/* Now have to check initial ramdisk, so that bootmap does not overwrite it */
 	if (sparc_ramdisk_image) {
-		if (sparc_ramdisk_image >= (unsigned long)&_end - 2 * PAGE_SIZE)
+		if (sparc_ramdisk_image >= KERNBASE)
 			sparc_ramdisk_image -= KERNBASE;
 		initrd_start = sparc_ramdisk_image + phys_base;
 		initrd_end = initrd_start + sparc_ramdisk_size;

[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux