[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [7189] kqemu: merge CONFIG_KQEMU and USE_KQEMU
From: |
Blue Swirl |
Subject: |
[Qemu-devel] [7189] kqemu: merge CONFIG_KQEMU and USE_KQEMU |
Date: |
Sun, 19 Apr 2009 10:18:02 +0000 |
Revision: 7189
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7189
Author: blueswir1
Date: 2009-04-19 10:18:01 +0000 (Sun, 19 Apr 2009)
Log Message:
-----------
kqemu: merge CONFIG_KQEMU and USE_KQEMU
Basically a recursive ":%s/USE_KQEMU/CONFIG_KQEMU/g".
Signed-off-by: Paul Bolle <address@hidden>
Modified Paths:
--------------
trunk/configure
trunk/cpu-all.h
trunk/cpu-exec.c
trunk/exec-all.h
trunk/exec.c
trunk/hw/pc.c
trunk/kqemu.c
trunk/monitor.c
trunk/osdep.c
trunk/qemu-options.hx
trunk/softmmu_template.h
trunk/sysemu.h
trunk/target-i386/cpu.h
trunk/target-i386/helper.c
trunk/target-i386/op_helper.c
trunk/vl.c
Modified: trunk/configure
===================================================================
--- trunk/configure 2009-04-19 09:15:50 UTC (rev 7188)
+++ trunk/configure 2009-04-19 10:18:01 UTC (rev 7189)
@@ -1770,7 +1770,7 @@
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
@@ -1786,7 +1786,7 @@
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
Modified: trunk/cpu-all.h
===================================================================
--- trunk/cpu-all.h 2009-04-19 09:15:50 UTC (rev 7188)
+++ trunk/cpu-all.h 2009-04-19 10:18:01 UTC (rev 7189)
@@ -846,7 +846,7 @@
#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;
Modified: trunk/cpu-exec.c
===================================================================
--- trunk/cpu-exec.c 2009-04-19 09:15:50 UTC (rev 7188)
+++ trunk/cpu-exec.c 2009-04-19 10:18:01 UTC (rev 7189)
@@ -314,7 +314,7 @@
}
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);
@@ -594,7 +594,7 @@
jump. */
{
if (next_tb != 0 &&
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
(env->kqemu_enabled != 2) &&
#endif
tb->page_addr[1] == -1) {
@@ -651,7 +651,7 @@
}
/* 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) {
Modified: trunk/exec-all.h
===================================================================
--- trunk/exec-all.h 2009-04-19 09:15:50 UTC (rev 7188)
+++ trunk/exec-all.h 2009-04-19 10:18:01 UTC (rev 7189)
@@ -352,7 +352,7 @@
}
#endif
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
#define KQEMU_MODIFY_PAGE_MASK (0xff & ~(VGA_DIRTY_FLAG | CODE_DIRTY_FLAG))
#define MSR_QPI_COMMBASE 0xfabe0010
Modified: trunk/exec.c
===================================================================
--- trunk/exec.c 2009-04-19 09:15:50 UTC (rev 7188)
+++ trunk/exec.c 2009-04-19 10:18:01 UTC (rev 7189)
@@ -71,9 +71,9 @@
#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 */
@@ -1760,7 +1760,7 @@
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);
}
@@ -1809,7 +1809,7 @@
tlb_flush_jmp_cache(env, addr);
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (env->kqemu_enabled) {
kqemu_flush_page(env, addr);
}
@@ -1861,7 +1861,7 @@
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) {
@@ -2328,7 +2328,7 @@
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) {
@@ -2429,7 +2429,7 @@
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)
{
@@ -2449,7 +2449,7 @@
{
RAMBlock *new_block;
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (kqemu_phys_ram_base) {
return kqemu_ram_alloc(size);
}
@@ -2494,7 +2494,7 @@
RAMBlock **prevp;
RAMBlock *block;
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (kqemu_phys_ram_base) {
return kqemu_phys_ram_base + addr;
}
@@ -2532,7 +2532,7 @@
RAMBlock *block;
uint8_t *host = ptr;
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (kqemu_phys_ram_base) {
return host - kqemu_phys_ram_base;
}
@@ -2642,7 +2642,7 @@
#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);
@@ -2667,7 +2667,7 @@
#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);
@@ -2692,7 +2692,7 @@
#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);
@@ -2993,7 +2993,7 @@
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);
Modified: trunk/hw/pc.c
===================================================================
--- trunk/hw/pc.c 2009-04-19 09:15:50 UTC (rev 7188)
+++ trunk/hw/pc.c 2009-04-19 10:18:01 UTC (rev 7189)
@@ -85,7 +85,7 @@
/* 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
Modified: trunk/kqemu.c
===================================================================
--- trunk/kqemu.c 2009-04-19 09:15:50 UTC (rev 7188)
+++ trunk/kqemu.c 2009-04-19 10:18:01 UTC (rev 7189)
@@ -41,7 +41,7 @@
#include "exec-all.h"
#include "qemu-common.h"
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
#define DEBUG
//#define PROFILE
Modified: trunk/monitor.c
===================================================================
--- trunk/monitor.c 2009-04-19 09:15:50 UTC (rev 7188)
+++ trunk/monitor.c 2009-04-19 10:18:01 UTC (rev 7189)
@@ -1368,7 +1368,7 @@
static void do_info_kqemu(Monitor *mon)
{
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
CPUState *env;
int val;
val = 0;
@@ -1445,7 +1445,7 @@
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
}
Modified: trunk/osdep.c
===================================================================
--- trunk/osdep.c 2009-04-19 09:15:50 UTC (rev 7188)
+++ trunk/osdep.c 2009-04-19 10:18:01 UTC (rev 7189)
@@ -69,7 +69,7 @@
#else
-#if defined(USE_KQEMU)
+#if defined(CONFIG_KQEMU)
#ifdef __OpenBSD__
#include <sys/param.h>
@@ -197,7 +197,7 @@
/* 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
@@ -206,7 +206,7 @@
void qemu_vfree(void *ptr)
{
-#if defined(USE_KQEMU)
+#if defined(CONFIG_KQEMU)
if (kqemu_allowed)
kqemu_vfree(ptr);
#endif
Modified: trunk/qemu-options.hx
===================================================================
--- trunk/qemu-options.hx 2009-04-19 09:15:50 UTC (rev 7188)
+++ trunk/qemu-options.hx 2009-04-19 10:18:01 UTC (rev 7189)
@@ -1304,7 +1304,7 @@
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
@@ -1313,7 +1313,7 @@
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
Modified: trunk/softmmu_template.h
===================================================================
--- trunk/softmmu_template.h 2009-04-19 09:15:50 UTC (rev 7188)
+++ trunk/softmmu_template.h 2009-04-19 10:18:01 UTC (rev 7189)
@@ -76,7 +76,7 @@
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;
@@ -221,7 +221,7 @@
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
}
Modified: trunk/sysemu.h
===================================================================
--- trunk/sysemu.h 2009-04-19 09:15:50 UTC (rev 7188)
+++ trunk/sysemu.h 2009-04-19 10:18:01 UTC (rev 7189)
@@ -104,7 +104,7 @@
extern int semihosting_enabled;
extern int old_param;
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
extern int kqemu_allowed;
#endif
Modified: trunk/target-i386/cpu.h
===================================================================
--- trunk/target-i386/cpu.h 2009-04-19 09:15:50 UTC (rev 7188)
+++ trunk/target-i386/cpu.h 2009-04-19 10:18:01 UTC (rev 7189)
@@ -662,7 +662,7 @@
uint64_t mask;
} mtrr_var[8];
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
int kqemu_enabled;
int last_io_time;
#endif
@@ -820,7 +820,7 @@
#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;
Modified: trunk/target-i386/helper.c
===================================================================
--- trunk/target-i386/helper.c 2009-04-19 09:15:50 UTC (rev 7188)
+++ trunk/target-i386/helper.c 2009-04-19 10:18:01 UTC (rev 7189)
@@ -930,7 +930,7 @@
/* 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)
@@ -1630,14 +1630,14 @@
/* 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)
@@ -1689,7 +1689,7 @@
return NULL;
}
cpu_reset(env);
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
kqemu_init(env);
#endif
if (kvm_enabled())
Modified: trunk/target-i386/op_helper.c
===================================================================
--- trunk/target-i386/op_helper.c 2009-04-19 09:15:50 UTC (rev 7188)
+++ trunk/target-i386/op_helper.c 2009-04-19 10:18:01 UTC (rev 7189)
@@ -1119,7 +1119,7 @@
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;
@@ -2478,7 +2478,7 @@
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();
@@ -2764,7 +2764,7 @@
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;
@@ -2776,7 +2776,7 @@
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();
@@ -2854,7 +2854,7 @@
}
ESP = ECX;
EIP = EDX;
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (kqemu_is_ok(env)) {
env->exception_index = -1;
cpu_loop_exit();
@@ -3167,7 +3167,7 @@
val = env->kernelgsbase;
break;
#endif
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
case MSR_QPI_COMMBASE:
if (env->kqemu_enabled) {
val = kqemu_comm_base;
Modified: trunk/vl.c
===================================================================
--- trunk/vl.c 2009-04-19 09:15:50 UTC (rev 7188)
+++ trunk/vl.c 2009-04-19 10:18:01 UTC (rev 7189)
@@ -435,7 +435,7 @@
{
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
@@ -445,7 +445,7 @@
{
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
@@ -455,7 +455,7 @@
{
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
@@ -466,7 +466,7 @@
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
@@ -478,7 +478,7 @@
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
@@ -490,7 +490,7 @@
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
@@ -1357,7 +1357,7 @@
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);
}
@@ -3343,7 +3343,7 @@
CPUState *env = cpu_single_env;
if (env) {
cpu_exit(env);
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (env->kqemu_enabled) {
kqemu_cpu_interrupt(env);
}
@@ -4634,7 +4634,7 @@
/* 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
) {
@@ -4809,7 +4809,7 @@
}
break;
#endif
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
case QEMU_OPTION_no_kqemu:
kqemu_allowed = 0;
break;
@@ -4820,7 +4820,7 @@
#ifdef CONFIG_KVM
case QEMU_OPTION_enable_kvm:
kvm_allowed = 1;
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
kqemu_allowed = 0;
#endif
break;
@@ -4976,7 +4976,7 @@
}
}
-#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");
@@ -5055,7 +5055,7 @@
}
#endif
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
if (smp_cpus > 1)
kqemu_allowed = 0;
#endif
@@ -5148,7 +5148,7 @@
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) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-devel] [7189] kqemu: merge CONFIG_KQEMU and USE_KQEMU,
Blue Swirl <=