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 8BA61C433F5 for ; Tue, 5 Oct 2021 12:53:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A89B861247 for ; Tue, 5 Oct 2021 12:53:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A89B861247 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 157C66B006C; Tue, 5 Oct 2021 08:53:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E145900003; Tue, 5 Oct 2021 08:53:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EC3DE900002; Tue, 5 Oct 2021 08:53:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0198.hostedemail.com [216.40.44.198]) by kanga.kvack.org (Postfix) with ESMTP id DE8E56B006C for ; Tue, 5 Oct 2021 08:53:08 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A7349181C8F0D for ; Tue, 5 Oct 2021 12:53:08 +0000 (UTC) X-FDA: 78662374056.17.DD9A181 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf25.hostedemail.com (Postfix) with ESMTP id D331CB000289 for ; Tue, 5 Oct 2021 12:53:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=3mL4e6pocxVR5OsISP9dNIeRYN7ixRmDV8QCVBso/L0=; b=mgxTuiy9hW/M1nl8BaIQ6Qvws0 YMpUaUgLvtSSiyL3eQUj+/XylScDbvdNDuIA6xONAnbVYTxIRsjjDzurhwBABzA1M9hUAtvUKgIwQ YcLZf8yv9NcBiiS8MOkrYsKxYk5Hj2ugMGnp8+yUGSmRXx24CKa2hVWDs+F3udLOJpWH7ZVnqpXmb 8Inzuyu1FoOPkk+acWPg9ew+lmG1lRGkh1MTUY+FnEbTroysx3/vRDVw7Wh76x1AsvD6qhkQA1dJo TWa0NrBb+CKV+l+IZXnJSkMUsXTv+cs4Se6IWsMVeRpQS3HQ+T1eIjYM1O8s+MlAsApC8j1meHlL0 gJrLZP4Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXjwF-0083AP-Q5; Tue, 05 Oct 2021 12:52:55 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 25C0130019C; Tue, 5 Oct 2021 14:52:54 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 134AD2026A8AF; Tue, 5 Oct 2021 14:52:54 +0200 (CEST) Date: Tue, 5 Oct 2021 14:52:54 +0200 From: Peter Zijlstra To: Marco Elver 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 Subject: Re: [PATCH -rcu/kcsan 04/23] kcsan: Add core support for a subset of weak memory modeling Message-ID: References: <20211005105905.1994700-1-elver@google.com> <20211005105905.1994700-5-elver@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211005105905.1994700-5-elver@google.com> Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=mgxTuiy9; spf=none (imf25.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org; dmarc=none X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D331CB000289 X-Stat-Signature: 85o3ni87s4jo15zicqstik79m18acdgo X-HE-Tag: 1633438387-612194 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. And since you want to mark these functions as uaccess_safe, there must not be any tracing on, hence notrace. > +static inline bool within_noinstr(unsigned long ip) { return false; } > +#else > +#define kcsan_noinstr noinstr > +static __always_inline bool within_noinstr(unsigned long ip) > +{ > + return (unsigned long)__noinstr_text_start <= ip && > + ip < (unsigned long)__noinstr_text_end; > +} > +#endif