[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 11/66] target/ppc: Implement do_unaligned_access for user-
From: |
Peter Maydell |
Subject: |
Re: [PATCH v3 11/66] target/ppc: Implement do_unaligned_access for user-only |
Date: |
Thu, 19 Aug 2021 16:44:06 +0100 |
On Wed, 18 Aug 2021 at 20:23, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> For simplicity on the linux-user side, always use SPR_DAR.
>
> Cc: qemu-ppc@nongnu.org
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> linux-user/ppc/cpu_loop.c | 2 +-
> target/ppc/cpu_init.c | 2 +-
> target/ppc/excp_helper.c | 2 ++
> 3 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/linux-user/ppc/cpu_loop.c b/linux-user/ppc/cpu_loop.c
> index fa91ea0eed..d72d30248b 100644
> --- a/linux-user/ppc/cpu_loop.c
> +++ b/linux-user/ppc/cpu_loop.c
> @@ -165,7 +165,7 @@ void cpu_loop(CPUPPCState *env)
> info.si_signo = TARGET_SIGBUS;
> info.si_errno = 0;
> info.si_code = TARGET_BUS_ADRALN;
> - info._sifields._sigfault._addr = env->nip;
> + info._sifields._sigfault._addr = env->spr[SPR_DAR];
> queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
> break;
> case POWERPC_EXCP_PROGRAM: /* Program exception
> */
> diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
> index 505a0ed6ac..84fb6bbb83 100644
> --- a/target/ppc/cpu_init.c
> +++ b/target/ppc/cpu_init.c
> @@ -9014,12 +9014,12 @@ static const struct TCGCPUOps ppc_tcg_ops = {
> .initialize = ppc_translate_init,
> .cpu_exec_interrupt = ppc_cpu_exec_interrupt,
> .tlb_fill = ppc_cpu_tlb_fill,
> + .do_unaligned_access = ppc_cpu_do_unaligned_access,
>
> #ifndef CONFIG_USER_ONLY
> .do_interrupt = ppc_cpu_do_interrupt,
> .cpu_exec_enter = ppc_cpu_exec_enter,
> .cpu_exec_exit = ppc_cpu_exec_exit,
> - .do_unaligned_access = ppc_cpu_do_unaligned_access,
> #endif /* !CONFIG_USER_ONLY */
> };
> #endif /* CONFIG_TCG */
> diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
> index d7743704ac..08cc474340 100644
> --- a/target/ppc/excp_helper.c
> +++ b/target/ppc/excp_helper.c
> @@ -1505,6 +1505,7 @@ void ppc_cpu_do_unaligned_access(CPUState *cs, vaddr
> vaddr,
> CPUPPCState *env = cs->env_ptr;
>
> switch (env->mmu_model) {
If you add a comment giving the same info the commit message has, eg:
/*
* In user-only mode we always set SPR_DAR regardless of CPU type
* so that the linux-user/ppc code only needs to look in one place
*/
then
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
- [PATCH v3 03/66] hw/core: Make do_unaligned_access available to user-only, (continued)
- [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
- [PATCH v3 11/66] target/ppc: Implement do_unaligned_access for user-only, Richard Henderson, 2021/08/18
- Re: [PATCH v3 11/66] target/ppc: Implement do_unaligned_access for user-only,
Peter Maydell <=
- [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
- [PATCH v3 15/66] target/sh4: Implement do_unaligned_access for user-only, Richard Henderson, 2021/08/18