Hi Geert,

Sorry for the delay, I've been mostly offline during last weeks.

On Thu, Jun 20, 2019 at 06:46:28PM +0200, Geert Uytterhoeven wrote:
> Hi Mike,
> 
> On Wed, Jun 19, 2019 at 4:18 PM Mike Rapoport <[email protected]> wrote:
> > On Wed, Jun 19, 2019 at 09:39:40AM +0200, Geert Uytterhoeven wrote:
> > > On Wed, Jun 19, 2019 at 9:06 AM Geert Uytterhoeven <[email protected]> 
> > > wrote:
> > > > On Tue, Jun 18, 2019 at 8:10 AM Mike Rapoport <[email protected]> 
> > > > wrote:
> 
> Thanks, that hack did fix CONFIG_SINGLE_MEMORY_CHUNK=y.
> 
> Back to sparsemem...
> 
> With CONFIG_SINGLE_MEMORY_CHUNK=n, and CONFIG_SPARSEMEM=y,
> it also fails.  Diff between working single memory chunk and failing
> sparsemem:
> 
>    -Memory: 7796K/12288K available (2555K kernel code, 259K rwdata,
> 700K rodata, 136K init, 153K bss, 4492K reserved, 0K cma-reserved)
>    +Memory: 7816K/131072K available (2556K kernel code, 261K rwdata,
> 700K rodata, 136K init, 157K bss, 123256K reserved, 0K cma-reserved)
> 
> Oops, looks like it thinks there's memory from 0x00000000-0x08000000,
> instead of 0x07400000-0x08000000.

Yeah, I've made a mistake in the zone/hole size calculations as it seems.

Can you try this:

diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
index 87d09942be5c..bf438a0da173 100644
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -229,10 +229,8 @@ static void m68k_free_area_init(unsigned long max_addr)
        memblock_set_bottom_up(true);
 
        zones_size[ZONE_DMA] = max_addr >> PAGE_SHIFT;
-       if (m68k_num_memory > 1) {
-               holes_size = max_addr - memblock_phys_mem_size();
-               zholes_size[ZONE_DMA] = holes_size >> PAGE_SHIFT;
-       }
+       holes_size = max_addr - memblock_phys_mem_size();
+       zholes_size[ZONE_DMA] =  >> PAGE_SHIFT;
 
        free_area_init_node(0, zones_size,
                            m68k_memory[0].addr >> PAGE_SHIFT, zholes_size);
 
> And of course it crashes later:
> 
>     Trying to unpack rootfs image as initramfs...
>     rootfs image is not initramfs (no cpio magic); looks like an initrd
>     Unable to handle kernel access at virtual address (ptrval)
> 
> Full log with more debugging attached.
> 
> Thanks for your comments!
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- 
> [email protected]
> 
> 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



-- 
Sincerely yours,
Mike.

Reply via email to