From: Jan Kiszka <jan.kiszka@xxxxxxxxxxx> Both implementations are identical if we map run_on_cpu on qemu-kvm's on_vcpu. Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx> --- kvm-all.c | 12 ++++++------ qemu-kvm.c | 29 ----------------------------- 2 files changed, 6 insertions(+), 35 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 2e7de45..c1be056 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -33,6 +33,10 @@ #include <sys/eventfd.h> #endif +#ifndef OBSOLETE_KVM_IMPL +#define run_on_cpu on_vcpu +#endif /* !OBSOLETE_KVM_IMPL */ + /* KVM uses PAGE_SIZE in it's definition of COALESCED_MMIO_MAX */ #define PAGE_SIZE TARGET_PAGE_SIZE @@ -896,8 +900,6 @@ void kvm_flush_coalesced_mmio_buffer(void) } } -#ifdef OBSOLETE_KVM_IMPL - static void do_kvm_cpu_synchronize_state(void *_env) { CPUState *env = _env; @@ -927,6 +929,8 @@ void kvm_cpu_synchronize_post_init(CPUState *env) env->kvm_vcpu_dirty = 0; } +#ifdef OBSOLETE_KVM_IMPL + int kvm_cpu_exec(CPUState *env) { struct kvm_run *run = env->kvm_run; @@ -1137,10 +1141,6 @@ void kvm_setup_guest_memory(void *start, size_t size) } #ifdef KVM_CAP_SET_GUEST_DEBUG -#ifndef OBSOLETE_KVM_IMPL -#define run_on_cpu on_vcpu -#endif /* !OBSOLETE_KVM_IMPL */ - struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(CPUState *env, target_ulong pc) { diff --git a/qemu-kvm.c b/qemu-kvm.c index 508580e..d65ff67 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -1097,35 +1097,6 @@ void on_vcpu(CPUState *env, void (*func)(void *data), void *data) } } -static void do_kvm_cpu_synchronize_state(void *_env) -{ - CPUState *env = _env; - - if (!env->kvm_vcpu_dirty) { - kvm_arch_get_registers(env); - env->kvm_vcpu_dirty = 1; - } -} - -void kvm_cpu_synchronize_state(CPUState *env) -{ - if (!env->kvm_vcpu_dirty) { - on_vcpu(env, do_kvm_cpu_synchronize_state, env); - } -} - -void kvm_cpu_synchronize_post_reset(CPUState *env) -{ - kvm_arch_put_registers(env, KVM_PUT_RESET_STATE); - env->kvm_vcpu_dirty = 0; -} - -void kvm_cpu_synchronize_post_init(CPUState *env) -{ - kvm_arch_put_registers(env, KVM_PUT_FULL_STATE); - env->kvm_vcpu_dirty = 0; -} - static void inject_interrupt(void *data) { cpu_interrupt(current_env, (long) data); -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html