mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
The exception_action() function in user-exec.c is just a call to cpu_loop_exit() for every target CPU except i386. Since this function is only called if the target's handle_mmu_fault() hook has indicated an MMU fault, and that hook is only called from the handle_cpu_signal() code path, we can simply move the x86-specific setup into that hook, which allows us to remove the TARGET_I386 ifdef from user-exec.c. Of the actions that were done by the call to raise_interrupt_err(): * cpu_svm_check_intercept_param() is a no-op in user mode * check_exception() is a no-op since double faults are impossible for user-mode * assignments to cs->exception_index and env->error_code are no-ops * assigning to env->exception_next_eip is unnecessary because it is not used unless env->exception_is_int is true * cpu_loop_exit_restore() is equivalent to cpu_loop_exit() since pc is 0 which leaves just setting env_>exception_is_int as the action that needs to be added to x86_cpu_handle_mmu_fault(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Sergey Fedorov <sergey.fedorov@linaro.org> Acked-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Riku Voipio <riku.voipio@linaro.org> Message-id: 1463494687-25947-7-git-send-email-peter.maydell@linaro.org |
||
|---|---|---|
| .. | ||
| arch_dump.c | ||
| arch_memory_mapping.c | ||
| bpt_helper.c | ||
| cc_helper.c | ||
| cc_helper_template.h | ||
| cpu-qom.h | ||
| cpu.c | ||
| cpu.h | ||
| excp_helper.c | ||
| fpu_helper.c | ||
| gdbstub.c | ||
| helper.c | ||
| helper.h | ||
| hyperv.c | ||
| hyperv.h | ||
| int_helper.c | ||
| kvm-stub.c | ||
| kvm.c | ||
| kvm_i386.h | ||
| machine.c | ||
| Makefile.objs | ||
| mem_helper.c | ||
| misc_helper.c | ||
| monitor.c | ||
| mpx_helper.c | ||
| ops_sse.h | ||
| ops_sse_header.h | ||
| seg_helper.c | ||
| shift_helper_template.h | ||
| smm_helper.c | ||
| svm.h | ||
| svm_helper.c | ||
| TODO | ||
| translate.c | ||