From patchwork Tue Nov 22 20:39:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 24573 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2429365wrr; Tue, 22 Nov 2022 12:42:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf7r2a2Ocn2J0wwTlgc7YktevkJkbYBCmFjXkYNTyxfihcC9fYrbz0StVAyadXlyy8EwP0+u X-Received: by 2002:a63:d14f:0:b0:476:95a8:de78 with SMTP id c15-20020a63d14f000000b0047695a8de78mr8801556pgj.66.1669149775302; Tue, 22 Nov 2022 12:42:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669149775; cv=none; d=google.com; s=arc-20160816; b=KzB6CmppYqZ0fgKgJEGKCXnw6eZt8lAKpBg68uFX2cCPbcCYzYFywnvGGlGfseQS7C hKTRJAZ9MeA8mjVn7JKnoKW3YicIYbiEqS85ZXL99QGZLEYSvzIfe10/3K7wuZTuz4/l 6hlsYWq8RBEIVD83Vr/R9S0yxTCUyYah7ymnrG6F8oenrHlcK6QDz0CWeUls8FPQXJH/ A+rKG5KlQeN+dUw8IAgQ4c7dWvOW6Upzif9z31/kRE0cCfQIuvAyLCuAlof6YDA8wZAh 0Vj+w/XZtKc0Brxjxh57Njjp8sMEAnFXhmgvrM46hv5god1RwdcZ2gnrUnZuTePzy3fC 9osg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k9-20020a170902d58900b0017f59ed2dfasi15858921plh.63.2022.11.22.12.42.28; Tue, 22 Nov 2022 12:42:55 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750230394561183521?= X-GMAIL-MSGID: =?utf-8?q?1750230394561183521?= 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);