Skip to contentSkip to conversation

kqemu: only compile kqemu.o if actually needed

PATCH Applied Paul Bolle 2 participants 4 messages Apr 18, 2009 – Apr 19, 2009 Kbuild

lore
Share & tools
lore

Paul Bolle

author
#0 lore raw

PATCH 1/1 kqemu: only compile kqemu.o if actually needed

kqemu.o is compiled even if kqemu support is disabled. This is useless (kqemu.o should provide nothing that is actually used in that case) and slightly confusing. So introduce CONFIG_KQEMU for optionally compiling kqemu.o.

---
If this is accepted a next step could be to merge CONFIG_KQEMU and USE_KQEMU.

 Makefile.target |    5 ++++-
 configure       |    2 ++
 2 files changed, 6 insertions(+), 1 deletions(-)
Makefile.target +4 -1
index dae339b..b27696a 100644
@@ -131,8 +131,11 @@ all: $(PROGS)
 
 #########################################################
 # cpu emulator library
-LIBOBJS=exec.o kqemu.o translate-all.o cpu-exec.o\
+LIBOBJS=exec.o translate-all.o cpu-exec.o\
         translate.o host-utils.o
+ifdef CONFIG_KQEMU
+LIBOBJS+= kqemu.o
+endif
 # TCG code generator
 LIBOBJS+= tcg/tcg.o tcg/tcg-runtime.o
 CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
configure +2 -0
index af35713..1d96635 100755
@@ -1766,6 +1766,7 @@ case "$target_cpu" in
     echo "#define TARGET_I386 1" >> $config_h
     if test $kqemu = "yes" -a "$target_softmmu" = "yes"
     then
+      echo "CONFIG_KQEMU=yes" >> $config_mak
       echo "#define USE_KQEMU 1" >> $config_h
     fi
     if test "$kvm" = "yes" ; then
@@ -1781,6 +1782,7 @@ case "$target_cpu" in
     echo "#define TARGET_X86_64 1" >> $config_h
     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
     fi
     if test "$kvm" = "yes" ; then
Signature · 1 line
1.6.2.2
Applied
#1 lore raw
Quoted 9 lines · Paul Bolle

kqemu.o is compiled even if kqemu support is disabled. This is useless
(kqemu.o should provide nothing that is actually used in that case) and slightly confusing. So introduce CONFIG_KQEMU for optionally compiling kqemu.o.

---
If this is accepted a next step could be to merge CONFIG_KQEMU and USE_KQEMU.

Thanks, applied. Merging those would be great.

author
#2 lore raw

PATCH 1/1 kqemu: merge CONFIG_KQEMU and USE_KQEMU

Basically a recursive ":%s/USE_KQEMU/CONFIG_KQEMU/g".

---

Quoted 4 lines
Quoted 2 lines

If this is accepted a next step could be to merge CONFIG_KQEMU and USE_KQEMU.

Thanks, applied. Merging those would be great.

Compile tested in the one configuration I tend to
care about (these are md5sums):

with patch, kqemu disabled:

    77df063d00432d2fc4410f0da79e75f5  i386-softmmu/qemu
with patch, kqemu enabled:
    799deb8cffc67a1dbc2d0494de7eed8a  i386-softmmu/qemu
before patch, kqemu disabled:
    77df063d00432d2fc4410f0da79e75f5  i386-softmmu/qemu
before patch, kqemu enabled:
    799deb8cffc67a1dbc2d0494de7eed8a  i386-softmmu/qemu
 configure               |    4 ++--
 cpu-all.h               |    2 +-
 cpu-exec.c              |    6 +++---
 exec-all.h              |    2 +-
 exec.c                  |   28 ++++++++++++++--------------
 hw/pc.c                 |    2 +-
 kqemu.c                 |    2 +-
 monitor.c               |    4 ++--
 osdep.c                 |    6 +++---
 qemu-options.hx         |    4 ++--
 softmmu_template.h      |    4 ++--
 sysemu.h                |    2 +-
 target-i386/cpu.h       |    4 ++--
 target-i386/helper.c    |    8 ++++----
 target-i386/op_helper.c |   12 ++++++------
 vl.c                    |   28 ++++++++++++++--------------
 16 files changed, 59 insertions(+), 59 deletions(-)
configure +2 -2
index c699466..8bf44de 100755
@@ -1770,7 +1770,7 @@ case "$target_cpu" in
     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 @@ case "$target_cpu" in
     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
cpu-all.h +1 -1
index aaaa70d..1d691dd 100644
@@ -846,7 +846,7 @@ int cpu_inl(CPUState *env, int addr);
 #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;
cpu-exec.c +3 -3
index 611f1ea..122bdd1 100644
@@ -314,7 +314,7 @@ int cpu_exec(CPUState *env1)
                 }
                 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 @@ int cpu_exec(CPUState *env1)
                    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 @@ int cpu_exec(CPUState *env1)
                 }
                 /* 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) {
exec-all.h +1 -1
index b4664f9..f91e646 100644
@@ -352,7 +352,7 @@ static inline int can_do_io(CPUState *env)
 }
 #endif
 
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
 #define KQEMU_MODIFY_PAGE_MASK (0xff & ~(VGA_DIRTY_FLAG | CODE_DIRTY_FLAG))
 
 #define MSR_QPI_COMMBASE 0xfabe0010
exec.c +14 -14
index 13e43d0..fc7e08c 100644
@@ -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 @@ void tlb_flush(CPUState *env, int flush_global)
 
     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 @@ void tlb_flush_page(CPUState *env, target_ulong addr)
 
     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 @@ void cpu_physical_memory_reset_dirty(ram_addr_t start, ram_addr_t end,
     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 @@ void cpu_register_physical_memory_offset(target_phys_addr_t start_addr,
     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 @@ void qemu_unregister_coalesced_mmio(target_phys_addr_t addr, ram_addr_t size)
         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 @@ ram_addr_t qemu_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);
     }
@@ -2494,7 +2494,7 @@ void *qemu_get_ram_ptr(ram_addr_t addr)
     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 @@ ram_addr_t qemu_ram_addr_from_host(void *ptr)
     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 @@ static void notdirty_mem_writeb(void *opaque, target_phys_addr_t ram_addr,
 #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 @@ static void notdirty_mem_writew(void *opaque, target_phys_addr_t 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);
@@ -2692,7 +2692,7 @@ static void notdirty_mem_writel(void *opaque, target_phys_addr_t 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);
@@ -2993,7 +2993,7 @@ static void io_mem_init(void)
 
     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);
hw/pc.c +1 -1
index 5451f05..cac6fb1 100644
@@ -85,7 +85,7 @@ uint64_t cpu_get_tsc(CPUX86State *env)
     /* 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
kqemu.c +1 -1
index 040e817..1718498 100644
@@ -41,7 +41,7 @@
 #include "exec-all.h"
 #include "qemu-common.h"
 
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
 
 #define DEBUG
 //#define PROFILE
monitor.c +2 -2
index 652d1f0..e7a4dc7 100644
@@ -1368,7 +1368,7 @@ static void tlb_info(Monitor *mon)
 
 static void do_info_kqemu(Monitor *mon)
 {
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
     CPUState *env;
     int val;
     val = 0;
@@ -1445,7 +1445,7 @@ static void do_info_profile(Monitor *mon)
     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
 }
osdep.c +3 -3
index 91fb39e..3696601 100644
@@ -69,7 +69,7 @@ void qemu_vfree(void *ptr)
 
 #else
 
-#if defined(USE_KQEMU)
+#if defined(CONFIG_KQEMU)
 
 #ifdef __OpenBSD__
 #include <sys/param.h>
@@ -197,7 +197,7 @@ void *qemu_memalign(size_t alignment, size_t size)
 /* 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_vmalloc(size_t size)
 
 void qemu_vfree(void *ptr)
 {
-#if defined(USE_KQEMU)
+#if defined(CONFIG_KQEMU)
     if (kqemu_allowed)
         kqemu_vfree(ptr);
 #endif
qemu-options.hx +2 -2
index 4d15f9b..1d783e5 100644
@@ -1304,7 +1304,7 @@ STEXI
 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 @@ STEXI
 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
softmmu_template.h +2 -2
index 9f20722..4b33aef 100644
@@ -76,7 +76,7 @@ static inline DATA_TYPE glue(io_read, SUFFIX)(target_phys_addr_t physaddr,
     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 @@ static inline void glue(io_write, SUFFIX)(target_phys_addr_t physaddr,
     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
 }
sysemu.h +1 -1
index 2b1677c..24b4bd1 100644
@@ -104,7 +104,7 @@ extern int no_quit;
 extern int semihosting_enabled;
 extern int old_param;
 
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
 extern int kqemu_allowed;
 #endif
 
target-i386/cpu.h +2 -2
index f38f194..c6bca94 100644
@@ -662,7 +662,7 @@ typedef struct CPUX86State {
         uint64_t mask;
     } mtrr_var[8];
 
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
     int kqemu_enabled;
     int last_io_time;
 #endif
@@ -820,7 +820,7 @@ uint64_t cpu_get_tsc(CPUX86State *env);
 #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;
target-i386/helper.c +4 -4
index 5ce8798..f107d50 100644
@@ -930,7 +930,7 @@ target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
 
 /* 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 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
 /* 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 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
         return NULL;
     }
     cpu_reset(env);
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
     kqemu_init(env);
 #endif
     if (kvm_enabled())
target-i386/op_helper.c +6 -6
index be09263..1a74902 100644
@@ -1119,7 +1119,7 @@ void helper_sysret(int dflag)
         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 @@ void helper_lcall_protected(int new_cs, target_ulong new_eip,
         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 @@ void helper_iret_protected(int shift, int next_eip)
         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_iret_protected(int shift, int next_eip)
 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 @@ void helper_sysexit(int dflag)
     }
     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 @@ void helper_rdmsr(void)
         val = env->kernelgsbase;
         break;
 #endif
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
     case MSR_QPI_COMMBASE:
         if (env->kqemu_enabled) {
             val = kqemu_comm_base;
vl.c +14 -14
index 72ea0e4..55a9bc5 100644
@@ -435,7 +435,7 @@ void cpu_outb(CPUState *env, int addr, int val)
 {
     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 @@ void cpu_outw(CPUState *env, int addr, int val)
 {
     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 @@ void cpu_outl(CPUState *env, int addr, int val)
 {
     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 cpu_inb(CPUState *env, int addr)
     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 cpu_inw(CPUState *env, int addr)
     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 cpu_inl(CPUState *env, int addr)
     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 @@ static void host_alarm_handler(int host_signum)
         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 @@ void qemu_service_io(void)
     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 @@ int main(int argc, char **argv, char **envp)
 
                 /* 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 @@ int main(int argc, char **argv, char **envp)
                 }
                 break;
 #endif
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
             case QEMU_OPTION_no_kqemu:
                 kqemu_allowed = 0;
                 break;
@@ -4820,7 +4820,7 @@ int main(int argc, char **argv, char **envp)
 #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 @@ int main(int argc, char **argv, char **envp)
         }
     }
 
-#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 @@ int main(int argc, char **argv, char **envp)
     }
 #endif
 
-#ifdef USE_KQEMU
+#ifdef CONFIG_KQEMU
     if (smp_cpus > 1)
         kqemu_allowed = 0;
 #endif
@@ -5148,7 +5148,7 @@ int main(int argc, char **argv, char **envp)
     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) {
Signature · 1 line
1.6.0.6
Applied
#3 lore raw

[Qemu-devel] Re: [PATCH] kqemu: merge CONFIG_KQEMU and USE_KQEMU

Quoted 3 lines · Paul Bolle

Basically a recursive ":%s/USE_KQEMU/CONFIG_KQEMU/g".

Thanks, applied.