mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Manuel Andreas <manuel.andreas@tum.de>
To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	pbonzini@redhat.com, Sean Christopherson <seanjc@google.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>
Subject: [PATCH] x86/hyper-v: Don't WARN on VM-Enter if eVMCS sees VMFUNC[63:32] != 0
Date: Tue, 20 Oct 2026 21:34:51 +0200	[thread overview]
Message-ID: <f1f39118-2e1b-476b-9a84-ef7d56412bdc@tum.de> (raw)

With the necessary Hyper-V extensions for eVMCS enabled, an L1 guest can
trivially fire a WARN_ON_ONCE in nested_evmcs_check_controls.
While vmcs12->vm_function_control is technically already sanity checked in
nested.c, that check is only performed if VMFUNC functionality is at all enabled
in the secondary processor controls of vmcs12.

vmcs12->vm_function_control seems to only be utilized in the handling
of a VMFUNC initiated from L2, but here a function other than 0 will
just end up in a failure case either way, regardless of whether or not
it is permissive in vmcs12->vm_function_control.
Therefore, the check has no reason to trigger a warning at all.

This patch simply removes the WARN_ON_ONCE and keeps the check.

Fixes: 3ff8a13d41b2 ("KVM: nVMX: WARN once and fail VM-Enter if eVMCS sees VMFUNC[63:32] != 0")
Signed-off-by: Manuel Andreas <manuel.andreas@tum.de>
---
 arch/x86/kvm/vmx/hyperv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/vmx/hyperv.c b/arch/x86/kvm/vmx/hyperv.c
index fa41d036acd4..008a06924eb4 100644
--- a/arch/x86/kvm/vmx/hyperv.c
+++ b/arch/x86/kvm/vmx/hyperv.c
@@ -186,7 +186,7 @@ int nested_evmcs_check_controls(struct vmcs12 *vmcs12)
 	 * controls in bits 63:32, i.e. dropping those bits on the consistency
 	 * check is intentional.
 	 */
-	if (WARN_ON_ONCE(vmcs12->vm_function_control >> 32))
+	if (vmcs12->vm_function_control >> 32)
 		return -EINVAL;
 
 	if (CC(!nested_evmcs_is_valid_controls(EVMCS_VMFUNC,
-- 
2.56.0


             reply	other threads:[~2026-10-20 19:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20 19:34 Manuel Andreas [this message]
2026-10-20 19:36 ` Manuel Andreas
2026-10-20 22:56 ` Sean Christopherson

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=f1f39118-2e1b-476b-9a84-ef7d56412bdc@tum.de \
    --to=manuel.andreas@tum.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=vkuznets@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

all inboxes | Powered by JetHome®