Comment 12 for bug 1888332

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

A bisect for arch/powerpc/ shows this is the first bad commit on 4.15:

$ git bisect bad
7d10952e8a56f87a53fc57594078555a9dfd4a07 is the first bad commit
commit 7d10952e8a56f87a53fc57594078555a9dfd4a07
Author: Michael Ellerman <email address hidden>
Date: Thu May 28 00:58:42 2020 +1000

    powerpc/64s: Save FSCR to init_task.thread.fscr after feature init

    BugLink: https://bugs.launchpad.net/bugs/1885176

    commit 912c0a7f2b5daa3cbb2bc10f303981e493de73bd upstream.

    At boot the FSCR is initialised via one of two paths. On most systems
    it's set to a hard coded value in __init_FSCR().

    On newer skiboot systems we use the device tree CPU features binding,
    where firmware can tell Linux what bits to set in FSCR (and HFSCR).

    In both cases the value that's configured at boot is not propagated
    into the init_task.thread.fscr value prior to the initial fork of init
    (pid 1), which means the value is not used by any processes other than
    swapper (the idle task).

    For the __init_FSCR() case this is OK, because the value in
    init_task.thread.fscr is initialised to something sensible. However it
    does mean that the value set in __init_FSCR() is not used other than
    for swapper, which is odd and confusing.

    The bigger problem is for the device tree CPU features case it
    prevents firmware from setting (or clearing) FSCR bits for use by user
    space. This means all existing kernels can not have features
    enabled/disabled by firmware if those features require
    setting/clearing FSCR bits.

    We can handle both cases by saving the FSCR value into
    init_task.thread.fscr after we have initialised it at boot. This fixes
    the bug for device tree CPU features, and will allow us to simplify
    the initialisation for the __init_FSCR() case in a future patch.

    Fixes: 5a61ef74f269 ("powerpc/64s: Support new device tree binding for discovering CPU features")
    Cc: <email address hidden> # v4.12+
    Signed-off-by: Michael Ellerman <email address hidden>
    Link: https://<email address hidden>
    Signed-off-by: Greg Kroah-Hartman <email address hidden>
    Signed-off-by: Kamal Mostafa <email address hidden>
    Signed-off-by: Khalid Elmously <email address hidden>

    :040000 040000 9c654d310ed9b7c4a1cf16620d120ec93624eda3
    05b34a61190e63ccde3b7d02e2183dc64b32c812 M arch

$ git bisect log
git bisect start '--' 'arch/powerpc/'
\# bad: [f4daf25f7f8608d1c14c85ea0b73c9e1e1eb2dba] UBUNTU: Ubuntu-4.15.0-114.115
git bisect bad f4daf25f7f8608d1c14c85ea0b73c9e1e1eb2dba
\# good: [495149ddc61a5997857fda041ccd4c81cac46e00] UBUNTU: Ubuntu-4.15.0-112.113
git bisect good 495149ddc61a5997857fda041ccd4c81cac46e00
\# bad: [07ad1246146fa49430d2455bd45db1c8da4d521c] powerpc/perf/hv-24x7: Fix inconsistent output values incase multiple hv-24x7 events run
git bisect bad 07ad1246146fa49430d2455bd45db1c8da4d521c
\# good: [f30471f4138df69bd4585d91c1f31a282daa41e7] powerpc/64s: Don't let DT CPU features set FSCR_DSCR
git bisect good f30471f4138df69bd4585d91c1f31a282daa41e7
\# bad: [0e198dfae237e9a9654d87b7c6df12146feaec26] sched/core: Fix illegal RCU from offline CPUs
git bisect bad 0e198dfae237e9a9654d87b7c6df12146feaec26
\# bad: [7d10952e8a56f87a53fc57594078555a9dfd4a07] powerpc/64s: Save FSCR to init_task.thread.fscr after feature init
git bisect bad 7d10952e8a56f87a53fc57594078555a9dfd4a07
\# first bad commit: [7d10952e8a56f87a53fc57594078555a9dfd4a07] powerpc/64s: Save FSCR to init_task.thread.fscr after feature init