Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp279957ybf; Wed, 26 Feb 2020 13:01:32 -0800 (PST) X-Google-Smtp-Source: APXvYqzDfJWFOwAbPKKE6MSf2wj6/M8KPV/0bqLsvgZr+IqGUTy+4hn8+1QEiEpsRNmNL7GsF/hG X-Received: by 2002:a05:6830:1e14:: with SMTP id s20mr574100otr.322.1582750892374; Wed, 26 Feb 2020 13:01:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582750892; cv=none; d=google.com; s=arc-20160816; b=t2TB84jEdhk3gakToAYTfGl+qsIFi8GDgIfGZf4QPF4OhSUguLxkyGlEY1zJjQUyDw UE9/33ijuzCYeBJMqo3btL8SFP3BT8oAQ+8jPyTWMsdlU+b0/oWkukC949cAGX2pOzOC 28MJTR3oCF93PPcMc/xvZ/9s4ZrC4WNEZwOS9MM4rpkX65CFbrFNlfhOzsDJM89D12UD haLcLo4FnoDO6YJ91iAxVpuD/5w3PwAOgt0PQSbkhFrjyF8Mq/d8qgEQDuKKUan4DDD4 qUsuzD3be70MEZdxp/ompadfc3LvKZW3EzmMB8bQQUeTPZYfKvu4Qqmj5vzAVESZUrhT Fwsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=F5M4ouI/Ty537epXuLpV9HFLlAXF48lqL1LV/M/YM+k=; b=ELJso4UAStuDRRkC7qipMqON5kaRit8UbWdhA4coH8qSEAMvCrpyEdYiV41bv/4bFQ Z7nouV+gFltj2SSGUhh1xCK8pLuS6nOk1a9/Hv2PEb6vxXOEeAjd1WY7n2Lf4gzu4EoW 6jzu8P4uK4Yzcfk/O+1X978u8EWXtdLQxkRlq9qmDGICj1iHkvCXpAnkk4BwJ793SHe5 n8rXgiA8OHgvKexIWV1UTAyhRU4XJvPKFajyak8rRNi1WaqLCN+9hFn5Nt3rQywW8k2d Gz93U6nMQ256XMcBJaLis8jbU/EBpU3UmVMeNhtqkEWrVdGXF/9fDhGm6WUXxjPW8y67 nfiQ== 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 v5si195221oix.197.2020.02.26.13.01.18; Wed, 26 Feb 2020 13:01:32 -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 S1727504AbgBZU7V convert rfc822-to-8bit (ORCPT + 99 others); Wed, 26 Feb 2020 15:59:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:41552 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727461AbgBZU7V (ORCPT ); Wed, 26 Feb 2020 15:59:21 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 D627724656; Wed, 26 Feb 2020 20:59:19 +0000 (UTC) Date: Wed, 26 Feb 2020 15:59:18 -0500 From: Steven Rostedt To: Andy Lutomirski Cc: Peter Zijlstra , Borislav Petkov , Andy Lutomirski , Frederic Weisbecker , Thomas Gleixner , LKML , X86 ML , Brian Gerst , Juergen Gross , Paolo Bonzini , Arnd Bergmann Subject: Re: [patch 02/10] x86/mce: Disable tracing and kprobes on do_machine_check() Message-ID: <20200226155918.125e0ad8@gandalf.local.home> In-Reply-To: References: <20200226185945.GC18400@hirez.programming.kicks-ass.net> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 26 Feb 2020 11:09:03 -0800 Andy Lutomirski wrote: > > On Feb 26, 2020, at 10:59 AM, Peter Zijlstra wrote: > > > > On Wed, Feb 26, 2020 at 07:42:37PM +0100, Borislav Petkov wrote: > >> On Wed, Feb 26, 2020 at 09:28:51AM -0800, Andy Lutomirski wrote: > >>>> It entirely depends on what the goal is :-/ On the one hand I see why > >>>> people might want function tracing / kprobes enabled, OTOH it's all > >>>> mighty frigging scary. Any tracing/probing/whatever on an MCE has the > >>>> potential to make a bad situation worse -- not unlike the same on #DF. > >> > >> FWIW, I had this at the beginning of the #MC handler in a feeble attempt > >> to poke at this: > >> > >> + hw_breakpoint_disable(); > >> + static_key_disable(&__tracepoint_read_msr.key); > >> + tracing_off(); > > > > You can't do static_key_disable() from an IST > > Can we set a percpu variable saying “in some stupid context, don’t trace”? Matter's what kind of tracing you care about? "tracing_off()" only stops writing to the ring buffer, but all the mechanisms are still in place (the things you want to stop). And "tracing" is not the issue. The issue is usually the breakpoint that is added to modify the jump labels to enable tracing, or a flag that has a trace event do a user space stack dump. It's not tracing you want to stop, its the other parts that are attached to tracing that makes it dangerous. -- Steve