From nobody Thu Apr 2 18:03:37 2026 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 90971C6FA86 for ; Thu, 22 Sep 2022 11:11:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231128AbiIVLLD (ORCPT ); Thu, 22 Sep 2022 07:11:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230078AbiIVLK1 (ORCPT ); Thu, 22 Sep 2022 07:10:27 -0400 Received: from smtpout.efficios.com (smtpout.efficios.com [IPv6:2607:5300:203:5aae::31e5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C33FE9CCC4; Thu, 22 Sep 2022 04:10:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1663844391; bh=ghI6w5m/fBuPawbc/R5A+f4FNxklkEyjIEUh4Xg9S2w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZeNNG0+c965RQbK9u1D1aNoPqc2b8MiqVflVLt4SPijocc/RBd5etYGT2cFRdKVmm pStqOBWB93+W9y76HuMLQKjk5I+W4loxSpVwqboqNRXgqfwgSZibFt674Wo/VRqWln 74xkxCm8BiRWauX9OPj4Lm0SED3Wuef+lGT4UI8sSc26snYHr8ARyJyDrKRC9u+fF4 DxtmWJQnhOGdj/26NyomtKe04YaNq64KiMZSF5OLoWTWqgrv+n9zDhVWJYKSQXY6bn xUKRO4JwYNgvKffEKQSfxClh2fKf9OI1G0Lx4I2AvBiPLVAN+NhjwcExeAdQhgRPPq PkH9djc7wcIXg== Received: from localhost.localdomain (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4MYC3V5VN7zNF9; Thu, 22 Sep 2022 06:59:50 -0400 (EDT) From: Mathieu Desnoyers To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , "Paul E . McKenney" , Boqun Feng , "H . Peter Anvin" , Paul Turner , linux-api@vger.kernel.org, Christian Brauner , Florian Weimer , David.Laight@ACULAB.COM, carlos@redhat.com, Peter Oskolkov , Alexander Mikhalitsyn , Mathieu Desnoyers Subject: [PATCH v4 24/25] selftests/rseq: parametrized test: Report/abort on negative cpu id Date: Thu, 22 Sep 2022 06:59:39 -0400 Message-Id: <20220922105941.237830-25-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922105941.237830-1-mathieu.desnoyers@efficios.com> References: <20220922105941.237830-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Report and abort when a negative cpu id value is observed by the spinlock test. Signed-off-by: Mathieu Desnoyers --- tools/testing/selftests/rseq/param_test.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/rseq/param_test.c b/tools/testing/self= tests/rseq/param_test.c index f3687a90ec0c..1c86b45bd579 100644 --- a/tools/testing/selftests/rseq/param_test.c +++ b/tools/testing/selftests/rseq/param_test.c @@ -410,6 +410,11 @@ static int rseq_this_cpu_lock(struct percpu_lock *lock) int ret; =20 cpu =3D get_current_cpu_id(); + if (cpu < 0) { + fprintf(stderr, "pid: %d: tid: %d, cpu: %d: Observing vcpu id %d\n", + getpid(), (int) rseq_gettid(), rseq_current_cpu_raw(), cpu); + abort(); + } ret =3D rseq_cmpeqv_storev(RSEQ_MO_RELAXED, RSEQ_PERCPU, &lock->c[cpu].v, 0, 1, cpu); --=20 2.25.1