[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 50/67] target/ppc: Set fault address in ppc_cpu_do_unaligned_a
From: |
Richard Henderson |
Subject: |
[PATCH v5 50/67] target/ppc: Set fault address in ppc_cpu_do_unaligned_access |
Date: |
Thu, 14 Oct 2021 21:10:36 -0700 |
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>
---
target/ppc/excp_helper.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index 88a8de4b80..e568a54536 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -1465,6 +1465,20 @@ void ppc_cpu_do_unaligned_access(CPUState *cs, vaddr
vaddr,
{
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;
env->error_code = 0;
cpu_loop_exit_restore(cs, retaddr);
--
2.25.1
- Re: [PATCH v5 43/67] hw/core: Add TCGCPUOps.record_sigbus, (continued)
- [PATCH v5 49/67] target/ppc: Move SPR_DSISR setting to powerpc_excp, Richard Henderson, 2021/10/15
- [PATCH v5 45/67] target/alpha: Implement alpha_cpu_record_sigbus, Richard Henderson, 2021/10/15
- [PATCH v5 48/67] target/microblaze: Do not set MO_ALIGN for user-only, Richard Henderson, 2021/10/15
- [PATCH v5 51/67] target/ppc: Restrict ppc_cpu_do_unaligned_access to sysemu, Richard Henderson, 2021/10/15
- [PATCH v5 52/67] target/s390x: Implement s390x_cpu_record_sigbus, Richard Henderson, 2021/10/15
- [PATCH v5 47/67] linux-user/hppa: Remove EXCP_UNALIGN handling, Richard Henderson, 2021/10/15
- [PATCH v5 50/67] target/ppc: Set fault address in ppc_cpu_do_unaligned_access,
Richard Henderson <=
- [PATCH v5 53/67] linux-user/hppa: Remove POWERPC_EXCP_ALIGN handling, Richard Henderson, 2021/10/15
- [PATCH v5 54/67] target/sh4: Set fault address in superh_cpu_do_unaligned_access, Richard Henderson, 2021/10/15
- [PATCH v5 57/67] target/sparc: Set fault address in sparc_cpu_do_unaligned_access, Richard Henderson, 2021/10/15
- [PATCH v5 55/67] target/sparc: Remove DEBUG_UNALIGNED, Richard Henderson, 2021/10/15
- [PATCH v5 60/67] tcg: Add helper_unaligned_{ld, st} for user-only sigbus, Richard Henderson, 2021/10/15
- [PATCH v5 58/67] accel/tcg: Report unaligned atomics for user-only, Richard Henderson, 2021/10/15