On 8/28/20 4:39 AM, Edgar E. Iglesias wrote: > + if ((access_type == MMU_INST_FETCH && cpu->cfg.iopb_bus_exception) || > + (access_type != MMU_INST_FETCH && cpu->cfg.dopb_bus_exception)) { > + cpu_restore_state(cs, retaddr, true); > + env->sregs[SR_ESR] = access_type == MMU_INST_FETCH ? > + ESR_EC_INSN_BUS : ESR_EC_DATA_BUS; > + env->sregs[SR_EAR] = addr; > + helper_raise_exception(env, EXCP_HW_EXCP);
I think it's better to use cpu_loop_exit_restore, adding the one line for cs->exception_index from helper_raise_exception. r~