From owner-freebsd-amd64@FreeBSD.ORG Mon May 20 20:42:10 2013 Return-Path: Delivered-To: amd64@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C58B1260; Mon, 20 May 2013 20:42:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id D8D30184C; Mon, 20 May 2013 20:42:09 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E2DD4B917; Mon, 20 May 2013 16:42:07 -0400 (EDT) From: John Baldwin To: freebsd-amd64@freebsd.org Subject: Re: Fix amd64 ddb hardware watchpoints for SMP Date: Mon, 20 May 2013 09:48:46 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <20130516064127.GC3047@kib.kiev.ua> In-Reply-To: <20130516064127.GC3047@kib.kiev.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201305200948.46211.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 20 May 2013 16:42:08 -0400 (EDT) Cc: amd64@freebsd.org, current@freebsd.org X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 20:42:10 -0000 On Thursday, May 16, 2013 2:41:27 am Konstantin Belousov wrote: > The ddb use of hardware watchpoints on the x86 architectures is known to > be lacking. There are at least two known problems. One is the improper > interaction with the user-mode debuggers which use debug registers. > Another is that ddb only loads the debug registers for the watchpoint > into the CPU which is executing ddb code, not setting up non-current > processors. > > Not touching the first problem for now, I want to fix the second issue, > since as is, hardware watchpoints are useless on SMP. Patch below makes > the stopped processors to load the debug registers after resuming from > the stop handler, if directed by ddb. > > Also the patch contains two other commands for ddb which made my > exprerience with debugger on amd64 better. The 'show pginfo[/p] addr' > command dumps the vm_page_t information, either by vm_page address, or, > if the /p modifier is specified, by the physical page address. The 'show > phys2dmap addr' command translates physical address into the directly > mapped address, which can be accessed from ddb then. This looks fine to me. It would be nice to fix i386 as well to be consistent. I would commit the new DDB commands as a separate patch from the watchpoint fixes. -- John Baldwin