On Mon, 07 Sep 2026 23:54:20 +0200, Thibault Ferrante wrote:
> tcheck() is used to check the current transaction state (active,
> suspended, doomed) via the "tcheck" instruction, which writes its
> result into CR field 0. The inline asm declared a GPR output operand
> for this result but never actually moved the CR into it.
> 
> Every caller (tcheck_doomed(), tcheck_active(), tcheck_suspended(),
> tcheck_transactional()) has effectively been testing bits of an unrelated,
> arbitrary register value since this helper was introduced.
> The "& 4" mask discards the TDOOMED and TS_lsb (suspended) bits before
> they ever reach the callers, so tcheck_doomed() and tcheck_suspended()
> can never return true, and tcheck_transactional() degrades to being
> equivalent to tcheck_active().
> 
> [...]

Applied to powerpc/fixes.

[1/1] selftests/powerpc/tm: Fix tcheck() reading uninitialised CR value
      https://git.kernel.org/powerpc/c/ed28b16eab705071d28edaace47189c2eb3aa108

cheers

Reply via email to