Bug 209869

Summary: Kernel 5.10-rc1 fails to boot on a PowerMac G4 3,6 at an early stage
Product: Platform Specific/Hardware Reporter: Erhard F. (erhard_f)
Component: PPC-32Assignee: platform_ppc-32
Status: CLOSED CODE_FIX    
Severity: normal CC: christophe.leroy, michael
Priority: P1    
Hardware: PPC-32   
OS: Linux   
Kernel Version: 5.10-rc1 Subsystem:
Regression: Yes Bisected commit-id:
Attachments: kernel .config (5.10-rc1, PowerMac G4 DP)
kernel .config (5.10-rc1 + KASAN, PowerMac G4 DP)
dmesg (5.10-rc1 + patch reverted + KASAN, PowerMac G4 DP)
kernel .config (5.9.3 + KASAN, PowerMac G4 DP)
dmesg (5.9.3 + KASAN, PowerMac G4 DP)

Description Erhard F. 2020-10-26 13:40:58 UTC
Created attachment 293201 [details]
kernel .config (5.10-rc1, PowerMac G4 DP)

With current 5.10-rc1 my PowerMac G4 DP fails to boot. The kernel gets decompressed but shortly afterwards the machine freezes, displaying in black letters on a white screen:

done
found display   : /pci@f0000000/ATY,AlteracParent@10/ATY,Alterac_B@1, opening...

Kernel 5.9.1 works well on this machine, the kernel .config was carried over from 5.9.1 with make oldconfig.
Comment 1 Christophe Leroy 2020-11-03 07:36:21 UTC
Could you try reverting commit https://github.com/linuxppc/linux/commit/69a1593abdbcf03a76367320d929a8ae7a5e3d71 ?

I got another report from someone who has the same problem and bisected it to that commit.
Comment 2 Erhard F. 2020-11-03 11:06:48 UTC
Yes, reverting this commit (on top of -rc1) makes the G4 boot again. Did not try -rc2 though.
Comment 3 Christophe Leroy 2020-11-04 14:30:21 UTC
Ok, thanks for the verification. I'm still having hard time understand what the problem can be. That commit sets up at all time the early hash table that was previously only set up when CONFIG_KASAN was set. As far as I remember, you tried KASAN many times.

Could you test whether CONFIG_KASAN works:
- on 5.10-rc1 with that commit reverted ?
- on 5.9 ?

If CONFIG_KASAN is already broken on 5.9, are you able to find the last kernel version on which CONFIG_KASAN works ?

Thanks
Christophe
Comment 4 Erhard F. 2020-11-04 23:18:43 UTC
(In reply to Christophe Leroy from comment #3)
> Could you test whether CONFIG_KASAN works:
> - on 5.10-rc1 with that commit reverted ?
> - on 5.9 ?

KASAN works in both cases. I'll attach kernel dmesg and config.
Comment 5 Erhard F. 2020-11-04 23:19:35 UTC
Created attachment 293495 [details]
kernel .config (5.10-rc1 + KASAN, PowerMac G4 DP)
Comment 6 Erhard F. 2020-11-04 23:20:15 UTC
Created attachment 293497 [details]
dmesg (5.10-rc1 + patch reverted + KASAN, PowerMac G4 DP)
Comment 7 Erhard F. 2020-11-04 23:21:03 UTC
Created attachment 293499 [details]
kernel .config (5.9.3 + KASAN, PowerMac G4 DP)
Comment 8 Erhard F. 2020-11-04 23:21:40 UTC
Created attachment 293501 [details]
dmesg (5.9.3 + KASAN, PowerMac G4 DP)
Comment 9 Christophe Leroy 2020-11-05 09:26:49 UTC
Ok, what about 5.10-rc1 + KASAN without reverting the patch ?
Comment 10 Erhard F. 2020-11-05 16:13:59 UTC
(In reply to Christophe Leroy from comment #9)
> Ok, what about 5.10-rc1 + KASAN without reverting the patch ?
Nope, does not boot. Same 5.10-rc1 .config + KASAN but without reverting the patch.
Comment 11 Christophe Leroy 2020-11-07 09:11:13 UTC
Can (In reply to Erhard F. from comment #10)
> (In reply to Christophe Leroy from comment #9)
> > Ok, what about 5.10-rc1 + KASAN without reverting the patch ?
> Nope, does not boot. Same 5.10-rc1 .config + KASAN but without reverting the
> patch.

Can you test patch at https://patchwork.ozlabs.org/project/linuxppc-dev/patch/9e225a856a8b22e0e77587ee22ab7a2f5bca8753.1604740029.git.christophe.leroy@csgroup.eu/
Comment 12 Erhard F. 2020-11-09 19:35:40 UTC
I can confirm the patch fixes booting 5.10-rc1 on my G4, with and without KASAN. Thanks!
Comment 13 Michael Ellerman 2020-11-27 12:08:37 UTC
Fixed in:
  01776f070ffc ("powerpc/32s: Use relocation offset when setting early hash table")
Comment 14 Erhard F. 2020-11-29 06:11:42 UTC
Thanks!
Comment 15 Michael Ellerman 2020-11-30 01:36:52 UTC
And the fix is in mainline as of v5.10-rc6.