Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Sohil Mehta <sohil.mehta@intel.com>
To: <kvm@vger.kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H . Peter Anvin" <hpa@zytor.com>, Xin Li <xin@zytor.com>,
	Shivansh Dhiman <shivansh.dhiman@amd.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Chao Gao <chao.gao@intel.com>,
	Binbin Wu <binbin.wu@linux.intel.com>,
	"Chang S . Bae" <chang.seok.bae@intel.com>,
	"Zhao Liu" <zhao1.liu@intel.com>, <x86@kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Vitaly Kuznetsov <vkuznets@redhat.com>
Subject: Re: [PATCH v2 1/3] KVM: VMX: Support the secondary VM-exit controls
Date: Thu, 3 Dec 2026 13:25:33 -0800	[thread overview]
Message-ID: <5ae2e04d-e8f1-4c8c-ae15-c11e57c4c2dc@intel.com> (raw)
In-Reply-To: <20261203065149.2952509-2-sohil.mehta@intel.com>

+Vitaly

>  arch/x86/include/asm/msr-index.h |  1 +
>  arch/x86/include/asm/vmx.h       |  3 +++
>  arch/x86/kvm/vmx/capabilities.h  |  6 ++++++
>  arch/x86/kvm/vmx/nested.c        |  3 +++
>  arch/x86/kvm/vmx/vmcs.h          |  1 +
>  arch/x86/kvm/vmx/vmx.c           | 25 +++++++++++++++++++++++++
>  arch/x86/kvm/vmx/vmx.h           |  7 ++++++-
>  7 files changed, 45 insertions(+), 1 deletion(-)
> 


Sashiko identified a sanitization item in kvm/vmx/ related to Hyper-V's
eVMCS.

https://lore.kernel.org/all/sashiko-outbox-247271@kernel.org/

The change is just two additional lines and avoids a future pitfall. So,
I plan to add the below diff to this patch. I don't think this warrants
a separate patch, especially since vmexit_2nd_ctrl is defined here.
Please let me know if anyone prefers otherwise.

Changelog update:

Like the tertiary controls, clear the secondary VM-exit controls when
KVM is running on Hyper-V, as eVMCS has no field for them.


diff --git a/arch/x86/kvm/vmx/hyperv_evmcs.h
b/arch/x86/kvm/vmx/hyperv_evmcs.h
index 052b62b8ed8e..99a4be8a2a40 100644
--- a/arch/x86/kvm/vmx/hyperv_evmcs.h
+++ b/arch/x86/kvm/vmx/hyperv_evmcs.h
@@ -106,6 +106,8 @@
 	 VM_EXIT_PT_CONCEAL_PIP |					\
 	 VM_EXIT_CLEAR_IA32_RTIT_CTL)

+#define EVMCS1_SUPPORTED_VMEXIT_2ND_CTRL (0ULL)
+
 #define EVMCS1_SUPPORTED_VMENTRY_CTRL					\
 	(VM_ENTRY_ALWAYSON_WITHOUT_TRUE_MSR |				\
 	 VM_ENTRY_LOAD_DEBUG_CONTROLS |					\
diff --git a/arch/x86/kvm/vmx/vmx_onhyperv.c
b/arch/x86/kvm/vmx/vmx_onhyperv.c
index b9a8b91166d0..56afb372e50d 100644
--- a/arch/x86/kvm/vmx/vmx_onhyperv.c
+++ b/arch/x86/kvm/vmx/vmx_onhyperv.c
@@ -33,4 +33,5 @@ void evmcs_sanitize_exec_ctrls(struct vmcs_config
*vmcs_conf)
 	evmcs_check_vmcs_conf(cpu_based_3rd_exec_ctrl, 3RDEXEC);
 	evmcs_check_vmcs_conf(vmentry_ctrl, VMENTRY_CTRL);
 	evmcs_check_vmcs_conf(vmexit_ctrl, VMEXIT_CTRL);
+	evmcs_check_vmcs_conf(vmexit_2nd_ctrl, VMEXIT_2ND_CTRL);
 }

  parent reply	other threads:[~2026-12-03 21:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03  6:51 [PATCH v2 0/3] KVM: VMX: Support the secondary VM-exit controls Sohil Mehta
2026-12-03  6:51 ` [PATCH v2 1/3] " Sohil Mehta
2026-12-03  7:16   ` sashiko-bot
2026-12-03 13:14   ` Chao Gao
2026-12-03 20:42     ` Sohil Mehta
2026-12-03 21:25   ` Sohil Mehta [this message]
2026-12-03  6:51 ` [PATCH v2 2/3] KVM: VMX: Treat partial support of an entry/exit pair as inconsistent Sohil Mehta
2026-12-03 14:22   ` Binbin Wu
2026-12-03 19:48     ` Sohil Mehta
2026-12-03  6:51 ` [PATCH v2 3/3] KVM: VMX: Dump the secondary VM-exit controls in dump_vmcs() Sohil Mehta
2026-12-03 14:24   ` Binbin Wu
2026-12-03 13:24 ` [PATCH v2 0/3] KVM: VMX: Support the secondary VM-exit controls Chao Gao
2026-12-03 23:16 ` Sohil Mehta

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=5ae2e04d-e8f1-4c8c-ae15-c11e57c4c2dc@intel.com \
    --to=sohil.mehta@intel.com \
    --cc=binbin.wu@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=chang.seok.bae@intel.com \
    --cc=chao.gao@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dwmw@amazon.co.uk \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=shivansh.dhiman@amd.com \
    --cc=tglx@kernel.org \
    --cc=vkuznets@redhat.com \
    --cc=x86@kernel.org \
    --cc=xin@zytor.com \
    --cc=zhao1.liu@intel.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