[PATCH 01/19] qemu-kvm: Switch to upstream mp_state functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>

They are now equivalent to qemu-kvm's version (minus the obsolete
feature check).

Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>
---
 qemu-kvm-x86.c    |   40 ++--------------------------------------
 target-i386/kvm.c |    2 --
 2 files changed, 2 insertions(+), 40 deletions(-)

diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
index d37f217..26ac852 100644
--- a/qemu-kvm-x86.c
+++ b/qemu-kvm-x86.c
@@ -546,42 +546,6 @@ int kvm_arch_qemu_create_context(void)
     return 0;
 }
 
-static void kvm_arch_save_mpstate(CPUState *env)
-{
-#ifdef KVM_CAP_MP_STATE
-    int r;
-    struct kvm_mp_state mp_state;
-
-    r = kvm_get_mpstate(env, &mp_state);
-    if (r < 0) {
-        env->mp_state = -1;
-    } else {
-        env->mp_state = mp_state.mp_state;
-        if (kvm_irqchip_in_kernel()) {
-            env->halted = (env->mp_state == KVM_MP_STATE_HALTED);
-        }
-    }
-#else
-    env->mp_state = -1;
-#endif
-}
-
-static void kvm_arch_load_mpstate(CPUState *env)
-{
-#ifdef KVM_CAP_MP_STATE
-    struct kvm_mp_state mp_state;
-
-    /*
-     * -1 indicates that the host did not support GET_MP_STATE ioctl,
-     *  so don't touch it.
-     */
-    if (env->mp_state != -1) {
-        mp_state.mp_state = env->mp_state;
-        kvm_set_mpstate(env, &mp_state);
-    }
-#endif
-}
-
 #define XSAVE_CWD_RIP     2
 #define XSAVE_CWD_RDP     4
 #define XSAVE_MXCSR       6
@@ -609,7 +573,7 @@ void kvm_arch_load_regs(CPUState *env, int level)
     }
 
     if (level >= KVM_PUT_RESET_STATE) {
-        kvm_arch_load_mpstate(env);
+        kvm_put_mp_state(env);
         kvm_load_lapic(env);
     }
     if (level == KVM_PUT_FULL_STATE) {
@@ -643,7 +607,7 @@ void kvm_arch_save_regs(CPUState *env)
         perror("kvm_get_msrs FAILED");
     }
 
-    kvm_arch_save_mpstate(env);
+    kvm_get_mp_state(env);
     kvm_save_lapic(env);
     kvm_get_vcpu_events(env);
     kvm_get_debugregs(env);
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 48d4f97..7974e62 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -1280,7 +1280,6 @@ static int kvm_get_msrs(CPUState *env)
     return 0;
 }
 
-#ifdef OBSOLETE_KVM_IMPL
 static int kvm_put_mp_state(CPUState *env)
 {
     struct kvm_mp_state mp_state = { .mp_state = env->mp_state };
@@ -1303,7 +1302,6 @@ static int kvm_get_mp_state(CPUState *env)
     }
     return 0;
 }
-#endif
 
 static int kvm_put_vcpu_events(CPUState *env, int level)
 {
-- 
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


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux