From 0c39b449f279c2ea1400f99edb0b2b5177421e22 Mon Sep 17 00:00:00 2001 From: pbrook Date: Fri, 21 Jul 2006 22:39:57 +0000 Subject: [PATCH] Fix Arm cp15 c13 (Process ID) register writes. --- target-arm/helper.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index 60eee5c2..2ed46a29 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -494,10 +494,18 @@ void helper_set_cp15(CPUState *env, uint32_t insn, uint32_t val) case 13: /* Process ID. */ switch (op2) { case 0: - env->cp15.c9_data = val; + /* Unlike real hardware the qemu TLB uses virtual addresses, + not modified virtual addresses, so this causes a TLB flush. + */ + if (env->cp15.c13_fcse != val) + tlb_flush(env, 1); + env->cp15.c13_fcse = val; break; case 1: - env->cp15.c9_insn = val; + /* This changes the ASID, so do a TLB flush. */ + if (env->cp15.c13_context != val) + tlb_flush(env, 0); + env->cp15.c13_context = val; break; default: goto bad_reg; -- 2.39.5