On Mon, Jan 18, 2010 at 4:17 PM, Artyom Tarasenko
<atar4q...@googlemail.com> wrote:
> Btw, what is the following hack for in do_unassigned_access?
>
>
>    saved_env = env;
>    env = cpu_single_env;
> //...
>    env = saved_env;

env is a host CPU register, see for example target-sparc/exec.h. Code
which is called directly from translated code (and cpu-exec.c) is
compiled this way.

I'm not sure if do_unassigned_access will ever be called from outside
of translated code, grep hits were from exec.c, cpu-exec.c and
op_helper.c.

> I wonder whether I modify the correct env here:
>
>   env = saved_env;
>
> +    /* flush neverland mappings created during no-fault mode,
> +       so the sequential MMU faults report proper fault types */
> +    if (env->mmuregs[0] & MMU_NF) {
> +        tlb_flush(env, 1);
> +    }

Right, if env was NULL when entering the function, it will crash.


Reply via email to