linux/arch/powerpc
Benjamin Herrenschmidt 7ed23e1bae powerpc: Disable HFSCR[TM] if TM is not supported
On Power8 & Power9 the early CPU inititialisation in __init_HFSCR()
turns on HFSCR[TM] (Hypervisor Facility Status and Control Register
[Transactional Memory]), but that doesn't take into account that TM
might be disabled by CPU features, or disabled by the kernel being built
with CONFIG_PPC_TRANSACTIONAL_MEM=n.

So later in boot, when we have setup the CPU features, clear HSCR[TM] if
the TM CPU feature has been disabled. We use CPU_FTR_TM_COMP to account
for the CONFIG_PPC_TRANSACTIONAL_MEM=n case.

Without this a KVM guest might try use TM, even if told not to, and
cause an oops in the host kernel. Typically the oops is seen in
__kvmppc_vcore_entry() and may or may not be fatal to the host, but is
always bad news.

In practice all shipping CPU revisions do support TM, and all host
kernels we are aware of build with TM support enabled, so no one should
actually be able to hit this in the wild.

Fixes: 2a3563b023 ("powerpc: Setup in HFSCR for POWER8")
Cc: stable@vger.kernel.org # v3.10+
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Tested-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
[mpe: Rewrite change log with input from Sam, add Fixes/stable]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-03-28 19:52:37 +11:00
..
boot powerpc/boot: Fix zImage TOC alignment 2017-03-08 10:39:32 +11:00
configs powerpc updates for 4.11 part 2 2017-03-01 10:10:16 -08:00
crypto crypto: powerpc - Fix initialisation of crc32c context 2017-03-08 14:01:08 +08:00
include powerpc: Wire up statx() syscall 2017-03-16 20:45:53 +11:00
kernel powerpc: Disable HFSCR[TM] if TM is not supported 2017-03-28 19:52:37 +11:00
kvm power/mm: update pte_write and pte_wrprotect to handle savedwrite 2017-03-09 17:01:09 -08:00
lib powerpc fixes for 4.11 #3 2017-03-07 10:46:10 -08:00
math-emu Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
mm Revert "powerpc/64: Disable use of radix under a hypervisor" 2017-03-21 16:50:28 +11:00
net powerpc updates for 4.11 part 1. 2017-02-22 10:30:38 -08:00
oprofile ktime: Cleanup ktime_set() usage 2016-12-25 17:21:22 +01:00
perf powerpc/perf: Handle sdar_mode for marked event in power9 2017-03-09 13:34:54 +11:00
platforms powerpc/pseries: Don't give a warning when HPT resizing isn't available 2017-03-17 16:10:58 +11:00
purgatory kexec, x86/purgatory: Unbreak it and clean it up 2017-03-10 20:55:09 +01:00
scripts
sysdev axonram: Fix gendisk handling 2017-03-08 10:55:40 -07:00
xmon sched/headers: Prepare for new header dependencies before moving code to <linux/sched/signal.h> 2017-03-02 08:42:29 +01:00
Kconfig powerpc: Sort the selects under CONFIG_PPC 2017-03-06 23:05:42 +11:00
Kconfig.debug powerpc/xmon: Enable disassembly files (compilation changes) 2017-02-15 20:02:42 +11:00
Makefile powerpc: Fix compiling a BE kernel with a powerpc64le toolchain 2017-03-03 11:24:50 +11:00
relocs_check.sh powerpc/64: whitelist unresolved modversions CRCs 2016-09-22 14:46:31 +02:00