qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] need help


From: Peter Maydell
Subject: Re: [Qemu-devel] need help
Date: Wed, 1 Mar 2017 12:49:26 +0000

On 1 March 2017 at 09:50, oussema ben khedher <address@hidden> wrote:
> I am trying to understand the block chaining of QEMU. And I have
> a question about the branch direction of each executed TBs.
> Suppose the TB#1 has been executed now, and find the next_tb (TB#2).
> Then we know the direction is TB#1--->TB#2 and store the chain
> in code cache for speedup the execution next time. So, next time
> qemu find the next TB (which is TB#1), then TB#1--->TB#2 will be
> executed in code cache.
> But I think that there are two branch direction of a TB.(branch
> taken/not taken) My question is how qemu ensure the direction is
> TB#1--->TB#2 next time?

Every TB has two outbound links (though one may be unused for
an unconditional branch). When we chain a TB together we only
chain the link that we took. So if we do a "branch taken" exit
from TB1 and find that it goes to TB2, then we link TB1's
branch-taken code path directly to TB2. But that doesn't affect
the branch-not-taken codepath. Later if we do a branch-not-taken
exit from TB1 we may be able to chain it to a different TB.

(In fact the outbound links are just numbered 0 and 1, and
there's no requirement to use them for taken and not-taken
in any particular order.)

thanks
-- PMM



reply via email to

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