[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] target/openrisc: Do not reset delay slot flag on early tb ex
From: |
Stafford Horne |
Subject: |
Re: [PATCH] target/openrisc: Do not reset delay slot flag on early tb exit |
Date: |
Thu, 12 May 2022 07:34:51 +0900 |
On Wed, May 11, 2022 at 02:56:37PM -0700, Richard Henderson wrote:
> On 5/11/22 14:43, Stafford Horne wrote:
> > At this point how would tb->flags have the right value? Would it always be
> > set
> > correctly by `cpu_get_tb_cpu_state` in the `lookup_tb_ptr`call?
>
> Well, it would be set by cpu_get_tb_cpu_state in cpu_exec, which is then
> passed to tb_gen_code. If we go around a loop and look it up a second time,
> we'll find a tb with a matching set of flags.
Right, cpu_get_tb_cpu_state called in lookup_tb_ptr will not update tb->flags.
What you mention, that is for when we have to generate a new TB, the tb->flags
get set right before tb_gen_code.
But for the case where we exit the delay-slot TB due to a pending exception I
think the flow would go.
TB chain:
-> branch-TB : set env->flag 1
-> delay-slot-TB : exit_tb due to condition
Exit:
-> return to cpu_tb_exec
-> tcg_ops->synchronize_from_tb
In this case I don't see how the tb->flag would be updated, ooh, I guess it
would have been set earlier when the TB was generated. Maybe that is what I am
missing.
-Stafford