From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Liran Alon <liran.alon@oracle.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [PATCH] x86/kvm/nVMCS: fix VMCLEAR when Enlightened VMCS is in use
Date: Wed, 26 Jun 2019 11:39:38 +0200 [thread overview]
Message-ID: <87k1d8d6sl.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <69274969-E2BE-442C-B2D2-0AF94338C31B@oracle.com>
Liran Alon <liran.alon@oracle.com> writes:
>> On 24 Jun 2019, at 17:16, Vitaly Kuznetsov <vkuznets@redhat.com> wrote:
>>
>>
>> That said I'm ok with dropping nested_release_evmcs() for consistency
>> but we can't just drop 'if (vmptr == vmx->nested.hv_evmcs_vmptr)’.
>
> Right. I meant that we can just change code to:
>
> /* Add relevant comment here as this is not trivial why we do this */
> If (likely(!vmx->nested.enlightened_vmcs_enabled) ||
> nested_enlightened_vmentry(vcpu, &evmptr)) {
>
> if (vmptr == vmx->nested.current_vmptr)
> nested_release_vmcs12(vcpu);
>
> kvm_vcpu_write_guest(…);
> }
>
The change, to my surprise, resulted in a set of L2 guest crashes. After
some debugging I figured out that clean fields is to blame: after
Windows does VMCLEAR it doesn't maintain clean field data before the
next VMLAUNCH - and nested_vmx_handle_enlightened_vmptrld() does nothing
in case evmcs_vmptr stays unchanged (so VMLAUNCH follows VMCLEAR on the
same vCPU). We apparently need to invalidate clean fields data on every
VMLAUCH. This is fix of its own, I'll do more testing and send v2.
--
Vitaly
next prev parent reply other threads:[~2019-06-26 9:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-24 13:30 [PATCH] x86/kvm/nVMCS: fix VMCLEAR when Enlightened VMCS is in use Vitaly Kuznetsov
2019-06-24 13:41 ` Liran Alon
2019-06-24 14:16 ` Vitaly Kuznetsov
2019-06-24 14:45 ` Liran Alon
2019-06-26 9:39 ` Vitaly Kuznetsov [this message]
2019-06-26 12:10 ` Paolo Bonzini
2019-06-25 8:51 ` Vitaly Kuznetsov
2019-06-25 11:01 ` Liran Alon
2019-06-25 11:15 ` Vitaly Kuznetsov
2019-06-25 11:18 ` Liran Alon
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=87k1d8d6sl.fsf@vitty.brq.redhat.com \
--to=vkuznets@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liran.alon@oracle.com \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
/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