Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6455368rwb; Tue, 22 Nov 2022 13:43:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf7AnOHDUhACh5amsysIO/5kMhvQrr4MiS0qHMIQLAJFF/nhw/CKQjfZTeBR//tkixsyZDHZ X-Received: by 2002:a17:903:2112:b0:188:7dca:6f41 with SMTP id o18-20020a170903211200b001887dca6f41mr5849118ple.72.1669153393994; Tue, 22 Nov 2022 13:43:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669153393; cv=none; d=google.com; s=arc-20160816; b=o7gwhPjZg4wdFQ2RpYO3K1InTOwqiJST1v91KnfNHLjCn1Apsktj8vZ3uEDly8ZasO Y3h6wORawQR7JWjOXZa4WSgfj1SyI/Xjkwi2xOZTTtHJw6D/LkBR5w0MER0PlHjZE52/ usjUpdeBJUIbkTzhppLUQHHtka88SMiL1yfEuqGpISdnvK3CaalDoepZZ/ecnsVc6oz6 UURxDQ1LQ9S1kOECMgcgsLxh4NUpfiQ13yGbL8VMTGje33yEREpOXDwXyNWl5L+DQoRg iEEnylSjdkdruZYoHkBbsG9PqkySBAqCxOb9Aio3BlQp0KRHCCrDfeqbq6CDoB78xH5R UMEw== 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=pOgVO/MA6sUwe5V3efcKSsiEHXuZ354px1XdqR5x9kE=; b=UGtuTrZzzD9so9KY8c7EIck2iAi/xhA1lqLAiHW3dcUQWTay4Q7eSCUDINmcIcM/Qy Qmil14/bV3O2msAR194z3ZoG4T2Vv8ehdi1gINlcObrYB/zpvr2Vt2M2BCcWVQx9oGGL 8vaC0x6kplq5YHizjrxBKFdz8b8w9Xr/fxHm1PYSqY7coonQ13OIO22trxFshllAd2Os mzhJiIMqXPE4qJaR9x5fvm5UoKVlXnxT527Hr+cOZmoWm+DlL5d+UuKFAdttffaD/+Uu oV0lUHSMn4DBNEn9tsZUkqrHzFtezdwmz76e6UbVC+zpM4oJGkmHaBbCgs9oK+ikzd+g JMZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=BUmSBoT8; 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 p5-20020a17090a4f0500b00212ec29c79asi54065pjh.62.2022.11.22.13.43.02; Tue, 22 Nov 2022 13:43:13 -0800 (PST) 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=BUmSBoT8; 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 S234982AbiKVUlg (ORCPT + 89 others); Tue, 22 Nov 2022 15:41:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234927AbiKVUj5 (ORCPT ); Tue, 22 Nov 2022 15:39:57 -0500 Received: from smtpout.efficios.com (unknown [IPv6:2607:5300:203:b2ee::31e5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01AF46E551; Tue, 22 Nov 2022 12:39:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1669149593; bh=Uj7UFmczknLn8GfrObDVcaH2jaTFCQ4AqsX1N3NtBH4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BUmSBoT8tcKMOuWgSgeJlbZyKXSL6WYuJsCyq0mob5gkZYLPkqga7KP05RMkBb/EU Pr/yK2o5o2GWfSBGTLPKuH0VpMs4K/v4iaLcv0k+NU+8+rO2N6Z1EjlhErFDARGktJ /02CPk3WU0i3PO9K/dSrVTBgOpNHwS6d/8cR+ZwbLmdA5lVTzULBeFctPVSMVajgtb DMPc4qppNgz70XCwv4SLmyhpvUdiqhmoEri+b7r8xz1PW2pMzuPFB7gemSqJtEk3gB L0tZFg9wGj+fAR8vll18nPCLK6l+2x3hnE1hJs+QeftxoOK/W51+qBafbMh80bHkA7 uDqNkTCrD5Zxw== Received: from localhost.localdomain (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4NGx2c5hmtzWgn; Tue, 22 Nov 2022 15:39:52 -0500 (EST) 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 , Chris Kennelly , Mathieu Desnoyers Subject: [PATCH 20/30] selftests/rseq: parametrized test: Report/abort on negative concurrency ID Date: Tue, 22 Nov 2022 15:39:22 -0500 Message-Id: <20221122203932.231377-21-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221122203932.231377-1-mathieu.desnoyers@efficios.com> References: <20221122203932.231377-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RDNS_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no 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 concurrency 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 cadb9d884811..bf951a490bb4 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: cid: %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