linux/tools/testing
Thibault Ferrante ed28b16eab selftests/powerpc/tm: Fix tcheck() reading uninitialised CR value
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().

Fix tcheck() to actually move CR into the output register with mfcr,
and widen the mask from "& 4" to "& 0xf" so the full CR0 nibble
(TDOOMED | TS_msb | TS_lsb | reserved) is preserved for the callers.

This bug has been present since tcheck() was introduced.

Link: https://bugs.launchpad.net/bugs/2107442
Fixes: 8e03bd4e70 ("selftests/powerpc: Add TM tcheck helpers in C")
Signed-off-by: Thibault Ferrante <thibault.ferrante@canonical.com>
Reported-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Closes: https://lore.kernel.org/all/364996ce-aba2-4213-8d20-7dd481b43fe6@linux.ibm.com/
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260907215420.1258678-1-thibault.ferrante@canonical.com
2026-09-10 13:12:09 +05:30
..
crypto/chacha20-s390 crypto: drbg - Fold include/crypto/drbg.h into crypto/drbg.c 2026-05-07 16:09:59 +08:00
cxl Merge branch 'for-7.3/cxl-misc' into cxl-for-next 2026-08-05 13:23:52 -07:00
fault-injection
ktest ktest: Add logfile to failure directory 2026-04-20 15:23:13 -04:00
kunit spi: Updates for v7.3 2026-08-19 09:47:41 -07:00
memblock kho: make boot time huge page allocation work nicely with KHO 2026-08-23 09:17:38 -07:00
nvdimm nvdimm: ndtest: remove redundant NULL check before vfree() 2026-07-14 16:12:53 -07:00
radix-tree maple_tree: change two GFP flags in tests 2026-08-24 18:43:31 -07:00
rbtree
scatterlist
selftests selftests/powerpc/tm: Fix tcheck() reading uninitialised CR value 2026-09-10 13:12:09 +05:30
shared mm/slab: improve kmem_cache_alloc_bulk 2026-06-03 18:20:43 +02:00
vma mm: fix CONFIG_STACK_GROWSUP typo in tools/testing/vma/include/dup.h 2026-08-24 18:43:12 -07:00
vsock vsock/test: add test for small packets under pressure 2026-07-21 12:11:06 +02:00