Re: [PATCH 1/3] KVM: VMX: Add support for the secondary VM-exit controls
From: Chang S. Bae
Date: Wed Dec 02 2026 - 13:12:38 EST
On 11/25/2026 6:27 PM, Sohil Mehta wrote:
From: "Xin Li (Intel)" <xin@xxxxxxxxx>
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
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.
I also think the subject could be simply:
KVM: nVMX: 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?
+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 seems readable to me:
secondary_vm_exit_controls_set(vmx, vmcs_config.vmexit_2nd_ctrl);
Thanks,
Chang