Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp239146ybl; Wed, 11 Dec 2019 17:20:43 -0800 (PST) X-Google-Smtp-Source: APXvYqxSRKHBO1gsEp2O2ino9EXfy3mh7eVEv9weld0T7d0VNqNdjNrKTBtZShKxgCvqpc8EmP9B X-Received: by 2002:aca:d18:: with SMTP id 24mr4799017oin.38.1576113642871; Wed, 11 Dec 2019 17:20:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576113642; cv=none; d=google.com; s=arc-20160816; b=feRW37ZV8QYD8U2CbO8vdk0Kve/MeacKGjal2UPV8nCkWr1avS9WGf22f3aDeauJlE Lc54rxKEDmo04y7UnTDQH8fw0nOlbBbP7es8dfggMEXpnWnubsSDbY2h9DjZ2K7ekQJM IdOgTFYXN2ynUhB7gnqHHZs8mamQb7c8bSlEGhzHGz+HXkXWOeWt++nZSG/gtfP2oHgv v3o4qIySPdc4x7QTVNGODpRgX7WlZTcu5oxcFciKn2OSCcUEHEYKAS4Zo9pZNhE2NCl8 efJ4YUZ4K3EHenFYu+7gPXg+cdwSDFQw2QU5FTyTZMaht3ptoB2mPfWz8VTJZvmZv+9n JgNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=/CgnngspqXUiViVBtDBHO52oSAxz2y2DL75wL6Ka794=; b=ddU3FCgCWdRzv+7jM6F0zL66Qoqk7wU1ROpZ5JR6PLDEpqEq7ufGAcuetP2nn98hID N/LlNi9uTgyBhiV3N+SUQuVC/WzjrCEHWoNVu90eB21/tWRx5Xojdua0ZzzG7DC1Oo0M 8j0ZZgxg/oCXLzs7yAHXbW6dLIO0WBml+HvFJyG/VbiLYu7k7UvWEs4nL4rz5M2MhhaH O9Xf9YgQX/u+w5vVznXhju+zIg+gMrGqZSlTgFQcmHwVC/5QAf9CfgMFR8DJIYNKH69S 5kL7GWZ/QAYjfEu+GQaq1sGdjnRgYDoDN9Mwl7CX9F8lKLN4YreBBU4ucf9LcOsaFDvK RpeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=L5fWSRXd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d17si2288681oij.136.2019.12.11.17.20.30; Wed, 11 Dec 2019 17:20:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=L5fWSRXd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727409AbfLLBUC (ORCPT + 99 others); Wed, 11 Dec 2019 20:20:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:33558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727297AbfLLBUC (ORCPT ); Wed, 11 Dec 2019 20:20:02 -0500 Received: from paulmck-ThinkPad-P72.home (unknown [199.201.64.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 06904214D8; Thu, 12 Dec 2019 01:20:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576113601; bh=2xneQyJ26LjPKcfQUBVtoZqwvkEND8rpRB+N5P9GBjM=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=L5fWSRXdjhHTiYZMsMkQ3arn/RcFsM7zwX9vMQbnajx/dd/SnKF02EfuCqBra5/gW Nmkrh9iMg3UG4qEBSdANw0+26B0fUK+zAC5gBL9BbsuhoWGn3kaOjnrPgnSduOQnAr vNsmPLX1Vlvkjzn0DKmnMl6msJRaMx/HmxtYvnKc= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 8DCB535203C6; Wed, 11 Dec 2019 17:20:00 -0800 (PST) Date: Wed, 11 Dec 2019 17:20:00 -0800 From: "Paul E. McKenney" To: Marco Elver Cc: torvalds@linux-foundation.org, mingo@kernel.org, peterz@infradead.org, will@kernel.org, tglx@linutronix.de, akpm@linux-foundation.org, stern@rowland.harvard.edu, dvyukov@google.com, mark.rutland@arm.com, parri.andrea@gmail.com, edumazet@google.com, linux-doc@vger.kernel.org, kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH -rcu/kcsan 1/2] kcsan: Document static blacklisting options Message-ID: <20191212012000.GP2889@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20191212000709.166889-1-elver@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191212000709.166889-1-elver@google.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 12, 2019 at 01:07:08AM +0100, Marco Elver wrote: > Updates the section on "Selective analysis", listing all available > options to blacklist reporting data races for: specific accesses, > functions, compilation units, and entire directories. > > These options should provide adequate control for maintainers to opt out > of KCSAN analysis at varying levels of granularity. It is hoped to > provide the required control to reflect preferences for handling data > races across the kernel. > > Signed-off-by: Marco Elver Both queued for testing and review, thank you! Thanx, Paul > --- > Documentation/dev-tools/kcsan.rst | 24 +++++++++++++++++------- > 1 file changed, 17 insertions(+), 7 deletions(-) > > diff --git a/Documentation/dev-tools/kcsan.rst b/Documentation/dev-tools/kcsan.rst > index a6f4f92df2fa..65a0be513b7d 100644 > --- a/Documentation/dev-tools/kcsan.rst > +++ b/Documentation/dev-tools/kcsan.rst > @@ -101,18 +101,28 @@ instrumentation or e.g. DMA accesses. > Selective analysis > ~~~~~~~~~~~~~~~~~~ > > -To disable KCSAN data race detection for an entire subsystem, add to the > -respective ``Makefile``:: > +It may be desirable to disable data race detection for specific accesses, > +functions, compilation units, or entire subsystems. For static blacklisting, > +the below options are available: > > - KCSAN_SANITIZE := n > +* KCSAN understands the ``data_race(expr)`` annotation, which tells KCSAN that > + any data races due to accesses in ``expr`` should be ignored and resulting > + behaviour when encountering a data race is deemed safe. > + > +* Disabling data race detection for entire functions can be accomplished by > + using the function attribute ``__no_kcsan`` (or ``__no_kcsan_or_inline`` for > + ``__always_inline`` functions). To dynamically control for which functions > + data races are reported, see the `debugfs`_ blacklist/whitelist feature. > > -To disable KCSAN on a per-file basis, add to the ``Makefile``:: > +* To disable data race detection for a particular compilation unit, add to the > + ``Makefile``:: > > KCSAN_SANITIZE_file.o := n > > -KCSAN also understands the ``data_race(expr)`` annotation, which tells KCSAN > -that any data races due to accesses in ``expr`` should be ignored and resulting > -behaviour when encountering a data race is deemed safe. > +* To disable data race detection for all compilation units listed in a > + ``Makefile``, add to the respective ``Makefile``:: > + > + KCSAN_SANITIZE := n > > debugfs > ~~~~~~~ > -- > 2.24.0.525.g8f36a354ae-goog >