From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GjHCM-0001M2-SW for qemu-devel@nongnu.org; Sun, 12 Nov 2006 10:24:42 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GjHCL-0001Lq-FE for qemu-devel@nongnu.org; Sun, 12 Nov 2006 10:24:41 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GjHCL-0001Ln-Ai for qemu-devel@nongnu.org; Sun, 12 Nov 2006 10:24:41 -0500 Received: from [66.93.172.17] (helo=nevyn.them.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GjHCL-0001bC-5q for qemu-devel@nongnu.org; Sun, 12 Nov 2006 10:24:41 -0500 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GjHCK-00033C-45 for qemu-devel@nongnu.org; Sun, 12 Nov 2006 10:24:40 -0500 Date: Sun, 12 Nov 2006 10:24:40 -0500 From: Daniel Jacobowitz Subject: Re: [Qemu-devel] [PATCH] Huge TLB performance improvement Message-ID: <20061112152440.GA11711@nevyn.them.org> References: <20060306145929.GD27785@networkno.de> <200611121408.09895.paul@codesourcery.com> <20061112142938.GC4040@networkno.de> <200611121444.46898.paul@codesourcery.com> <20061112150714.GA10651@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20061112150714.GA10651@nevyn.them.org> 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 On Sun, Nov 12, 2006 at 10:07:15AM -0500, Daniel Jacobowitz wrote: > > Actually that gives me an idea. When a TLB entry with a different ASID gets > > evicted we currently flush that page. This should be a no-op because we > > already did a full flush when the ASID changed. > > Let me see if this makes any difference. Saves about 2% of invalidate_tlb calls, no measurable time change, but we might as well. Attached. -- Daniel Jacobowitz CodeSourcery --- target-mips/op_helper.c | 7 +++++++ 1 file changed, 7 insertions(+) Index: qemu/target-mips/op_helper.c =================================================================== --- qemu.orig/target-mips/op_helper.c 2006-11-12 10:09:44.000000000 -0500 +++ qemu/target-mips/op_helper.c 2006-11-12 10:21:16.000000000 -0500 @@ -573,8 +573,15 @@ static void invalidate_tlb (int idx) { tlb_t *tlb; target_ulong addr; + uint8_t ASID; + + ASID = env->CP0_EntryHi & 0xFF; tlb = &env->tlb[idx]; + if (tlb->G == 0 && tlb->ASID != ASID) { + return; + } + if (tlb->V0) { tb_invalidate_page_range(tlb->PFN[0], tlb->end - tlb->VPN); addr = tlb->VPN;