X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=cpu-exec.c;h=08c35f72d4868e5650ede94a669e031a96068ec3;hb=052bb77a47ce2508538d0e4c9a2fb4b9787a2267;hp=0fa8325b27e833ed0dc6e5a49b3905ad6d50f63a;hpb=33cf629a3754b58a1e2dbbe01d91d97e712b7c06;p=qemu.git diff --git a/cpu-exec.c b/cpu-exec.c index 0fa8325b2..08c35f72d 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -21,6 +21,7 @@ #include "disas.h" #include "tcg.h" #include "qemu-barrier.h" +#include "qtest.h" int tb_invalidated_flag; @@ -183,6 +184,9 @@ volatile sig_atomic_t exit_request; int cpu_exec(CPUArchState *env) { +#ifdef TARGET_PPC + CPUState *cpu = ENV_GET_CPU(env); +#endif int ret, interrupt_request; TranslationBlock *tb; uint8_t *tc_ptr; @@ -285,16 +289,18 @@ int cpu_exec(CPUArchState *env) #endif #if defined(TARGET_I386) if (interrupt_request & CPU_INTERRUPT_INIT) { - svm_check_intercept(env, SVM_EXIT_INIT); - do_cpu_init(env); + cpu_svm_check_intercept_param(env, SVM_EXIT_INIT, + 0); + do_cpu_init(x86_env_get_cpu(env)); env->exception_index = EXCP_HALTED; cpu_loop_exit(env); } else if (interrupt_request & CPU_INTERRUPT_SIPI) { - do_cpu_sipi(env); + do_cpu_sipi(x86_env_get_cpu(env)); } else if (env->hflags2 & HF2_GIF_MASK) { if ((interrupt_request & CPU_INTERRUPT_SMI) && !(env->hflags & HF_SMM_MASK)) { - svm_check_intercept(env, SVM_EXIT_SMI); + cpu_svm_check_intercept_param(env, SVM_EXIT_SMI, + 0); env->interrupt_request &= ~CPU_INTERRUPT_SMI; do_smm_enter(env); next_tb = 0; @@ -315,7 +321,8 @@ int cpu_exec(CPUArchState *env) (env->eflags & IF_MASK && !(env->hflags & HF_INHIBIT_IRQ_MASK))))) { int intno; - svm_check_intercept(env, SVM_EXIT_INTR); + cpu_svm_check_intercept_param(env, SVM_EXIT_INTR, + 0); env->interrupt_request &= ~(CPU_INTERRUPT_HARD | CPU_INTERRUPT_VIRQ); intno = cpu_get_pic_interrupt(env); qemu_log_mask(CPU_LOG_TB_IN_ASM, "Servicing hardware INT=0x%02x\n", intno); @@ -329,7 +336,8 @@ int cpu_exec(CPUArchState *env) !(env->hflags & HF_INHIBIT_IRQ_MASK)) { int intno; /* FIXME: this should respect TPR */ - svm_check_intercept(env, SVM_EXIT_VINTR); + cpu_svm_check_intercept_param(env, SVM_EXIT_VINTR, + 0); intno = ldl_phys(env->vm_vmcb + offsetof(struct vmcb, control.int_vector)); qemu_log_mask(CPU_LOG_TB_IN_ASM, "Servicing virtual hardware INT=0x%02x\n", intno); do_interrupt_x86_hardirq(env, intno, 1); @@ -340,7 +348,7 @@ int cpu_exec(CPUArchState *env) } #elif defined(TARGET_PPC) if ((interrupt_request & CPU_INTERRUPT_RESET)) { - cpu_state_reset(env); + cpu_reset(cpu); } if (interrupt_request & CPU_INTERRUPT_HARD) { ppc_hw_interrupt(env); @@ -463,11 +471,18 @@ int cpu_exec(CPUArchState *env) do_interrupt(env); next_tb = 0; } - if (interrupt_request & CPU_INTERRUPT_NMI - && (env->pregs[PR_CCS] & M_FLAG)) { - env->exception_index = EXCP_NMI; - do_interrupt(env); - next_tb = 0; + if (interrupt_request & CPU_INTERRUPT_NMI) { + unsigned int m_flag_archval; + if (env->pregs[PR_VR] < 32) { + m_flag_archval = M_FLAG_V10; + } else { + m_flag_archval = M_FLAG_V32; + } + if ((env->pregs[PR_CCS] & m_flag_archval)) { + env->exception_index = EXCP_NMI; + do_interrupt(env); + next_tb = 0; + } } #elif defined(TARGET_M68K) if (interrupt_request & CPU_INTERRUPT_HARD @@ -540,8 +555,8 @@ int cpu_exec(CPUArchState *env) tb_invalidated_flag = 0; } #ifdef CONFIG_DEBUG_EXEC - qemu_log_mask(CPU_LOG_EXEC, "Trace 0x%08lx [" TARGET_FMT_lx "] %s\n", - (long)tb->tc_ptr, tb->pc, + qemu_log_mask(CPU_LOG_EXEC, "Trace %p [" TARGET_FMT_lx "] %s\n", + tb->tc_ptr, tb->pc, lookup_symbol(tb->pc)); #endif /* see if we can patch the calling TB. When the TB