kernel - Fix signal FP save/restore issues when AVX is enabled
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 13 Jan 2013 00:16:11 +0000 (16:16 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 13 Jan 2013 00:16:11 +0000 (16:16 -0800)
commite6e019a801e99ba7888ed009c5c3b3c7b047af1e
tree8a8fcd943f4ad8b6f4b9f356aaf541f1b9d2c612
parentef31a1a8fc23435f0bb9e198ca7433d84f86068d
kernel - Fix signal FP save/restore issues when AVX is enabled

* The kernel was not saving/restoring the full FP context when entering into
  or returning from a signal, leading to corrupt FP registers even when
  AVX is not used, when AVX is enabled in the kernel.

  ANY SIGNAL COULD CORRUPT THE FP STATE.

* Fixed by adjusting the on-user-stack fpsave area sizes and operation.

* This unfortunately changes a number of user visible structures.
  ucontext_t, mcontext_t, sigcontext, sigframe.

  It is POSSIBLE that most userland use cases will be unaffected, but I'm
  not holding my breath.

Major-Sleuthing-by: ftigeot
Testing-by: ftigeot, dillon
sys/cpu/x86_64/include/signal.h
sys/cpu/x86_64/include/ucontext.h
sys/platform/pc64/x86_64/machdep.c
sys/platform/pc64/x86_64/npx.c