* [PATCH] selftests/futex: load atomic values before harness comparisons
@ 2026-10-14 20:01 Sasha Levin
2026-11-03 13:01 ` Sasha Levin
2026-11-03 13:03 ` André Almeida
0 siblings, 2 replies; 3+ messages in thread
From: Sasha Levin @ 2026-10-14 20:01 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, Peter Zijlstra
Cc: Sasha Levin, Darren Hart, Davidlohr Bueso, André Almeida,
Nathan Chancellor, Shuah Khan, llvm, linux-kselftest,
linux-kernel
Clang 21 rejects the harness comparison because typeof(*futex) preserves
the atomic qualification. Load the value explicitly in the three affected
assertions so the harness compares unsigned integers. Atomic access and
its existing sequentially consistent ordering are preserved.
The baseline produces three invalid-operands errors. The complete futex
suite builds with Clang 21 and GCC 14 after the change.
Fixes: 608323bf7bb8 ("selftests: futex: Add tests for robust release operations")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/futex/functional/robust_list.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/futex/functional/robust_list.c b/tools/testing/selftests/futex/functional/robust_list.c
index 87217c5493619..895e6cfe59bcd 100644
--- a/tools/testing/selftests/futex/functional/robust_list.c
+++ b/tools/testing/selftests/futex/functional/robust_list.c
@@ -669,7 +669,7 @@ TEST_F(vdso_unlock, test_robust_try_unlock_uncontended)
ret = self->vdso(futex, tid, &head.list_op_pending);
ASSERT_EQ(ret, tid);
- ASSERT_EQ(*futex, 0);
+ ASSERT_EQ(atomic_load(futex), 0);
/* Check only the lower 32 bits for the 32-bit entry point */
if (variant->is_32) {
@@ -709,7 +709,7 @@ TEST_F(vdso_unlock, test_robust_try_unlock_contended)
ret = self->vdso(futex, tid, &head.list_op_pending);
ASSERT_EQ(ret, tid | FUTEX_WAITERS);
- ASSERT_EQ(*futex, tid | FUTEX_WAITERS);
+ ASSERT_EQ(atomic_load(futex), tid | FUTEX_WAITERS);
ASSERT_EQ(head.list_op_pending, &lock.list);
}
@@ -793,7 +793,7 @@ TEST_F(futex_op, test_futex_robust_unlock)
&head.list_op_pending, variant->val3);
ASSERT_EQ(ret, 0);
- ASSERT_EQ(*futex, 0);
+ ASSERT_EQ(atomic_load(futex), 0);
if (variant->op & FUTEX_ROBUST_LIST32) {
exp = (uint64_t)(unsigned long)&lock.list;
base-commit: 4eb2586bd40db27d77cc5b724ca9386ed0c71d53
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] selftests/futex: load atomic values before harness comparisons
2026-10-14 20:01 [PATCH] selftests/futex: load atomic values before harness comparisons Sasha Levin
@ 2026-11-03 13:01 ` Sasha Levin
2026-11-03 13:03 ` André Almeida
1 sibling, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2026-11-03 13:01 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, Peter Zijlstra
Cc: Darren Hart, Davidlohr Bueso, André Almeida,
Nathan Chancellor, Shuah Khan, llvm, linux-kselftest,
linux-kernel
Ping, this still applies on 7.4-rc1. The clang jobs in KernelCI still
fail to build futex/functional/robust_list.c with the three
invalid-operands errors.
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] selftests/futex: load atomic values before harness comparisons
2026-10-14 20:01 [PATCH] selftests/futex: load atomic values before harness comparisons Sasha Levin
2026-11-03 13:01 ` Sasha Levin
@ 2026-11-03 13:03 ` André Almeida
1 sibling, 0 replies; 3+ messages in thread
From: André Almeida @ 2026-11-03 13:03 UTC (permalink / raw)
To: Sasha Levin
Cc: Peter Zijlstra, Darren Hart, Davidlohr Bueso, Thomas Gleixner,
Ingo Molnar, Nathan Chancellor, Shuah Khan, llvm,
linux-kselftest, linux-kernel
Em 14/10/2026 17:01, Sasha Levin escreveu:
> Clang 21 rejects the harness comparison because typeof(*futex) preserves
> the atomic qualification. Load the value explicitly in the three affected
> assertions so the harness compares unsigned integers. Atomic access and
> its existing sequentially consistent ordering are preserved.
>
> The baseline produces three invalid-operands errors. The complete futex
> suite builds with Clang 21 and GCC 14 after the change.
>
> Fixes: 608323bf7bb8 ("selftests: futex: Add tests for robust release operations")
> Signed-off-by: Sasha Levin <sashal@kernel.org>
Reviewed-by: André Almeida <andrealmeid@igalia.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-03 13:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-14 20:01 [PATCH] selftests/futex: load atomic values before harness comparisons Sasha Levin
2026-11-03 13:01 ` Sasha Levin
2026-11-03 13:03 ` André Almeida
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®