diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2008-07-17 15:16:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-20 20:24:40 -0400 |
commit | fb6624ebd912e3d6907ca6490248e73368223da9 (patch) | |
tree | 5b65886c761a444fe115e96d7db04fd611816477 /init/main.c | |
parent | 18c993629a5a5938a032f04a698d15122550593d (diff) |
initrd: Fix virtual/physical mix-up in overwrite test
On recent kernels, I get the following error when using an initrd:
| initrd overwritten (0x00b78000 < 0x07668000) - disabling it.
My Amiga 4000 has 12 MiB of RAM at physical address 0x07400000 (virtual
0x00000000).
The initrd is located at the end of RAM: 0x00b78000 - 0x00c00000 (virtual).
The overwrite test compares the (virtual) initrd location to the (physical)
first available memory location, which fails.
This patch converts initrd_start to a page frame number, so it can safely be
compared with min_low_pfn.
Before the introduction of discontiguous memory support on m68k
(12d810c1b8c2b913d48e629e2b5c01d105029839), min_low_pfn was just left
untouched by the m68k-specific code (zero, I guess), and everything worked
fine.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'init/main.c')
-rw-r--r-- | init/main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/init/main.c b/init/main.c index edeace036fd9..756eca4b821a 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -630,9 +630,10 @@ asmlinkage void __init start_kernel(void) | |||
630 | 630 | ||
631 | #ifdef CONFIG_BLK_DEV_INITRD | 631 | #ifdef CONFIG_BLK_DEV_INITRD |
632 | if (initrd_start && !initrd_below_start_ok && | 632 | if (initrd_start && !initrd_below_start_ok && |
633 | initrd_start < min_low_pfn << PAGE_SHIFT) { | 633 | page_to_pfn(virt_to_page(initrd_start)) < min_low_pfn) { |
634 | printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - " | 634 | printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - " |
635 | "disabling it.\n",initrd_start,min_low_pfn << PAGE_SHIFT); | 635 | "disabling it.\n", |
636 | page_to_pfn(virt_to_page(initrd_start)), min_low_pfn); | ||
636 | initrd_start = 0; | 637 | initrd_start = 0; |
637 | } | 638 | } |
638 | #endif | 639 | #endif |