qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] target/i386: kvm: add VMX and SVM migration blockers
Date: Fri, 16 Nov 2018 17:48:05 +0100	[thread overview]
Message-ID: <20181116164806.26929-1-pbonzini@redhat.com> (raw)

Nested VMX and SVM do not support live migration yet.  Add a blocker
until that is worked out.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/kvm.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index db1f4104b6..3b6fbd3f20 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -860,6 +860,8 @@ static int hyperv_init_vcpu(X86CPU *cpu)
 }
 
 static Error *invtsc_mig_blocker;
+static Error *vmx_mig_blocker;
+static Error *svm_mig_blocker;
 
 #define KVM_MAX_CPUID_ENTRIES  100
 
@@ -1250,6 +1252,29 @@ int kvm_arch_init_vcpu(CPUState *cs)
     if (c) {
         has_msr_feature_control = !!(c->ecx & CPUID_EXT_VMX) ||
                                   !!(c->ecx & CPUID_EXT_SMX);
+
+    }
+
+    if ((env->features[FEAT_1_ECX] & CPUID_EXT_VMX) && !vmx_mig_blocker) {
+        error_setg(&vmx_mig_blocker,
+                   "Nested VMX virtualization does not support live migration yet");
+        r = migrate_add_blocker(vmx_mig_blocker, &local_err);
+        if (local_err) {
+            error_report_err(local_err);
+            error_free(vmx_mig_blocker);
+            return r;
+        }
+    }
+
+    if ((env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_SVM) && !svm_mig_blocker) {
+        error_setg(&svm_mig_blocker,
+                   "Nested SVM virtualization does not support live migration yet");
+        r = migrate_add_blocker(svm_mig_blocker, &local_err);
+        if (local_err) {
+            error_report_err(local_err);
+            error_free(svm_mig_blocker);
+            return r;
+        }
     }
 
     if (env->mcg_cap & MCG_LMCE_P) {
-- 
2.19.1

             reply	other threads:[~2018-11-16 16:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-16 16:48 Paolo Bonzini [this message]
2018-11-16 16:48 ` [Qemu-devel] [PATCH] migration: savevm: consult migration blockers Paolo Bonzini
2018-11-16 17:12   ` Dr. David Alan Gilbert
2018-11-19 18:20     ` Paolo Bonzini
2018-11-17  2:15   ` Wang, Wei W
2018-11-16 16:56 ` [Qemu-devel] [PATCH] target/i386: kvm: add VMX and SVM " Dr. David Alan Gilbert
2018-11-19 18:21   ` Paolo Bonzini

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=20181116164806.26929-1-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).