]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/tm: Fix saving of TM SPRs in core dump
authorGustavo Romero <gromero@linux.vnet.ibm.com>
Wed, 19 Jul 2017 05:44:13 +0000 (01:44 -0400)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 28 Jul 2017 05:56:06 +0000 (15:56 +1000)
commit449fbf672beeb0fd99e5b60dfd292b4b5461a660
treea654af0dfd9be1b77674292f8fa94471275440e2
parentb856283a1bd21c6c15d4880174182ed94614612f
powerpc/tm: Fix saving of TM SPRs in core dump

Currently flush_tmregs_to_thread() does not save the TM SPRs (TFHAR,
TFIAR, TEXASR) to the thread struct, unless the process is currently
inside a suspended transaction.

If the process is core dumping, and the TM SPRs have changed since the
last time the process was context switched, then we will save stale
values of the TM SPRs to the core dump.

Fix it by saving the live register state to the thread struct in that
case.

Fixes: 0ac25d43ca7a ("powerpc/ptrace: Enable support for TM SPR state")
Cc: stable@vger.kernel.org # v4.8+
Signed-off-by: Gustavo Romero <gromero@linux.vnet.ibm.com>
Reviewed-by: Cyril Bur <cyrilbur@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/ptrace.c