Merge 'qemu 1.5.1' into tizen_qemu_1.5.1
[sdk/emulator/qemu.git] / exec.c
diff --git a/exec.c b/exec.c
index aec65c5..4c62ee1 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 "hw/xen/xen.h"
@@ -37,6 +46,7 @@
 #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 */
@@ -249,7 +259,24 @@ static const VMStateDescription vmstate_cpu_common = {
 #define vmstate_cpu_common vmstate_dummy
 #endif
 
+<<<<<<< HEAD
+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION) && defined(CONFIG_SOFTMMU)
+/* check whether the given addr is in TCG generated code buffer or not */
+bool is_tcg_gen_code(uintptr_t tc_ptr)
+{
+    /* This can be called during code generation, code_gen_buffer_size
+       is used instead of code_gen_ptr for upper boundary checking */
+    return (tc_ptr >= (uintptr_t)code_gen_buffer &&
+            tc_ptr < (uintptr_t)(code_gen_buffer + code_gen_buffer_size));
+}
+#endif
+
+/* find the TB 'tb' such that tb[0].tc_ptr <= tc_ptr <
+   tb[1].tc_ptr. Return NULL if not found */
+TranslationBlock *tb_find_pc(uintptr_t tc_ptr)
+=======
 CPUState *qemu_get_cpu(int index)
+>>>>>>> test1.5
 {
     CPUArchState *env = first_cpu;
     CPUState *cpu = NULL;
@@ -1076,7 +1103,28 @@ 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);
+#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);
+                       }
+               }
+#endif
+=======
                 new_block->host = qemu_anon_ram_alloc(size);
+>>>>>>> test1.5
             }
             memory_try_enable_merging(new_block->host, size);
         }