Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp73319ybj; Fri, 8 May 2020 06:50:27 -0700 (PDT) X-Google-Smtp-Source: APiQypJSa+Np9T5aCXx/yuKvLqaFq6jCrQ3JYM4UMNraodMowE8yrhagW10OAv39uQA4Ckif21xR X-Received: by 2002:a05:6000:189:: with SMTP id p9mr1033799wrx.187.1588945827619; Fri, 08 May 2020 06:50:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588945827; cv=none; d=google.com; s=arc-20160816; b=A9uPMhPjDmQPtqI+Uya107j3oUVGCnV6IpyIv+sYOPNSEuRXh1rSwaGwPhrRYyl+S/ ilsorBw8vXKIiGK/zHqVNnVkfZpycG0BXiULwGnWH+0jd8jNzw4xblif6m5S3z0HYymR U6WfXaN+TonEJy2A3cxhwPwjgfAgXFRXXUfA6TYxTFsXs2Ot6TI8csb20gn18tEfeCA6 vTfhz89BrZnYw9NUlczZpa+Q/AgJ/wM6EiD+etwTDK4sOuTbnrQGNABvNhkBDaXUHZcL ZhiM3O9J+0N+6UqV2OzbQ3z++qeOxjBaIEsGv7X+1fe3UHF6QgSNsgVYt7qRwyColDAn s6wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=MSeJkITTDNp/1D/d4CLQ3HeK/DpnTcLjsvcAm0PTLRU=; b=rrt6wuOXloo91wTSOb2G68GCAxYpikP5nHZ/r+vZptud2vODBcbxLL8RZHZCcxno+f pm73zNzDQZdE4rF+pIHo5KTk6TozGSMDje8IYpuq+ODep1o5BDmw4jxFj8XaJGXsUNCD 0uUCcaa202OQxz1PqSfn3Tc85htqxL3JXHrtI5xHKbjhB7BbXyG065ImOwUA5M2CTbqI z09fHOd0QP7Rd0s/pxaijNQnw+whb0eHY8ZU2C9cdRxd5V2MV2rMxmFpCYBJ8OsEowkU 1k5m1y0vORd5zWUWhssV7lZ099SvTdHFgV2nhzHs04wuX8LzGiaUXI5yK7MMUGi7rDic y5eA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h133si7741914wmf.179.2020.05.08.06.50.03; Fri, 08 May 2020 06:50:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728575AbgEHNrd (ORCPT + 99 others); Fri, 8 May 2020 09:47:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728137AbgEHNqg (ORCPT ); Fri, 8 May 2020 09:46:36 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5D0CC05BD43; Fri, 8 May 2020 06:46:35 -0700 (PDT) Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jX3Kj-0001mB-EZ; Fri, 08 May 2020 15:46:33 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 20D781C0080; Fri, 8 May 2020 15:46:33 +0200 (CEST) Date: Fri, 08 May 2020 13:46:33 -0000 From: "tip-bot2 for Marco Elver" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/kcsan] kcsan: Change data_race() to no longer require marking racing accesses Cc: "Paul E. McKenney" , Will Deacon , Qian Cai , Marco Elver , x86 , LKML In-Reply-To: <20200331131002.GA30975@willie-the-truck> References: <20200331131002.GA30975@willie-the-truck> MIME-Version: 1.0 Message-ID: <158894559307.8414.14354210811122295104.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the locking/kcsan branch of tip: Commit-ID: d071e91361bbfef524ae8abf7e560fb294d0ad64 Gitweb: https://git.kernel.org/tip/d071e91361bbfef524ae8abf7e560fb294d0ad64 Author: Marco Elver AuthorDate: Tue, 31 Mar 2020 21:32:33 +02:00 Committer: Paul E. McKenney CommitterDate: Mon, 13 Apr 2020 17:18:15 -07:00 kcsan: Change data_race() to no longer require marking racing accesses Thus far, accesses marked with data_race() would still require the racing access to be marked in some way (be it with READ_ONCE(), WRITE_ONCE(), or data_race() itself), as otherwise KCSAN would still report a data race. This requirement, however, seems to be unintuitive, and some valid use-cases demand *not* marking other accesses, as it might hide more serious bugs (e.g. diagnostic reads). Therefore, this commit changes data_race() to no longer require marking racing accesses (although it's still recommended if possible). The alternative would have been introducing another variant of data_race(), however, since usage of data_race() already needs to be carefully reasoned about, distinguishing between these cases likely adds more complexity in the wrong place. Link: https://lkml.kernel.org/r/20200331131002.GA30975@willie-the-truck Cc: Paul E. McKenney Cc: Will Deacon Cc: Qian Cai Acked-by: Will Deacon Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney --- include/linux/compiler.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index f504ede..1729bd1 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -326,9 +326,9 @@ unsigned long read_word_at_a_time(const void *addr) #define data_race(expr) \ ({ \ typeof(({ expr; })) __val; \ - kcsan_nestable_atomic_begin(); \ + kcsan_disable_current(); \ __val = ({ expr; }); \ - kcsan_nestable_atomic_end(); \ + kcsan_enable_current(); \ __val; \ }) #else