[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 10/66] target/ppc: Set fault address in ppc_cpu_do_unalign
From: |
Peter Maydell |
Subject: |
Re: [PATCH v3 10/66] target/ppc: Set fault address in ppc_cpu_do_unaligned_access |
Date: |
Thu, 19 Aug 2021 16:41:26 +0100 |
On Wed, 18 Aug 2021 at 20:33, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> We ought to have been recording the virtual address for reporting
> to the guest trap handler.
>
> Cc: qemu-ppc@nongnu.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 0df358f93f..d7743704ac 100644
> --- a/target/ppc/excp_helper.c
> +++ b/target/ppc/excp_helper.c
> @@ -1504,6 +1504,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);
> --
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
- [PATCH v3 02/66] hw/core: Make do_unaligned_access noreturn, (continued)
- [PATCH v3 02/66] hw/core: Make do_unaligned_access noreturn, Richard Henderson, 2021/08/18
- [PATCH v3 03/66] hw/core: Make do_unaligned_access available to user-only, Richard Henderson, 2021/08/18
- [PATCH v3 04/66] target/alpha: Implement do_unaligned_access for user-only, Richard Henderson, 2021/08/18
- [PATCH v3 05/66] target/arm: Implement do_unaligned_access for user-only, Richard Henderson, 2021/08/18
- [PATCH v3 06/66] target/hppa: Implement do_unaligned_access for user-only, Richard Henderson, 2021/08/18
- [PATCH v3 09/66] target/ppc: Move SPR_DSISR setting to powerpc_excp, Richard Henderson, 2021/08/18
- [PATCH v3 10/66] target/ppc: Set fault address in ppc_cpu_do_unaligned_access, Richard Henderson, 2021/08/18
- Re: [PATCH v3 10/66] target/ppc: Set fault address in ppc_cpu_do_unaligned_access,
Peter Maydell <=
- [PATCH v3 11/66] target/ppc: Implement do_unaligned_access for user-only, Richard Henderson, 2021/08/18
- [PATCH v3 07/66] target/microblaze: Do not set MO_ALIGN for user-only, Richard Henderson, 2021/08/18
- [PATCH v3 12/66] target/riscv: Implement do_unaligned_access for user-only, Richard Henderson, 2021/08/18
- [PATCH v3 14/66] target/sh4: Set fault address in superh_cpu_do_unaligned_access, Richard Henderson, 2021/08/18
- [PATCH v3 16/66] target/sparc: Remove DEBUG_UNALIGNED, Richard Henderson, 2021/08/18
- [PATCH v3 18/66] target/sparc: Set fault address in sparc_cpu_do_unaligned_access, Richard Henderson, 2021/08/18
- [PATCH v3 13/66] target/s390x: Implement do_unaligned_access for user-only, Richard Henderson, 2021/08/18
- [PATCH v3 08/66] target/mips: Implement do_unaligned_access for user-only, Richard Henderson, 2021/08/18