]> git.itanic.dy.fi Git - linux-stable/commit
powerpc/64s: Don't let DT CPU features set FSCR_DSCR
authorMichael Ellerman <mpe@ellerman.id.au>
Wed, 27 May 2020 14:58:41 +0000 (00:58 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jun 2020 07:33:07 +0000 (09:33 +0200)
commit219125ba17fda4292ee99b5afdc1559201017de6
tree9242577c7cff96a9319c0af217ea328a60181fa6
parent32a65dcf6910a6b8f5544ebf86b2ae27b8ca0fdc
powerpc/64s: Don't let DT CPU features set FSCR_DSCR

commit 993e3d96fd08c3ebf7566e43be9b8cd622063e6d upstream.

The device tree CPU features binding includes FSCR bit numbers which
Linux is instructed to set by firmware.

Whether that's a good idea or not, in the case of the DSCR the Linux
implementation has a hard requirement that the FSCR_DSCR bit not be
set by default. We use it to track when a process reads/writes to
DSCR, so it must be clear to begin with.

So if firmware tells us to set FSCR_DSCR we must ignore it.

Currently this does not cause a bug in our DSCR handling because the
value of FSCR that the device tree CPU features code establishes is
only used by swapper. All other tasks use the value hard coded in
init_task.thread.fscr.

However we'd like to fix that in a future commit, at which point this
will become necessary.

Fixes: 5a61ef74f269 ("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-2-mpe@ellerman.id.au
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/kernel/dt_cpu_ftrs.c