]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-5.1/kvm-nvmx-use-correct-clean-fields-when-copying-from-.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / queue-5.1 / kvm-nvmx-use-correct-clean-fields-when-copying-from-.patch
1 From 7f857d66ce1b19123ba54ed2434ed67b0f39d154 Mon Sep 17 00:00:00 2001
2 From: Vitaly Kuznetsov <vkuznets@redhat.com>
3 Date: Thu, 13 Jun 2019 13:35:02 +0200
4 Subject: KVM: nVMX: use correct clean fields when copying from eVMCS
5
6 [ Upstream commit f9bc5227652df4900eff12a9b8b38e9a8c7c78ea ]
7
8 Unfortunately, a couple of mistakes were made while implementing
9 Enlightened VMCS support, in particular, wrong clean fields were
10 used in copy_enlightened_to_vmcs12():
11 - exception_bitmap is covered by CONTROL_EXCPN;
12 - vm_exit_controls/pin_based_vm_exec_control/secondary_vm_exec_control
13 are covered by CONTROL_GRP1.
14
15 Fixes: 945679e301ea0 ("KVM: nVMX: add enlightened VMCS state")
16 Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
17 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
18 Signed-off-by: Sasha Levin <sashal@kernel.org>
19 ---
20 arch/x86/kvm/vmx/nested.c | 4 ++--
21 1 file changed, 2 insertions(+), 2 deletions(-)
22
23 diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
24 index 5fa0c17d0b41..4ca834d22169 100644
25 --- a/arch/x86/kvm/vmx/nested.c
26 +++ b/arch/x86/kvm/vmx/nested.c
27 @@ -1404,7 +1404,7 @@ static int copy_enlightened_to_vmcs12(struct vcpu_vmx *vmx)
28 }
29
30 if (unlikely(!(evmcs->hv_clean_fields &
31 - HV_VMX_ENLIGHTENED_CLEAN_FIELD_CONTROL_PROC))) {
32 + HV_VMX_ENLIGHTENED_CLEAN_FIELD_CONTROL_EXCPN))) {
33 vmcs12->exception_bitmap = evmcs->exception_bitmap;
34 }
35
36 @@ -1444,7 +1444,7 @@ static int copy_enlightened_to_vmcs12(struct vcpu_vmx *vmx)
37 }
38
39 if (unlikely(!(evmcs->hv_clean_fields &
40 - HV_VMX_ENLIGHTENED_CLEAN_FIELD_HOST_GRP1))) {
41 + HV_VMX_ENLIGHTENED_CLEAN_FIELD_CONTROL_GRP1))) {
42 vmcs12->pin_based_vm_exec_control =
43 evmcs->pin_based_vm_exec_control;
44 vmcs12->vm_exit_controls = evmcs->vm_exit_controls;
45 --
46 2.20.1
47