Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2528483ybk; Mon, 18 May 2020 01:07:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKgvMm5jP3SJZcMa4Btjdpy4BhGQ5kUVuy4iN23IDORLARAY77edEIAiba9GXXxm0enCCj X-Received: by 2002:a17:907:420e:: with SMTP id oh22mr13909135ejb.320.1589789228628; Mon, 18 May 2020 01:07:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589789228; cv=none; d=google.com; s=arc-20160816; b=q/ThPVAWjN0pZ14s3hxsbdG058+T1+zjKz4L59up1FgoqfpyzOkoYtSWu/H/UDxXKR i2wQbnzbEdRrGdQvKVajFjSiLOQEiz3fuNibNevAf7Au5Yw3Eit2YjlS0eTcj08ttsNN NDIscbjCo4cwcbBpJCYDarSzcqeNCLphHItBJi4Jt5taVdTnfqSar3W/fw6KBFFDFABO 2baj77KPjo63wLiJTHe95M4bj8OHwArXT//qXj3AjnruxIvvOB8KlasNAMuWQ7W4iunk sxwGbaPvXaJ75tqRp9F7gW+4NgNEze8K5fcqmFZPkc/h04ItWa22QR/oKVm1VZnzkj/H u1ow== 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=6JHSYrBCJ0Uc/0r9JYkEpHNCTN/zzEXXiJqwKmDDj1g=; b=JFwfZuki+eJIGxIO52Xe7RlHaXQXffGE2m0Rg6Rc93FAvGiscu8BGBvmOdgPUVD3+9 rPNENBaYDgV2Db6V5aENWyswlkpVrZrCH+RZVZGDroCZS8lzaJBta3oMySjw53j91z0/ 25lHxX6q4u0b3lMlDrbOJQH8u06G6dhw/IfVAhODMVmiRYOdgWb2zBJsOrH4pAX5+KAz OosXJMUTF1j0hQnEJQlnP5t/47ufH5VrwuG0L6sPLjupjCr13SXv8ZTZdWdNSn4WYazS C2xiHm5H1TUSCMswynR4TKztkQ8beAfuBEpGb1wm8WTkFLuGCxoyFoaEXNoN+IrCYElC vU6Q== ARC-Authentication-Results: i=1; mx.google.com; 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 w3si5832307ejk.480.2020.05.18.01.06.45; Mon, 18 May 2020 01:07:08 -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; 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 S1727882AbgERIEX (ORCPT + 99 others); Mon, 18 May 2020 04:04:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726828AbgERIEX (ORCPT ); Mon, 18 May 2020 04:04:23 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA030C061A0C for ; Mon, 18 May 2020 01:04:22 -0700 (PDT) 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 1jaajp-0004W8-4K; Mon, 18 May 2020 10:03:05 +0200 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 748921006FB; Mon, 18 May 2020 10:03:04 +0200 (CEST) From: Thomas Gleixner To: Andy Lutomirski Cc: Andy Lutomirski , LKML , X86 ML , "Paul E. McKenney" , Alexandre Chartre , Frederic Weisbecker , Paolo Bonzini , Sean Christopherson , Masami Hiramatsu , Petr Mladek , Steven Rostedt , Joel Fernandes , Boris Ostrovsky , Juergen Gross , Brian Gerst , Mathieu Desnoyers , Josh Poimboeuf , Will Deacon , Tom Lendacky , Wei Liu , Michael Kelley , Jason Chen CJ , Zhao Yakui , "Peter Zijlstra \(Intel\)" Subject: Re: [patch V6 04/37] x86: Make hardware latency tracing explicit In-Reply-To: References: <20200515234547.710474468@linutronix.de> <20200515235124.783722942@linutronix.de> <87zha7c5h5.fsf@nanos.tec.linutronix.de> Date: Mon, 18 May 2020 10:03:04 +0200 Message-ID: <877dx9zn47.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, May 17, 2020 at 1:48 AM Thomas Gleixner wrote: >> Remember this is about ensuring that all the state is properly >> established before any of this instrumentation muck can happen. >> >> DR7 handling is specific to #DB and done even before nmi_enter to >> prevent recursion. > > So why is this change needed? We really want nmi_enter() to be the carefully crafted mechanism which establishes correct state in whatever strange context the exception hits. Not more, not less. Random instrumentation has absolutely no business there and I went a long way to make sure that this is enforcible by objtool. Aside of that the tracing which is contained in nmi_enter() is about taking timestamps for hardware latency detection. If someone runs hardware latency detection with active break/watchpoints then I really can't help it. Thanks, tglx