if test $kqemu = "yes" -a "$target_softmmu" = "yes"
then
echo "CONFIG_KQEMU=yes" >> $config_mak
- echo "#define USE_KQEMU 1" >> $config_h
+ echo "#define CONFIG_KQEMU 1" >> $config_h
fi
if test "$kvm" = "yes" ; then
echo "CONFIG_KVM=yes" >> $config_mak
if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
then
echo "CONFIG_KQEMU=yes" >> $config_mak
- echo "#define USE_KQEMU 1" >> $config_h
+ echo "#define CONFIG_KQEMU 1" >> $config_h
fi
if test "$kvm" = "yes" ; then
echo "CONFIG_KVM=yes" >> $config_mak
#endif
/* address in the RAM (different from a physical address) */
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
typedef uint32_t ram_addr_t;
#else
typedef unsigned long ram_addr_t;
}
env->exception_index = -1;
}
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (kqemu_is_ok(env) && env->interrupt_request == 0 && env->exit_request == 0) {
int ret;
env->eflags = env->eflags | helper_cc_compute_all(CC_OP) | (DF & DF_MASK);
jump. */
{
if (next_tb != 0 &&
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
(env->kqemu_enabled != 2) &&
#endif
tb->page_addr[1] == -1) {
}
/* reset soft MMU for next block (it can currently
only be set by a memory fault) */
-#if defined(USE_KQEMU)
+#if defined(CONFIG_KQEMU)
#define MIN_CYCLE_BEFORE_SWITCH (100 * 1000)
if (kqemu_is_ok(env) &&
(cpu_get_time_fast() - env->last_io_time) >= MIN_CYCLE_BEFORE_SWITCH) {
}
#endif
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
#define KQEMU_MODIFY_PAGE_MASK (0xff & ~(VGA_DIRTY_FLAG | CODE_DIRTY_FLAG))
#define MSR_QPI_COMMBASE 0xfabe0010
#define TARGET_VIRT_ADDR_SPACE_BITS 42
#elif defined(TARGET_PPC64)
#define TARGET_PHYS_ADDR_SPACE_BITS 42
-#elif defined(TARGET_X86_64) && !defined(USE_KQEMU)
+#elif defined(TARGET_X86_64) && !defined(CONFIG_KQEMU)
#define TARGET_PHYS_ADDR_SPACE_BITS 42
-#elif defined(TARGET_I386) && !defined(USE_KQEMU)
+#elif defined(TARGET_I386) && !defined(CONFIG_KQEMU)
#define TARGET_PHYS_ADDR_SPACE_BITS 36
#else
/* Note: for compatibility with kqemu, we use 32 bits for x86_64 */
memset (env->tb_jmp_cache, 0, TB_JMP_CACHE_SIZE * sizeof (void *));
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (env->kqemu_enabled) {
kqemu_flush(env, flush_global);
}
tlb_flush_jmp_cache(env, addr);
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (env->kqemu_enabled) {
kqemu_flush_page(env, addr);
}
if (length == 0)
return;
len = length >> TARGET_PAGE_BITS;
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
/* XXX: should not depend on cpu context */
env = first_cpu;
if (env->kqemu_enabled) {
ram_addr_t orig_size = size;
void *subpage;
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
/* XXX: should not depend on cpu context */
env = first_cpu;
if (env->kqemu_enabled) {
kvm_uncoalesce_mmio_region(addr, size);
}
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
/* XXX: better than nothing */
static ram_addr_t kqemu_ram_alloc(ram_addr_t size)
{
{
RAMBlock *new_block;
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (kqemu_phys_ram_base) {
return kqemu_ram_alloc(size);
}
RAMBlock **prevp;
RAMBlock *block;
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (kqemu_phys_ram_base) {
return kqemu_phys_ram_base + addr;
}
RAMBlock *block;
uint8_t *host = ptr;
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (kqemu_phys_ram_base) {
return host - kqemu_phys_ram_base;
}
#endif
}
stb_p(qemu_get_ram_ptr(ram_addr), val);
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (cpu_single_env->kqemu_enabled &&
(dirty_flags & KQEMU_MODIFY_PAGE_MASK) != KQEMU_MODIFY_PAGE_MASK)
kqemu_modify_page(cpu_single_env, ram_addr);
#endif
}
stw_p(qemu_get_ram_ptr(ram_addr), val);
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (cpu_single_env->kqemu_enabled &&
(dirty_flags & KQEMU_MODIFY_PAGE_MASK) != KQEMU_MODIFY_PAGE_MASK)
kqemu_modify_page(cpu_single_env, ram_addr);
#endif
}
stl_p(qemu_get_ram_ptr(ram_addr), val);
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (cpu_single_env->kqemu_enabled &&
(dirty_flags & KQEMU_MODIFY_PAGE_MASK) != KQEMU_MODIFY_PAGE_MASK)
kqemu_modify_page(cpu_single_env, ram_addr);
io_mem_watch = cpu_register_io_memory(0, watch_mem_read,
watch_mem_write, NULL);
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (kqemu_phys_ram_base) {
/* alloc dirty bits array */
phys_ram_dirty = qemu_vmalloc(kqemu_phys_ram_size >> TARGET_PAGE_BITS);
/* Note: when using kqemu, it is more logical to return the host TSC
because kqemu does not trap the RDTSC instruction for
performance reasons */
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (env->kqemu_enabled) {
return cpu_get_real_ticks();
} else
#include "exec-all.h"
#include "qemu-common.h"
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
#define DEBUG
//#define PROFILE
static void do_info_kqemu(Monitor *mon)
{
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
CPUState *env;
int val;
val = 0;
kqemu_ret_int_count = 0;
kqemu_ret_excp_count = 0;
kqemu_ret_intr_count = 0;
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
kqemu_record_dump();
#endif
}
#else
-#if defined(USE_KQEMU)
+#if defined(CONFIG_KQEMU)
#ifdef __OpenBSD__
#include <sys/param.h>
/* alloc shared memory pages */
void *qemu_vmalloc(size_t size)
{
-#if defined(USE_KQEMU)
+#if defined(CONFIG_KQEMU)
if (kqemu_allowed)
return kqemu_vmalloc(size);
#endif
void qemu_vfree(void *ptr)
{
-#if defined(USE_KQEMU)
+#if defined(CONFIG_KQEMU)
if (kqemu_allowed)
kqemu_vfree(ptr);
#endif
Set the filename for the BIOS.
ETEXI
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
DEF("kernel-kqemu", 0, QEMU_OPTION_kernel_kqemu, \
"-kernel-kqemu enable KQEMU full virtualization (default is user mode only)\n")
#endif
Enable KQEMU full virtualization (default is user mode only).
ETEXI
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
DEF("no-kqemu", 0, QEMU_OPTION_no_kqemu, \
"-no-kqemu disable KQEMU kernel module usage\n")
#endif
res |= (uint64_t)io_mem_read[index][2](io_mem_opaque[index], physaddr + 4) << 32;
#endif
#endif /* SHIFT > 2 */
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
env->last_io_time = cpu_get_time_fast();
#endif
return res;
io_mem_write[index][2](io_mem_opaque[index], physaddr + 4, val >> 32);
#endif
#endif /* SHIFT > 2 */
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
env->last_io_time = cpu_get_time_fast();
#endif
}
extern int semihosting_enabled;
extern int old_param;
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
extern int kqemu_allowed;
#endif
uint64_t mask;
} mtrr_var[8];
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
int kqemu_enabled;
int last_io_time;
#endif
#define X86_DUMP_FPU 0x0001 /* dump FPU state too */
#define X86_DUMP_CCOP 0x0002 /* dump qemu flag cache */
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
static inline int cpu_get_time_fast(void)
{
int low, high;
/* XXX: This value should match the one returned by CPUID
* and in exec.c */
-#if defined(USE_KQEMU)
+#if defined(CONFIG_KQEMU)
#define PHYS_ADDR_MASK 0xfffff000LL
#else
# if defined(TARGET_X86_64)
/* XXX: This value must match the one used in the MMU code. */
if (env->cpuid_ext2_features & CPUID_EXT2_LM) {
/* 64 bit processor */
-#if defined(USE_KQEMU)
+#if defined(CONFIG_KQEMU)
*eax = 0x00003020; /* 48 bits virtual, 32 bits physical */
#else
/* XXX: The physical address space is limited to 42 bits in exec.c. */
*eax = 0x00003028; /* 48 bits virtual, 40 bits physical */
#endif
} else {
-#if defined(USE_KQEMU)
+#if defined(CONFIG_KQEMU)
*eax = 0x00000020; /* 32 bits physical */
#else
if (env->cpuid_features & CPUID_PSE36)
return NULL;
}
cpu_reset(env);
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
kqemu_init(env);
#endif
if (kvm_enabled())
env->eflags |= IF_MASK;
cpu_x86_set_cpl(env, 3);
}
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (kqemu_is_ok(env)) {
if (env->hflags & HF_LMA_MASK)
CC_OP = CC_OP_EFLAGS;
SET_ESP(sp, sp_mask);
EIP = offset;
}
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (kqemu_is_ok(env)) {
env->exception_index = -1;
cpu_loop_exit();
helper_ret_protected(shift, 1, 0);
}
env->hflags2 &= ~HF2_NMI_MASK;
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (kqemu_is_ok(env)) {
CC_OP = CC_OP_EFLAGS;
env->exception_index = -1;
void helper_lret_protected(int shift, int addend)
{
helper_ret_protected(shift, 0, addend);
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (kqemu_is_ok(env)) {
env->exception_index = -1;
cpu_loop_exit();
}
ESP = ECX;
EIP = EDX;
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (kqemu_is_ok(env)) {
env->exception_index = -1;
cpu_loop_exit();
val = env->kernelgsbase;
break;
#endif
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
case MSR_QPI_COMMBASE:
if (env->kqemu_enabled) {
val = kqemu_comm_base;
{
LOG_IOPORT("outb: %04x %02x\n", addr, val);
ioport_write(0, addr, val);
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (env)
env->last_io_time = cpu_get_time_fast();
#endif
{
LOG_IOPORT("outw: %04x %04x\n", addr, val);
ioport_write(1, addr, val);
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (env)
env->last_io_time = cpu_get_time_fast();
#endif
{
LOG_IOPORT("outl: %04x %08x\n", addr, val);
ioport_write(2, addr, val);
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (env)
env->last_io_time = cpu_get_time_fast();
#endif
int val;
val = ioport_read(0, addr);
LOG_IOPORT("inb : %04x %02x\n", addr, val);
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (env)
env->last_io_time = cpu_get_time_fast();
#endif
int val;
val = ioport_read(1, addr);
LOG_IOPORT("inw : %04x %04x\n", addr, val);
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (env)
env->last_io_time = cpu_get_time_fast();
#endif
int val;
val = ioport_read(2, addr);
LOG_IOPORT("inl : %04x %08x\n", addr, val);
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (env)
env->last_io_time = cpu_get_time_fast();
#endif
if (env) {
/* stop the currently executing cpu because a timer occured */
cpu_exit(env);
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (env->kqemu_enabled) {
kqemu_cpu_interrupt(env);
}
CPUState *env = cpu_single_env;
if (env) {
cpu_exit(env);
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (env->kqemu_enabled) {
kqemu_cpu_interrupt(env);
}
/* On 32-bit hosts, QEMU is limited by virtual address space */
if (value > (2047 << 20)
-#ifndef USE_KQEMU
+#ifndef CONFIG_KQEMU
&& HOST_LONG_BITS == 32
#endif
) {
}
break;
#endif
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
case QEMU_OPTION_no_kqemu:
kqemu_allowed = 0;
break;
#ifdef CONFIG_KVM
case QEMU_OPTION_enable_kvm:
kvm_allowed = 1;
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
kqemu_allowed = 0;
#endif
break;
}
}
-#if defined(CONFIG_KVM) && defined(USE_KQEMU)
+#if defined(CONFIG_KVM) && defined(CONFIG_KQEMU)
if (kvm_allowed && kqemu_allowed) {
fprintf(stderr,
"You can not enable both KVM and kqemu at the same time\n");
}
#endif
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (smp_cpus > 1)
kqemu_allowed = 0;
#endif
if (ram_size == 0)
ram_size = DEFAULT_RAM_SIZE * 1024 * 1024;
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
/* FIXME: This is a nasty hack because kqemu can't cope with dynamic
guest ram allocation. It needs to go away. */
if (kqemu_allowed) {