Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2026299ybf; Mon, 2 Mar 2020 00:11:31 -0800 (PST) X-Google-Smtp-Source: ADFU+vuvXVPazXl8BAxcZWavU3r8HCu5ClARV+ni35ocw7jhoZQNzmiIRNdv+BSRt0Oztnd7jrNt X-Received: by 2002:aca:ac4c:: with SMTP id v73mr4492484oie.102.1583136691633; Mon, 02 Mar 2020 00:11:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583136691; cv=none; d=google.com; s=arc-20160816; b=O9LQYVGfTr77e8syfEAJtleeujzlvssTS8R8Yvxvwi4nGW6IduAISZ27Q8kiasGtE9 WMTQq0QyA+6OQPiMT9qvxzncR750VtgROs1f+YaLHauP76RgVOMrHigIHWpn+CaNXCb/ yhVfIkA/EExpIk0THMKze9E3CEAsqj8iLQ4bu/5+jSF/5u35f02i/4PNOFBTIVgO6X37 Gc+OllBzAYbBXkEeZ/42GDM/bPtxvvIrSEkughhhs/B8bohF3QvlhH54JmcxvrJJQAk+ Ol/f8qZnVC7YYhJDOQ1OgOw1+jBK5C03GlHdFDNoryLgmdQkMZr6hJsCqOiNVplz6qv6 2b7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=I7FOyKyCt/AFSsnj53EUqeEX8XHWWoWDJ595DSZ1mkY=; b=ToePc0tyrtyeQGl55u8z4MkhOPptDCteUI31S6LuwOpQSqV1q5slferu/Tk30dplhD a8IiPbgXsv6615S2w34MCO0BCF7L1DjNL2OztxHkIsf/Dm6kKgr1LLO9gNBuSyR6DF6+ qOgibcKNNamEZmUgqSQvEkPZiovyQ8kFUrYU7NWymF9UFa47nRIGegkUEzakPMoEllyc cUw362QogJCWDEwKZ72dDkg1ndVRyKm2/66CKXzOgTqgdfemeeTlMrdwdsfoMcPXp6LU b8g3GmWljePFndS1eFZOoUMY988K7A7Of+ToSMJ6QwIPgq+mxAGVEfUqYptd6Xys/hdy 8GnA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16si6147708oih.154.2020.03.02.00.11.19; Mon, 02 Mar 2020 00:11:31 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726960AbgCBIKU (ORCPT + 99 others); Mon, 2 Mar 2020 03:10:20 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:41284 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726313AbgCBIKU (ORCPT ); Mon, 2 Mar 2020 03:10:20 -0500 Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1j8g9K-0005TZ-BJ; Mon, 02 Mar 2020 09:10:02 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 7A7B2101161; Mon, 2 Mar 2020 09:10:01 +0100 (CET) From: Thomas Gleixner To: Andy Lutomirski , "Paul E. McKenney" Cc: Andy Lutomirski , Steven Rostedt , Peter Zijlstra , LKML , X86 ML , Brian Gerst , Juergen Gross , Paolo Bonzini , Arnd Bergmann Subject: Re: [patch 4/8] x86/entry: Move irq tracing on syscall entry to C-code In-Reply-To: References: <87imjofkhx.fsf@nanos.tec.linutronix.de> <87d09wf6dw.fsf@nanos.tec.linutronix.de> <878skkeygm.fsf@nanos.tec.linutronix.de> <20200301182605.GT2935@paulmck-ThinkPad-P72> Date: Mon, 02 Mar 2020 09:10:01 +0100 Message-ID: <8736arfa92.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain 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 Andy Lutomirski writes: > On Sun, Mar 1, 2020 at 10:26 AM Paul E. McKenney wrote: >> > So tracing itself is fine, but then if you have probes or bpf programs >> > attached to a tracepoint these use rcu_read_lock()/unlock() which is >> > obviosly wrong in rcuidle context. >> >> Definitely, any such code needs to use tricks similar to that of the >> tracing code. Or instead use something like SRCU, which is OK with >> readers from idle. Or use something like Steve Rostedt's workqueue-based >> approach, though please be very careful with this latter, lest the >> battery-powered embedded guys come after you for waking up idle CPUs >> too often. ;-) >> > > Are we okay if we somehow ensure that all the entry code before > enter_from_user_mode() only does rcuidle tracing variants and has > kprobes off? Including for BPF use cases? I think this is the right thing to do. The only requirement we have _before_ enter_from_user_mode() is to tell lockdep that interrupts are off. There is not even the need for a real tracepoint IMO. The fact that the lockdep call is hidden in that tracepoint is just an implementation detail. That would clearly set the rules straight: Anything low level entry code before enter_from_user_mode() returns is neither probable nor traceable. I know that some people will argue that this is too restrictive in terms of instrumentation, but OTOH the whole low level entry code has to be excluded from instrumentation anyway, so having a dozen instructions more excluded does not matter at all. Keep it simple! > It would be *really* nice if we could statically verify this, as has > been mentioned elsewhere in the thread. It would also probably be > good enough if we could do it at runtime. Maybe with lockdep on, we > verify rcu state in tracepoints even if the tracepoint isn't active? > And we could plausibly have some widget that could inject something > into *every* kprobeable function to check rcu state. That surely would be useful. Thanks, tglx