Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp632992ybg; Wed, 3 Jun 2020 09:32:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrHsUxqsK3XEPZsIwFpYElvB7lcS7y7mK0UOfEGbGH3KOuYFUfOb0vDODvUqgN9tZH2tkH X-Received: by 2002:a17:906:5283:: with SMTP id c3mr155665ejm.22.1591201927179; Wed, 03 Jun 2020 09:32:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591201927; cv=none; d=google.com; s=arc-20160816; b=EIAJ+sCqBWcapOK2LqYwWEtCQUrPVJy2wER9ueTN7KOeOcNblM/4Tqzgh3vUEZZEh6 /qGB3jhXqdfbju8itujWpbxF5d6Jud6bvP4tjhPn/7u5/fJaa5Wpl/ZOesCY2L1X/Vny fRFNybF/QsO6OYlSUhbla3RGUFSJ6eR/i02irFpJmu8oMFDjlhhL/inMGS80m5JbbFBp ElfMid+2UgwgLBgVctnhvNXbBB9+nhUva7t9NhWNogusdavO4ZBD2tFlM74ZCr89PgiZ pF3LF8Vvs7RfEPRuQ/u7b28FK04Kwxn02fTK8CgGbxV2fw3zeMcYWLmediGouRbDVGQF f03Q== 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=pGtn01Ejxv4U5A8NN+buYh4/UyvofPXF8HV+4s2Dc8A=; b=PFg2igM32Ryk4GGSLtPCOrYDLD3lHPBDo2e56lbRyGauDf/NDL5hmD4f621NvTXLnV fXBZa2FxoQJa0ziecyMY0SUWGGF1FdDASFnYMAJZkWxYQ5CczAUWSKzyYE2v4Qs1c9Ee nfox1I9V+12OFNvc+3WMzqrbgY1Zdouw6IJbYiJYG6N4utKZbUO9lPzieqdT4PCV3sWK Ju7o7ktGgfuZ7iy/ebUiZel04hbsxX2YSsfXw1J2+2uFrxmFVDg5hZ9oTIJbnj7H5b2E sdupwiQ0Du6JLJFTJ/hWw59g6GeX8w4oVltFGRiNYian5g4MruSIimdB+OYjZs7t8OSy +Yvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="TSOOj/h7"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y21si435edt.501.2020.06.03.09.31.42; Wed, 03 Jun 2020 09:32:07 -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; dkim=pass header.i=@kernel.org header.s=default header.b="TSOOj/h7"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726182AbgFCQ3v (ORCPT + 99 others); Wed, 3 Jun 2020 12:29:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:44384 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725904AbgFCQ3u (ORCPT ); Wed, 3 Jun 2020 12:29:50 -0400 Received: from paulmck-ThinkPad-P72.home (50-39-105-78.bvtn.or.frontiernet.net [50.39.105.78]) (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 C70CF20659; Wed, 3 Jun 2020 16:29:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591201789; bh=V4v/+8+lWFZ7CMLSbJU7qQu/syYSwbhiswQCZEP0HRw=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=TSOOj/h7G6v0j9acb9wGJ63VjpgRYjwsIJP6XEeL1QEAka5A0dvCOvM1ND0SHRe4A irgsSygznKpoECopGUkXYJv3wcQERN2e1kVfNTX/PsO0uNeHrHt/B2gHKRiVYsDErj JcUty3CcVHN7DXSxW83KIMaWgPyRRu0SrksS9qog= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id AD32D35209C5; Wed, 3 Jun 2020 09:29:49 -0700 (PDT) Date: Wed, 3 Jun 2020 09:29:49 -0700 From: "Paul E. McKenney" To: Peter Zijlstra Cc: Marco Elver , Nick Desaulniers , Will Deacon , Borislav Petkov , Thomas Gleixner , Ingo Molnar , clang-built-linux , Dmitry Vyukov , Alexander Potapenko , Andrey Konovalov , kasan-dev , LKML Subject: Re: [PATCH] rcu: Fixup noinstr warnings Message-ID: <20200603162949.GP29598@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200602184409.22142-1-elver@google.com> <20200602191936.GE2604@hirez.programming.kicks-ass.net> <20200602193853.GF2604@hirez.programming.kicks-ass.net> <20200603084818.GB2627@hirez.programming.kicks-ass.net> <20200603095932.GM29598@paulmck-ThinkPad-P72> <20200603105206.GG2604@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200603105206.GG2604@hirez.programming.kicks-ass.net> 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 Wed, Jun 03, 2020 at 12:52:06PM +0200, Peter Zijlstra wrote: > On Wed, Jun 03, 2020 at 02:59:32AM -0700, Paul E. McKenney wrote: > > On Wed, Jun 03, 2020 at 10:48:18AM +0200, Peter Zijlstra wrote: > > > On Tue, Jun 02, 2020 at 09:38:53PM +0200, Peter Zijlstra wrote: > > > > > > > That said; noinstr's __no_sanitize combined with atomic_t might be > > > > 'interesting', because the regular atomic things have explicit > > > > annotations in them. That should give validation warnings for the right > > > > .config, I'll have to go try -- so far I've made sure to never enable > > > > the *SAN stuff. > > > > > > --- > > > Subject: rcu: Fixup noinstr warnings > > > > > > A KCSAN build revealed we have explicit annoations through atomic_t > > > usage, switch to arch_atomic_*() for the respective functions. > > > > > > vmlinux.o: warning: objtool: rcu_nmi_exit()+0x4d: call to __kcsan_check_access() leaves .noinstr.text section > > > vmlinux.o: warning: objtool: rcu_dynticks_eqs_enter()+0x25: call to __kcsan_check_access() leaves .noinstr.text section > > > vmlinux.o: warning: objtool: rcu_nmi_enter()+0x4f: call to __kcsan_check_access() leaves .noinstr.text section > > > vmlinux.o: warning: objtool: rcu_dynticks_eqs_exit()+0x2a: call to __kcsan_check_access() leaves .noinstr.text section > > > vmlinux.o: warning: objtool: __rcu_is_watching()+0x25: call to __kcsan_check_access() leaves .noinstr.text section > > > > > > Signed-off-by: Peter Zijlstra (Intel) > > > > This one does not apply cleanly onto the -rcu tree's "dev" branch, so > > I am guessing that it is intended to be carried in -tip with yours and > > Thomas's patch series. > > Right, I've not played patch tetris yet so see how it should all fit > together. I also didn't know you feel about loosing the instrumentation > in these functions. It would be very good for KCSAN to be able to detect misuse of ->dynticks! > One option would be do add explicit: instrument_atomic_write() calls > before instrument_end() / after instrument_begin() in > the respective callers that have that. One good thing: The atomic_andnot() goes away in -rcu patches slated for v5.9. However, the others remain. So if today's -next is any guide, this instrument_atomic_write() would be added (for one example) in the functions that invoke rcu_dynticks_eqs_enter(), since it is noinstr. Rather annoying, and will require careful commenting. But there are only two such calls and they are both in the same file and it is very low-level code, so this should be doable. I should also add some commentary to the RCU requirements document say why all of this is happening. > Anyway, I'll shortly be posting a pile of patches resulting from various > KCSAN and KASAN builds. The good news is that GCC-KASAN seems to behave > quite well with Marco's patches, the bad news is that GCC-KASAN is > retarded wrt inline and needs a bunch of kicks. > > That is, it out-of-lines: > > static inline bool foo(..) > { > return false; > } > > just because.. Compilers!!! :-/ Thanx, Paul