Pablo Greco e6a3ae
From aaf60450da6b0bc4723028aeab9ced75ee03111b Mon Sep 17 00:00:00 2001
Pablo Greco e6a3ae
From: Paolo Bonzini <pbonzini@redhat.com>
Pablo Greco e6a3ae
Date: Mon, 22 Jul 2019 18:22:20 +0100
Pablo Greco e6a3ae
Subject: [PATCH 39/39] i386/kvm: Do not sync nested state during runtime
Pablo Greco e6a3ae
Pablo Greco e6a3ae
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
Pablo Greco e6a3ae
Message-id: <20190722182220.19374-19-pbonzini@redhat.com>
Pablo Greco e6a3ae
Patchwork-id: 89635
Pablo Greco e6a3ae
O-Subject: [RHEL-8.1.0 PATCH qemu-kvm v3 18/18] i386/kvm: Do not sync nested state during runtime
Pablo Greco e6a3ae
Bugzilla: 1689269
Pablo Greco e6a3ae
RH-Acked-by: Peter Xu <zhexu@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
From: Jan Kiszka <jan.kiszka@siemens.com>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Writing the nested state e.g. after a vmport access can invalidate
Pablo Greco e6a3ae
important parts of the kernel-internal state, and it is not needed as
Pablo Greco e6a3ae
well. So leave this out from KVM_PUT_RUNTIME_STATE.
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Pablo Greco e6a3ae
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Pablo Greco e6a3ae
Message-Id: <bdd53f40-4e60-f3ae-7ec6-162198214953@siemens.com>
Pablo Greco e6a3ae
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Pablo Greco e6a3ae
(cherry picked from commit 20b25d239ab7a94bb8bff3d0f13a9527ee75cf10)
Pablo Greco e6a3ae
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Pablo Greco e6a3ae
---
Pablo Greco e6a3ae
 target/i386/kvm.c | 10 +++++-----
Pablo Greco e6a3ae
 1 file changed, 5 insertions(+), 5 deletions(-)
Pablo Greco e6a3ae
Pablo Greco e6a3ae
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
Pablo Greco e6a3ae
index 8648f1f..da5f07e 100644
Pablo Greco e6a3ae
--- a/target/i386/kvm.c
Pablo Greco e6a3ae
+++ b/target/i386/kvm.c
Pablo Greco e6a3ae
@@ -3014,12 +3014,12 @@ int kvm_arch_put_registers(CPUState *cpu, int level)
Pablo Greco e6a3ae
 
Pablo Greco e6a3ae
     assert(cpu_is_stopped(cpu) || qemu_cpu_is_self(cpu));
Pablo Greco e6a3ae
 
Pablo Greco e6a3ae
-    ret = kvm_put_nested_state(x86_cpu);
Pablo Greco e6a3ae
-    if (ret < 0) {
Pablo Greco e6a3ae
-        return ret;
Pablo Greco e6a3ae
-    }
Pablo Greco e6a3ae
-
Pablo Greco e6a3ae
     if (level >= KVM_PUT_RESET_STATE) {
Pablo Greco e6a3ae
+        ret = kvm_put_nested_state(x86_cpu);
Pablo Greco e6a3ae
+        if (ret < 0) {
Pablo Greco e6a3ae
+            return ret;
Pablo Greco e6a3ae
+        }
Pablo Greco e6a3ae
+
Pablo Greco e6a3ae
         ret = kvm_put_msr_feature_control(x86_cpu);
Pablo Greco e6a3ae
         if (ret < 0) {
Pablo Greco e6a3ae
             return ret;
Pablo Greco e6a3ae
-- 
Pablo Greco e6a3ae
1.8.3.1
Pablo Greco e6a3ae