Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I2se8-0007D9-Bh for qemu-devel@nongnu.org; Mon, 25 Jun 2007 13:46:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I2se7-0007Cr-GV for qemu-devel@nongnu.org; Mon, 25 Jun 2007 13:46:39 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I2se7-0007Co-Cl for qemu-devel@nongnu.org; Mon, 25 Jun 2007 13:46:39 -0400 Received: from phoenix.bawue.net ([193.7.176.60] helo=mail.bawue.net) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1I2se6-00037G-Ue for qemu-devel@nongnu.org; Mon, 25 Jun 2007 13:46:39 -0400 Date: Mon, 25 Jun 2007 18:46:14 +0100 Subject: Re: [Qemu-devel] [PATCH, MIPS] Code translation improvement Message-ID: <20070625174614.GB3665@networkno.de> References: <20070615040008.GA4156@amd64.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070615040008.GA4156@amd64.aurel32.net> From: Thiemo Seufer Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: qemu-devel@nongnu.org Aurelien Jarno wrote: > Hi, > > The patch below makes a few improvement to the code translation, and fixes > a small bug: > > - The check for the bit ERL in CP0 Status register implies that the CPU > is in kernel mode, so there is no need to further check for user mode. Applied. > - Checking for the bit UM in CP0 Status register is not enough to detect > the user mode, the patch below changes that to a check for > MIPS_HFLAG_UM in hflags. Applied. > - Currently checking if CP0 is accessible, ie either the CPU is in kernel > mode or the bit CU0 in CP0 Status register enabled, is done in the > translated code. The patch below moves the check for user mode at > translation time to improve a bit the execution time. It also saves a > call to save_cpu_state() if the CPU is in kernel mode. A few CP0 > instructions then needs to explicitely save the cpu state, as they > are modifying hflags. This part breaks my standard Linux boot test. In general the idea is sound, though. Thiemo