qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 05/26] target/cris: Convert to CPUClass::tlb_fil


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 05/26] target/cris: Convert to CPUClass::tlb_fill
Date: Tue, 30 Apr 2019 12:57:56 +0100

On Wed, 3 Apr 2019 at 04:46, Richard Henderson
<address@hidden> wrote:
>
> Cc: Edgar E. Iglesias <address@hidden>
> Signed-off-by: Richard Henderson <address@hidden>
> ---
>  target/cris/cpu.h       |  5 +--
>  target/cris/cpu.c       |  5 ++-
>  target/cris/helper.c    | 67 +++++++++++++++++++++++------------------
>  target/cris/op_helper.c | 28 -----------------
>  4 files changed, 42 insertions(+), 63 deletions(-)

> -int cris_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int size, int rw,
> -                              int mmu_idx)
> +bool cris_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
> +                       MMUAccessType access_type, int mmu_idx,
> +                       bool probe, uintptr_t retaddr)
>  {
>      CRISCPU *cpu = CRIS_CPU(cs);
>
>      cs->exception_index = 0xaa;
>      cpu->env.pregs[PR_EDA] = address;
> -    cpu_dump_state(cs, stderr, fprintf, 0);
> -    return 1;
> +    cpu_loop_exit_restore(cs, retaddr);

You might mention in the commit message that we removed the
cpu_dump_state().

> +    env->pregs[PR_EDA] = address;
> +    cs->exception_index = EXCP_BUSFAULT;
> +    env->fault_vector = res.bf_vec;
> +    if (retaddr) {
> +        if (cpu_restore_state(cs, retaddr, true)) {
> +            /* Evaluate flags after retranslation. */
> +            helper_top_evaluate_flags(env);

Side note because the old code does the same thing, but it seems
weird that we have to manually recalculate the flags here -- I
would expect cpu_restore_state() to actually restore the state
(presumably by having restore_state_to_opc() do the fixing up
of the flags?).

> +        }
> +    }
> +    cpu_loop_exit(cs);
> +}

Reviewed-by: Peter Maydell <address@hidden>

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]