]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: Improve FSCR init and context switching
authorMichael Neuling <mikey@neuling.org>
Thu, 9 Jun 2016 02:31:08 +0000 (12:31 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 21 Jun 2016 05:30:50 +0000 (15:30 +1000)
commit1b80a636616b144bb15561abe4c9d6ec4f3d7581
treed1842bca1241f401b1ccc538e00d5f2dd9215df5
parent51d0eb7a5c92e78a7c6da4cc327bb6633bbd9535
powerpc: Improve FSCR init and context switching

This fixes a few issues with FSCR init and switching.

In commit 9865132eed50 ("powerpc: Create context switch helpers
save_sprs() and restore_sprs()") we moved the setting of the FSCR
register from inside an CPU_FTR_ARCH_207S section to inside just a
CPU_FTR_ARCH_DSCR section. Hence we are setting FSCR on POWER6/7 where
the FSCR doesn't exist. This is harmless but we shouldn't do it.

Also, we can simplify the FSCR context switch. We don't need to go
through the calculation involving dscr_inherit. We can just restore
what we saved last time.

We also set an initial value in INIT_THREAD, so that pid 1 which is
cloned from that gets a sane value.

Based on patch by Jack Miller.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/processor.h
arch/powerpc/kernel/process.c
arch/powerpc/kernel/traps.c