From owner-freebsd-current@FreeBSD.ORG Mon May 20 21:14:52 2013 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0CE8E68F; Mon, 20 May 2013 21:14:52 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id D78AA16B3; Mon, 20 May 2013 21:14:51 +0000 (UTC) Received: from Julian-MBP3.local (50-196-156-133-static.hfc.comcastbusiness.net [50.196.156.133]) (authenticated bits=0) by vps1.elischer.org (8.14.5/8.14.5) with ESMTP id r4KLEoUA061090 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 20 May 2013 14:14:51 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <519A9245.4080609@freebsd.org> Date: Mon, 20 May 2013 14:14:45 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: John Baldwin Subject: Re: Fix amd64 ddb hardware watchpoints for SMP References: <20130516064127.GC3047@kib.kiev.ua> <201305200948.46211.jhb@freebsd.org> In-Reply-To: <201305200948.46211.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Konstantin Belousov , amd64@freebsd.org, current@freebsd.org, freebsd-amd64@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 21:14:52 -0000 On 5/20/13 6:48 AM, John Baldwin wrote: > 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. > the big test is to add the support in the gdb stub to use these.. :-)