Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp2164083rwi; Thu, 3 Nov 2022 13:31:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4ICqKv82qtI+K9R+21csbDa9bbn63tTv8X5G+0lNZnk9oqnwluqnRzBv4b00+WqRmHBVou X-Received: by 2002:a17:90b:4a92:b0:213:54f:ddd8 with SMTP id lp18-20020a17090b4a9200b00213054fddd8mr50967404pjb.234.1667507483422; Thu, 03 Nov 2022 13:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667507483; cv=none; d=google.com; s=arc-20160816; b=JHzb8zFPRRsWzj8dWRsdhNksJprPjFtcrLI7w4fLIx8NCwgLAy/NZLtTOvyyRKeOKS PZEZ00lw0OZq9bn4M5xNGSaPGowzfg+EDraL6nGqRZ98cJz/bH4OT70p+MPo4UMJJCxf Q1Ahq+0DyFzDWL6hhgsabaqGNq2Dyhat6nzyjvIDNn7W829PMTfdLsHmAhd6WRYwQO30 a54Vn8BU3tVAPKL+mr+H8Nh57rrvHEHbbcv38q1HdLnsHBFGPuNtjaWgMzlBDRf2ufYn FPN4EIqo+3i0rxp36oRjkdtFm79wj1ZFuNiykL13OyqRSCwjeU7I4roix+cqQ1IxSAqE dIgA== 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=Wj9KTs3z4gcpz6PqJd79gcDEH0Jao7wj0nfX4xuCNYE/uTCqSAEoQzqqLLkmRyWg16 70vRniyFP1gm8k+vFeQs7GiPF3l9DwQmLinT2pHuqGegnUOlRYpZDy9NYcNcdFbOhQWc HlnNmj6TTAdY9jjJIg6I/P4qQExxv/tH0VIyJGcCkYXrX7nazm9BkMnKbrDqAUelpE5B S6VBh+uI6ItIigwLxbr3lxg5NtdrgdJUHIW4X4H3RaViUSwcuxX5x+M4sqcfDZ14/qii b/7tP75FjXXu0+pSsUp+q6XazyKiVHew1pX4GPYdSHfrCCe7gtPylNAp69yb2Y3Ra4+4 MKpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=gUfZiiUu; 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 s142-20020a632c94000000b0046afed15623si1915608pgs.372.2022.11.03.13.31.10; Thu, 03 Nov 2022 13:31:23 -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=gUfZiiUu; 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 S231789AbiKCUGq (ORCPT + 97 others); Thu, 3 Nov 2022 16:06:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231404AbiKCUFQ (ORCPT ); Thu, 3 Nov 2022 16:05:16 -0400 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53188205F2; Thu, 3 Nov 2022 13:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1667505904; bh=ghI6w5m/fBuPawbc/R5A+f4FNxklkEyjIEUh4Xg9S2w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gUfZiiUuutcK6KdatvmWhn8NGtZU2VkDD1lmteu03H71N+hiQ14a19T1sM2+NRdQl vsxPW2pf5z+7LfNYbI+42XEl58Sokm0z8oeAq+CEAqx41xeCYSBPVwRM8mL6bi3Xxn kNBiSe+Dd2A0fOl+mKepMVMjhE2alx5vYAHAXsY19WCTf1qAtBkVeKAmg0yY1szCth OiS091Bbw+YlZR02oFvKNRf9IgU0qmIbETFXs+DTyTjWRStLTqKz6cA2TiHzec+awQ tj9knfGeYfmgjNB5qxMCDvEyyyZ6A8DY1y4LkoONY+wKi3bi7609pHurYtwl8USGpY SwETJy9PhRz3g== Received: from localhost.localdomain (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4N3F9D0p0Tzg0D; Thu, 3 Nov 2022 16:05:04 -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 , Chris Kennelly , Mathieu Desnoyers Subject: [PATCH v5 23/24] selftests/rseq: parametrized test: Report/abort on negative cpu id Date: Thu, 3 Nov 2022 16:03:58 -0400 Message-Id: <20221103200359.328736-24-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221103200359.328736-1-mathieu.desnoyers@efficios.com> References: <20221103200359.328736-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