Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Alexandru Matei <alexandru.matei@uipath.com>
Cc: stable@vger.kernel.org,
	Mihai Petrisor <mihai.petrisor@uipath.com>,
	Viorel Canja <viorel.canja@uipath.com>
Subject: Re: [PATCH 5.15.y 1/3] KVM: nVMX: Don't use Enlightened MSR Bitmap for L3
Date: Wed, 15 Mar 2023 09:01:13 +0100	[thread overview]
Message-ID: <ZBF7SQXlCXuxtkAa@kroah.com> (raw)
In-Reply-To: <20230314091953.3041-2-alexandru.matei@uipath.com>

On Tue, Mar 14, 2023 at 11:19:51AM +0200, Alexandru Matei wrote:
> From: Vitaly Kuznetsov <vkuznets@redhat.com>
> 
> commit 250552b925ce400c17d166422fde9bb215958481 upstream.
> 
> When KVM runs as a nested hypervisor on top of Hyper-V it uses Enlightened
> VMCS and enables Enlightened MSR Bitmap feature for its L1s and L2s (which
> are actually L2s and L3s from Hyper-V's perspective). When MSR bitmap is
> updated, KVM has to reset HV_VMX_ENLIGHTENED_CLEAN_FIELD_MSR_BITMAP from
> clean fields to make Hyper-V aware of the change. For KVM's L1s, this is
> done in vmx_disable_intercept_for_msr()/vmx_enable_intercept_for_msr().
> MSR bitmap for L2 is build in nested_vmx_prepare_msr_bitmap() by blending
> MSR bitmap for L1 and L1's idea of MSR bitmap for L2. KVM, however, doesn't
> check if the resulting bitmap is different and never cleans
> HV_VMX_ENLIGHTENED_CLEAN_FIELD_MSR_BITMAP in eVMCS02. This is incorrect and
> may result in Hyper-V missing the update.
> 
> The issue could've been solved by calling evmcs_touch_msr_bitmap() for
> eVMCS02 from nested_vmx_prepare_msr_bitmap() unconditionally but doing so
> would not give any performance benefits (compared to not using Enlightened
> MSR Bitmap at all). 3-level nesting is also not a very common setup
> nowadays.
> 
> Don't enable 'Enlightened MSR Bitmap' feature for KVM's L2s (real L3s) for
> now.
> 
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> Message-Id: <20211129094704.326635-2-vkuznets@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---

You did not sign off on this backport (or any of the backports), so I
can't take them sorry.

greg k-h

  reply	other threads:[~2023-03-15  8:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06 16:08 FAILED: patch "[PATCH] KVM: VMX: Fix crash due to uninitialized current_vmcs" failed to apply to 5.15-stable tree gregkh
2023-03-14  9:19 ` [PATCH 5.15.y 0/3] Stable backport for KVM-on-HyperV fix Alexandru Matei
2023-03-14  9:19   ` [PATCH 5.15.y 1/3] KVM: nVMX: Don't use Enlightened MSR Bitmap for L3 Alexandru Matei
2023-03-15  8:01     ` Greg Kroah-Hartman [this message]
2023-03-15  8:16       ` Alexandru Matei
2023-03-14  9:19   ` [PATCH 5.15.y 2/3] KVM: VMX: Introduce vmx_msr_bitmap_l01_changed() helper Alexandru Matei
2023-03-14  9:19   ` [PATCH 5.15.y 3/3] KVM: VMX: Fix crash due to uninitialized current_vmcs Alexandru Matei

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=ZBF7SQXlCXuxtkAa@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=alexandru.matei@uipath.com \
    --cc=mihai.petrisor@uipath.com \
    --cc=stable@vger.kernel.org \
    --cc=viorel.canja@uipath.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