[PATCH/RFC] Revive initrd

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

 



On recent kernels, I get the following error when using an initrd:

| initrd overwritten (0x00b78000 < 0x07668000) - disabling it.

My A4000 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 configuration, which fails.

Correct this by subtracting `min_addr' from `availmem' before calculating
its PFN.

Before the introduction of discontiguous memory support
(12d810c1b8c2b913d48e629e2b5c01d105029839), m{in,ax}_low_pfn where just left
untouched by the m68k-specific code, and everything worked fine.

BTW, nothing seems to actually use min_low_pfn, except for the initrd overwrite
test in init/main.c.

Max_low_pfn is used by the block layer. Subtracting `min_addr' from `max_addr'
before calculating its PFN will cause a crash in the block layer later.
This makes me think something else is wrong.

Or are we just (again) the only platform where (a) physical memory doesn't
start at zero and (b) we want to use initrd?
---
 arch/m68k/mm/motorola.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -248,7 +248,7 @@ void __init paging_init(void)
 
 	high_memory = phys_to_virt(max_addr);
 
-	min_low_pfn = availmem >> PAGE_SHIFT;
+	min_low_pfn = (availmem - min_addr) >> PAGE_SHIFT;
 	max_low_pfn = max_addr >> PAGE_SHIFT;
 
 	for (i = 0; i < m68k_num_memory; i++) {

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
-
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux