Skip to content

Commit 1dc6432

Browse files
committed
KVM: nVMX: Remove explicit filtering of GUEST_INTR_STATUS from shadow VMCS fields
Drop KVM's filtering of GUEST_INTR_STATUS when generating the shadow VMCS bitmap now that KVM drops GUEST_INTR_STATUS from the set of supported vmcs12 fields if the field isn't supported by hardware, and initialization of the shadow VMCS fields omits unsupported vmcs12 fields. Note, there is technically a small functional change here, as the vmcs12 filtering only requires support for Virtual Interrupt Delivery, whereas the shadow VMCS code being removed required "full" APICv support, i.e. required Virtual Interrupt Delivery *and* APIC Register Virtualizaton *and* Posted Interrupt support. Opportunistically tweak the comment to more precisely explain why the PML and VMX preemption timer fields need to be explicitly checked. Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com> Link: https://patch.msgid.link/20260115173427.716021-5-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 5fdf86e commit 1dc6432

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

arch/x86/kvm/vmx/nested.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,10 @@ static void init_vmcs_shadow_fields(void)
118118
continue;
119119

120120
/*
121-
* PML and the preemption timer can be emulated, but the
122-
* processor cannot vmwrite to fields that don't exist
123-
* on bare metal.
121+
* KVM emulates PML and the VMX preemption timer irrespective
122+
* of hardware support, but shadowing their related VMCS fields
123+
* requires hardware support as the CPU will reject VMWRITEs to
124+
* fields that don't exist.
124125
*/
125126
switch (field) {
126127
case GUEST_PML_INDEX:
@@ -131,10 +132,6 @@ static void init_vmcs_shadow_fields(void)
131132
if (!cpu_has_vmx_preemption_timer())
132133
continue;
133134
break;
134-
case GUEST_INTR_STATUS:
135-
if (!cpu_has_vmx_apicv())
136-
continue;
137-
break;
138135
default:
139136
break;
140137
}

0 commit comments

Comments
 (0)