All of lore.kernel.org
 help / color / mirror / Atom feed
* Re. [SPARC32]: Fix bogus ramdisk image location check.
@ 2007-08-20 22:46 Robert Reif
  2007-08-20 22:51 ` David Miller
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Robert Reif @ 2007-08-20 22:46 UTC (permalink / raw)
  To: sparclinux

commit    f642b263800e6e57c377d630be6d2a999683b579

This patch causes sparc32 SMP to watchdog fail on boot.

Reverting it lets the system boot.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Re. [SPARC32]: Fix bogus ramdisk image location check.
  2007-08-20 22:46 Re. [SPARC32]: Fix bogus ramdisk image location check Robert Reif
@ 2007-08-20 22:51 ` David Miller
  2007-08-21 10:23 ` mark
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2007-08-20 22:51 UTC (permalink / raw)
  To: sparclinux

From: Robert Reif <reif@earthlink.net>
Date: Mon, 20 Aug 2007 18:46:54 -0400

> commit    f642b263800e6e57c377d630be6d2a999683b579
> 
> This patch causes sparc32 SMP to watchdog fail on boot.
> 
> Reverting it lets the system boot.

Thanks I'll revert this.

Mark, please work with Robert to figure out what we should
do about this if you want to try and make this change again.

I think this shows that SILO can in fact provide ramdisk addresses
which should not be normalized by KERNBASE in the kernel.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Re. [SPARC32]: Fix bogus ramdisk image location check.
  2007-08-20 22:46 Re. [SPARC32]: Fix bogus ramdisk image location check Robert Reif
  2007-08-20 22:51 ` David Miller
@ 2007-08-21 10:23 ` mark
  2007-08-21 23:32 ` Robert Reif
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mark @ 2007-08-21 10:23 UTC (permalink / raw)
  To: sparclinux

Hi Robert,

Can you put some prom_printf's or printk's in to find out where your initrd ramdisk is ending up. 

The code relies on ordering/alignment in the linker script which is not a good idear so the aim needs to be to create some code that correctly identifies the location of the ramdisk without using hard coded offsets based on '&end' and 2*4096 :). I will have another look at the code later on this week and see if I can work out somthing that does the same thing but with more flexibility in what can be done to the linker script (i.e. does not rely on specific alignments and ordering in the linker script).

The information about where the ramdisk is may present a simple solution.

Regards
    Mark Fortescue.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Re. [SPARC32]: Fix bogus ramdisk image location check.
  2007-08-20 22:46 Re. [SPARC32]: Fix bogus ramdisk image location check Robert Reif
  2007-08-20 22:51 ` David Miller
  2007-08-21 10:23 ` mark
@ 2007-08-21 23:32 ` Robert Reif
  2007-08-27 14:26 ` Mark Fortescue
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Robert Reif @ 2007-08-21 23:32 UTC (permalink / raw)
  To: sparclinux

[-- Attachment #1: Type: text/plain, Size: 959 bytes --]

mark@mtfhpc.demon.co.uk wrote:

>Hi Robert,
>
>Can you put some prom_printf's or printk's in to find out where your initrd ramdisk is ending up. 
>
>The code relies on ordering/alignment in the linker script which is not a good idear so the aim needs to be to create some code that correctly identifies the location of the ramdisk without using hard coded offsets based on '&end' and 2*4096 :). I will have another look at the code later on this week and see if I can work out somthing that does the same thing but with more flexibility in what can be done to the linker script (i.e. does not rely on specific alignments and ordering in the linker script).
>
>The information about where the ramdisk is may present a simple solution.
>
>Regards
>    Mark Fortescue.
>
>
>  
>
The following patch gives these numbers:

sparc_ramdisk_image = 3000000, &_end = f028bde0, phys_base = 0, 
sparc_ramdisk_size = 3064303
initrd_start = 3000000, initrd_end = 32ec1ef



[-- Attachment #2: init.diff.txt --]
[-- Type: text/plain, Size: 920 bytes --]

--- a/arch/sparc/mm/init.c
+++ b/arch/sparc/mm/init.c
@@ -206,9 +206,13 @@ unsigned long __init bootmem_init(unsigned long *pages_avail)
 #ifdef CONFIG_BLK_DEV_INITRD
 	/* Now have to check initial ramdisk, so that bootmap does not overwrite it */
 	if (sparc_ramdisk_image) {
-		sparc_ramdisk_image -= KERNBASE;
+printk("sparc_ramdisk_image = %x, &_end = %p, phys_base = %lx, sparc_ramdisk_size = %u\n", 
+sparc_ramdisk_image, &_end, phys_base, sparc_ramdisk_size);
+		if (sparc_ramdisk_image >= (unsigned long)&_end - 2 * PAGE_SIZE)
+			sparc_ramdisk_image -= KERNBASE;
 		initrd_start = sparc_ramdisk_image + phys_base;
 		initrd_end = initrd_start + sparc_ramdisk_size;
+printk("initrd_start = %lx, initrd_end = %lx\n", initrd_start, initrd_end);
 		if (initrd_end > end_of_phys_memory) {
 			printk(KERN_CRIT "initrd extends beyond end of memory "
 		                 	 "(0x%016lx > 0x%016lx)\ndisabling initrd\n",

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Re. [SPARC32]: Fix bogus ramdisk image location check.
  2007-08-20 22:46 Re. [SPARC32]: Fix bogus ramdisk image location check Robert Reif
                   ` (2 preceding siblings ...)
  2007-08-21 23:32 ` Robert Reif
@ 2007-08-27 14:26 ` Mark Fortescue
  2007-08-29 23:14 ` Robert Reif
  2007-08-30 13:32 ` Mark Fortescue
  5 siblings, 0 replies; 7+ messages in thread
From: Mark Fortescue @ 2007-08-27 14:26 UTC (permalink / raw)
  To: sparclinux

[-- Attachment #1: Type: TEXT/PLAIN, Size: 799 bytes --]

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;


[-- Attachment #2: Type: TEXT/PLAIN, Size: 1254 bytes --]

From: Mark Fortescue <mark@mtfhpc.demon.co.uk>

[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@mtfhpc.demon.co.uk>
---
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;

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Re. [SPARC32]: Fix bogus ramdisk image location check.
  2007-08-20 22:46 Re. [SPARC32]: Fix bogus ramdisk image location check Robert Reif
                   ` (3 preceding siblings ...)
  2007-08-27 14:26 ` Mark Fortescue
@ 2007-08-29 23:14 ` Robert Reif
  2007-08-30 13:32 ` Mark Fortescue
  5 siblings, 0 replies; 7+ messages in thread
From: Robert Reif @ 2007-08-29 23:14 UTC (permalink / raw)
  To: sparclinux

Mark Fortescue wrote:

> 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.

Works with current git SMP.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Re. [SPARC32]: Fix bogus ramdisk image location check.
  2007-08-20 22:46 Re. [SPARC32]: Fix bogus ramdisk image location check Robert Reif
                   ` (4 preceding siblings ...)
  2007-08-29 23:14 ` Robert Reif
@ 2007-08-30 13:32 ` Mark Fortescue
  5 siblings, 0 replies; 7+ messages in thread
From: Mark Fortescue @ 2007-08-30 13:32 UTC (permalink / raw)
  To: sparclinux

>> 
>> I beleive that the attached+inserted patch should have the desired 
>> characteristics. Can you check it out to ensure it does nothing silly.
>
> Works with current git SMP.
>
Thanks for testing.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-08-30 13:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-20 22:46 Re. [SPARC32]: Fix bogus ramdisk image location check Robert Reif
2007-08-20 22:51 ` David Miller
2007-08-21 10:23 ` mark
2007-08-21 23:32 ` Robert Reif
2007-08-27 14:26 ` Mark Fortescue
2007-08-29 23:14 ` Robert Reif
2007-08-30 13:32 ` Mark Fortescue

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.