]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64s: system call rfscv workaround for TM bugs
authorNicholas Piggin <npiggin@gmail.com>
Wed, 8 Sep 2021 10:17:17 +0000 (20:17 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 13 Sep 2021 12:34:11 +0000 (22:34 +1000)
commita90ba97cb701f4c5a2b6ea97852da5771d75d330
treeea3c2fb75f9e7723a48df8f90c72e4833336ca52
parentc4b341901510f00289e686af1e4b45dfb300d7ca
powerpc/64s: system call rfscv workaround for TM bugs

The rfscv instruction does not work correctly with the fake-suspend mode
in POWER9, which can end up with the hypervisor restoring an incorrect
checkpoint.

Work around this by setting the _TIF_RESTOREALL flag if a system call
returns to a transaction active state, causing rfid to be used instead
of rfscv to return, which will do the right thing. The contents of the
registers are irrelevant because they will be overwritten in this case
anyway.

Fixes: e3292c1450ef5 ("powerpc/64s: system call support for scv/rfscv instructions")
Reported-by: Eirik Fuller <efuller@redhat.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210908101718.118522-1-npiggin@gmail.com
arch/powerpc/kernel/interrupt.c