提交 640f42e4 编写于 作者: B blueswir1

kqemu: merge CONFIG_KQEMU and USE_KQEMU

Basically a recursive ":%s/USE_KQEMU/CONFIG_KQEMU/g".
Signed-off-by: NPaul Bolle <pebolle@tiscali.nl>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7189 c046a42c-6fe2-441c-8c8c-71466251a162
上级 ac611340
......@@ -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
......
......@@ -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;
......
......@@ -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) {
......
......@@ -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
......
......@@ -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);
......
......@@ -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
......
......@@ -41,7 +41,7 @@
#include "exec-all.h"
#include "qemu-common.h"
#ifdef USE_KQEMU
#ifdef CONFIG_KQEMU
#define DEBUG
//#define PROFILE
......
......@@ -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
}
......
......@@ -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
......
......@@ -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
......
......@@ -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
}
......
......@@ -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
......
......@@ -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;
......
......@@ -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())
......
......@@ -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;
......
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册