Yes, that seems correct.

Paolo


Il gio 23 lug 2020, 15:26 Vitaly Kuznetsov <vkuzn...@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