|
From: | EricSong |
Subject: | [Qemu-discuss] Why Qemu get the io event , while Qemu system reset? Is it unreasonable? |
Date: | Fri, 9 Jan 2015 10:42:23 +0800 |
Hi, All I traced the Qemu code, and I found a debug information but not unreasonable in my opinion. Qemu main process always get the command --- RESET, by qemu_reset_requested() in main_loop_should_exit(), and the thread qemu_tcg_cpu_thread_fn() always running. While RESET is got , main process will execute followings: if (qemu_reset_requested()) {
pause_all_vcpus(); cpu_synchronize_all_states();
qemu_system_reset(VMRESET_REPORT);
resume_all_vcpus(); if (runstate_needs_reset()) { runstate_set(RUN_STATE_PAUSED); } } After pause_all_vcpus(), the qemu_tcg_cpu_thread_fn() will is under qemu_tcg_wait_io_event(). But never execute tcg_exec_all().
After qemu_system_reset(VMRESET_REPORT), the system is under reset state, then the qemu_tcg_cpu_thread_fn() will is still under qemu_tcg_wait_io_event(). After resume_all_vcpus(),the qemu_tcg_cpu_thread_fn() can receive the event and exit qemu_tcg_wait_io_event(), then start to execute tcg_exec_all(). I think it is reasonable sequence about system reset phase. But from my testing, I found qemu_tcg_cpu_thread_fn() exit qemu_tcg_wait_io_event(), while system resetting. How to explain? The debug information is followings: add system 1 reset starting!!!
----- before
qemu_system_reset Eric add devices reset!!!
----- enter
qemu_system_reset and before devices reset Eric add x86 cpu reset handler real execution ----- some reset handler (x86 cpu reset handler) Eric add (new start)cs = ffff0000; eip=fff0!!!
--------\ (bf wait tcg_exec)cs = ffff0000; eip=fff0!!!
---------- Why appear here?
Eric add cs = ffff0000; eip=fff0!!!
---------/ Eric add devices reset end!!!
----- after
devices reset Eric add system 1 reset ended!!! ----- after
qemu_system_reset Eric add (bf cpu_resume)cs = ffff0000; eip=fff0!!! -----
resume_all_vcpus(); Eric add (new start)cs = ffff0000; eip=fff0!!! ----- after
qemu_tcg_wait_io_event() (bf tcg_exec_all)cs = ffff0000; eip=fff0!!! ----- before
tcg_exec_all() Eric add cs = ffff0000; eip=fff0!!!
----- start to execute tcg_exec_all() Thank you very much! Eric CONFIDENTIAL NOTE: This email contains confidential or legally privileged information and is for the sole use of its intended recipient. Any unauthorized review, use, copying or distribution of this email or the content of this email is strictly prohibited. If you are not the intended recipient, you may reply to the sender and should delete this e-mail immediately. Thank you. |
[Prev in Thread] | Current Thread | [Next in Thread] |