linux_dsm_epyc7002/arch/powerpc
Felipe Rechia e901378578 powerpc/process: Fix flush_all_to_thread for SPE
Fix a bug introduced by the creation of flush_all_to_thread() for
processors that have SPE (Signal Processing Engine) and use it to
compute floating-point operations.

>From userspace perspective, the problem was seen in attempts of
computing floating-point operations which should generate exceptions.
For example:

  fork();
  float x = 0.0 / 0.0;
  isnan(x);           // forked process returns False (should be True)

The operation above also should always cause the SPEFSCR FINV bit to
be set. However, the SPE floating-point exceptions were turned off
after a fork().

Kernel versions prior to the bug used flush_spe_to_thread(), which
first saves SPEFSCR register values in tsk->thread and then calls
giveup_spe(tsk).

After commit 579e633e76, the save_all() function was called first
to giveup_spe(), and then the SPEFSCR register values were saved in
tsk->thread. This would save the SPEFSCR register values after
disabling SPE for that thread, causing the bug described above.

Fixes 579e633e76 ("powerpc: create flush_all_to_thread()")
Signed-off-by: Felipe Rechia <felipe.rechia@datacom.com.br>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2018-10-26 21:58:58 +11:00
..
boot powerpc/boot: Build boot wrapper with optimisations 2018-10-13 22:21:25 +11:00
configs powerpc/config: Enable CONFIG_PRINTK_TIME 2018-10-03 15:40:06 +10:00
crypto powerpc updates for 4.19 2018-08-17 11:32:50 -07:00
include powerpc/pseries: add missing cpumask.h include file 2018-10-26 21:58:58 +11:00
kernel powerpc/process: Fix flush_all_to_thread for SPE 2018-10-26 21:58:58 +11:00
kvm KVM: PPC: Use exported tb_to_ns() function in decrementer emulation 2018-10-26 21:58:58 +11:00
lib powerpc: Add support for function error injection 2018-10-20 13:26:43 +11:00
math-emu License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mm powerpc/8xx: Use patch_site for memory setup patching 2018-10-26 21:58:58 +11:00
net powerpc updates for 4.19 2018-08-17 11:32:50 -07:00
oprofile powerpc: Add -Werror at arch/powerpc level 2018-10-19 00:56:17 +11:00
perf powerpc/8xx: Use patch_site for perf counters setup 2018-10-26 21:58:58 +11:00
platforms powerpc/pseries: Export maximum memory value 2018-10-26 21:58:58 +11:00
purgatory powerpc updates for 4.19 2018-08-17 11:32:50 -07:00
sysdev powerpc/sysdev/ipic: check primary_ipic NULL pointer before using it 2018-10-20 13:26:47 +11:00
tools powerpc: Add a checkpatch wrapper with our preferred settings 2018-08-07 21:49:25 +10:00
xmon powerpc/time: Only set CONFIG_ARCH_HAS_SCALED_CPUTIME on PPC64 2018-10-20 13:26:47 +11:00
Kbuild powerpc: Add -Werror at arch/powerpc level 2018-10-19 00:56:17 +11:00
Kconfig powerpc/time: Only set CONFIG_ARCH_HAS_SCALED_CPUTIME on PPC64 2018-10-20 13:26:47 +11:00
Kconfig.debug powerpc: remove redundant 'default n' from Kconfig-s 2018-10-13 22:21:25 +11:00
Makefile powerpc: Move core kernel logic into arch/powerpc/Kbuild 2018-10-19 00:56:17 +11:00
Makefile.postlink License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00