diff --git a/qemu/target/sparc/mmu_helper.c b/qemu/target/sparc/mmu_helper.c index 1ea63a8a..003ccf4e 100644 --- a/qemu/target/sparc/mmu_helper.c +++ b/qemu/target/sparc/mmu_helper.c @@ -28,10 +28,18 @@ int sparc_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int size, int rw, int mmu_idx) { + SPARCCPU *cpu = SPARC_CPU(cs->uc, cs); + CPUSPARCState *env = &cpu->env; + if (rw & 2) { cs->exception_index = TT_TFAULT; } else { cs->exception_index = TT_DFAULT; +#ifdef TARGET_SPARC64 + env->dmmu.mmuregs[4] = address; +#else + env->mmuregs[4] = address; +#endif } return 1; }