Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1929262pxb; Fri, 29 Jan 2021 08:38:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9PGMacy96JT0VxhNP73il9F45+fJX75WKOw5/LvJM4kMR41lgzurh/1DjTkZrrAh2KBKM X-Received: by 2002:a50:bf4a:: with SMTP id g10mr5894521edk.201.1611938296539; Fri, 29 Jan 2021 08:38:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611938296; cv=none; d=google.com; s=arc-20160816; b=GM9dTmtuCUu7Kf7kuMM8TJqQ+xeZoybGjGJecJpYaXbdSxFoRrYImTu1roJO6pukSE WYuQr4dbbUI3s1qa8KpMFA0g/HTTm94zw7l3gvCtdF8PRHBXbVZYF3AsaHSLnjJ2hhIc ZhowbuakDysvulpIc/Qm5y7ojQggczU6IHCQQ+6mpY8E3gZfDkAJvFPv1mXQiEXZcPQv qSh6NWOs5zLv2EPV0EGRwhVwLhU/1IjhfJhfPzHYgNRd2r0h8i/G+ABvuWUbEddY2ldO nZESO2knlu1IJKNTXyfsDIMxqzdK29+IX/yrMyqVBWOh8aQHTZUVhVXnNfJ2raIUT3T4 wIsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=yiqFfxPWjaBBtMQaM+MAoojFayOhd4kIg0RTmjiEmOo=; b=JqKI2zlCR6zIncb+nQLQ2I9R8aEcfQAEE54dSV4VmZt5j9CJ1uoYFCv/QGO7lDtZWW iEVN9ZokJtC2jUqgNhZBPvwlgwk4k7E6xmXS+sj6738SA7Ar0XPxJ7bgRcoO5xbMiDCK ozQwlxH12QZ0/DRQZLePy1c6zM4wFBgwnAAe0F/KzaXD2Xa1IyMUv3XZDhWuX73V0lo4 bew4ZHLoCzdo6ja3ugkPFb38P5lsv3uoA5P5CH4mQIuA4WqtiL4DeIwdkfywJ0zV9j/a 2mjxCoz42pNe9hkSMDyZJR/eVKkLSsvtFzZyTLjDN5VFDufb6aIRqsnTNpEAN7A1+DcR n7qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ojhbcyf9; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g18si5191392ejd.480.2021.01.29.08.37.50; Fri, 29 Jan 2021 08:38:16 -0800 (PST) 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=@infradead.org header.s=casper.20170209 header.b=ojhbcyf9; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231617AbhA2Qdh (ORCPT + 99 others); Fri, 29 Jan 2021 11:33:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231244AbhA2Qbc (ORCPT ); Fri, 29 Jan 2021 11:31:32 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEBB1C0613D6; Fri, 29 Jan 2021 08:25:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=yiqFfxPWjaBBtMQaM+MAoojFayOhd4kIg0RTmjiEmOo=; b=ojhbcyf9SCPvTLZTogs2KrgZ7S ZLPgcka/xchmQCpmMifqdDSJvVJBIYZqv1tVP1hGLOgXDG3yyTHsHUyk7sHcy6UVHTHomiQkRkdHi afcJH9vFuryu+jA+bv8n2Uge/Qf07cY/y052xTeFy4dVGac7ipDIiuE+N2R1j7455nvr0Ou/WC6jk MHL/HtK7hiYIow7RkUyHFE1hdSEj6Txqg+9pmpWjNI434Iu+PD+2BETXTIrH5QHKurF9GW+sbtXm2 fcmNyfcnsOvPheKRb1o5nxILO5yksWW8IWKXwXUpJpl8b9jAvF+7gQ5KPSCIMF6OhGtj0NbvTdIrm lOCspA4g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1l5WZc-00A14C-Bi; Fri, 29 Jan 2021 16:24:42 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id A7521981070; Fri, 29 Jan 2021 17:24:38 +0100 (CET) Date: Fri, 29 Jan 2021 17:24:38 +0100 From: Peter Zijlstra To: Steven Rostedt Cc: Masami Hiramatsu , Alexei Starovoitov , Nikolay Borisov , LKML , Alexei Starovoitov , bpf@vger.kernel.org, Josh Poimboeuf Subject: Re: kprobes broken since 0d00449c7a28 ("x86: Replace ist_enter() with nmi_enter()") Message-ID: <20210129162438.GC8912@worktop.programming.kicks-ass.net> References: <20210128103415.d90be51ec607bb6123b2843c@kernel.org> <20210128123842.c9e33949e62f504b84bfadf5@gmail.com> <20210129013452.njuh3fomws62m4rc@ast-mbp.dhcp.thefacebook.com> <20210129224011.81bcdb3eba1227c414e69e1f@kernel.org> <20210129105952.74dc8464@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210129105952.74dc8464@gandalf.local.home> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 29, 2021 at 10:59:52AM -0500, Steven Rostedt wrote: > On Fri, 29 Jan 2021 22:40:11 +0900 > Masami Hiramatsu wrote: > > > > So what, they can all happen with random locks held. Marking them as NMI > > > enables a whole bunch of sanity checks that are entirely appropriate. > > > > How about introducing an idea of Asynchronous NMI (ANMI) and Synchronous > > NMI (SNMI)? kprobes and ftrace is synchronously called and can be controlled > > (we can expect the context) but ANMI may be caused by asynchronous > > hardware events on any context. > > > > If we can distinguish those 2 NMIs on preempt count, bpf people can easily > > avoid the inevitable situation. > > I don't like the name NMI IN SNMI, because they are not NMIs. They are > actually more like kernel exceptions. Even page faults in the kernel is > similar to a kprobe breakpoint or ftrace. It can happen anywhere, with any > lock held. Perhaps we need a kernel exception context? Which by definition > is synchronous. What problem are you trying to solve? AFAICT all these contexts have the same restrictions, why try and muck about with different names for the same thing?