]> 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)
commite2dda8598aa5f44246187d15008b65f60cd55fbb
treea654af0dfd9be1b77674292f8fa94471275440e2
parent70871771f94afbf740c1022deb0286c0e751a801
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: 5cbaf7e59056 ("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