linux_dsm_epyc7002/arch/powerpc
Cyril Bur b0f16b4698 powerpc: Add check_if_tm_restore_required() to giveup_all()
giveup_all() causes FPU/VMX/VSX facilities to be disabled in a threads
MSR. If the thread performing the giveup was transactional, the kernel
must record which facilities were in use before the giveup as the
thread must have these facilities re-enabled on return to userspace.

>From process.c:
 /*
  * This is called if we are on the way out to userspace and the
  * TIF_RESTORE_TM flag is set.  It checks if we need to reload
  * FP and/or vector state and does so if necessary.
  * If userspace is inside a transaction (whether active or
  * suspended) and FP/VMX/VSX instructions have ever been enabled
  * inside that transaction, then we have to keep them enabled
  * and keep the FP/VMX/VSX state loaded while ever the transaction
  * continues.  The reason is that if we didn't, and subsequently
  * got a FP/VMX/VSX unavailable interrupt inside a transaction,
  * we don't know whether it's the same transaction, and thus we
  * don't know which of the checkpointed state and the transactional
  * state to use.
  */

Calling check_if_tm_restore_required() will set TIF_RESTORE_TM and
save the MSR if needed.

Fixes: c208505 ("powerpc: create giveup_all()")
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-10-04 16:43:06 +11:00
..
boot powerpc/boot: Add support for XZ compression 2016-09-28 14:35:14 +10:00
configs powerpc/configs: Enable Intel i40e on 64 bit configs 2016-10-04 16:10:56 +11:00
crypto crypto: crc32c-vpmsum - Convert to CPU feature based module autoloading 2016-08-09 14:50:17 +10:00
include powerpc/powernv: Specify proper data type for PCI_SLOT_ID_PREFIX 2016-10-04 16:29:46 +11:00
kernel powerpc: Add check_if_tm_restore_required() to giveup_all() 2016-10-04 16:43:06 +11:00
kvm powerpc: move hmi.c to arch/powerpc/kvm/ 2016-08-22 11:09:33 +10:00
lib powerpc/64: Align hot loops of memset() and backwards_memcpy() 2016-10-04 16:08:19 +11:00
math-emu powerpc: Correct emulated mtfsf instruction 2014-04-07 10:33:11 +10:00
mm KVM: PPC: Book3S HV: Migrate pinned pages out of CMA 2016-09-29 15:14:44 +10:00
net powerpc/ebpf/jit: Implement JIT compiler for extended BPF 2016-06-24 15:17:57 +10:00
oprofile powerpc/sparse: Make a bunch of things static 2016-09-13 17:35:47 +10:00
perf powerpc/sparse: Make a bunch of things static 2016-09-13 17:35:47 +10:00
platforms powerpc/powernv: Fix data type for @r in pnv_ioda_parse_m64_window() 2016-10-04 16:30:28 +11:00
scripts powerpc/ftrace: Add Kconfig & Make glue for mprofile-kernel 2016-03-07 14:53:56 +11:00
sysdev powerpc: Remove all usages of NO_IRQ 2016-09-20 20:57:12 +10:00
xmon powerpc/xmon: Don't use ld on 32-bit 2016-09-13 17:37:02 +10:00
Kconfig powerpc: Only disable HAVE_EFFICIENT_UNALIGNED_ACCESS on POWER7 little endian 2016-10-04 16:15:00 +11:00
Kconfig.debug powerpc/mm: Catch usage of cpu/mmu_has_feature() before jump label init 2016-08-01 11:15:06 +10:00
Makefile powerpc/Makefile: Construct the UTS_MACHINE value more concisely 2016-09-13 17:37:06 +10:00
relocs_check.sh powerpc: Convert relocs_check to a shell script using grep 2015-03-23 14:47:39 +11:00