linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Erhard Furtner <erhard_f@mailbox.org>
To: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: KASAN debug kernel fails to boot at early stage when CONFIG_SMP=y is set (kernel 6.5-rc5, PowerMac G4 3,6)
Date: Tue, 12 Sep 2023 22:09:20 +0200	[thread overview]
Message-ID: <20230912220920.64a9ac3c@yea> (raw)
In-Reply-To: <453090a5-0d01-40ee-50a5-794c8f0f1f95@csgroup.eu>

On Tue, 12 Sep 2023 17:39:10 +0000
Christophe Leroy <christophe.leroy@csgroup.eu> wrote:

> Ah ok, maybe your CPU only has 4 BATs and they are all used, following 
> change would tell us.
> 
> diff --git a/arch/powerpc/mm/book3s32/mmu.c b/arch/powerpc/mm/book3s32/mmu.c
> index 850783cfa9c7..bd26767edce7 100644
> --- a/arch/powerpc/mm/book3s32/mmu.c
> +++ b/arch/powerpc/mm/book3s32/mmu.c
> @@ -86,6 +86,7 @@ int __init find_free_bat(void)
>   		if (!(bat[1].batu & 3))
>   			return b;
>   	}
> +	pr_err("NO FREE BAT (%d)\n", n);
>   	return -1;
>   }
> 
> Or you have 8 BATs in which case it's an alignment problem, you need to 
> increase CONFIG_DATA_SHIFT to 23, for that you need CONFIG_ADVANCED and 
> CONFIG_DATA_SHIFT_BOOL

Applied all your patches. According to the output my G4 DP seems to have 8 BATs. Now I get the following output on screen before the freeze:

printk: bootconsole [udbg0] enabled
Total memory = 2048MB; using 4096kB for hash table
mapin_ram:125
mmu_mapin_ram:170 0 30000000 1400000 2000000
__mmu_mapin_ram:147 0 1400000
__mmu_mapin_ram:156 1400000
__mmu_mapin_ram:147 1400000 30000000
NO FREE BAT (8)
__mmu_mapin_ram:156 20000000
__mapin_ram_chunk:107 20000000 30000000
__mapin_ram_chunk:117
mapin_ram:134
kasan_mmu_init:132
kasan_mmu_init:135 0
kasan_mmu_init:140
ioremap() called early from btext_map+0x64/0xdc. Use early_ioremap() instead
Linux version 6.6.0-rc1-PMacG4-dirty (root@T1000) (gcc (Gentoo 12.3.1_p20230526 p2) 12.3.1 20230526, GNU ld (Gentoo 2.40 p7) 2.40.0) #5 SMP Tue Sep 12 16:50:47 CEST 2023
kasan_init_region: c0000000 30000000 f8000000 fe000000
NO FREE BAT (8)
kasan_init_region: loop f8000000 fe000000


So I set CONFIG_DATA_SHIFT=23 as suggested but then I only get:

printk: bootconsole [udbg0] enabled
Total memory = 2048MB; using 4096kB for hash table
mapin_ram:125
mmu_mapin_ram:170 0 30000000 1400000 2000000
__mmu_mapin_ram:147 0 1400000
__mmu_mapin_ram:156 1400000
__mmu_mapin_ram:147 1400000 30000000
NO FREE BAT (8)
__mmu_mapin_ram:156 20000000
__mapin_ram_chunk:107 20000000 30000000
__mapin_ram_chunk:117
mapin_ram:134
kasan_mmu_init:132
kasan_mmu_init:135 0
kasan_mmu_init:140


With btext_unmap() left in place in init_32.c I only get:

printk: bootconsole [udbg0] enabled
Total memory = 2048MB; using 4096kB for hash table
mapin_ram:125
mmu_mapin_ram:170 0 30000000 1400000 2000000
__mmu_mapin_ram:147 0 1400000
__mmu_mapin_ram:156 1400000
__mmu_mapin_ram:147 1400000 30000000
NO FREE BAT (8)
__mmu_mapin_ram:156 20000000
__mapin_ram_chunk:107 20000000 30000000
__mapin_ram_chunk:117
mapin_ram:134
btext_unmap:129

Hope the output sheds at least some light on what's going wrong!

Regards,
Erhard

  reply	other threads:[~2023-09-12 20:10 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-10 23:48 KASAN debug kernel fails to boot at early stage when CONFIG_SMP=y is set (kernel 6.5-rc5, PowerMac G4 3,6) Erhard Furtner
2023-08-11  6:45 ` Christophe Leroy
2023-08-13 19:38   ` Erhard Furtner
2023-08-14  9:40     ` Christophe Leroy
2023-08-14 17:27       ` Erhard Furtner
2023-08-15 17:21         ` [PATCH] Add pr_info() traces for investigation Christophe Leroy
2023-08-15 17:25         ` KASAN debug kernel fails to boot at early stage when CONFIG_SMP=y is set (kernel 6.5-rc5, PowerMac G4 3,6) Christophe Leroy
2023-08-15 20:01           ` Erhard Furtner
2023-08-16 15:56             ` Christophe Leroy
2023-08-17 18:32               ` Erhard Furtner
2023-08-17 23:13                 ` Michael Ellerman
2023-08-18  9:16                   ` Erhard Furtner
2023-08-18 15:47                     ` Christophe Leroy
2023-08-18 16:23                       ` Erhard Furtner
2023-08-22  7:31                         ` Christophe Leroy
2023-08-24  0:00                           ` Erhard Furtner
2023-08-24 11:36                             ` Michael Ellerman
2023-08-27 23:17                               ` Erhard Furtner
2023-08-31  5:32                                 ` Christophe Leroy
2023-08-31 22:44                                   ` Erhard Furtner
2023-09-01  7:43                                     ` Christophe Leroy
2023-09-03 21:06                                       ` Erhard Furtner
2023-09-04 14:48                                         ` Christophe Leroy
2023-09-04 14:55                                           ` Christophe Leroy
2023-09-04 21:32                                             ` Erhard Furtner
2023-09-12  0:11                                             ` Erhard Furtner
2023-09-12  7:47                                               ` Christophe Leroy
2023-09-12 15:59                                                 ` Erhard Furtner
2023-09-12 17:39                                                   ` Christophe Leroy
2023-09-12 20:09                                                     ` Erhard Furtner [this message]
2023-09-13  5:28                                                       ` Christophe Leroy
2023-09-14  4:54                                                     ` Christophe Leroy
2023-09-14 12:33                                                       ` Erhard Furtner
2024-02-28 23:55                                                       ` Erhard Furtner

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=20230912220920.64a9ac3c@yea \
    --to=erhard_f@mailbox.org \
    --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).