From f7a0b9649b7153727faad00d95cf660dc3ca0f26 Mon Sep 17 00:00:00 2001 From: SeokYeon Hwang Date: Thu, 4 Jul 2013 13:16:49 +0900 Subject: [PATCH] Merge some files Change-Id: Icacfd942bbdef1d5c57a50e3c7a4df756ac6d874 Signed-off-by: SeokYeon Hwang --- cpu-exec.c | 40 +++++++++------------------------------- cpus.c | 25 +++---------------------- exec.c | 45 +++++++++++++++------------------------------ 3 files changed, 27 insertions(+), 83 deletions(-) diff --git a/cpu-exec.c b/cpu-exec.c index 9ed3f8dd25..7d36d963a4 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -20,14 +20,9 @@ #include "cpu.h" #include "disas/disas.h" #include "tcg.h" -<<<<<<< HEAD #include "hax.h" -#include "qemu-barrier.h" -#include "qtest.h" -======= #include "qemu/atomic.h" #include "sysemu/qtest.h" ->>>>>>> test1.5 bool qemu_cpu_has_work(CPUState *cpu) { @@ -205,14 +200,15 @@ volatile sig_atomic_t exit_request; * because MMIO is emulated for only one instruction now and then back to * HAX kernel */ -int need_handle_intr_request(CPUArchState *env) +static int need_handle_intr_request(CPUState *cpu) { #ifdef CONFIG_HAX + CPUArchState *env = cpu->env_ptr; if (!hax_enabled() || hax_vcpu_emulation_mode(env)) - return env->interrupt_request; + return cpu->interrupt_request; return 0; #else - return env->interrupt_request; + return cpu->interrupt_request; #endif } @@ -318,11 +314,7 @@ int cpu_exec(CPUArchState *env) next_tb = 0; /* force lookup of first TB */ for(;;) { -<<<<<<< HEAD - interrupt_request = need_handle_intr_request(env); -======= - interrupt_request = cpu->interrupt_request; ->>>>>>> test1.5 + interrupt_request = need_handle_intr_request(cpu); if (unlikely(interrupt_request)) { if (unlikely(env->singlestep_enabled & SSTEP_NOIRQ)) { /* Mask out external interrupts for this step. */ @@ -364,25 +356,16 @@ int cpu_exec(CPUArchState *env) !(env->hflags & HF_SMM_MASK)) { cpu_svm_check_intercept_param(env, SVM_EXIT_SMI, 0); -<<<<<<< HEAD - env->interrupt_request &= ~CPU_INTERRUPT_SMI; + cpu->interrupt_request &= ~CPU_INTERRUPT_SMI; #ifdef CONFIG_HAX - if (hax_enabled()) - env->hax_vcpu->resync = 1; + if (hax_enabled()) + env->hax_vcpu->resync = 1; #endif do_smm_enter(env); next_tb = 0; - } else if ((interrupt_request & CPU_INTERRUPT_NMI) && - !(env->hflags2 & HF2_NMI_MASK)) { - env->interrupt_request &= ~CPU_INTERRUPT_NMI; -======= - cpu->interrupt_request &= ~CPU_INTERRUPT_SMI; - do_smm_enter(env); - next_tb = 0; } else if ((interrupt_request & CPU_INTERRUPT_NMI) && !(env->hflags2 & HF2_NMI_MASK)) { cpu->interrupt_request &= ~CPU_INTERRUPT_NMI; ->>>>>>> test1.5 env->hflags2 |= HF2_NMI_MASK; do_interrupt_x86_hardirq(env, EXCP02_NMI, 1); next_tb = 0; @@ -713,16 +696,11 @@ int cpu_exec(CPUArchState *env) break; } } -<<<<<<< HEAD - env->current_tb = NULL; + cpu->current_tb = NULL; #ifdef CONFIG_HAX if (hax_enabled() && hax_stop_emulation(env)) cpu_loop_exit(env); #endif - -======= - cpu->current_tb = NULL; ->>>>>>> test1.5 /* 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 2579250a25..3592ba2063 100644 --- a/cpus.c +++ b/cpus.c @@ -25,20 +25,12 @@ /* Needed early for CONFIG_BSD etc. */ #include "config-host.h" -<<<<<<< HEAD -#include "monitor.h" -#include "sysemu.h" -#include "gdbstub.h" -#include "dma.h" -#include "kvm.h" -#include "hax.h" -======= #include "monitor/monitor.h" #include "sysemu/sysemu.h" #include "exec/gdbstub.h" #include "sysemu/dma.h" #include "sysemu/kvm.h" ->>>>>>> test1.5 +#include "hax.h" #include "qmp-commands.h" #include "qemu/thread.h" @@ -81,13 +73,8 @@ static bool cpu_thread_is_idle(CPUArchState *env) if (cpu->stopped || !runstate_is_running()) { return true; } -<<<<<<< HEAD - if (!env->halted || qemu_cpu_has_work(env) || - kvm_async_interrupts_enabled() || hax_enabled()) { -======= if (!cpu->halted || qemu_cpu_has_work(cpu) || - kvm_async_interrupts_enabled()) { ->>>>>>> test1.5 + kvm_async_interrupts_enabled() || hax_enabled()) { return false; } return true; @@ -1037,16 +1024,10 @@ void resume_all_vcpus(void) static void qemu_tcg_init_vcpu(CPUState *cpu) { -<<<<<<< HEAD - CPUArchState *env = _env; - CPUState *cpu = ENV_GET_CPU(env); - #ifdef CONFIG_HAX if (hax_enabled()) - hax_init_vcpu(env); + hax_init_vcpu(cpu->env_ptr); #endif -======= ->>>>>>> test1.5 /* share a single thread for all cpus with TCG */ if (!tcg_cpu_thread) { cpu->thread = g_malloc0(sizeof(QemuThread)); diff --git a/exec.c b/exec.c index 4c62ee1cb1..d66bc4254a 100644 --- a/exec.c +++ b/exec.c @@ -29,24 +29,15 @@ #include "tcg.h" #include "hw/hw.h" #include "hw/qdev.h" -<<<<<<< HEAD -#include "osdep.h" -#include "kvm.h" -#include "hax.h" -#include "hw/xen.h" -#include "qemu-timer.h" -#include "memory.h" -#include "exec-memory.h" -======= #include "qemu/osdep.h" #include "sysemu/kvm.h" +#include "hax.h" #include "hw/xen/xen.h" #include "qemu/timer.h" #include "qemu/config-file.h" #include "exec/memory.h" #include "sysemu/dma.h" #include "exec/address-spaces.h" ->>>>>>> test1.5 #if defined(CONFIG_USER_ONLY) #include #else /* !CONFIG_USER_ONLY */ @@ -1103,28 +1094,22 @@ ram_addr_t qemu_ram_alloc_from_ptr(ram_addr_t size, void *host, /* some s390/kvm configurations have special constraints */ new_block->host = kvm_ram_alloc(size); } else { -<<<<<<< HEAD - new_block->host = qemu_vmalloc(size); + new_block->host = qemu_anon_ram_alloc(size); #ifdef CONFIG_HAX - /* - * In Hax, the qemu allocate the virtual address, and HAX kernel - * populate the memory with physical memory. Currently we have no - * paging, so user should make sure enough free memory in advance - */ - if (hax_enabled()) - { - int ret; - ret = hax_populate_ram((uint64_t)new_block->host, size); - if (ret < 0) - { - fprintf(stderr, "Hax failed to populate ram\n"); - exit(-1); - } - } + /* + * In Hax, the qemu allocate the virtual address, and HAX kernel + * populate the memory with physical memory. Currently we have no + * paging, so user should make sure enough free memory in advance + */ + if (hax_enabled()) { + int ret; + ret = hax_populate_ram((uint64_t)new_block->host, size); + if (ret < 0) { + fprintf(stderr, "Hax failed to populate ram\n"); + exit(-1); + } + } #endif -======= - new_block->host = qemu_anon_ram_alloc(size); ->>>>>>> test1.5 } memory_try_enable_merging(new_block->host, size); } -- 2.34.1