diff options
author | Greg Bellows <greg.bellows@linaro.org> | 2015-02-05 13:37:22 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2015-02-05 13:37:22 +0000 |
commit | 5097227c15aa89baec1123aac25dd9500a62684d (patch) | |
tree | a81a3de52a7f32c70c3d38407699b485f8881abc /target-arm/cpu.c | |
parent | be8e8128595b41b9f609c1507e67d121e65e7173 (diff) | |
download | hqemu-5097227c15aa89baec1123aac25dd9500a62684d.zip hqemu-5097227c15aa89baec1123aac25dd9500a62684d.tar.gz |
target-arm: Change reset to highest available EL
Update to arm_cpu_reset() to reset into the highest available exception level
based on the set ARM features.
Signed-off-by: Greg Bellows <greg.bellows@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1422029835-4696-4-git-send-email-greg.bellows@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target-arm/cpu.c')
-rw-r--r-- | target-arm/cpu.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/target-arm/cpu.c b/target-arm/cpu.c index 285947f..f43e2de 100644 --- a/target-arm/cpu.c +++ b/target-arm/cpu.c @@ -113,7 +113,14 @@ static void arm_cpu_reset(CPUState *s) /* and to the FP/Neon instructions */ env->cp15.c1_coproc = deposit64(env->cp15.c1_coproc, 20, 2, 3); #else - env->pstate = PSTATE_MODE_EL1h; + /* Reset into the highest available EL */ + if (arm_feature(env, ARM_FEATURE_EL3)) { + env->pstate = PSTATE_MODE_EL3h; + } else if (arm_feature(env, ARM_FEATURE_EL2)) { + env->pstate = PSTATE_MODE_EL2h; + } else { + env->pstate = PSTATE_MODE_EL1h; + } env->pc = cpu->rvbar; #endif } else { |