Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LNBbp-0001x8-13 for qemu-devel@nongnu.org; Wed, 14 Jan 2009 14:41:01 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LNBbo-0001wo-Fs for qemu-devel@nongnu.org; Wed, 14 Jan 2009 14:41:00 -0500 Received: from [199.232.76.173] (port=56202 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNBbo-0001wl-77 for qemu-devel@nongnu.org; Wed, 14 Jan 2009 14:41:00 -0500 Received: from hall.aurel32.net ([88.191.82.174]:40131) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LNBbn-0006bG-O7 for qemu-devel@nongnu.org; Wed, 14 Jan 2009 14:41:00 -0500 Date: Wed, 14 Jan 2009 20:40:58 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] 4xx wrtee instructions Message-ID: <20090114194058.GH20474@hall.aurel32.net> References: <20090113160418.225e5362@acmay.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20090113160418.225e5362@acmay.homeip.net> Sender: Aurelien Jarno 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: Andrew May On Tue, Jan 13, 2009 at 04:04:18PM -0800, Andrew May wrote: > When I try to boot a PPC 4xx linux kernel it fails somewhere after > expanding the ramdisk with: > "qemu: fatal: Trying to execute code outside RAM or ROM at 0xc007c70c" > > It seems that the "wrteei" instruction is unsetting the address > translate bits in the MSR. This patch seems to fix it, and I think it > is correct, to and with the "not" of the bit instead of the bit itself > to disable interrupts. > > The qemu log file doesn't display the correct instructions, but that > doesn't seem to be a problem. > ==================== > IN: > 0xc000d0cc: mfmsr r5 > 0xc000d0d0: mfspr r6,945 > 0xc000d0d4: .long 0x7c000146 > 0xc000d0d8: mtspr 945,r4 > 0xc000d0dc: .long 0x7c601f25 > 0xc000d0e0: mtspr 945,r6 > 0xc000d0e4: .long 0x7ca00106 > ======================= > > Please CC me since I am not on the list. > > Here is the patch. > ========== > diff --git a/trunk/target-ppc/translate.c b/trunk/target-ppc/translate.c > --- a/trunk/target-ppc/translate.c > +++ b/trunk/target-ppc/translate.c > @@ -6050,7 +6050,7 @@ GEN_HANDLER(wrteei, 0x1F, 0x03, 0x05, 0x000EFC01, PPC_WRTEE) > /* Stop translation to have a chance to raise an exception */ > gen_stop_exception(ctx); > } else { > - tcg_gen_andi_tl(cpu_msr, cpu_msr, (1 << MSR_EE)); > + tcg_gen_andi_tl(cpu_msr, cpu_msr, ~(1 << MSR_EE)); > } > #endif > } > Thanks, applied. -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net