Patchwork linux-user: fix running programs with iwmmxt instructions

login
register
mail settings
Submitter Lars Munch
Date March 15, 2010, 12:39 p.m.
Message ID <20100315123932.GB8895@firewall>
Download mbox | patch
Permalink /patch/47758/
State New
Headers show

Comments

Lars Munch - March 15, 2010, 12:39 p.m.
When using linux-user for emulating an pxa270 we cannot generate an illegal
instruction trap to the kernel to save/load the iwmmxt registers.

Signed-off-by: Lars Munch <lars@segv.dk>
---
 target-arm/translate.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Paul Brook - March 15, 2010, 12:53 p.m.
> +#if !defined(CONFIG_USER_ONLY)
>      if (arm_feature(env, ARM_FEATURE_XSCALE)
>  	    && ((env->cp15.c15_cpar ^ 0x3fff) & (1 << cpnum)))
>  	return 1;
> +#endif

This is almost certainly the wrong way to fix this.

Paul

Patch

diff --git a/target-arm/translate.c b/target-arm/translate.c
index cdfe946..6b621b1 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -5802,9 +5802,11 @@  static int disas_coproc_insn(CPUState * env, DisasContext *s, uint32_t insn)
     int cpnum;
 
     cpnum = (insn >> 8) & 0xf;
+#if !defined(CONFIG_USER_ONLY)
     if (arm_feature(env, ARM_FEATURE_XSCALE)
 	    && ((env->cp15.c15_cpar ^ 0x3fff) & (1 << cpnum)))
 	return 1;
+#endif
 
     switch (cpnum) {
       case 0: