From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43226 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OU24Z-0002uT-MK for qemu-devel@nongnu.org; Wed, 30 Jun 2010 14:31:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OU24Y-0004t2-I9 for qemu-devel@nongnu.org; Wed, 30 Jun 2010 14:31:47 -0400 Received: from hall.aurel32.net ([88.191.82.174]:39032) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OU24Y-0004sX-Dj for qemu-devel@nongnu.org; Wed, 30 Jun 2010 14:31:46 -0400 Date: Wed, 30 Jun 2010 20:31:35 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] A bit optimization for tlb_set_page() (resend) Message-ID: <20100630183135.GA24593@ohm.aurel32.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jun Koi Cc: Jan Kiszka , qemu-devel@nongnu.org On Thu, May 06, 2010 at 02:36:59PM +0900, Jun Koi wrote: > This patch avoids handling write watchpoints on read-only memory access. > It also breaks the searching loop for watchpoint once the setup for > handling watchpoint later is done. > > Signed-off-by: Jun Koi Thanks, applied. > diff --git a/exec.c b/exec.c > index 14d1fd7..6fd859f 100644 > --- a/exec.c > +++ b/exec.c > @@ -2236,10 +2236,12 @@ void tlb_set_page(CPUState *env, target_ulong vaddr, > watchpoint trap routines. */ > QTAILQ_FOREACH(wp, &env->watchpoints, entry) { > if (vaddr == (wp->vaddr & TARGET_PAGE_MASK)) { > - iotlb = io_mem_watch + paddr; > - /* TODO: The memory case can be optimized by not trapping > - reads of pages with a write breakpoint. */ > - address |= TLB_MMIO; > + /* Avoid trapping reads of pages with a write breakpoint. */ > + if ((prot & PAGE_WRITE) || (wp->flags & BP_MEM_READ)) { > + iotlb = io_mem_watch + paddr; > + address |= TLB_MMIO; > + break; > + } > } > } > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net