From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IhFjV-0004qK-BB for qemu-devel@nongnu.org; Sun, 14 Oct 2007 22:31:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IhFjQ-0004nc-Ux for qemu-devel@nongnu.org; Sun, 14 Oct 2007 22:31:04 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IhFjQ-0004nU-NU for qemu-devel@nongnu.org; Sun, 14 Oct 2007 22:31:00 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IhFjQ-0008Ar-8E for qemu-devel@nongnu.org; Sun, 14 Oct 2007 22:31:00 -0400 From: Paul Brook Subject: Re: [Qemu-devel] RFC: Code fetch optimisation Date: Mon, 15 Oct 2007 03:30:55 +0100 References: <1192362267.9976.383.camel@rapid> In-Reply-To: <1192362267.9976.383.camel@rapid> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200710150330.55998.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: "J. Mayer" On Sunday 14 October 2007, J. Mayer wrote: > Here's an updated version of the code fetch optimisation patch against > current CVS. > As a remainder, this patch avoid use of softmmu helpers to fetch the > code in most case. A new target define TARGET_HAS_VLE_INSNS has been > added which is used to handle the case of an instruction that span 2 > pages, when the target CPU uses a variable-length instructions encoding. > For pure RISC, the code fetch is done using raw access routines. > + unsigned long phys_pc; > + unsigned long phys_pc_start; These are ram offsets, not physical addresses. I recommend naming them as such to avoid confusion. > + opc = glue(glue(lds,SUFFIX),MEMSUFFIX)(virt_pc); > + /* Avoid softmmu access on next load */ > + /* XXX: dont: phys PC is not correct anymore > + * We could call get_phys_addr_code(env, pc); and remove the else > + * condition, here. > + */ > + //*start_pc = phys_pc; The commented out code is completely bogus, please remove it. The comment is also somewhat misleading/incorrect. The else would still be required for accesses that span a page boundary. The code itself looks ok, though I'd be surprised if it made a significant difference. We're always going to hit the fast-path TLB lookup case anyway. Paul