Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp941913pxa; Wed, 19 Aug 2020 20:47:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyc+fa8KHdERJfrO/kInurmb8fvDUdfCxxqMDAMcqZmSrSjdk8dUy3HMOdeEnBojxHmNIsP X-Received: by 2002:a17:906:413:: with SMTP id d19mr1433116eja.523.1597895269772; Wed, 19 Aug 2020 20:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597895269; cv=none; d=google.com; s=arc-20160816; b=pTDyD0BlFLjzT8jcu8a56X1lS07jXIa0SEwlXnaLYNAG3pZWdxQXOx+Hj8kDBD173r zACIpS8JYeTgvBLRxXwiWWoiSlyclqV+J6OuwappBdGOgo17Wqn1UQ+sFvDg6OaQniqz kHI8e6Rqg9EH+p3hgLXPTmEYkoahe01uhWc3APe658JgLCTRZ6a2vdRZO8jx8MYNaItx wlfpYQKMjMbX2lqiW34njC5BJ0FJWyJMTVup5RWocuvpEX6sQjX42mELdLZZME7nip0l XFsPHNSFVd9ZKkQOAS8XFUVAd2vn86x05w8FmHy9V2b84Ys5H0QTQFn3FG0km/ecnDoT e28A== 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=yJp8ETPySMsCpzxcqSo+vhA8i7HDv8eDmkf15FdeaxY=; b=JEC/fVbhONwnM8Ns2T1+bX9zUW5y/sHSC6WBS+/OaPZvxyzSobN//9yX38UCdFWZXj S6Aw2NJUXkIFG49vTYMvhuQCG/b/Frk6D2mUCnRjIcjpOTmsMg5OTIE+VXYFU7ZjK+d/ +SyLotkoaQRcKvVrHV/QIuBpCcORCFulLbIRIB6cBvZjzCfouimEK7zj4ZoOgIIhmypL +8y1nYYROfuDUySFr7SlszeZNuImhVf+myz24+3UUS1KGAihUZgm80HLqC1r7ZzSsk+k +otH/ZdQ1+uzc+sYxJP4QGue6WMbrHdYLviUq8z6bbkLG6HE/e6X8SeDw7LsqMQEU+Ld 6H4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EBNSDL9z; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d14si443651ejw.459.2020.08.19.20.47.26; Wed, 19 Aug 2020 20:47:49 -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=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EBNSDL9z; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726852AbgHTDqt (ORCPT + 99 others); Wed, 19 Aug 2020 23:46:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26422 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726578AbgHTDqs (ORCPT ); Wed, 19 Aug 2020 23:46:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597895207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yJp8ETPySMsCpzxcqSo+vhA8i7HDv8eDmkf15FdeaxY=; b=EBNSDL9zOOn3bpAmGNw4ZMLXUYXh3TePPLhs2EQk6SeWeU+Mr7omjxk4jxubXlgdexQcUV hSdZ6rEq359wPKQiNuECwERRCrP2Nwk5t7DmrAEQJat8X0jK6IntHciDliONL7jWHCdwLu nH2mJGSrS5CRzNV0fKr6sj9XRDmZ2LI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-501-CPdbQVJvNBSygXj1nyor9g-1; Wed, 19 Aug 2020 23:46:45 -0400 X-MC-Unique: CPdbQVJvNBSygXj1nyor9g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 63875100CEC4; Thu, 20 Aug 2020 03:46:42 +0000 (UTC) Received: from treble (ovpn-117-70.rdu2.redhat.com [10.10.117.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 339621B47B; Thu, 20 Aug 2020 03:46:39 +0000 (UTC) Date: Wed, 19 Aug 2020 22:46:36 -0500 From: Josh Poimboeuf To: Andy Lutomirski Cc: Peter Zijlstra , Kyle Huey , Thomas Gleixner , Alexandre Chartre , Robert O'Callahan , LKML , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "Paul E. McKenney" , Frederic Weisbecker , Paolo Bonzini , Sean Christopherson , Masami Hiramatsu , Petr Mladek , Steven Rostedt , Joel Fernandes , Boris Ostrovsky , Juergen Gross , Brian Gerst , Mathieu Desnoyers , Will Deacon Subject: Re: [REGRESSION 5.8] x86/entry: DR0 break-on-write not working Message-ID: <20200820034636.tl4nq5aiitpfvx62@treble> References: <20200819184149.GH2674@hirez.programming.kicks-ass.net> <20200819213534.GQ3982@worktop.programming.kicks-ass.net> <20200819224731.3edo5lqw6lbuprdx@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 19, 2020 at 05:14:18PM -0700, Andy Lutomirski wrote: > On Wed, Aug 19, 2020 at 3:47 PM Josh Poimboeuf wrote: > > What amazes me is that it successfully schedules back to the end of the > > #DB handler finish and everything keeps working. > > > > Do we not have assertions in the scheduler to catch this? > > You almost nailed it. > > I'm pretty sure you have the buggy sequence of events right, but for > the wrong reason. There's nothing wrong with scheduling when > delivering SIGTRAP, but it's definitely wrong to blindly save and > restore DR7 around scheduling and around ptrace invocations. Remember > this is an entry from user mode, so it runs on the user stack. Wow, I had no idea user #DB's run on the task stack. The scheduling from #DB blew my mind :-) What's the purpose of that? -- Josh