Bug 203597 - kernel 4.9.175 fails to boot on a PowerMac G4 3,6 at early stage
Summary: kernel 4.9.175 fails to boot on a PowerMac G4 3,6 at early stage
Status: CLOSED CODE_FIX
Alias: None
Product: Platform Specific/Hardware
Classification: Unclassified
Component: PPC-32 (show other bugs)
Hardware: PPC-32 Linux
: P1 normal
Assignee: platform_ppc-32
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-13 20:18 UTC by Erhard F.
Modified: 2019-05-20 01:53 UTC (History)
2 users (show)

See Also:
Kernel Version: 4.9.175
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
kernel .config (PowerMac G4 MDD) (72.99 KB, text/plain)
2019-05-13 20:18 UTC, Erhard F.
Details
bisect.log (3.12 KB, text/plain)
2019-05-13 20:18 UTC, Erhard F.
Details

Description Erhard F. 2019-05-13 20:18:03 UTC
Created attachment 282743 [details]
kernel .config (PowerMac G4 MDD)

Trying out older kernels on the G4 MDD I noticed recent 4.9.x freeze the machine. Only message displayed in black letters on a white screen:

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


It's a hard freeze, RCU_CPU_STALL_TIMEOUT does not kick in.

Tried other stable kernels, which all worked:
4.19.37
4.14.114 
4.4.179

So I suppose it's only a 4.9.x issue. Last working 4.9.x kernel I had in service was 4.9.161. First one I spotted freezing was 4.9.171. A bisect gave me the following commit:

1c38a84d45862be06ac418618981631eddbda741 is the first bad commit
commit 1c38a84d45862be06ac418618981631eddbda741
Author: Michael Neuling <mikey@neuling.org>
Date:   Thu Apr 11 21:45:59 2019 +1000

    powerpc: Avoid code patching freed init sections
    
    commit 51c3c62b58b357e8d35e4cc32f7b4ec907426fe3 upstream.
    
    This stops us from doing code patching in init sections after they've
    been freed.
    
    In this chain:
      kvm_guest_init() ->
        kvm_use_magic_page() ->
          fault_in_pages_readable() ->
             __get_user() ->
               __get_user_nocheck() ->
                 barrier_nospec();
    
    We have a code patching location at barrier_nospec() and
    kvm_guest_init() is an init function. This whole chain gets inlined,
    so when we free the init section (hence kvm_guest_init()), this code
    goes away and hence should no longer be patched.
    
    We seen this as userspace memory corruption when using a memory
    checker while doing partition migration testing on powervm (this
    starts the code patching post migration via
    /sys/kernel/mobility/migration). In theory, it could also happen when
    using /sys/kernel/debug/powerpc/barrier_nospec.
    
    Cc: stable@vger.kernel.org # 4.13+
    Signed-off-by: Michael Neuling <mikey@neuling.org>
    Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
    Reviewed-by: Christophe Leroy <christophe.leroy@c-s.fr>
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
Comment 1 Erhard F. 2019-05-13 20:18:42 UTC
Created attachment 282745 [details]
bisect.log
Comment 2 Christophe Leroy 2019-05-14 04:43:22 UTC
You are missing following commit:

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b45ba4a51cd
Comment 3 Erhard F. 2019-05-19 20:11:41 UTC
(In reply to Christophe Leroy from comment #2)
> You are missing following commit:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/
> ?id=b45ba4a51cd
Your fix landed in 4.9.177 and I can confirm my G4 boots fine now. Thanks!

Note You need to log in before you can comment on or make changes to this bug.