Skip to contentSkip to conversation

target-alpha: Emit tcg debug_insn_start.

PATCH In review Richard Henderson 2 participants 5 messages Dec 19, 2009 – Dec 21, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 target-alpha: Emit tcg debug_insn_start.

---
 target-alpha/translate.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
target-alpha/translate.c +5 -0
index 45cb697..5e0647b 100644
@@ -2627,6 +2627,11 @@ static inline void gen_intermediate_code_internal(CPUState *env,
             gen_io_start();
         insn = ldl_code(ctx.pc);
         num_insns++;
+
+	if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP))) {
+            tcg_gen_debug_insn_start(ctx.pc);
+        }
+
         ctx.pc += 4;
         ret = translate_one(ctxp, insn);
         if (ret != 0)
Signature · 1 line
1.6.5.2
#1 lore raw

PATCH 2/3 linux-user: Add aliases for some Alpha syscalls

Alpha always used 32-bit uids, but never renamed the syscalls to match i386 when 32-bit uids were added there. This enables the proper bits in syscall.c.

---
 linux-user/alpha/syscall_nr.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
linux-user/alpha/syscall_nr.h +8 -0
index d3c19cc..7182223 100644
@@ -411,3 +411,11 @@
 #define TARGET_NR_signalfd			476
 #define TARGET_NR_timerfd			477
 #define TARGET_NR_eventfd			478
+
+/* The following aliases are defined in order to match up with the
+   standard i386 syscalls implemented in syscalls.c.  */
+#define TARGET_NR_chown32	TARGET_NR_chown
+#define TARGET_NR_setuid32	TARGET_NR_setuid
+#define TARGET_NR_setgid32	TARGET_NR_setgid
+#define TARGET_NR_setfsuid32	TARGET_NR_setfsuid
+#define TARGET_NR_setfsgid32	TARGET_NR_setfsgid
Signature · 1 line
1.6.5.2
#2 lore raw

PATCH 3/3 linux-user: Initialize Alpha FPCR register.

In reply to Richard Henderson
---
 linux-user/main.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
linux-user/main.c +2 -0
index 12502ad..b67662c 100644
@@ -3052,6 +3052,8 @@ int main(int argc, char **argv, char **envp)
         env->ir[30] = regs->usp;
         env->pc = regs->pc;
         env->unique = regs->unique;
+        cpu_alpha_store_fpcr(env, (FPCR_INVD | FPCR_DZED | FPCR_OVFD
+                                   | FPCR_UNFD | FPCR_INED | FPCR_DNOD));
     }
 #elif defined(TARGET_CRIS)
     {
Signature · 1 line
1.6.5.2
#3 lore raw

Re: [Qemu-devel] [PATCH 3/3] linux-user: Initialize Alpha FPCR register.

Quoted 10 lines · Richard Henderson
---
 linux-user/main.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
linux-user/main.c +0 -0
index 12502ad..b67662c 100644

linux-user/main.c int main(int argc, char **argv, char **envp) · line 3057

Quoted 6 lines
linux-user/main.c +2 -0
@@ -3052,6 +3052,8 @@ int main(int argc, char **argv, char **envp)
         env->ir[30] = regs->usp;
         env->pc = regs->pc;
         env->unique = regs->unique;
+        cpu_alpha_store_fpcr(env, (FPCR_INVD | FPCR_DZED | FPCR_OVFD
+                                   | FPCR_UNFD | FPCR_INED | FPCR_DNOD));
     }

This cpu initialization which does not depends on the binary being run is usually done in target-*/translate.c, using #if defined (CONFIG_USER_ONLY).

Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net
#4 lore raw

Re: [Qemu-devel] [PATCH 3/3] linux-user: Initialize Alpha FPCR register.

Quoted 6 lines · Aurelien Jarno
Quoted 5 lines · Richard Henderson
---
  linux-user/main.c |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)
Quoted 15 lines

linux-user/main.c int main(int argc, char **argv, char **envp) · line 3057

Quoted 11 lines
linux-user/main.c +2 -0
index 12502ad..b67662c 100644
@@ -3052,6 +3052,8 @@ int main(int argc, char **argv, char **envp)
          env->ir[30] = regs->usp;
          env->pc = regs->pc;
          env->unique = regs->unique;
+        cpu_alpha_store_fpcr(env, (FPCR_INVD | FPCR_DZED | FPCR_OVFD
+                                   | FPCR_UNFD | FPCR_INED | FPCR_DNOD));
      }

This cpu initialization which does not depends on the binary being run is usually done in target-*/translate.c, using #if defined (CONFIG_USER_ONLY).

I didn't want to assume that bsd-user initializes the fpcr to the same value. However, they probably do. This appears to be what you wanted.

r~

commit 033df7a558acdf39d81681f3858f13ebe2a92a6e

Author: Richard Henderson <[email protected]>
Date:   Mon Dec 21 12:48:43 2009 -0800

target-alpha: Initialize fpcr.

Linux, at least, disables exceptions by default.

target-alpha/translate.c +2 -0
index 5e0647b..87813e7 100644
@@ -2748,6 +2748,8 @@ CPUAlphaState * cpu_alpha_init (const char *cpu_model)
     env->ps = 0x1F00;
 #if defined (CONFIG_USER_ONLY)
     env->ps |= 1 << 3;
+    cpu_alpha_store_fpcr(env, (FPCR_INVD | FPCR_DZED | FPCR_OVFD
+                               | FPCR_UNFD | FPCR_INED | FPCR_DNOD));
 #endif
     pal_init(env);
     /* Initialize IPR */