diff mbox

[2/3] mips-linux-user: Always support rdhwr.

Message ID 1324160506-25183-3-git-send-email-rth@twiddle.net
State New
Headers show

Commit Message

Richard Henderson Dec. 17, 2011, 10:21 p.m. UTC
The kernel will emulate this instruction if it's not supported
natively.  This insn is used for TLS, among other things, and
so is required by modern glibc.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target-mips/translate.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/target-mips/translate.c b/target-mips/translate.c
index b20a817..e2ee763 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -8118,7 +8118,11 @@  gen_rdhwr (CPUState *env, DisasContext *ctx, int rt, int rd)
 {
     TCGv t0;
 
+#if !defined(CONFIG_USER_ONLY)
+    /* The Linux kernel will emulate rdhwr if it's not supported natively.
+       Therefore only check the ISA in system mode.  */
     check_insn(env, ctx, ISA_MIPS32R2);
+#endif
     t0 = tcg_temp_new();
 
     switch (rd) {