Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp806992pxa; Wed, 19 Aug 2020 15:49:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMXOmvrR9VwvlZ10A429BpbRY4duVKO8xs9USpbXvEP5gl8oaIultrdeK2iz7Ck0mJFQs/ X-Received: by 2002:a17:907:372:: with SMTP id rs18mr544908ejb.146.1597877381088; Wed, 19 Aug 2020 15:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597877381; cv=none; d=google.com; s=arc-20160816; b=lmshQb7XBXX22GRnj7TyeHDLmOp4+uD23hO6wSvG8uPGCc1Ay+0di0HAH7qdKEOvpn p40lqIUciHLie3N0T52KEVm5w5KAnuEAWm7RGYw/no9OgzZmkspoRxAe6i3kWCCDX8P0 /oI3XhtKzPX/Bw38fgMOXVNm2tgTbzmGrAs7pRNqiZecRH2SL1WBpFs2iD4nUTSuBhup rn3DCTL++i+XW3HlBl1lvfRBgdBGSq4cZS1RsNBgbinwma+mq0/d10gyiT2pMb2mQEen Vd9JUjf7Kxf+cbbgl9oEltiQ1AxhNcSZ3GBZC+8TncTnwyPi26nZNuLH7UTxrBJbYN/A n7MA== 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=QXnTSgNfg8RNoeGnfUHV2QiCinLcEjZGZZliKpRTfWM=; b=d9cuBJQdR3RLL9nPU8he4UukkPEvYsaddmthIqWVoQlHVgKDaCHVoKDuG1IcQRQu3Y nQrbSTeTBlkBYoTs9YLp/oCmMXnSVHxibN6zPbcbPpQQKHeHwXTSv5OYZ2rkOYJHMez3 wQR/g4FZ3/P0okA5wL8kId+sci1QN/ejbHIGjdLFeb37+lEhNW+8cRdVZTSf19VC7gqf FF/0GXk4a8gbckpfl+igv8CkWqiVKQjvDfaUfurR2lx2EslwxxxTRtD2AF9TBQ2p6Xbq fm1ha5VrJFYsTCq2PxPSVd/k70IiJCYbSrrjtmCxvJkyD75QEDRNQJVGyv6UmtIHYsPc fJEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UaPDSEfV; 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 r12si39529ejr.473.2020.08.19.15.49.16; Wed, 19 Aug 2020 15:49:41 -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=UaPDSEfV; 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 S1726466AbgHSWrm (ORCPT + 99 others); Wed, 19 Aug 2020 18:47:42 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:33536 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726209AbgHSWrm (ORCPT ); Wed, 19 Aug 2020 18:47:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597877260; 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=QXnTSgNfg8RNoeGnfUHV2QiCinLcEjZGZZliKpRTfWM=; b=UaPDSEfVAjxlJU4F2oi5AfPU82SsvdNcsI8ks8QL7lTEy2N5b97wObP3IHWYi46GT4gvYE 5Zx6GH6MAfAom2ySAa/tcvJp2IzumdzR/A5sxTLRLVNb7HU+pFb4aaTW06rBEFG6vQS0jh 6VnhMe3rInX1anCYVZlbyysddSraYPQ= 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-312-4rdRZyruNsOTxOvAhWr_RA-1; Wed, 19 Aug 2020 18:47:38 -0400 X-MC-Unique: 4rdRZyruNsOTxOvAhWr_RA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1C72F801AE5; Wed, 19 Aug 2020 22:47:36 +0000 (UTC) Received: from treble (ovpn-117-70.rdu2.redhat.com [10.10.117.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3EB4919C4F; Wed, 19 Aug 2020 22:47:33 +0000 (UTC) Date: Wed, 19 Aug 2020 17:47:31 -0500 From: Josh Poimboeuf To: Peter Zijlstra Cc: Kyle Huey , Thomas Gleixner , Alexandre Chartre , Andy Lutomirski , 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: <20200819224731.3edo5lqw6lbuprdx@treble> References: <20200819184149.GH2674@hirez.programming.kicks-ass.net> <20200819213534.GQ3982@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200819213534.GQ3982@worktop.programming.kicks-ass.net> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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 11:35:34PM +0200, Peter Zijlstra wrote: > On Wed, Aug 19, 2020 at 12:28:16PM -0700, Kyle Huey wrote: > > > > I'm guess that is not the expected outcome, is that the same failure you > > > saw? > > > > Yes. Is status also 0x4d00 for you? > > Indeed. > > > The program is expected to complete with no assertions firing. > > When I comment out the break-on-exec test, the break-on-write test > succeeds. > > When I add a few printk()'s to our #DB handler (6) the program will > magically work again. I added some trace_printk()'s and I think the #DB handler is calling schedule???? exc_debug_user() irqentry_exit_to_user_mode() exit_to_user_mode_prepare() exit_to_user_mode_loop() schedule() So #DB schedules out, then the process scheduls in and tells ptrace to set the data breakpoint in DR7. Then the #DB handler schedules back in and overwrites DR7 with the original value. 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? -- Josh