android_kernel_motorola_sm6375/arch/powerpc
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Michael Ellerman 1b0d830e0c powerpc/64s: Save FSCR to init_task.thread.fscr after feature init
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: 5a61ef74f2 ("powerpc/64s: Support new device tree binding for discovering CPU features")
Cc: stable@vger.kernel.org # v4.12+
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200527145843.2761782-3-mpe@ellerman.id.au
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-22 09:31:23 +02:00
..
boot
configs
crypto
include powerpc/kasan: Fix shadow pages allocation failure 2020-06-22 09:31:23 +02:00
kernel powerpc/64s: Save FSCR to init_task.thread.fscr after feature init 2020-06-22 09:31:23 +02:00
kvm KVM: PPC: Book3S HV: Fix H_CEDE return code for nested guests 2020-04-23 10:36:32 +02:00
lib
math-emu
mm powerpc/kasan: Fix shadow pages allocation failure 2020-06-22 09:31:23 +02:00
net
oprofile
perf
platforms powerpc/spufs: fix copy_to_user while atomic 2020-06-22 09:31:02 +02:00
purgatory
sysdev powerpc/xive: Clear the page tables for the ESB IO mapping 2020-06-17 16:40:22 +02:00
tools powerpc: Do not consider weak unresolved symbol relocations as bad 2020-02-24 08:37:00 +01:00
xmon powerpc/xmon: Restrict when kernel is locked down 2020-06-07 13:18:49 +02:00
Kbuild
Kconfig powerpc/32: Disable KASAN with pages bigger than 16k 2020-06-22 09:31:23 +02:00
Kconfig.debug
Makefile
Makefile.postlink powerpc: Do not consider weak unresolved symbol relocations as bad 2020-02-24 08:37:00 +01:00