History

x86/kvm/hyper-v: remove stale evmcs_already_enabled check from nested_enable_evmcs()

In nested_enable_evmcs() evmcs_already_enabled check doesn't really do anything: controls are already sanitized and we return '0' regardless. Just drop the check.

Vitaly Kuznetsov committed 6 years ago

Commit de9bf4d1 parent de761ea1 file · +0 −5Browse files

Unified · Split

arch/x86/kvm/vmx/evmcs.c+0−5
@@ -350,17 +350,12 @@ int nested_enable_evmcs(struct kvm_vcpu *vcpu, · 349 unmodified lines
350350 uint16_t *vmcs_version)
351351 {
352352 struct vcpu_vmx *vmx = to_vmx(vcpu);
353− bool evmcs_already_enabled = vmx->nested.enlightened_vmcs_enabled;
354353
355354 vmx->nested.enlightened_vmcs_enabled = true;
356355
357356 if (vmcs_version)
358357 *vmcs_version = nested_get_evmcs_version(vcpu);
359358
360− /* We don't support disabling the feature for simplicity. */
361− if (evmcs_already_enabled)
362− return 0;
363−
364359 vmx->nested.msrs.pinbased_ctls_high &= ~EVMCS1_UNSUPPORTED_PINCTRL;
365360 vmx->nested.msrs.entry_ctls_high &= ~EVMCS1_UNSUPPORTED_VMENTRY_CTRL;
366361 vmx->nested.msrs.exit_ctls_high &= ~EVMCS1_UNSUPPORTED_VMEXIT_CTRL;