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.
Unified · Split
| @@ -350,17 +350,12 @@ int nested_enable_evmcs(struct kvm_vcpu *vcpu, · 349 unmodified lines | ||
| 350 | 350 | uint16_t *vmcs_version) |
| 351 | 351 | { |
| 352 | 352 | struct vcpu_vmx *vmx = to_vmx(vcpu); |
| 353 | − bool evmcs_already_enabled = vmx->nested.enlightened_vmcs_enabled; | |
| 354 | 353 | |
| 355 | 354 | vmx->nested.enlightened_vmcs_enabled = true; |
| 356 | 355 | |
| 357 | 356 | if (vmcs_version) |
| 358 | 357 | *vmcs_version = nested_get_evmcs_version(vcpu); |
| 359 | 358 | |
| 360 | − /* We don't support disabling the feature for simplicity. */ | |
| 361 | − if (evmcs_already_enabled) | |
| 362 | − return 0; | |
| 363 | − | |
| 364 | 359 | vmx->nested.msrs.pinbased_ctls_high &= ~EVMCS1_UNSUPPORTED_PINCTRL; |
| 365 | 360 | vmx->nested.msrs.entry_ctls_high &= ~EVMCS1_UNSUPPORTED_VMENTRY_CTRL; |
| 366 | 361 | vmx->nested.msrs.exit_ctls_high &= ~EVMCS1_UNSUPPORTED_VMEXIT_CTRL; |