Skip to contentSkip to conversation

Improve alpha-linux userspace emulation

PATCH In review Richard Henderson 5 participants 18 messages Dec 10, 2009 – Dec 14, 2009 exec and binfmt

lore
Share & tools
lore
#6 lore raw

PATCH 3/7 alpha: Add binfmt entry.

In reply to Richard Henderson
---
 qemu-binfmt-conf.sh |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
qemu-binfmt-conf.sh +3 -0
index 941f0cf..ba916ac 100644
@@ -34,6 +34,9 @@ if [ $cpu != "i386" ] ; then
     echo ':i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register
     echo ':i486:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register
 fi
+if [ $cpu != "alpha" ] ; then
+    echo ':alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-alpha:' > /proc/sys/fs/binfmt_misc/register
+fi
 if [ $cpu != "arm" ] ; then
     echo   ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-arm:' > /proc/sys/fs/binfmt_misc/register
     echo   ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-armeb:' > /proc/sys/fs/binfmt_misc/register
Signature · 1 line
1.6.5.2
#0 lore raw

cover Improve alpha-linux userspace emulation

The following patch series results in an emulator that's good enough to run a good bit of the GCC testsuite, dynamic linking and all. There are more failures than native hardware. At first glance they appear to be fpu related, but I havn't investigated properly yet.

r~
--

Richard Henderson (7):
alpha: Implement IMB; add placeholders for other userspace PALcalls.
alpha: Drop bogus UNIQ initial value on Linux.
alpha: Add binfmt entry.
alpha: Remove bogus DO_TB_FLUSH code from translator.
alpha: Honor the -cpu command line argument. Also change the default
cpu to ev67.
alpha: Enable softfloat.
alpha: Fixes for alpha-linux syscalls.

 configure                  |    2 +-
 fpu/softfloat-specialize.h |    4 +-
 fpu/softfloat.h            |    1 +
 hw/alpha_palcode.c         |   29 ++++++-
 linux-user/alpha/syscall.h |  212 ++++++++++++++++++++++++++++++++++++++++++++
 linux-user/elfload.c       |    3 -
 linux-user/syscall.c       |  137 ++++++++++++++++++++++++++--
 qemu-binfmt-conf.sh        |    3 +
 target-alpha/cpu.h         |   49 ++++++++++
 target-alpha/helper.c      |   77 ++++++++++++++++
 target-alpha/helper.h      |    2 -
 target-alpha/op_helper.c   |   46 +---------
 target-alpha/translate.c   |   52 +++++++++--
 13 files changed, 544 insertions(+), 73 deletions(-)
#1 lore raw

PATCH 1/7 alpha: Implement IMB; add placeholders for other userspace PALcalls.

---
 hw/alpha_palcode.c |   29 +++++++++++++++++++++++++++--
 1 files changed, 27 insertions(+), 2 deletions(-)
hw/alpha_palcode.c +27 -2
index c48a297..44b2ca4 100644
@@ -1062,6 +1062,16 @@ void call_pal (CPUState *env, int palcode)
 
     qemu_log("%s: palcode %02x\n", __func__, palcode);
     switch (palcode) {
+    case 0x80:
+        /* BPT */
+        qemu_log("BPT\n");
+        /* FIXME: Sends SIGTRAP, si_code=TRAP_BRKPT.  */
+        exit(1);
+    case 0x81:
+        /* BUGCHK */
+        qemu_log("BUGCHK\n");
+        /* FIXME: Sends SIGTRAP, si_code=SI_FAULT.  */
+        exit(1);
     case 0x83:
         /* CALLSYS */
         qemu_log("CALLSYS n " TARGET_FMT_ld "\n", env->ir[0]);
@@ -1076,6 +1086,11 @@ void call_pal (CPUState *env, int palcode)
             env->ir[IR_V0] = -ret;
         }
         break;
+    case 0x86:
+        /* IMB */
+        qemu_log("IMB\n");
+        tb_flush(env);
+        break;
     case 0x9E:
         /* RDUNIQUE */
         env->ir[IR_V0] = env->unique;
@@ -1086,9 +1101,19 @@ void call_pal (CPUState *env, int palcode)
         env->unique = env->ir[IR_A0];
         qemu_log("WRUNIQUE: " TARGET_FMT_lx "\n", env->unique);
         break;
+    case 0xAA:
+        /* GENTRAP */
+        qemu_log("GENTRAP: " TARGET_FMT_lx "\n", env->ir[IR_A0]);
+        /* FIXME: This is supposed to send a signal:
+           SIGFPE:
+             GEN_INTOVF, GEN_INTDIV, GEN_FLTOVF, GEN_FLTDIV,
+             GEN_FLTUND, GEN_FLTINV, GEN_FLTINE, GEN_ROPRAND
+           SIGTRAP:
+             others
+           with various settings of si_code.  */
+        exit(1);
     default:
-        qemu_log("%s: unhandled palcode %02x\n",
-                    __func__, palcode);
+        qemu_log("%s: unhandled palcode %02x\n", __func__, palcode);
         exit(1);
     }
 }
Signature · 1 line
1.6.5.2
#5 lore raw

PATCH 2/7 alpha: Drop bogus UNIQ initial value on Linux.

In reply to Richard Henderson
---
 linux-user/elfload.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
linux-user/elfload.c +0 -3
index 682a813..f47ec1e 100644
@@ -677,9 +677,6 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
     regs->pc = infop->entry;
     regs->ps = 8;
     regs->usp = infop->start_stack;
-    regs->unique = infop->start_data; /* ? */
-    printf("Set unique value to " TARGET_FMT_lx " (" TARGET_FMT_lx ")\n",
-           regs->unique, infop->start_data);
 }
 
 #define ELF_EXEC_PAGESIZE        8192
Signature · 1 line
1.6.5.2
#7 lore raw

PATCH 4/7 alpha: Remove bogus DO_TB_FLUSH code from translator.

In reply to Richard Henderson
---
 target-alpha/helper.h    |    2 --
 target-alpha/op_helper.c |    5 -----
 target-alpha/translate.c |    8 +-------
 3 files changed, 1 insertions(+), 14 deletions(-)
target-alpha/helper.h +0 -2
index a4faca2..9c60be1 100644
@@ -1,7 +1,5 @@
 #include "def-helper.h"
 
-DEF_HELPER_0(tb_flush, void)
-
 DEF_HELPER_2(excp, void, int, int)
 DEF_HELPER_0(load_pcc, i64)
 DEF_HELPER_0(rc, i64)
target-alpha/op_helper.c +0 -5
index fe222dc..508272c 100644
@@ -22,11 +22,6 @@
 #include "softfloat.h"
 #include "helper.h"
 
-void helper_tb_flush (void)
-{
-    tb_flush(env);
-}
-
 /*****************************************************************************/
 /* Exceptions processing helpers */
 void helper_excp (int excp, int error)
target-alpha/translate.c +1 -7
index 9e7e9b2..ae1f5a8 100644
@@ -32,10 +32,7 @@
 #define GEN_HELPER 1
 #include "helper.h"
 
-/* #define DO_SINGLE_STEP */
-#define ALPHA_DEBUG_DISAS
-/* #define DO_TB_FLUSH */
-
+#undef ALPHA_DEBUG_DISAS
 
 #ifdef ALPHA_DEBUG_DISAS
 #  define LOG_DISAS(...) qemu_log(__VA_ARGS__)
@@ -2428,9 +2425,6 @@ static inline void gen_intermediate_code_internal(CPUState *env,
     if (ret != 1 && ret != 3) {
         tcg_gen_movi_i64(cpu_pc, ctx.pc);
     }
-#if defined (DO_TB_FLUSH)
-    gen_helper_tb_flush();
-#endif
     if (tb->cflags & CF_LAST_IO)
         gen_io_end();
     /* Generate the return instruction */
Signature · 1 line
1.6.5.2
#10 lore raw

PATCH 7/7 alpha: Fixes for alpha-linux syscalls.

In reply to Richard Henderson

1. Add correct definitions of error numbers.
2. Implement SYS_osf_sigprocmask
3. Implement SYS_osf_get/setsysinfo for IEEE_FP_CONTROL.

This last requires exposing the FPCR value to do_syscall. Since this value is actually split up into the float_status, expose routines from helper.c to access it.

Finally, also add a float_exception_mask field to float_status. We don't actually use it to control delivery of exceptions to the emulator yet, but simply hold the value that we placed there when loading/storing the FPCR.

---
 fpu/softfloat.h            |    1 +
 linux-user/alpha/syscall.h |  212 ++++++++++++++++++++++++++++++++++++++++++++
 linux-user/syscall.c       |  137 ++++++++++++++++++++++++++--
 target-alpha/cpu.h         |   49 ++++++++++
 target-alpha/helper.c      |   77 ++++++++++++++++
 target-alpha/op_helper.c   |   41 +--------
 6 files changed, 468 insertions(+), 49 deletions(-)
fpu/softfloat.h +1 -0
index 636591b..9d82694 100644
@@ -187,6 +187,7 @@ typedef struct float_status {
     signed char float_detect_tininess;
     signed char float_rounding_mode;
     signed char float_exception_flags;
+    signed char float_exception_mask;
 #ifdef FLOATX80
     signed char floatx80_rounding_precision;
 #endif
linux-user/alpha/syscall.h +212 -0

215 lines not on this page · raw message

linux-user/syscall.c +127 -10

152 lines not on this page · raw message

target-alpha/cpu.h +49 -0

61 lines not on this page · raw message

target-alpha/helper.c +77 -0

83 lines not on this page · raw message

target-alpha/op_helper.c +2 -39

51 lines not on this page · raw message

Signature · 1 line
1.6.5.2
#8 lore raw

PATCH 5/7 alpha: Honor the -cpu command line argument.

In reply to Richard Henderson

Also change the default cpu to ev67.

---
 target-alpha/translate.c |   44 ++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 42 insertions(+), 2 deletions(-)
target-alpha/translate.c +42 -2
index ae1f5a8..3f8d1b2 100644
@@ -2460,17 +2460,57 @@ void gen_intermediate_code_pc (CPUState *env, struct TranslationBlock *tb)
     gen_intermediate_code_internal(env, tb, 1);
 }
 
+struct cpu_def_t {
+    const char *name;
+    int implver, amask;
+};
+
+static const struct cpu_def_t cpu_defs[] = {
+    { "ev4",   IMPLVER_2106x, 0 },
+    { "ev5",   IMPLVER_21164, 0 },
+    { "ev56",  IMPLVER_21164, AMASK_BWX },
+    { "pca56", IMPLVER_21164, AMASK_BWX | AMASK_MVI },
+    { "ev6",   IMPLVER_21264, AMASK_BWX | AMASK_FIX | AMASK_MVI | AMASK_TRAP },
+    { "ev67",  IMPLVER_21264, (AMASK_BWX | AMASK_FIX | AMASK_CIX
+			       | AMASK_MVI | AMASK_TRAP | AMASK_PREFETCH), },
+    { "ev68",  IMPLVER_21264, (AMASK_BWX | AMASK_FIX | AMASK_CIX
+			       | AMASK_MVI | AMASK_TRAP | AMASK_PREFETCH), },
+    { "21064", IMPLVER_2106x, 0 },
+    { "21164", IMPLVER_21164, 0 },
+    { "21164a", IMPLVER_21164, AMASK_BWX },
+    { "21164pc", IMPLVER_21164, AMASK_BWX | AMASK_MVI },
+    { "21264", IMPLVER_21264, AMASK_BWX | AMASK_FIX | AMASK_MVI | AMASK_TRAP },
+    { "21264a", IMPLVER_21264, (AMASK_BWX | AMASK_FIX | AMASK_CIX
+				| AMASK_MVI | AMASK_TRAP | AMASK_PREFETCH), }
+};
+
 CPUAlphaState * cpu_alpha_init (const char *cpu_model)
 {
     CPUAlphaState *env;
     uint64_t hwpcb;
+    int implver, amask, i, max;
 
     env = qemu_mallocz(sizeof(CPUAlphaState));
     cpu_exec_init(env);
     alpha_translate_init();
     tlb_flush(env, 1);
-    /* XXX: should not be hardcoded */
-    env->implver = IMPLVER_2106x;
+
+    /* Default to ev67; no reason not to emulate insns by default.  */
+    implver = IMPLVER_21264;
+    amask = (AMASK_BWX | AMASK_FIX | AMASK_CIX | AMASK_MVI
+	     | AMASK_TRAP | AMASK_PREFETCH);
+
+    max = ARRAY_SIZE(cpu_defs);
+    for (i = 0; i < max; i++) {
+        if (strcmp (cpu_model, cpu_defs[i].name) == 0) {
+            implver = cpu_defs[i].implver;
+            amask = cpu_defs[i].amask;
+            break;
+        }
+    }
+    env->implver = implver;
+    env->amask = amask;
+
     env->ps = 0x1F00;
 #if defined (CONFIG_USER_ONLY)
     env->ps |= 1 << 3;
Signature · 1 line
1.6.5.2
#9 lore raw

PATCH 6/7 alpha: Enable softfloat.

In reply to Richard Henderson
---
 configure                  |    2 +-
 fpu/softfloat-specialize.h |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
configure +1 -1
index a29839e..2d46abb 100755
@@ -2432,7 +2432,7 @@ if test ! -z "$gdb_xml_files" ; then
 fi
 
 case "$target_arch2" in
-  arm|armeb|m68k|microblaze|mips|mipsel|mipsn32|mipsn32el|mips64|mips64el|ppc|ppc64|ppc64abi32|ppcemb|s390x|sparc|sparc64|sparc32plus)
+  alpha|arm|armeb|m68k|microblaze|mips|mipsel|mipsn32|mipsn32el|mips64|mips64el|ppc|ppc64|ppc64abi32|ppcemb|s390x|sparc|sparc64|sparc32plus)
     echo "CONFIG_SOFTFLOAT=y" >> $config_target_mak
     ;;
   *)
fpu/softfloat-specialize.h +2 -2
index f607e19..8e6aceb 100644
@@ -61,7 +61,7 @@ typedef struct {
 *----------------------------------------------------------------------------*/
 #if defined(TARGET_SPARC)
 #define float32_default_nan make_float32(0x7FFFFFFF)
-#elif defined(TARGET_POWERPC) || defined(TARGET_ARM)
+#elif defined(TARGET_POWERPC) || defined(TARGET_ARM) || defined(TARGET_ALPHA)
 #define float32_default_nan make_float32(0x7FC00000)
 #elif defined(TARGET_HPPA)
 #define float32_default_nan make_float32(0x7FA00000)
@@ -189,7 +189,7 @@ static float32 propagateFloat32NaN( float32 a, float32 b STATUS_PARAM)
 *----------------------------------------------------------------------------*/
 #if defined(TARGET_SPARC)
 #define float64_default_nan make_float64(LIT64( 0x7FFFFFFFFFFFFFFF ))
-#elif defined(TARGET_POWERPC) || defined(TARGET_ARM)
+#elif defined(TARGET_POWERPC) || defined(TARGET_ARM) || defined(TARGET_ALPHA)
 #define float64_default_nan make_float64(LIT64( 0x7FF8000000000000 ))
 #elif defined(TARGET_HPPA)
 #define float64_default_nan make_float64(LIT64( 0x7FF4000000000000 ))
Signature · 1 line
1.6.5.2
#11 lore raw
In reply to Richard Henderson
Quoted 5 lines · Richard Henderson

The following patch series results in an emulator that's good enough to run a good bit of the GCC testsuite, dynamic linking and all. There are more failures than native hardware.  At first glance they appear to be fpu related, but I havn't investigated properly yet.

I don't know what FPU instructions gcc emits, but QEMU doesn't handle the rounding mode encoding. If you're interested I started implementing that, though it's not complete (and it didn't fix the SPEC2k equake failure I had).

Laurent

Quoted 33 lines

r~
--

Richard Henderson (7):
 alpha: Implement IMB; add placeholders for other userspace PALcalls.
 alpha: Drop bogus UNIQ initial value on Linux.
 alpha: Add binfmt entry.
 alpha: Remove bogus DO_TB_FLUSH code from translator.
 alpha: Honor the -cpu command line argument. Also change the default cpu to ev67.
 alpha: Enable softfloat.
 alpha: Fixes for alpha-linux syscalls.

 configure                  |    2 +-
 fpu/softfloat-specialize.h |    4 +-
 fpu/softfloat.h            |    1 +
 hw/alpha_palcode.c         |   29 ++++++- linux-user/alpha/syscall.h |  212 ++++++++++++++++++++++++++++++++++++++++++++ linux-user/elfload.c       |    3 -
 linux-user/syscall.c       |  137 ++++++++++++++++++++++++++-- qemu-binfmt-conf.sh        |    3 +
 target-alpha/cpu.h         |   49 ++++++++++ target-alpha/helper.c      |   77 ++++++++++++++++ target-alpha/helper.h      |    2 -
 target-alpha/op_helper.c   |   46 +--------- target-alpha/translate.c   |   52 +++++++++--

 13 files changed, 544 insertions(+), 73 deletions(-)
#12 lore raw
Quoted 2 lines · Laurent Desnogues

I don't know what FPU instructions gcc emits, but QEMU doesn't handle the rounding mode encoding.

Ah yes, GCC does make use of those.

Quoted 3 lines

If you're interested I started
implementing that, though it's not complete (and it didn't fix the SPEC2k equake failure I had).

Sure, I'm interested. Pass it along.

r~

#13 lore raw
In reply to Richard Henderson
Quoted 5 lines · Richard Henderson

The following patch series results in an emulator that's good enough to run a good bit of the GCC testsuite, dynamic linking and all. There are more failures than native hardware. At first glance they appear to be fpu related, but I havn't investigated properly yet.

Richard,

just in case you weren't aware and are interested: I was able to make an es40 emulation in qemu good enough to start Linux. I did this work several months ago, so it need revival.
At this time the main limitation was the absence of IOMMU abstraction in qemu.

Tristan.

#14 lore raw
Quoted 4 lines · Tristan Gingold

just in case you weren't aware and are interested: I was able to make an es40 emulation in qemu good enough to start Linux. I did this work several months ago, so it need revival. At this time the main limitation was the absence of IOMMU abstraction in qemu.

At the moment I'm most interested in being able to test gcc, so user-level is enough. However, being able to boot a real kernel would be a Really Cool Thing.

BTW, who takes care of reviewing and committing patches to non-mainstream cpus like this?

r~

#2 lore raw

Re: [Qemu-devel] [PATCH 1/7] alpha: Implement IMB; add placeholders for other userspace PALcalls.

In reply to Richard Henderson
Quoted 28 lines · Richard Henderson
---
 hw/alpha_palcode.c |   29 +++++++++++++++++++++++++++--
 1 files changed, 27 insertions(+), 2 deletions(-)
hw/alpha_palcode.c +10 -0
index c48a297..44b2ca4 100644
@@ -1062,6 +1062,16 @@ void call_pal (CPUState *env, int palcode)
 
     qemu_log("%s: palcode %02x\n", __func__, palcode);
     switch (palcode) {
+    case 0x80:
+        /* BPT */
+        qemu_log("BPT\n");
+        /* FIXME: Sends SIGTRAP, si_code=TRAP_BRKPT.  */
+        exit(1);
+    case 0x81:
+        /* BUGCHK */
+        qemu_log("BUGCHK\n");
+        /* FIXME: Sends SIGTRAP, si_code=SI_FAULT.  */
+        exit(1);
     case 0x83:
         /* CALLSYS */
         qemu_log("CALLSYS n " TARGET_FMT_ld "\n", env->ir[0]);

hw/alpha_palcode.c void call_pal (CPUState *env, int palcode) · line 1092

Quoted 7 lines
hw/alpha_palcode.c +4 -0
@@ -1076,6 +1086,11 @@ void call_pal (CPUState *env, int palcode)
             env->ir[IR_V0] = -ret;
         }
         break;
+    case 0x86:
+        /* IMB */
+        qemu_log("IMB\n");
+        tb_flush(env);

Is it really necessary to flush all the TB here? QEMU should already discard TB that have been modified.

On other architecture this kind of memory barrier instruction is simply ignored.

Quoted 32 lines
hw/alpha_palcode.c +13 -2
+        break;
     case 0x9E:
         /* RDUNIQUE */
         env->ir[IR_V0] = env->unique;
@@ -1086,9 +1101,19 @@ void call_pal (CPUState *env, int palcode)
         env->unique = env->ir[IR_A0];
         qemu_log("WRUNIQUE: " TARGET_FMT_lx "\n", env->unique);
         break;
+    case 0xAA:
+        /* GENTRAP */
+        qemu_log("GENTRAP: " TARGET_FMT_lx "\n", env->ir[IR_A0]);
+        /* FIXME: This is supposed to send a signal:
+           SIGFPE:
+             GEN_INTOVF, GEN_INTDIV, GEN_FLTOVF, GEN_FLTDIV,
+             GEN_FLTUND, GEN_FLTINV, GEN_FLTINE, GEN_ROPRAND
+           SIGTRAP:
+             others
+           with various settings of si_code.  */
+        exit(1);
     default:
-        qemu_log("%s: unhandled palcode %02x\n",
-                    __func__, palcode);
+        qemu_log("%s: unhandled palcode %02x\n", __func__, palcode);
         exit(1);
     }
 }
Signature · 1 line
1.6.5.2
Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net
#15 lore raw
In reply to Richard Henderson
Quoted 6 lines · Richard Henderson

The following patch series results in an emulator that's good enough to run a good bit of the GCC testsuite, dynamic linking and all. There are more failures than native hardware. At first glance they appear to be fpu related, but I havn't investigated properly yet.

Thanks for the patches, I have applied all of them except the first one (see my comment on this patch).

Quoted 30 lines

Richard Henderson (7):
alpha: Implement IMB; add placeholders for other userspace PALcalls.
alpha: Drop bogus UNIQ initial value on Linux.
alpha: Add binfmt entry.
alpha: Remove bogus DO_TB_FLUSH code from translator.
alpha: Honor the -cpu command line argument. Also change the default
cpu to ev67.
alpha: Enable softfloat.
alpha: Fixes for alpha-linux syscalls.

 configure                  |    2 +-
 fpu/softfloat-specialize.h |    4 +-
 fpu/softfloat.h            |    1 +
 hw/alpha_palcode.c         |   29 ++++++-
 linux-user/alpha/syscall.h |  212 ++++++++++++++++++++++++++++++++++++++++++++
 linux-user/elfload.c       |    3 -
 linux-user/syscall.c       |  137 ++++++++++++++++++++++++++--
 qemu-binfmt-conf.sh        |    3 +
 target-alpha/cpu.h         |   49 ++++++++++
 target-alpha/helper.c      |   77 ++++++++++++++++
 target-alpha/helper.h      |    2 -
 target-alpha/op_helper.c   |   46 +---------
 target-alpha/translate.c   |   52 +++++++++--
 13 files changed, 544 insertions(+), 73 deletions(-)
Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net
#3 lore raw

Re: [Qemu-devel] [PATCH 1/7] alpha: Implement IMB; add placeholders for other userspace PALcalls.

In reply to Aurelien Jarno
Quoted 2 lines · Aurelien Jarno

Is it really necessary to flush all the TB here? QEMU should already discard TB that have been modified.

No. But I meant to look into this more carefully with a view to disabling the other checking within QEMU and speed things up a tad. It seems to me that the explicit checking with each memory write ought to only be necessary on architectures like x86 that don't architecturally require a flush insn to be used.

I can drop this fragment if necessary for patch acceptance, however.

r~

#16 lore raw
In reply to Aurelien Jarno

Hello,

Am 13.12.2009 um 20:46 schrieb Aurelien Jarno:

Quoted 6 lines · Richard Henderson
Quoted 5 lines

The following patch series results in an emulator that's good enough to run a good bit of the GCC testsuite, dynamic linking and all.

There are more failures than native hardware.

;-)

Quoted 5 lines
Quoted 3 lines

At first glance they
appear to be fpu related, but I havn't investigated properly yet.

Thanks for the patches, I have applied all of them except the first one

I've checked the linux-user testsuite 0.3 on master:
The message "Set unique value to 0000000120060e38 (0000000120060e38)" is gone now, but ls -l dummyfile doesn't list the file yet.

Would this be fpu related? If there were missing syscalls or something, I would expect an error/warning message rather than silent failure.

Andreas

#4 lore raw

Re: [Qemu-devel] [PATCH 1/7] alpha: Implement IMB; add placeholders for other userspace PALcalls.

In reply to Richard Henderson
Quoted 9 lines · Richard Henderson
Quoted 2 lines · Aurelien Jarno

Is it really necessary to flush all the TB here? QEMU should already discard TB that have been modified.

No. But I meant to look into this more carefully with a view to disabling the other checking within QEMU and speed things up a tad. It seems to me that the explicit checking with each memory write ought to only be necessary on architectures like x86 that don't architecturally require a flush insn to be used.

This is actually done only on the first write access to a page and not to each write, so it should not be so costly. It is however something to investigate, as I agree that removing the checks can add some speed-up.

Quoted 2 lines

I can drop this fragment if necessary for patch acceptance, however.

I think it is better to drop it until we have a better view of the whole thing. You can add a comment saying that an optimisation might be possible here.

Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net
#17 lore raw
In reply to Andreas Färber
Quoted 3 lines · Andreas Färber

I've checked the linux-user testsuite 0.3 on master:
The message "Set unique value to 0000000120060e38 (0000000120060e38)" is gone now, but ls -l dummyfile doesn't list the file yet.

Checking...

Alpha doesn't use __NR_getdents64, it uses __NR_osf_getdirentries which isn't implemented.

r~