Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HpDGS-0004pJ-Tu for qemu-devel@nongnu.org; Fri, 18 May 2007 20:57:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HpDGQ-0004p7-Pr for qemu-devel@nongnu.org; Fri, 18 May 2007 20:57:43 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HpDGQ-0004p4-Mk for qemu-devel@nongnu.org; Fri, 18 May 2007 20:57:42 -0400 Received: from farad.aurel32.net ([82.232.2.251] helo=mail.aurel32.net) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HpDGQ-00013k-6Z for qemu-devel@nongnu.org; Fri, 18 May 2007 20:57:42 -0400 Received: from amd64.aurel32.net ([2001:618:400:fc13:216:3eff:fe00:1009]) by mail.aurel32.net with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1HpDGK-0005G2-O5 for qemu-devel@nongnu.org; Sat, 19 May 2007 02:57:36 +0200 Received: from aurel32 by amd64.aurel32.net with local (Exim 4.67) (envelope-from ) id 1HpDGK-0006pn-Hb for qemu-devel@nongnu.org; Sat, 19 May 2007 02:57:36 +0200 Date: Sat, 19 May 2007 02:57:36 +0200 From: Aurelien Jarno Message-ID: <20070519005736.GA26262@amd64.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Subject: [Qemu-devel] [PATCH, MIPS64] Fix LDR and LDL instructions 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 Hi, The trivial patch below fixes the LDR and LDL instructions. Before modifying a register, it is better to load it :) With this patch I am able to boot a 64-bit MIPS kernel on the emulated Malta board up to the start of INIT. Then I get: Freeing unused kernel memory: 168k freed modprobe: FATAL: Could not load /lib/modules/2.6.21.1/modules.dep: No such file or directory INIT: version 2.86 booting schedule_timeout: wrong timeout value 7ffffffffffffffe Call Trace: [] dump_stack+0x8/0x38 [] schedule_timeout+0xdc/0x108 [] do_select+0x428/0x548 [] compat_core_sys_select+0x1a4/0x230 [] compat_sys_select+0x104/0x1f0 [] handle_sys+0x108/0x124 This call trace is then printed in loop. Note that the kernel part of the 64-bit boot log is now the same as the 32-bit one, except for the addresses. The 64-bit specific error messages (for example the USB ones) are fixed with this patch. Bye, Aurelien Index: target-mips/translate.c =================================================================== RCS file: /sources/qemu/qemu/target-mips/translate.c,v retrieving revision 1.80 diff -u -d -p -r1.80 translate.c --- target-mips/translate.c 18 May 2007 11:55:54 -0000 1.80 +++ target-mips/translate.c 19 May 2007 00:46:59 -0000 @@ -761,6 +761,7 @@ static void gen_ldst (DisasContext *ctx, opn = "scd"; break; case OPC_LDL: + GEN_LOAD_REG_TN(T1, rt); op_ldst(ldl); GEN_STORE_TN_REG(rt, T0); opn = "ldl"; @@ -771,6 +772,7 @@ static void gen_ldst (DisasContext *ctx, opn = "sdl"; break; case OPC_LDR: + GEN_LOAD_REG_TN(T1, rt); op_ldst(ldr); GEN_STORE_TN_REG(rt, T0); opn = "ldr"; -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net