|
From: | Jun Koi |
Subject: | Re: [Qemu-devel] How to break cpu_tb_exec()? |
Date: | Sat, 4 Jul 2015 01:10:14 +0800 |
Every TB starts with a little bit of generated code that checksOn 3 July 2015 at 18:02, Jun Koi <address@hidden> wrote:
> I am looking at how the main thread interrupts TCG thread. Inside
> cpu-exec.c, in function cpu_tb_exec(), I can see that it executes one TB,
> and when this is over, it can check for events from other threads (like main
> thread). This is the reason why TCG thread can be interrupted.
>
> Is my understanding correct?
>
> If this is true, then what if this TB is running infinitely, and do not
> return, or it is in a very long loop? In this case, TCG thread cannot be
> interrupted?
the 'tcg_exit_req' flag in the CPUState for the CPU (see the
gen_tb_start() function). If some other part of QEMU wants the
CPU to stop running guest code and return to the top level loop,
it calls cpu_exit() which sets this flag.
[Prev in Thread] | Current Thread | [Next in Thread] |