On 17.02.2011, at 23:51, Michael Walle wrote: > Am Samstag 12 Februar 2011, 07:49:52 schrieb Blue Swirl: >>> That said, IMHO the best handling of unknown opcodes would be to kill the >>> VM. >> >> In this case it should be OK. Alternatively the VM could be halted, so >> that instead of restarting QEMU, only system_reset needs to be issued. >> This may be more useful for developers, since for example registers >> and memory can be examined after the error. > > Good idea! May I call vm_stop() in a tcg helper? Like in the following > example: > > void helper_vm_stop(uint32_t msg_id) > { > if (qemu_log_enabled()) { > qemu_log("VM stopped: %s", err_msg_str[msg_id]); > } else { > fprintf(stderr, "VM stopped: %s", err_msg_str[msg_id]); > } > #ifndef CONFIG_USER_ONLY > vm_stop(0); > #endif > env->exception_index = EXCP_HALTED; > cpu_loop_exit(); > } > > If not, what is the proper way to stop/pause the VM from within the executed > code?
Since I haven't seen any reply yet: Can't you just do the same as hlt and disable interrupts? Alex