qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/2] QEMU kvm: Add support to get/set vcpu unhal


From: Raghavendra K T
Subject: Re: [Qemu-devel] [PATCH 2/2] QEMU kvm: Add support to get/set vcpu unhalt msr to aid migration
Date: Fri, 23 Mar 2012 18:37:42 +0530
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1

On 03/23/2012 02:27 PM, Jan Kiszka wrote:
On 2012-03-23 09:23, Raghavendra K T wrote:
From: Raghavendra K T<address@hidden>

MSR_KVM_PV_UNHALT tells whether vcpu is unhalted, which needs to be
used during migration.

Err, and where is it actually saved to/restored from the vmstate? You
are lacking an extension of the CPU vmstate, preferably via a substate.
See e.g. cpu/async_pf_msr.


Please let me know whether adding below patch make it complete. Or did
I miss something else ?

---
diff --git a/target-i386/machine.c b/target-i386/machine.c
index a8be058..c51d8d1 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -279,6 +279,13 @@ static bool async_pf_msr_needed(void *opaque)
     return cpu->async_pf_en_msr != 0;
 }

+static bool pv_unhalt_msr_needed(void *opaque)
+{
+    CPUX86State *cpu = opaque;
+
+    return cpu->pv_unhalt_msr != 0;
+}
+
 static const VMStateDescription vmstate_async_pf_msr = {
     .name = "cpu/async_pf_msr",
     .version_id = 1,
@@ -290,6 +297,17 @@ static const VMStateDescription vmstate_async_pf_msr = {
     }
 };

+static const VMStateDescription vmstate_pv_unhalt_msr = {
+    .name = "cpu/pv_unhalt_msr",
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .minimum_version_id_old = 1,
+    .fields      = (VMStateField []) {
+        VMSTATE_UINT64(pv_unhalt_msr, CPUX86State),
+        VMSTATE_END_OF_LIST()
+    }
+};
+
 static bool fpop_ip_dp_needed(void *opaque)
 {
     CPUX86State *env = opaque;
@@ -462,6 +480,9 @@ static const VMStateDescription vmstate_cpu = {
         }, {
             .vmsd = &vmstate_msr_ia32_misc_enable,
             .needed = misc_enable_needed,
+        }, {
+            .vmsd = &vmstate_pv_unhalt_msr,
+            .needed = pv_unhalt_msr_needed,
         } , {
             /* empty */
         }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]