diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2009-08-10 17:07:24 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-08-24 08:02:55 -0500 |
commit | 4a1418e07bdcfaa3177739e04707ecaec75d89e1 (patch) | |
tree | a68b7017b184850330000afa416d4ed419bb736a /target-i386 | |
parent | 0953a80f04a9771323931123cbe486e9fd8ffe20 (diff) | |
download | qemu-4a1418e07bdcfaa3177739e04707ecaec75d89e1.zip qemu-4a1418e07bdcfaa3177739e04707ecaec75d89e1.tar.gz qemu-4a1418e07bdcfaa3177739e04707ecaec75d89e1.tar.bz2 |
Unbreak large mem support by removing kqemu
kqemu introduces a number of restrictions on the i386 target. The worst is that
it prevents large memory from working in the default build.
Furthermore, kqemu is fundamentally flawed in a number of ways. It relies on
the TSC as a time source which will not be reliable on a multiple processor
system in userspace. Since most modern processors are multicore, this severely
limits the utility of kqemu.
kvm is a viable alternative for people looking to accelerate qemu and has the
benefit of being supported by the upstream Linux kernel. If someone can
implement work arounds to remove the restrictions introduced by kqemu, I'm
happy to avoid and/or revert this patch.
N.B. kqemu will still function in the 0.11 series but this patch removes it from
the 0.12 series.
Paul, please Ack or Nack this patch.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'target-i386')
-rw-r--r-- | target-i386/TODO | 1 | ||||
-rw-r--r-- | target-i386/cpu.h | 14 | ||||
-rw-r--r-- | target-i386/helper.c | 15 | ||||
-rw-r--r-- | target-i386/op_helper.c | 42 |
4 files changed, 0 insertions, 72 deletions
diff --git a/target-i386/TODO b/target-i386/TODO index b671e24..c8ada07 100644 --- a/target-i386/TODO +++ b/target-i386/TODO @@ -30,4 +30,3 @@ Optimizations/Features: - evaluate x87 stack pointer statically - find a way to avoid translating several time the same TB if CR0.TS is set or not. -- move kqemu support outside target-i386. diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 6a96e93..d4274ea 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -682,11 +682,6 @@ typedef struct CPUX86State { uint64_t mask; } mtrr_var[8]; -#ifdef CONFIG_KQEMU - int kqemu_enabled; - int last_io_time; -#endif - /* For KVM */ uint64_t interrupt_bitmap[256 / 64]; uint32_t mp_state; @@ -850,15 +845,6 @@ 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 CONFIG_KQEMU -static inline int cpu_get_time_fast(void) -{ - int low, high; - asm volatile("rdtsc" : "=a" (low), "=d" (high)); - return low; -} -#endif - #define TARGET_PAGE_BITS 12 #define cpu_init cpu_x86_init diff --git a/target-i386/helper.c b/target-i386/helper.c index dd89885..e18a5a9 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -995,15 +995,11 @@ 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(CONFIG_KQEMU) -#define PHYS_ADDR_MASK 0xfffff000LL -#else # if defined(TARGET_X86_64) # define PHYS_ADDR_MASK 0xfffffff000LL # else # define PHYS_ADDR_MASK 0xffffff000LL # endif -#endif /* return value: -1 = cannot handle fault @@ -1743,21 +1739,13 @@ 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(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(CONFIG_KQEMU) - *eax = 0x00000020; /* 32 bits physical */ -#else if (env->cpuid_features & CPUID_PSE36) *eax = 0x00000024; /* 36 bits physical */ else *eax = 0x00000020; /* 32 bits physical */ -#endif } *ebx = 0; *ecx = 0; @@ -1833,9 +1821,6 @@ CPUX86State *cpu_x86_init(const char *cpu_model) } mce_init(env); cpu_reset(env); -#ifdef CONFIG_KQEMU - kqemu_init(env); -#endif qemu_init_vcpu(env); diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c index 6808a35..c3f5af6 100644 --- a/target-i386/op_helper.c +++ b/target-i386/op_helper.c @@ -1111,14 +1111,6 @@ void helper_sysret(int dflag) env->eflags |= IF_MASK; cpu_x86_set_cpl(env, 3); } -#ifdef CONFIG_KQEMU - if (kqemu_is_ok(env)) { - if (env->hflags & HF_LMA_MASK) - CC_OP = CC_OP_EFLAGS; - env->exception_index = -1; - cpu_loop_exit(); - } -#endif } #endif @@ -2506,12 +2498,6 @@ void helper_lcall_protected(int new_cs, target_ulong new_eip, SET_ESP(sp, sp_mask); EIP = offset; } -#ifdef CONFIG_KQEMU - if (kqemu_is_ok(env)) { - env->exception_index = -1; - cpu_loop_exit(); - } -#endif } /* real and vm86 mode iret */ @@ -2792,24 +2778,11 @@ void helper_iret_protected(int shift, int next_eip) helper_ret_protected(shift, 1, 0); } env->hflags2 &= ~HF2_NMI_MASK; -#ifdef CONFIG_KQEMU - if (kqemu_is_ok(env)) { - CC_OP = CC_OP_EFLAGS; - env->exception_index = -1; - cpu_loop_exit(); - } -#endif } void helper_lret_protected(int shift, int addend) { helper_ret_protected(shift, 0, addend); -#ifdef CONFIG_KQEMU - if (kqemu_is_ok(env)) { - env->exception_index = -1; - cpu_loop_exit(); - } -#endif } void helper_sysenter(void) @@ -2882,12 +2855,6 @@ void helper_sysexit(int dflag) } ESP = ECX; EIP = EDX; -#ifdef CONFIG_KQEMU - if (kqemu_is_ok(env)) { - env->exception_index = -1; - cpu_loop_exit(); - } -#endif } #if defined(CONFIG_USER_ONLY) @@ -3211,15 +3178,6 @@ void helper_rdmsr(void) val = env->kernelgsbase; break; #endif -#ifdef CONFIG_KQEMU - case MSR_QPI_COMMBASE: - if (env->kqemu_enabled) { - val = kqemu_comm_base; - } else { - val = 0; - } - break; -#endif case MSR_MTRRphysBase(0): case MSR_MTRRphysBase(1): case MSR_MTRRphysBase(2): |