From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1AuJrx-0000SH-Pp for qemu-devel@nongnu.org; Fri, 20 Feb 2004 18:15:41 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1AuJr2-0008AJ-W4 for qemu-devel@nongnu.org; Fri, 20 Feb 2004 18:15:16 -0500 Received: from [62.210.158.45] (helo=quito.magic.fr) by monty-python.gnu.org with esmtp (Exim 4.30) id 1AuJr1-000876-NJ for qemu-devel@nongnu.org; Fri, 20 Feb 2004 18:14:43 -0500 Received: from 10.0.0.2 (ppp-181.net-555.magic.fr [62.210.255.181]) by quito.magic.fr (8.11.6/8.11.2) with ESMTP id i1KNDtQ07530 for ; Sat, 21 Feb 2004 00:13:55 +0100 (CET) Subject: Re: [Qemu-devel] qemu simple user mode testing (arm, ppc, sparc) From: "J. Mayer" In-Reply-To: References: Content-Type: text/plain Message-Id: <1077318882.17685.38.camel@rapid> Mime-Version: 1.0 Date: Sat, 21 Feb 2004 00:14:43 +0100 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Mon, 2004-02-16 at 13:58, Karel Gardas wrote: > Hello, > > I have performed simple testing of qemu-0.5.2 (vide also my last email > about ARM emulation issues). I have used these tests: > > 1) C++ hello world example using iostreams > 2) C++ hello world example using C stdio > 3) C hello world example using C stdio > 4) bogomips test > ... > qemu-ppc: > > 1) stat: failed > dyn: failed (qemu segfaults) > 2) stats: run > dyn: failed (qemu segfaults) > 3) stat: run > dyn: run > 4) run (40 BogoMIPS) I don't know if this fixes all issues, but I just found some bugs, trying kernel-mode emulation, which will also affect user-mode: 1/ lwarx does all right, but doesn't keep the loaded value: Index: target-ppc/op_mem.h =================================================================== RCS file: /cvsroot/qemu/qemu/target-ppc/op_mem.h,v retrieving revision 1.3 diff -u -d -w -B -b -d -p -r1.3 op_mem.h --- target-ppc/op_mem.h 18 Jan 2004 22:49:57 -0000 1.3 +++ target-ppc/op_mem.h 20 Feb 2004 23:07:16 -0000 @@ -141,8 +141,8 @@ PPC_OP(glue(lwarx, MEMSUFFIX)) do_queue_exception(EXCP_ALIGN); do_process_exceptions(); } else { - glue(ldl, MEMSUFFIX)((void *)T0); - regs->reserve = T0 & ~0x03; + T1 = glue(ldl, MEMSUFFIX)((void *)T0); + regs->reserve = T0; } RETURN(); } 2/ Always have to update nip when processing exceptions: Index: op.c =================================================================== RCS file: /cvsroot/qemu/qemu/target-ppc/op.c,v retrieving revision 1.5 diff -u -d -w -B -b -d -p -r1.5 op.c --- op.c 18 Jan 2004 22:49:57 -0000 1.5 +++ op.c 20 Feb 2004 23:10:40 -0000 @@ -220,8 +220,8 @@ PPC_OP(queue_exception) PPC_OP(process_exceptions) { - if (env->exceptions != 0) { env->nip = PARAM(1); + if (env->exceptions != 0) { do_check_exception_state(); } } 3/ Fix check for lswi: Index: translate.c =================================================================== RCS file: /cvsroot/qemu/qemu/target-ppc/translate.c,v retrieving revision 1.6 diff -u -d -w -B -b -d -p -r1.6 translate.c --- translate.c 3 Feb 2004 23:39:42 -0000 1.6 +++ translate.c 20 Feb 2004 23:12:40 -0000 @@ -1229,8 +1225,9 @@ GEN_HANDLER(lswi, 0x1F, 0x15, 0x12, 0x00 if (nb == 0) nb = 32; nr = nb / 4; - if (((start + nr) > 32 && start <= ra && (start + nr - 32) >= ra) || - ((start + nr) <= 32 && start <= ra && (start + nr) >= ra)) { + if (((start + nr) > 32 && start <= ra && (start + nr - 32) > ra) || + ((start + nr) <= 32 && start <= ra && (start + nr) > ra)) { + printf("Invalid lswi: start=%d nr=%d ra=%d\n", start, nr, ra); RET_EXCP(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_LSWX); } if (ra == 0) { Hope this helps... -- J. Mayer Never organized