#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)
{
* 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
}
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. */
!(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;
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(;;) */
/* 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"
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;
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));
#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 */
/* 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);
}