All of lore.kernel.org
 help / color / mirror / Atom feed
From: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Avi Kivity <avi@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Alexander Graf <agraf@suse.de>,
	Qemu-devel <qemu-devel@nongnu.org>, KVM <kvm@vger.kernel.org>,
	Anthony Liguori <aliguori@us.ibm.com>,
	Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Subject: Re: [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	[thread overview]
Message-ID: <4F6C759E.8050004@linux.vnet.ibm.com> (raw)
In-Reply-To: <4F6C3AF8.5050802@siemens.com>

On 03/23/2012 02:27 PM, Jan Kiszka wrote:
> On 2012-03-23 09:23, Raghavendra K T wrote:
>> From: Raghavendra K T<raghavendra.kt@linux.vnet.ibm.com>
>>
>> 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 */
          }


WARNING: multiple messages have this Message-ID (diff)
From: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>, KVM <kvm@vger.kernel.org>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Qemu-devel <qemu-devel@nongnu.org>,
	Alexander Graf <agraf@suse.de>, Avi Kivity <avi@redhat.com>,
	Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
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	[thread overview]
Message-ID: <4F6C759E.8050004@linux.vnet.ibm.com> (raw)
In-Reply-To: <4F6C3AF8.5050802@siemens.com>

On 03/23/2012 02:27 PM, Jan Kiszka wrote:
> On 2012-03-23 09:23, Raghavendra K T wrote:
>> From: Raghavendra K T<raghavendra.kt@linux.vnet.ibm.com>
>>
>> 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 */
          }

  parent reply	other threads:[~2012-03-23 13:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-23  8:22 [PATCH 0/2] QEMU kvm: Adding paravirtual spinlock support for x86 Raghavendra K T
2012-03-23  8:22 ` [Qemu-devel] " Raghavendra K T
2012-03-23  8:23 ` [PATCH 1/2] QEMU kvm: Add PV_UNHALT feature support Raghavendra K T
2012-03-23  8:23   ` [Qemu-devel] " Raghavendra K T
2012-03-23  8:23 ` [PATCH 2/2] QEMU kvm: Add support to get/set vcpu unhalt msr to aid migration Raghavendra K T
2012-03-23  8:23   ` [Qemu-devel] " Raghavendra K T
2012-03-23  8:57   ` Jan Kiszka
2012-03-23  8:57     ` [Qemu-devel] " Jan Kiszka
2012-03-23  9:38     ` Raghavendra K T
2012-03-23  9:38       ` [Qemu-devel] " Raghavendra K T
2012-03-23 13:07     ` Raghavendra K T [this message]
2012-03-23 13:07       ` Raghavendra K T

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F6C759E.8050004@linux.vnet.ibm.com \
    --to=raghavendra.kt@linux.vnet.ibm.com \
    --cc=agraf@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vatsa@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.