]> 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)
commit89de18044a1b035828371d9877ae49edfda462a6
treed1842bca1241f401b1ccc538e00d5f2dd9215df5
parent67d601e3135f3abab3ef949f915a5e5fd50821b4
powerpc: Improve FSCR init and context switching

This fixes a few issues with FSCR init and switching.

In commit 10a5e6a58f38 ("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