qemu-devel
[Top][All Lists]
Advanced

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

Re: 5.1.0-rc1 regression: reset fails with kvm and -cpu host


From: Paolo Bonzini
Subject: Re: 5.1.0-rc1 regression: reset fails with kvm and -cpu host
Date: Thu, 23 Jul 2020 15:35:15 +0200

Yes, that seems correct.

Paolo


Il gio 23 lug 2020, 15:26 Vitaly Kuznetsov <vkuznets@redhat.com> ha scritto:
This depends on whether the guest has performed VMXON or not I believe.

Anyways, I *think* the fix will be:

diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 2b6b744..75c2e68 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -3883,7 +3883,7 @@ static int kvm_put_nested_state(X86CPU *cpu)
     } else {
         env->nested_state->flags &= ~KVM_STATE_NESTED_GUEST_MODE;
     }
-    if (env->hflags2 & HF2_GIF_MASK) {
+    if (cpu_has_svm(env) && (env->hflags2 & HF2_GIF_MASK)) {
         env->nested_state->flags |= KVM_STATE_NESTED_GIF_SET;
     } else {
         env->nested_state->flags &= ~KVM_STATE_NESTED_GIF_SET;

As "KVM_STATE_NESTED_GIF_SET" is not relevant to nVMX, this works for me
but let me explore kernel side of this a bit more.

--
Vitaly


reply via email to

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