]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
powerpc/tm: Save and restore AMR on treclaim and trechkpt
authorGustavo Romero <gromero@linux.ibm.com>
Sat, 19 Sep 2020 15:00:25 +0000 (12:00 -0300)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 6 Oct 2020 12:22:25 +0000 (23:22 +1100)
commitd0ffdee8ff01fb21085d835ee54dc8c1c4d19226
tree8e765220d07bfa1571acf8c28537fb6a28a4b365
parent35d64734b64315f2c5716c5a0a380ed1ba8fbe4a
powerpc/tm: Save and restore AMR on treclaim and trechkpt

Althought AMR is stashed in the checkpoint area, currently we don't save
it to the per thread checkpoint struct after a treclaim and so we don't
restore it either from that struct when we trechkpt. As a consequence when
the transaction is later rolled back the kernel space AMR value when the
trechkpt was done appears in userspace.

That commit saves and restores AMR accordingly on treclaim and trechkpt.
Since AMR value is also used in kernel space in other functions, it also
takes care of stashing kernel live AMR into the stack before treclaim and
before trechkpt, restoring it later, just before returning from tm_reclaim
and __tm_recheckpoint.

Is also fixes two nonrelated comments about CR and MSR.

Signed-off-by: Gustavo Romero <gromero@linux.ibm.com>
Tested-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200919150025.9609-1-gromero@linux.ibm.com
arch/powerpc/include/asm/processor.h
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/kernel/tm.S