Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp48406ybj; Fri, 8 May 2020 06:16:56 -0700 (PDT) X-Google-Smtp-Source: APiQypL2MkuKeiIzaLxLkn4teqfN28XbLcwzsotkrhm/axlnPLiNmr8ARARFRvPumKgZTvLccNtS X-Received: by 2002:a05:6402:2214:: with SMTP id cq20mr2223057edb.320.1588943816438; Fri, 08 May 2020 06:16:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588943816; cv=none; d=google.com; s=arc-20160816; b=kyWIcE0qbCc46CyLv2eTxKUaUoBv2e09vylzOpir76Zc83F92hOgsV0xXwBjL0O5t1 91T8n5+wN0xRsDykf1R6SM3KUbDRyjfoVumbzGNlA1zrdRLOT91amhQIiCN24Tptiy0X Fk2JvpUguqakjiuZhN5WSL/V3/X9a/vOEAiy9n1c/JaBraK9m6jprNBB8L88ClxCSi+x GWya9Wl9asQFdFd6PO8DgSOILN8gU96CSe91oOSVGtcLaw+cvKvarIw4H6XA3+/jfRIo sFnYlWAJLEAAZaCuUZNrTX/PmY1HHQaYDp17o05eBWmtGXtyh3AApYtgqigHUZyztSNv cyqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=fv3tCmIOkPBMFm+eOon0jR/scXReOp+FqwgAM+RJy7g=; b=I4deU2PVcwlVD7OLfndxlnpSIW30sA3UBEQ5DHX+uP/kHsXR1Zza6/MwmvGx2HWjJz AXbpQKfUZP3DPRBmJFmbMXO0e2/KP+I819u0gYawmwVRd/Us4StHxrREUi1MPSZ/Tn7D fEuki8dh/r1OxnuQ1oYyVWEeEFhdLw27LU2+NimeZnvT2MM2+5/BIBTICpuoO7d8JpRO yvqhjLYKvM0pY6JENV6gVcFFh3pVAhHQf1U/0y3Ibl4CBqnGjY0jP0ModxvtAEI+mugc tkLLTscESuTHDlyd+yCA9giZCVS0K+m8Mgl7KpvJSPS7pJSBhGrvlf2yLaZg4auUeNK4 du+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=eh1IKm04; 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 kt5si984239ejb.455.2020.05.08.06.16.07; Fri, 08 May 2020 06:16:56 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=eh1IKm04; 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 S1727780AbgEHMqn (ORCPT + 99 others); Fri, 8 May 2020 08:46:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729443AbgEHMqg (ORCPT ); Fri, 8 May 2020 08:46:36 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67008C05BD43 for ; Fri, 8 May 2020 05:46:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=fv3tCmIOkPBMFm+eOon0jR/scXReOp+FqwgAM+RJy7g=; b=eh1IKm04spoVdqNCUB2bspGRyj ajneD5hV2+aJaeGEFtkeW26q3S/h0DG4GOJX2JugNJbJMNPRNu3ipQlOUA8vDmMKEhCVfdi/Btt74 eTcJ/uNTHP6t+zEDvlebV16CyIJ2kF9b7uoe7gcPT83S7aaH9o7u8GPznyBjGvUPosYTtI7nF6lEA 45rDdtcLDlrBTHuXPm6CXRQmGoXDg02BRLzWNT6sd4MFFh3Ak3QReqmrCBxXP2G+/88S1lsRGvzyJ /pMtE4n496Uge2ojxVhbr7LPeFZn7LNtMH79LFu9erGgbmMhCXWgAXEGL/iNSn/U3332ua35nOd9u yaJr08fw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jX2O6-00035E-NB; Fri, 08 May 2020 12:46:03 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 9623D307968; Fri, 8 May 2020 14:45:56 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4A5E72B843CE2; Fri, 8 May 2020 14:45:56 +0200 (CEST) Date: Fri, 8 May 2020 14:45:56 +0200 From: Peter Zijlstra To: Thomas Gleixner Cc: Alexandre Chartre , LKML , x86@kernel.org, "Paul E. McKenney" , Andy Lutomirski , 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 Subject: Re: [patch V4 part 4 15/24] x86/db: Split out dr6/7 handling Message-ID: <20200508124556.GI5281@hirez.programming.kicks-ass.net> References: <20200505134926.578885807@linutronix.de> <20200505135314.808628211@linutronix.de> <16c57a7e-8d39-d77e-915d-41b7f5e042fd@oracle.com> <20200508085909.GU5298@hirez.programming.kicks-ass.net> <87wo5mk595.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87wo5mk595.fsf@nanos.tec.linutronix.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 08, 2020 at 01:58:30PM +0200, Thomas Gleixner wrote: > Peter Zijlstra writes: > >> > +static __always_inline void debug_enter(unsigned long *dr6, unsigned long *dr7) > >> > +{ > >> > + /* > >> > + * Disable breakpoints during exception handling; recursive exceptions > >> > + * are exceedingly 'fun'. > >> > + * > >> > + * Since this function is NOKPROBE, and that also applies to > >> > + * HW_BREAKPOINT_X, we can't hit a breakpoint before this (XXX except a > >> > + * HW_BREAKPOINT_W on our stack) > >> > + * > >> > + * Entry text is excluded for HW_BP_X and cpu_entry_area, which > >> > + * includes the entry stack is excluded for everything. > >> > + */ > >> > + get_debugreg(*dr7, 6); > >> > >> Do you mean get_debugreg(*dr7, 7); ? > > > > Shees, I have to go buy a new stack of brown paper bags at this rate, > > don't I :/ > > Not only you, but it's also amazing that the selftests didn't catch > that. I don't think the selftests try and set hardware breakpoints in the kernel.