From: Robert Reif <reif@earthlink.net>
To: sparclinux@vger.kernel.org
Subject: Re: Re. [SPARC32]: Fix bogus ramdisk image location check.
Date: Tue, 21 Aug 2007 23:32:05 +0000 [thread overview]
Message-ID: <46CB75F5.5090401@earthlink.net> (raw)
In-Reply-To: <46CA19DE.3000108@earthlink.net>
[-- 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",
next prev parent reply other threads:[~2007-08-21 23:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2007-08-27 14:26 ` Mark Fortescue
2007-08-29 23:14 ` Robert Reif
2007-08-30 13:32 ` Mark Fortescue
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46CB75F5.5090401@earthlink.net \
--to=reif@earthlink.net \
--cc=sparclinux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.