From nobody Thu Dec 18 23:38:42 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A07FCEEB570 for ; Fri, 8 Sep 2023 23:03:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343600AbjIHXDa (ORCPT ); Fri, 8 Sep 2023 19:03:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239613AbjIHXD3 (ORCPT ); Fri, 8 Sep 2023 19:03:29 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 706661FEB for ; Fri, 8 Sep 2023 16:03:25 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-cf4cb742715so2497728276.2 for ; Fri, 08 Sep 2023 16:03:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1694214204; x=1694819004; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=b98aA5lsSwU0e6a2QD0NPfrvu8IBYbkSu4DS3ojXLjM=; b=7SPxUPktNb5j/Gb6kGYrDBl2U5ySeIZ4p0JB3UbScmcFwRpKbt4NGKG3ZjjJlxpReN Us2BaxwVFTTQ0tfaIDXpuRcMeaVxLaXMWj6YuZN6wLnuNLmycNJTSNYOB5LkpNQciGlK sNHMCJxvw4B9Dpjx2OzjQctzL3TFQf8DuH8WnOvcftGxhVorFVJJ8Lf8I78azJ4aN/4+ gB5w1HgXfyyQLVTeo0e/+KJCZuWfzOe79JRJgGvc+RZI0pgxrcsdVsosPrbH4qUoRdcK H8udI/kWi8VF39vGstsheVn2dXqyrva4444I4r/X9bmj5jzg54sdOU/G7DXvs/ooNa2D 6jcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694214204; x=1694819004; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=b98aA5lsSwU0e6a2QD0NPfrvu8IBYbkSu4DS3ojXLjM=; b=Nm06Yc8NpTQxeVZn0Ks9bbZgt60j87WCPEwzSsRMk0D6IIxBXdI2cP4kcpBkFcUtEC y15pah43raWXoTfvjshnaz6cF7Fg9rX7waqFtw7nLOt85Tz42mjjyqt5pHB2lnzzFudy F2GBYoR+WmpuBpSQKH6G9zAFrN7Q9M0NPxQlmuB3mabDDJ4j3g3m6EN+CC31yJBiwJoA I2VCOx7FBXmg2YASanYmHUMpxHcS607C8hrA5tBEYyRMfFK9I5YSbVUa4ko9tHbbzcRu AICFe1leWVF5XP8wRk20487Io3fF5GeVfcg9fx6TLlnNZOekdsu1lYWB3rEpqXEzJrXP cCug== X-Gm-Message-State: AOJu0YzySVJK70MDiWkoIPwOTdB2xEFftQS6zXbAk8zz/mc2gDIz9W4L Y6JwYFz5VVV3hqv9x4G4IRxsGXMVsPy0uyKPNA== X-Google-Smtp-Source: AGHT+IH7+IGP4N+5rjSjCLLdCVJhYLHEeHbwhPidz47HX5WWuR/DTQJlAG4w6KEvm7q3PZZODEduULaPwxf1R/NQyw== X-Received: from jstitt-linux1.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:23b5]) (user=justinstitt job=sendgmr) by 2002:a05:6902:1682:b0:d7b:8d0c:43f1 with SMTP id bx2-20020a056902168200b00d7b8d0c43f1mr92700ybb.9.1694214204562; Fri, 08 Sep 2023 16:03:24 -0700 (PDT) Date: Fri, 08 Sep 2023 23:03:23 +0000 Mime-Version: 1.0 X-B4-Tracking: v=1; b=H4sIADqo+2QC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDI2MDSwML3ezi1Jy0ktTiEt2CxKLE3HgwM1nX0NzMOMnMKNXczChNCai5oCg 1LbMCbHC0UpCbs1JsbS0A5OV5420AAAA= X-Developer-Key: i=justinstitt@google.com; a=ed25519; pk=tC3hNkJQTpNX/gLKxTNQKDmiQl6QjBNCGKJINqAdJsE= X-Developer-Signature: v=1; a=ed25519-sha256; t=1694214203; l=2948; i=justinstitt@google.com; s=20230717; h=from:subject:message-id; bh=U7toQp9XYVwiQw1flxIcg0RQUw/WUAt8uuyO5vIs0cs=; b=m6DVoM2aKvthnKkhJ2kEFW+8y3zfXgXLKKjGBV5dz10ltPeArywKoK91of1kYJaKM4dIIj+L1 7a9X6VMUvMWD0OcAOciXLUli+xa7n05MUMrwODU7CmSEplQPe9zvpz6 X-Mailer: b4 0.12.3 Message-ID: <20230908-kselftest-param_test-c-v1-1-e35bd9052d61@google.com> Subject: [PATCH RFC] selftests/rseq: fix kselftest Clang build warnings From: Justin Stitt To: Mathieu Desnoyers , Peter Zijlstra , "Paul E. McKenney" , Boqun Feng , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Tom Rix Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, llvm@lists.linux.dev, Justin Stitt Content-Type: text/plain; charset="utf-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Hi, I am experiencing many warnings when trying to build tools/testing/selftest= s. Here's one such example from rseq tree: | param_test.c:1234:10: error: address argument to atomic operation must b= e a pointer to _Atomic type ('intptr_t *' (aka 'long *') invalid) | 1234 | while (!atomic_load(&args->percpu_list_ptr)) {} | | ^ ~~~~~~~~~~~~~~~~~~~~~~ | /usr/local/google/home/justinstitt/repos/tc-build/build/llvm/final/lib/c= lang/18/include/stdatomic.h:140:29: note: expanded from macro 'atomic_load' | 140 | #define atomic_load(object) __c11_atomic_load(object, __ATOMIC_S= EQ_CST) | | ^ ~~~~~~ I added the _Atomic type in various locations to silence _all_ (10) of these warnings. I'm wondering, though, perhaps the absence of these _Atomic types in the first place is on purpose? Am I on the right track to fix these warnings without damaging the legitimacy of the tests at hand? I'd like some feedback about where to go from here and if others are experiencing the same issues. Thanks! FWIW here's my specific build incantation on Clang-18 (49d41de57896e935cd57= 26719c5208bce22694ae): $ make LLVM=3D1 -j128 ARCH=3Dx86_64 mrproper headers defconfig kselftest-me= rge $ make LLVM=3D1 ARCH=3Dx86_64 -C tools/testing/selftests Link: https://github.com/ClangBuiltLinux/linux/issues/1698 Link: https://github.com/ClangBuiltLinux/continuous-integration2/issues/61 Signed-off-by: Justin Stitt --- tools/testing/selftests/rseq/param_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/rseq/param_test.c b/tools/testing/self= tests/rseq/param_test.c index bf951a490bb4..94802aeed2c6 100644 --- a/tools/testing/selftests/rseq/param_test.c +++ b/tools/testing/selftests/rseq/param_test.c @@ -356,7 +356,7 @@ struct inc_thread_test_data { }; =20 struct percpu_list_node { - intptr_t data; + _Atomic intptr_t data; struct percpu_list_node *next; }; =20 @@ -1212,8 +1212,8 @@ static int set_signal_handler(void) /* Test MEMBARRIER_CMD_PRIVATE_RESTART_RSEQ_ON_CPU membarrier command. */ #ifdef TEST_MEMBARRIER struct test_membarrier_thread_args { - int stop; - intptr_t percpu_list_ptr; + _Atomic int stop; + _Atomic intptr_t percpu_list_ptr; }; =20 /* Worker threads modify data in their "active" percpu lists. */ @@ -1240,7 +1240,7 @@ void *test_membarrier_worker_thread(void *arg) int cpu =3D get_current_cpu_id(); =20 ret =3D rseq_offset_deref_addv(RSEQ_MO_RELAXED, RSEQ_PERCPU, - &args->percpu_list_ptr, + (intptr_t*)&args->percpu_list_ptr, sizeof(struct percpu_list_entry) * cpu, 1, cpu); } while (rseq_unlikely(ret)); } --- base-commit: 2dde18cd1d8fac735875f2e4987f11817cc0bc2c change-id: 20230908-kselftest-param_test-c-1763b62e762f Best regards, -- Justin Stitt