mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 10:34:58 -06:00
target/ppc: Set fault address in ppc_cpu_do_unaligned_access
We ought to have been recording the virtual address for reporting to the guest trap handler. Cc: qemu-ppc@nongnu.org Reviewed-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
336e91f853
commit
a7e3af1325
1 changed files with 14 additions and 0 deletions
|
@ -1465,6 +1465,20 @@ void ppc_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr,
|
||||||
{
|
{
|
||||||
CPUPPCState *env = cs->env_ptr;
|
CPUPPCState *env = cs->env_ptr;
|
||||||
|
|
||||||
|
switch (env->mmu_model) {
|
||||||
|
case POWERPC_MMU_SOFT_4xx:
|
||||||
|
case POWERPC_MMU_SOFT_4xx_Z:
|
||||||
|
env->spr[SPR_40x_DEAR] = vaddr;
|
||||||
|
break;
|
||||||
|
case POWERPC_MMU_BOOKE:
|
||||||
|
case POWERPC_MMU_BOOKE206:
|
||||||
|
env->spr[SPR_BOOKE_DEAR] = vaddr;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
env->spr[SPR_DAR] = vaddr;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
cs->exception_index = POWERPC_EXCP_ALIGN;
|
cs->exception_index = POWERPC_EXCP_ALIGN;
|
||||||
env->error_code = 0;
|
env->error_code = 0;
|
||||||
cpu_loop_exit_restore(cs, retaddr);
|
cpu_loop_exit_restore(cs, retaddr);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue