From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K2SpX-0003Cp-2F for qemu-devel@nongnu.org; Sat, 31 May 2008 11:17:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K2SpV-0003CE-Ih for qemu-devel@nongnu.org; Sat, 31 May 2008 11:17:14 -0400 Received: from [199.232.76.173] (port=48219 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K2SpV-0003CB-DB for qemu-devel@nongnu.org; Sat, 31 May 2008 11:17:13 -0400 Received: from mail.codesourcery.com ([65.74.133.4]:46011) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K2SpU-0004tG-D0 for qemu-devel@nongnu.org; Sat, 31 May 2008 11:17:12 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH 4/5] Report exact PC on watchpoint hit Date: Sat, 31 May 2008 16:17:03 +0100 References: <48414AC8.7080206@web.de> <200805311511.39508.paul@codesourcery.com> <484163CD.9040900@web.de> In-Reply-To: <484163CD.9040900@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200805311617.03860.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jan Kiszka On Saturday 31 May 2008, Jan Kiszka wrote: > Paul Brook wrote: > >> @@ -2395,6 +2396,11 @@ static target_ulong check_watchpoint(tar > >> + if (env->current_tb) { > >> + tb_addr = env->current_tb->page_addr[0]; > >> + tb_invalidate_phys_page_range(tb_addr, > >> + tb_addr+TARGET_PAGE_SIZE-1, > > > > This is wrong. env->current_tb is not what you think it it is. TB > > chaining means we may be an any TB reachable from there. > > OK, I see. But the general approach to obtain the exact PC is fine? So > should I flush the whole memory range instead? By whole memory range you mean all of everything? That sounds a fairly poor solution. The way arm and m68k handle this is to never put a memory op in the middle of a TB. Your solution also only works for targets that define TARGET_HAS_PRECISE_SMC. Paul