Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 575b3a2c authored by Wanpeng Li's avatar Wanpeng Li Committed by Radim Krčmář
Browse files

KVM: nVMX: Fix EPT switching advertising



I can use vmxcap tool to observe "EPTP Switching   yes" even if EPT is not
exposed to L1.

EPT switching is advertised unconditionally since it is emulated, however,
it can be treated as an extended feature for EPT and it should not be
advertised if EPT itself is not exposed. This patch fixes it.

Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Cc: Jim Mattson <jmattson@google.com>
Signed-off-by: default avatarWanpeng Li <wanpeng.li@hotmail.com>
Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
parent cc3d967f
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -2842,6 +2842,7 @@ static void nested_vmx_setup_ctls_msrs(struct vcpu_vmx *vmx)
		 * Advertise EPTP switching unconditionally
		 * Advertise EPTP switching unconditionally
		 * since we emulate it
		 * since we emulate it
		 */
		 */
		if (enable_ept)
			vmx->nested.nested_vmx_vmfunc_controls =
			vmx->nested.nested_vmx_vmfunc_controls =
				VMX_VMFUNC_EPTP_SWITCHING;
				VMX_VMFUNC_EPTP_SWITCHING;
	}
	}