Skip to content

Commit

Permalink
target-arm: A64: Respect SPSEL when taking exceptions
Browse files Browse the repository at this point in the history
Reviewed-by: Alex Bennée <[email protected]>
Signed-off-by: Edgar E. Iglesias <[email protected]>
Reviewed-by: Greg Bellows <[email protected]>
Message-id: [email protected]
Signed-off-by: Peter Maydell <[email protected]>
  • Loading branch information
edgarigl authored and pm215 committed Aug 4, 2014
1 parent 98ea561 commit f151b12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions target-arm/helper-a64.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,7 @@ void aarch64_cpu_do_interrupt(CPUState *cs)

if (is_a64(env)) {
env->banked_spsr[aarch64_banked_spsr_index(1)] = pstate_read(env);
env->sp_el[arm_current_pl(env)] = env->xregs[31];
env->xregs[31] = env->sp_el[1];
aarch64_save_sp(env, arm_current_pl(env));
env->elr_el[1] = env->pc;
} else {
env->banked_spsr[0] = cpsr_read(env);
Expand All @@ -508,6 +507,7 @@ void aarch64_cpu_do_interrupt(CPUState *cs)

pstate_write(env, PSTATE_DAIF | PSTATE_MODE_EL1h);
env->aarch64 = 1;
aarch64_restore_sp(env, 1);

env->pc = addr;
cs->interrupt_request |= CPU_INTERRUPT_EXITTB;
Expand Down

0 comments on commit f151b12

Please sign in to comment.