Optimize redundant cp15 coprocessor access control register writes.
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 22 Oct 2008 16:14:08 +0000 (16:14 +0000)
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 22 Oct 2008 16:14:08 +0000 (16:14 +0000)
Signed-off-by: Paul Brook <paul@codesourcery.com>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5512 c046a42c-6fe2-441c-8c8c-71466251a162

target-arm/helper.c

index b9a8f78..d4af859 100644 (file)
@@ -1334,9 +1334,11 @@ void HELPER(set_cp15)(CPUState *env, uint32_t insn, uint32_t val)
         case 2:
             if (arm_feature(env, ARM_FEATURE_XSCALE))
                 goto bad_reg;
-            env->cp15.c1_coproc = val;
-            /* ??? Is this safe when called from within a TB?  */
-            tb_flush(env);
+            if (env->cp15.c1_coproc != val) {
+                env->cp15.c1_coproc = val;
+                /* ??? Is this safe when called from within a TB?  */
+                tb_flush(env);
+            }
             break;
         default:
             goto bad_reg;