Received: from [140.186.70.92] (port=49148 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PdpW5-0005RD-5K for qemu-devel@nongnu.org; Fri, 14 Jan 2011 14:40:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PdpW3-00030s-Rd for qemu-devel@nongnu.org; Fri, 14 Jan 2011 14:40:56 -0500 Received: from hall.aurel32.net ([88.191.126.93]:57146) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PdpW3-00030k-K2 for qemu-devel@nongnu.org; Fri, 14 Jan 2011 14:40:55 -0500 Date: Fri, 14 Jan 2011 20:40:55 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH v2 0/8] target-arm: Translate based on TB flags, not CPUState Message-ID: <20110114194055.GD16663@hall.aurel32.net> References: <1294783938-19629-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1294783938-19629-1-git-send-email-peter.maydell@linaro.org> Sender: Aurelien Jarno List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org On Tue, Jan 11, 2011 at 10:12:10PM +0000, Peter Maydell wrote: > This patchset corrects a number of places in the ARM translation code > which were generating code which was dependent on values in the CPUState > structure which might change at runtime. This is a bad idea for two > reasons. Firstly, we might try to reuse the generated code later when > the assumptions baked into the generated code were no longer valid. > Secondly, we might try to retranslate the same TB (eg when an exception > results in our calling cpu_restore_state()) but get different generated > code, which could result in qemu crashing. > > Bug https://bugs.launchpad.net/bugs/604872 is a particular example > of the latter case involving the IT bits; this patchset fixes that bug. > > I believe that this patchset deals with all the problems. Remaining > CPUState fields referred to in translate.c are either constant after > system init or trigger flushing of affected TBs when they are changed. > > Differences from v1: I've added some macros for the TB flags bitfields, > as suggested by Aurelien. > > Peter Maydell (8): > target-arm: Don't generate code specific to current CPU mode for SRS > target-arm: Add symbolic constants for bitfields in TB flags > target-arm: Translate with VFP-enabled from TB flags, not CPUState > target-arm: Translate with VFP len/stride from TB flags, not CPUState > target-arm: Translate with Thumb state from TB flags, not CPUState > target-arm: Translate with condexec bits from TB flags, not CPUState > target-arm: Set privileged bit in TB flags correctly for M profile > target-arm: Translate with user-state from TB flags, not CPUState > > target-arm/cpu.h | 51 ++++++++++++++++++++++++--- > target-arm/helper.c | 12 +++++- > target-arm/translate.c | 88 ++++++++++++++++++----------------------------- > 3 files changed, 89 insertions(+), 62 deletions(-) > > > Thanks, all applied. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net