From: SeokYeon Hwang Date: Fri, 7 Nov 2014 02:40:37 +0000 (+0900) Subject: hax: for testing... X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~634 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=57a0d655687a503ab76db51942543c9b8812a941;p=sdk%2Femulator%2Fqemu.git hax: for testing... Change-Id: Ia5f03db254b576e0f3847df52f9e4fde2f9c65b7 Signed-off-by: SeokYeon Hwang --- diff --git a/cpu-exec.c b/cpu-exec.c index 64a6150fc0..c3d4b7b0da 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -214,26 +214,17 @@ static void cpu_handle_debug_exception(CPUArchState *env) volatile sig_atomic_t exit_request; -/* - * QEMU emulate can happens because of MMIO or emulation mode, i.e. non-PG mode, - * when it's because of MMIO, the MMIO, the interrupt should not be emulated, - * because MMIO is emulated for only one instruction now and then back to - * HAX kernel - */ static int need_handle_intr_request(CPUState *cpu) { -#ifdef CONFIG_HAX - if (!hax_enabled() || hax_vcpu_emulation_mode(cpu)) - return cpu->interrupt_request; - return 0; -#else return cpu->interrupt_request; -#endif } int cpu_exec(CPUArchState *env) { +#ifdef CONFIG_HAX + assert(0); +#else CPUState *cpu = ENV_GET_CPU(env); #if !(defined(CONFIG_USER_ONLY) && \ (defined(TARGET_M68K) || defined(TARGET_PPC) || defined(TARGET_S390X))) @@ -331,11 +322,6 @@ int cpu_exec(CPUArchState *env) } } -#ifdef CONFIG_HAX - if (hax_enabled() && !hax_vcpu_exec(cpu)) - longjmp(cpu->jmp_env, 1); -#endif - next_tb = 0; /* force lookup of first TB */ for(;;) { interrupt_request = need_handle_intr_request(cpu); @@ -380,10 +366,6 @@ int cpu_exec(CPUArchState *env) cpu_svm_check_intercept_param(env, SVM_EXIT_SMI, 0); cpu->interrupt_request &= ~CPU_INTERRUPT_SMI; -#ifdef CONFIG_HAX - if (hax_enabled()) - cpu->hax_vcpu->resync = 1; -#endif do_smm_enter(x86_cpu); next_tb = 0; } else if ((interrupt_request & CPU_INTERRUPT_NMI) && @@ -709,10 +691,6 @@ int cpu_exec(CPUArchState *env) } } cpu->current_tb = NULL; -#ifdef CONFIG_HAX - if (hax_enabled() && hax_stop_emulation(cpu)) - cpu_loop_exit(cpu); -#endif /* reset soft MMU for next block (it can currently only be set by a memory fault) */ } /* for(;;) */ diff --git a/cpus.c b/cpus.c index b28a92a0f0..226dbc4822 100644 --- a/cpus.c +++ b/cpus.c @@ -1182,10 +1182,6 @@ void resume_all_vcpus(void) static void qemu_tcg_init_vcpu(CPUState *cpu) { -#ifdef CONFIG_HAX - if (hax_enabled()) - hax_init_vcpu(cpu); -#endif char thread_name[VCPU_THREAD_NAME_SIZE]; tcg_cpu_address_space_init(cpu, cpu->as); diff --git a/include/sysemu/hax.h b/include/sysemu/hax.h index 3b6783867c..a2c6da4880 100644 --- a/include/sysemu/hax.h +++ b/include/sysemu/hax.h @@ -48,8 +48,10 @@ void hax_cpu_synchronize_post_init(CPUState *cpu); int hax_populate_ram(uint64_t va, uint32_t size); int hax_set_phys_mem(MemoryRegionSection *section); int hax_vcpu_emulation_mode(CPUState *cpu); +/* int hax_stop_emulation(CPUState *cpu); int hax_stop_translate(CPUState *cpu); +*/ int hax_vcpu_destroy(CPUState *cpu); void hax_raise_event(CPUState *cpu); void hax_reset_vcpu_state(void *opaque); diff --git a/target-i386/hax-all.c b/target-i386/hax-all.c index 7b4bd46339..d0d4afcbce 100644 --- a/target-i386/hax-all.c +++ b/target-i386/hax-all.c @@ -70,12 +70,15 @@ int hax_vcpu_emulation_mode(CPUState *cpu) if (hax_enabled()) return 0; - else + else { + assert(0); return 1; + } } static int hax_prepare_emulation(CPUArchState *env) { + assert(0); /* Flush all emulation states */ tlb_flush(ENV_GET_CPU(env), 1); tb_flush(env); @@ -88,6 +91,7 @@ static int hax_prepare_emulation(CPUArchState *env) * Check whether to break the translation block loop * break tbloop after one MMIO emulation, or after finish emulation mode */ +#if 0 static int hax_stop_tbloop(CPUArchState *env) { CPUState *cpu = ENV_GET_CPU(env); @@ -143,6 +147,7 @@ int hax_stop_translate(CPUState *cpu) return 0; } +#endif int valid_hax_tunnel_size(uint16_t size) { diff --git a/target-i386/translate.c b/target-i386/translate.c index 701663979c..58682911e9 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -7993,12 +7993,15 @@ static inline void gen_intermediate_code_internal(X86CPU *cpu, pc_ptr = disas_insn(env, dc, pc_ptr); num_insns++; #ifdef CONFIG_HAX + assert(1); +/* if (hax_enabled() && hax_stop_translate(cs)) { gen_jmp_im(pc_ptr - dc->cs_base); gen_eob(dc); break; } +*/ #endif /* stop translation if indicated */ if (dc->is_jmp)