All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sohil Mehta <sohil.mehta@intel.com>
To: "Chang S. Bae" <chang.seok.bae@intel.com>, <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>,
	Zhao Liu <zhao1.liu@intel.com>, Jon Kohler <jon@nutanix.com>,
	<x86@kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] KVM: VMX: Add support for the secondary VM-exit controls
Date: Wed, 2 Dec 2026 12:45:24 -0800	[thread overview]
Message-ID: <b9d17f89-fb9f-4cb5-82d7-94709b71b0ee@intel.com> (raw)
In-Reply-To: <2f9ae103-99c6-4830-afcd-43715075b86c@intel.com>

On 12/2/2026 10:12 AM, Chang S. Bae wrote:
> On 11/25/2026 6:27 PM, Sohil Mehta wrote:
>> From: "Xin Li (Intel)" <xin@zytor.com>
>>
>> The secondary VM-exit controls are a 64-bit VMCS field for controls that
>> no longer fit in the 32-bit primary field. Bit 31 of the primary VM-exit
>> controls activates them. No feature KVM supports uses any of these
>> controls yet, but the upcoming FRED KVM support is planning to use them.
> 
> This reads more like background explaining what the secondary controls
> are than a description of what the patch actually does, so looks
> misaligned with the guidline in:
> 
>   https://docs.kernel.org/process/maintainer-kvm-x86.html
> 

Yeah, core x86 habits :) I thought the intro paragraph was short enough
that it can be easily skimmed.

>   Changelog
>   ... lead with a short blurb on the actual changes, and then follow up
>   with the context and background.
> 
> Based on what I understood, perhaps something like:
> 
>   Support the new 64-bit secondary VM-exit controls in VMCS
>   configuration and its shadow data. Activate the controls in vmcs01
>   whenever hardware supports them, and copy them into vmcs02.
> 

Sure, I can add a small blurb in the beginning.

> I also think the subject could be simply:
> 
>   KVM: nVMX: Support the secondary VM-exit controls
> 

Why the nVMX? Most of the patch is VMX. It does touch vmcs02, but only
so that L0's own controls stay in effect while an L2 runs. L1 doesn't
see the field yet. So I think this would be more appropriate:

	KVM: VMX: Support the secondary VM-exit controls


> ...
>> Copy the controls into vmcs02 as well. vmcs02 inherits the activation
>> bit from vmcs01, so without the copy it would run with the secondary
>> controls active but empty. That is harmless while every bit is clear.
>> Once a feature sets one, though, L2 would run with it silently off,
>> leaving the host with L2's state after a VM exit.
> 
> Just to clarify: so, you resolved by copying into vmcs02; otherwise, the
> issue there, right?
> 

Yes, that's right. The issue would only happen once a feature sets a
control.


>> +static u64 vmx_get_initial_secondary_vmexit_ctrl(void)
>> +{
>> +    return vmcs_config.vmexit_2nd_ctrl;
>> +}
>> +
> ...
>> +    if (cpu_has_secondary_vmexit_ctrls())
>> +        secondary_vm_exit_controls_set(vmx,
>> vmx_get_initial_secondary_vmexit_ctrl());
> 
> I was wondering back in V10 why the wrapper is necessary without
> any gating there. 


This is mainly to keep it consistent with vmx_get_initial_vmexit_ctrl().
Also, similar to the primary function, the secondary will likely mask
features out in the future. So, adding the wrapper now would avoid the
churn.


> This seems readable to me:
> 
>   secondary_vm_exit_controls_set(vmx, vmcs_config.vmexit_2nd_ctrl);
> 

  reply	other threads:[~2026-12-02 20:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26  2:27 [PATCH 0/3] KVM: VMX: Add support for the secondary VM-exit controls Sohil Mehta
2026-11-26  2:27 ` [PATCH 1/3] " Sohil Mehta
2026-12-02 18:12   ` Chang S. Bae
2026-12-02 20:45     ` Sohil Mehta [this message]
2026-11-26  2:27 ` [PATCH 2/3] KVM: VMX: Treat partial support of an entry/exit pair as inconsistent Sohil Mehta
2026-12-02 18:12   ` Chang S. Bae
2026-12-02 20:46     ` Sohil Mehta
2026-11-26  2:27 ` [PATCH 3/3] KVM: VMX: Dump the secondary VM-exit controls in dump_vmcs() Sohil Mehta
2026-12-02 18:12   ` Chang S. Bae

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=b9d17f89-fb9f-4cb5-82d7-94709b71b0ee@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=jon@nutanix.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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.