On Tue, Dec 13, 2011 at 08:29:50PM -0500, Xin Tong wrote: > QEMU performs a recursive unchaining on the current executing tb when > a timer fires. This timer is set by setitimer in the qemu-timer.c. You mean dynticks_start_timer?
> This is what I mean by "interrupt pending". Of course, there are > interrupts from emulated devices as well, but i do not know how that > is set up, i.e. how tcg_handle_interrupt is called when the devices > finishes some work. I hope you can enlighten me on that. I am not familiar with how QEMU deal with virtual devices. But AFAIK, virtual devices will register IRQ to APIC (hw/apic.c), APIC will call cpu_interrupt (cpu-all.h), which turns to call cpu_interrupt_handler. You can see cpu_interrupt_handler is assigned as tcg_handle_interrupt in exec.c. tcg_handle_interrupt raise env's interrupt_request, and leave cpu_exec to check env's interrupt_request. Regards, chenwj -- Wei-Ren Chen (陳韋任) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667 Homepage: http://people.cs.nctu.edu.tw/~chenwj