cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-target-i386-kvm-Delete-VMX-migration-blocker-on-vCPU.patch

4ec855
From 9cf495aabeeaf4fdccae83d748a70936e3bf26ab Mon Sep 17 00:00:00 2001
4ec855
From: Paolo Bonzini <pbonzini@redhat.com>
4ec855
Date: Mon, 22 Jul 2019 18:22:07 +0100
4ec855
Subject: [PATCH 26/39] target/i386: kvm: Delete VMX migration blocker on vCPU
4ec855
 init failure
4ec855
4ec855
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
4ec855
Message-id: <20190722182220.19374-6-pbonzini@redhat.com>
4ec855
Patchwork-id: 89624
4ec855
O-Subject: [RHEL-8.1.0 PATCH qemu-kvm v3 05/18] target/i386: kvm: Delete VMX migration blocker on vCPU init failure
4ec855
Bugzilla: 1689269
4ec855
RH-Acked-by: Peter Xu <zhexu@redhat.com>
4ec855
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
4ec855
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
4ec855
4ec855
From: Liran Alon <liran.alon@oracle.com>
4ec855
4ec855
Commit d98f26073beb ("target/i386: kvm: add VMX migration blocker")
4ec855
added migration blocker for vCPU exposed with Intel VMX because QEMU
4ec855
doesn't yet contain code to support migration of nested virtualization
4ec855
workloads.
4ec855
4ec855
However, that commit missed adding deletion of the migration blocker in
4ec855
case init of vCPU failed. Similar to invtsc_mig_blocker. This commit fix
4ec855
that issue.
4ec855
4ec855
Fixes: d98f26073beb ("target/i386: kvm: add VMX migration blocker")
4ec855
Signed-off-by: Liran Alon <liran.alon@oracle.com>
4ec855
Reviewed-by: Maran Wilson <maran.wilson@oracle.com>
4ec855
Message-Id: <20190619162140.133674-2-liran.alon@oracle.com>
4ec855
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4ec855
(cherry picked from commit 6b2341eeea43c00b8e266026cec84d57af1484dc)
4ec855
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
4ec855
---
4ec855
 target/i386/kvm.c | 7 +++++--
4ec855
 1 file changed, 5 insertions(+), 2 deletions(-)
4ec855
4ec855
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
4ec855
index 875412c..8e861a1 100644
4ec855
--- a/target/i386/kvm.c
4ec855
+++ b/target/i386/kvm.c
4ec855
@@ -798,7 +798,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
4ec855
 
4ec855
     r = kvm_arch_set_tsc_khz(cs);
4ec855
     if (r < 0) {
4ec855
-        goto fail;
4ec855
+        return r;
4ec855
     }
4ec855
 
4ec855
     /* vcpu's TSC frequency is either specified by user, or following
4ec855
@@ -1142,7 +1142,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
4ec855
             if (local_err) {
4ec855
                 error_report_err(local_err);
4ec855
                 error_free(invtsc_mig_blocker);
4ec855
-                return r;
4ec855
+                goto fail2;
4ec855
             }
4ec855
             /* for savevm */
4ec855
             vmstate_x86_cpu.unmigratable = 1;
4ec855
@@ -1190,6 +1190,9 @@ int kvm_arch_init_vcpu(CPUState *cs)
4ec855
 
4ec855
  fail:
4ec855
     migrate_del_blocker(invtsc_mig_blocker);
4ec855
+ fail2:
4ec855
+    migrate_del_blocker(vmx_mig_blocker);
4ec855
+
4ec855
     return r;
4ec855
 }
4ec855
 
4ec855
-- 
4ec855
1.8.3.1
4ec855