linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Bizon <mbizon@freebox.fr>
To: Christophe Leroy <christophe.leroy@csgroup.eu>
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 17:42:17 +0100	[thread overview]
Message-ID: <20211205164217.GA29658@sakura> (raw)
In-Reply-To: <5f4d36a1-695d-38a7-9ff9-d5af97f1a7e0@csgroup.eu>



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.

> 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.

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 ?


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.


-- 
Maxime

  reply	other threads:[~2021-12-05 16:51 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 [this message]
2021-12-05 18:11             ` Christophe Leroy
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=20211205164217.GA29658@sakura \
    --to=mbizon@freebox.fr \
    --cc=christophe.leroy@csgroup.eu \
    --cc=linuxppc-dev@lists.ozlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).