Merge some files
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Thu, 4 Jul 2013 04:16:49 +0000 (13:16 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Thu, 4 Jul 2013 04:16:49 +0000 (13:16 +0900)
Change-Id: Icacfd942bbdef1d5c57a50e3c7a4df756ac6d874
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
cpu-exec.c
cpus.c
exec.c

index 9ed3f8dd25e750c0a5bbb713914c095cfb7979a5..7d36d963a4069e2315e26babac4e9430e6a85204 100644 (file)
 #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 2579250a25aff3669aaf1c9119453ab6d3c0e838..3592ba2063960e2549e7fe0bd8be459d4c3a77b1 100644 (file)
--- a/cpus.c
+++ b/cpus.c
 /* 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 4c62ee1cb1c19b575ce68517b3f74efbc2d07275..d66bc4254a2639293162b27c3f1b1841e1a4770e 100644 (file)
--- a/exec.c
+++ b/exec.c
 #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 <qemu.h>
 #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);
         }