From: Riku Voipio <riku.voi...@nokia.com> Change the system-emulation code also to only support accessing the cp15.c13 Thread ID registers on ARMv6K and newer.
Signed-off-by: Riku Voipio <riku.voi...@nokia.com> --- target-arm/helper.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index 68578ce..1245d9d 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -1517,12 +1517,18 @@ void HELPER(set_cp15)(CPUState *env, uint32_t insn, uint32_t val) env->cp15.c13_context = val; break; case 2: + if (!arm_feature(env, ARM_FEATURE_V6K)) + goto bad_reg; env->cp15.c13_tls1 = val; break; case 3: + if (!arm_feature(env, ARM_FEATURE_V6K)) + goto bad_reg; env->cp15.c13_tls2 = val; break; case 4: + if (!arm_feature(env, ARM_FEATURE_V6K)) + goto bad_reg; env->cp15.c13_tls3 = val; break; default: @@ -1805,10 +1811,16 @@ uint32_t HELPER(get_cp15)(CPUState *env, uint32_t insn) case 1: return env->cp15.c13_context; case 2: + if (!arm_feature(env, ARM_FEATURE_V6K)) + goto bad_reg; return env->cp15.c13_tls1; case 3: + if (!arm_feature(env, ARM_FEATURE_V6K)) + goto bad_reg; return env->cp15.c13_tls2; case 4: + if (!arm_feature(env, ARM_FEATURE_V6K)) + goto bad_reg; return env->cp15.c13_tls3; default: goto bad_reg; -- 1.6.5