qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] qemu simple user mode testing (arm, ppc, sparc)


From: J. Mayer
Subject: Re: [Qemu-devel] qemu simple user mode testing (arm, ppc, sparc)
Date: Sat, 21 Feb 2004 00:14:43 +0100

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 <address@hidden>
Never organized





reply via email to

[Prev in Thread] Current Thread [Next in Thread]