All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Maxime Bizon <mbizon@freebox.fr>
Cc: "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: Fail to boot 5.15 on mpc8347 with either debug_pagealloc or nobats
Date: Sun, 5 Dec 2021 18:11:59 +0000	[thread overview]
Message-ID: <d39825e0-6b48-5ac1-662e-26186e730eaa@csgroup.eu> (raw)
In-Reply-To: <20211205164217.GA29658@sakura>



Le 05/12/2021 à 17:42, Maxime Bizon a écrit :
> 
> 
> On Saturday 04 Dec 2021 à 17:42:44 (+0000), Christophe Leroy wrote:
> 
>> I guess all the guard is in the comment ...
>>
>> /*
>>    * Set up one of the I/D BAT (block address translation) register pairs.
>>    * The parameters are not checked; in particular size must be a power
>>    * of 2 between 128k and 256M.
>>    */
> 
> It's missing the aligment rule you just taught me, but it's arguably
> not the right place to teach ppc 101.

Indeed

> 
>> Not sure it is that simple.
>>
>> I'm cooking a patch reusing the block_size() function in mm/book3s32/mmu.c
> 
> Indeed it will handle cases that need more than 2 BATs.

Yes, that's the idea.

> 
> Also when mem=2G, I have physical memory mapped twice:
> 
> CONFIG_PAGE_OFFSET=0x80000000
> CONFIG_LOWMEM_SIZE=0x60000000
> 
> 0: 0x80000000-0x8fffffff 0x00000000       256M Kernel rw      m
> 1: 0x90000000-0x9fffffff 0x10000000       256M Kernel rw      m
> 2: 0xa0000000-0xafffffff 0x20000000       256M Kernel rw      m
> 3: 0xb0000000-0xbfffffff 0x30000000       256M Kernel rw      m
> 4: 0xc0000000-0xcfffffff 0x40000000       256M Kernel rw      m
> 5: 0xd0000000-0xdfffffff 0x50000000       256M Kernel rw      m
> 6: 0xf0000000-0xf7ffffff 0x50000000       128M Kernel rw      m
> 
> BAT5 comes from __mmu_mapin_ram(), BAT6 from kasan init
> 
> Is BAT5 needed here ?

Sure it is, because that's were kernel expects lowmem to be mapped. 
Allthough the kernel will unlikely access the 128M reserved for KASAN 
directly, the other 128M are still needed.

> 
> 
> Last one, with KASAN and the following layout, I have an non working
> kernel with VMALLOC_START > VMALLOC_END:
> 
> mem=2G
> CONFIG_PAGE_OFFSET=0x80000000
> CONFIG_LOWMEM_SIZE=0x70000000
> 
> [    0.000000]   * 0xf0000000..0xfe000000  : kasan shadow mem
> [    0.000000]   * 0xef7ff000..0xeffff000  : fixmap
> [    0.000000]   * 0xf1000000..0xef7ff000  : vmalloc & ioremap
> 
> 
> IIUC the safeguard is here:
> 
> arch/powerpc/mm/init_32.c:
> /* The amount of lowmem must be within 0xF0000000 - KERNELBASE. */
> #if (CONFIG_LOWMEM_SIZE > (0xF0000000 - PAGE_OFFSET))
> #error "You must adjust CONFIG_LOWMEM_SIZE or CONFIG_KERNEL_START"
> 
> 
> but the definition needs to be adapted for KASAN=y and require 256
> more MB.
> 
> 

Hum.. Good point.

Christophe

  reply	other threads:[~2021-12-05 18:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <f23763d551e65d4a225ba13c7898f83853c2aeaf.camel@freebox.fr>
2021-12-03 12:49 ` Fail to boot 5.15 on mpc8347 with either debug_pagealloc or nobats Christophe Leroy
2021-12-03 18:43   ` Maxime Bizon
2021-12-04 10:01     ` Christophe Leroy
2021-12-04 14:10       ` Maxime Bizon
2021-12-04 17:42         ` Christophe Leroy
2021-12-05 16:42           ` Maxime Bizon
2021-12-05 18:11             ` Christophe Leroy [this message]
2021-12-05 21:44               ` Maxime Bizon
2021-12-06  7:03                 ` Christophe Leroy
2021-12-06  8:47                   ` Maxime Bizon
2021-12-06  9:07                     ` Christophe Leroy
2021-12-06 10:32                       ` Maxime Bizon
2021-12-06 14:22                         ` Christophe Leroy
2021-12-06 15:48                           ` Maxime Bizon
2021-12-07  5:50                             ` Christophe Leroy
2021-12-07  6:11                               ` Christophe Leroy
2021-12-12 11:21                                 ` Maxime Bizon
2021-12-07  5:54             ` Christophe Leroy
2021-12-07  9:04               ` Maxime Bizon

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=d39825e0-6b48-5ac1-662e-26186e730eaa@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mbizon@freebox.fr \
    /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.