From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA5C0C4332F for ; Tue, 5 Oct 2021 13:13:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 338C16138F for ; Tue, 5 Oct 2021 13:13:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 338C16138F Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 6BED66B006C; Tue, 5 Oct 2021 09:13:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 66D916B0071; Tue, 5 Oct 2021 09:13:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 55CD2900002; Tue, 5 Oct 2021 09:13:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0096.hostedemail.com [216.40.44.96]) by kanga.kvack.org (Postfix) with ESMTP id 466BD6B006C for ; Tue, 5 Oct 2021 09:13:38 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D72432CBC3 for ; Tue, 5 Oct 2021 13:13:37 +0000 (UTC) X-FDA: 78662425674.09.52E197D Received: from mail-oo1-f53.google.com (mail-oo1-f53.google.com [209.85.161.53]) by imf19.hostedemail.com (Postfix) with ESMTP id 9430AB00155F for ; Tue, 5 Oct 2021 13:13:37 +0000 (UTC) Received: by mail-oo1-f53.google.com with SMTP id l8-20020a4ae2c8000000b002b5ec765d9fso6359813oot.13 for ; Tue, 05 Oct 2021 06:13:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6G7malU1QffNFlLHyGnF0GE1rVke+5aiG8YVR53mxq8=; b=Uo5Dxx/8CK3cBObyCN+G6zjFAZKGtDxuUZOCiZhE8emJWurCVGfpeQbXCqRz/ifw8h 5hJG4lOZ1j+wsv17NwZ2izgQ7JLzW/ft2ZZ3ui7naNTAy9MMSaSzlMSgOCEBE0K7Qs0t PGSRYvlOSlUpoORJazPfM8UN/kLb9qnhtdMtq0XuKNTETS4ZCdnWTuLhsuCks3oPF//n wf8xGuAxUqWcWqkBx+CDmE/gNFN5HOJjTlwmMXm8VSDfCjJt1mgSLS0RjAeKs7jE1lCa uTfhMSHLyVhB2mkQfBO+UMdTDtPE/eSnpRBBglK2HfZhOmKx3KBZqBW59LtAzXHqvVZb JaFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6G7malU1QffNFlLHyGnF0GE1rVke+5aiG8YVR53mxq8=; b=s32zYvmp12iPPA0/QyUzovZdSnqghgygH8okgA7CGa8BwSDQMBB7hhYOmhYX4nm5oI dZIi8eTSHu5me0WBpXKQ0IaCpJ9iC8iTb4oOjkFlLWQD3l+JQjhNmFHccdGJm1Wg9hh6 /KF8RpFR0zQJyFRXM6VTWQ0sJSeTZ/y2gSi5FYGOibvWjP2fdTjRnmNG/nIDrpgeonXO Yp2xAmKJmChvc8k0cP0FbUND9Grd0A2TTcTcPNv+yz/ET+IytQz0RbP2NNxZa+B3QcwB 8mkI/3zTjnWitEoJOOrGgfN8vO7N7PxW3H5aMvu+uVCrMAFoekBGk+rJz8Qo7jJK2G76 +YDQ== X-Gm-Message-State: AOAM530KloVU1/ic2dPqNRxSAaHfqLGNEhu6HZLpiM57Jke2s4RyVLp5 Yf4hlYNEKWWqjcAjn1z4FL5Fpt3VkCe0zTtd5Dpx6w== X-Google-Smtp-Source: ABdhPJxqMq8cjDTc9QTKdqIRvlnQBOs1H6JCXbF5h1q6usAXXwdA/S40EKnb/uwBvgOd/CGMKkYqHGw1riXb4Giu+98= X-Received: by 2002:a4a:de57:: with SMTP id z23mr13364623oot.70.1633439616620; Tue, 05 Oct 2021 06:13:36 -0700 (PDT) MIME-Version: 1.0 References: <20211005105905.1994700-1-elver@google.com> <20211005105905.1994700-5-elver@google.com> In-Reply-To: From: Marco Elver Date: Tue, 5 Oct 2021 15:13:25 +0200 Message-ID: Subject: Re: [PATCH -rcu/kcsan 04/23] kcsan: Add core support for a subset of weak memory modeling To: Peter Zijlstra Cc: "Paul E . McKenney" , Alexander Potapenko , Boqun Feng , Borislav Petkov , Dmitry Vyukov , Ingo Molnar , Josh Poimboeuf , Mark Rutland , Thomas Gleixner , Waiman Long , Will Deacon , kasan-dev@googlegroups.com, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b="Uo5Dxx/8"; spf=pass (imf19.hostedemail.com: domain of elver@google.com designates 209.85.161.53 as permitted sender) smtp.mailfrom=elver@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 9430AB00155F X-Stat-Signature: eij7ss1qz9uzp8zynhispapge8xsf5j8 X-HE-Tag: 1633439617-563347 X-Bogosity: Ham, tests=bogofilter, spamicity=0.006674, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, 5 Oct 2021 at 14:53, Peter Zijlstra wrote: > On Tue, Oct 05, 2021 at 12:58:46PM +0200, Marco Elver wrote: > > +#if !defined(CONFIG_ARCH_WANTS_NO_INSTR) || defined(CONFIG_STACK_VALIDATION) > > +/* > > + * Arch does not rely on noinstr, or objtool will remove memory barrier > > + * instrumentation, and no instrumentation of noinstr code is expected. > > + */ > > +#define kcsan_noinstr > > I think this still wants to be at the very least: > > #define kcsan_noinstr noinline notrace > > without noinline it is possible LTO (or similarly daft things) will end > up inlining the calls, and since we rely on objtool to NOP out CALLs > this must not happen. Good point about noinline, will add. > And since you want to mark these functions as uaccess_safe, there must > not be any tracing on, hence notrace. In the Makefile we've relied on: CFLAGS_REMOVE_core.o = $(CC_FLAGS_FTRACE) just to disable it for all code here. That should be enough, right?