Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp623881rwb; Thu, 22 Sep 2022 04:32:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7nHwONR+NEgpzwhWF2Gqf452+CoxHXifRlRk6subVJ+/YFqqjR4zg8rcJHJuiEyEvc1m3X X-Received: by 2002:a17:907:a079:b0:77d:a363:64b6 with SMTP id ia25-20020a170907a07900b0077da36364b6mr2278076ejc.451.1663846358040; Thu, 22 Sep 2022 04:32:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663846358; cv=none; d=google.com; s=arc-20160816; b=VUPB7lbtOL1UUWIN8Gto3pQn/4lqI6e97F5Df9oukTnOsyj9KpgWLRp/RJ8XwqDMNZ QCsDNzhjmVpXX6jPhFtyFxbnt9zc3cloK7x/DmxTD9G1O7CEStNPCItOTO2xkR67wHDE vit51uuaNSRj0C9wQxx8hic1R6F/S09BX1jo0Aw2qZQDYDowxVkj5P1H6NtPu1SSNtGK QP76vKnsl0BMOBSNgfPGa3tuxTZLC0h8RMVUBbMIH5w92eWa89HZHDtzGBbeT+5Ewa/d xmfBqILfLiB5opB+VSn0Xei0xsmbqwzjSpOR4Zvomt4IwoUtPx2Wacg+qW52miOHy/eR 97NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dkT8RPBe8dG6o12giDl5DqFYR4Opn//NSLkzS6Qvrcs=; b=u45Z2fvrq7dKDkCNInBB86Bc3u6db7thMkAovCQb+a0+82V8VsrCaJVcnFPkrYY+Cn iLiJAMvsfvBvXfvXwNLJnT1Qm8PwT6l0r9/BsAFgeD1oaYTzXMiFmgWMLTcV+QM4T235 Irw++1mxVpqeIbl29FoL6/E32+i3wCtfs0RQpXfv7xM7PM0RoIUisL53MGUt9383tbeF uwbZkpTNLHPT4w0t9MsDYN4QB8t0okGbyrGc2a7++A4y7uR0AWpjTFtoQ5/Rso22f1NH Vcj0BxQUXV5vHg1+39D9N8HvRPW2Pc4bu2OQTZu47s6y8QNtmDHJ3DEY+HLRaQOY3sJp 34Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=ZeNNG0+c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd16-20020a170907969000b007803b5893f2si2054708ejc.672.2022.09.22.04.28.45; Thu, 22 Sep 2022 04:32:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=ZeNNG0+c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231460AbiIVLLC (ORCPT + 99 others); Thu, 22 Sep 2022 07:11:02 -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: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/selftests/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; cpu = 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 = rseq_cmpeqv_storev(RSEQ_MO_RELAXED, RSEQ_PERCPU, &lock->c[cpu].v, 0, 1, cpu); -- 2.25.1