[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] target/mips: Fold jazz behaviour into mips_cpu_do_transa
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 1/2] target/mips: Fold jazz behaviour into mips_cpu_do_transaction_failed |
Date: |
Mon, 1 Mar 2021 09:53:40 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 |
On 2/28/21 12:25 AM, Richard Henderson wrote:
> Add a flag to MIPSCPUClass in order to avoid needing to
> replace mips_tcg_ops.do_transaction_failed.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> target/mips/cpu-qom.h | 3 +++
> hw/mips/jazz.c | 35 +++--------------------------------
> target/mips/op_helper.c | 3 ++-
> 3 files changed, 8 insertions(+), 33 deletions(-)
...
> diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c
> index 83c8086062..7b22a9b511 100644
> --- a/hw/mips/jazz.c
> +++ b/hw/mips/jazz.c
...> @@ -152,7 +128,7 @@ static void mips_jazz_init(MachineState *machine,
> int bios_size, n;
> Clock *cpuclk;
> MIPSCPU *cpu;
> - CPUClass *cc;
> + MIPSCPUClass *mcc;
> CPUMIPSState *env;
> qemu_irq *i8259;
> rc4030_dma *dmas;
> @@ -199,8 +175,6 @@ static void mips_jazz_init(MachineState *machine,
> * However, we can't simply add a global memory region to catch
> * everything, as this would make all accesses including instruction
> * accesses be ignored and not raise exceptions.
> - * So instead we hijack the do_transaction_failed method on the CPU, and
> - * do not raise exceptions for data access.
> *
> * NOTE: this behaviour of raising exceptions for bad instruction
> * fetches but not bad data accesses was added in commit 54e755588cf1e9
> @@ -210,11 +184,8 @@ static void mips_jazz_init(MachineState *machine,
> * we could replace this hijacking of CPU methods with a simple global
> * memory region that catches all memory accesses, as we do on Malta.
> */
> - cc = CPU_GET_CLASS(cpu);
> -#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY)
> - real_do_transaction_failed = cc->tcg_ops->do_transaction_failed;
> - cc->tcg_ops->do_transaction_failed = mips_jazz_do_transaction_failed;
We don't need the "hw/core/tcg-cpu-ops.h" header anymore.
> -#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */
> + mcc = MIPS_CPU_GET_CLASS(cpu);
> + mcc->no_data_aborts = true;