diff options
| author | Vitaly Kuznetsov <vkuznets@redhat.com> | 2019-06-13 07:35:02 -0400 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-06-13 10:05:29 -0400 |
| commit | f9bc5227652df4900eff12a9b8b38e9a8c7c78ea (patch) | |
| tree | d2b83e9138ff67d2627b4256091825b0243b2db2 | |
| parent | f8d221d2e0e1572d0d60174c118e3554d1aa79fa (diff) | |
KVM: nVMX: use correct clean fields when copying from eVMCS
Unfortunately, a couple of mistakes were made while implementing
Enlightened VMCS support, in particular, wrong clean fields were
used in copy_enlightened_to_vmcs12():
- exception_bitmap is covered by CONTROL_EXCPN;
- vm_exit_controls/pin_based_vm_exec_control/secondary_vm_exec_control
are covered by CONTROL_GRP1.
Fixes: 945679e301ea0 ("KVM: nVMX: add enlightened VMCS state")
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| -rw-r--r-- | arch/x86/kvm/vmx/nested.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c index 1032f068f0b9..d3940da3d435 100644 --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c | |||
| @@ -1397,7 +1397,7 @@ static int copy_enlightened_to_vmcs12(struct vcpu_vmx *vmx) | |||
| 1397 | } | 1397 | } |
| 1398 | 1398 | ||
| 1399 | if (unlikely(!(evmcs->hv_clean_fields & | 1399 | if (unlikely(!(evmcs->hv_clean_fields & |
| 1400 | HV_VMX_ENLIGHTENED_CLEAN_FIELD_CONTROL_PROC))) { | 1400 | HV_VMX_ENLIGHTENED_CLEAN_FIELD_CONTROL_EXCPN))) { |
| 1401 | vmcs12->exception_bitmap = evmcs->exception_bitmap; | 1401 | vmcs12->exception_bitmap = evmcs->exception_bitmap; |
| 1402 | } | 1402 | } |
| 1403 | 1403 | ||
| @@ -1437,7 +1437,7 @@ static int copy_enlightened_to_vmcs12(struct vcpu_vmx *vmx) | |||
| 1437 | } | 1437 | } |
| 1438 | 1438 | ||
| 1439 | if (unlikely(!(evmcs->hv_clean_fields & | 1439 | if (unlikely(!(evmcs->hv_clean_fields & |
| 1440 | HV_VMX_ENLIGHTENED_CLEAN_FIELD_HOST_GRP1))) { | 1440 | HV_VMX_ENLIGHTENED_CLEAN_FIELD_CONTROL_GRP1))) { |
| 1441 | vmcs12->pin_based_vm_exec_control = | 1441 | vmcs12->pin_based_vm_exec_control = |
| 1442 | evmcs->pin_based_vm_exec_control; | 1442 | evmcs->pin_based_vm_exec_control; |
| 1443 | vmcs12->vm_exit_controls = evmcs->vm_exit_controls; | 1443 | vmcs12->vm_exit_controls = evmcs->vm_exit_controls; |
