233,235c233,241
< currState->aarch64 = isStage2 || opModeIs64(currOpMode(_tc)) ||
< ((currEL(_tc) == EL0) && ELIs64(_tc, EL1));
< currState->el = currEL(_tc);
---
> if (isStage2) {
> currState->el = EL1;
> currState->aarch64 = ELIs64(_tc, EL2);
> } else {
> currState->el =
> TLB::tranTypeEL(_tc->readMiscReg(MISCREG_CPSR), tranType);
> currState->aarch64 =
> ELIs64(_tc, currState->el == EL0 ? EL1 : currState->el);
> }
366,371d371
< ExceptionLevel target_el = EL0;
< if (currState->aarch64)
< target_el = currEL(currState->tc);
< else
< target_el = EL1;
<
376c376
< target_el);
---
> currState->el);
442c442
< false, target_el);
---
> false, currState->el);