]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-5.0/kvm-vmx-fix-typos-in-vmentry-vmexit-control-setting.patch
Linux 4.19.41
[thirdparty/kernel/stable-queue.git] / queue-5.0 / kvm-vmx-fix-typos-in-vmentry-vmexit-control-setting.patch
1 From d92935979adba274b1099e67b7f713f6d8413121 Mon Sep 17 00:00:00 2001
2 From: Yu Zhang <yu.c.zhang@linux.intel.com>
3 Date: Thu, 31 Jan 2019 11:26:39 +0800
4 Subject: kvm: vmx: Fix typos in vmentry/vmexit control setting
5
6 From: Yu Zhang <yu.c.zhang@linux.intel.com>
7
8 commit d92935979adba274b1099e67b7f713f6d8413121 upstream.
9
10 Previously, 'commit f99e3daf94ff ("KVM: x86: Add Intel PT
11 virtualization work mode")' work mode' offered framework
12 to support Intel PT virtualization. However, the patch has
13 some typos in vmx_vmentry_ctrl() and vmx_vmexit_ctrl(), e.g.
14 used wrong flags and wrong variable, which will cause the
15 VM entry failure later.
16
17 Fixes: 'commit f99e3daf94ff ("KVM: x86: Add Intel PT virtualization work mode")'
18 Signed-off-by: Yu Zhang <yu.c.zhang@linux.intel.com>
19 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21
22 ---
23 arch/x86/kvm/vmx/vmx.h | 8 +++++---
24 1 file changed, 5 insertions(+), 3 deletions(-)
25
26 --- a/arch/x86/kvm/vmx/vmx.h
27 +++ b/arch/x86/kvm/vmx/vmx.h
28 @@ -444,7 +444,8 @@ static inline u32 vmx_vmentry_ctrl(void)
29 {
30 u32 vmentry_ctrl = vmcs_config.vmentry_ctrl;
31 if (pt_mode == PT_MODE_SYSTEM)
32 - vmentry_ctrl &= ~(VM_EXIT_PT_CONCEAL_PIP | VM_EXIT_CLEAR_IA32_RTIT_CTL);
33 + vmentry_ctrl &= ~(VM_ENTRY_PT_CONCEAL_PIP |
34 + VM_ENTRY_LOAD_IA32_RTIT_CTL);
35 /* Loading of EFER and PERF_GLOBAL_CTRL are toggled dynamically */
36 return vmentry_ctrl &
37 ~(VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL | VM_ENTRY_LOAD_IA32_EFER);
38 @@ -454,9 +455,10 @@ static inline u32 vmx_vmexit_ctrl(void)
39 {
40 u32 vmexit_ctrl = vmcs_config.vmexit_ctrl;
41 if (pt_mode == PT_MODE_SYSTEM)
42 - vmexit_ctrl &= ~(VM_ENTRY_PT_CONCEAL_PIP | VM_ENTRY_LOAD_IA32_RTIT_CTL);
43 + vmexit_ctrl &= ~(VM_EXIT_PT_CONCEAL_PIP |
44 + VM_EXIT_CLEAR_IA32_RTIT_CTL);
45 /* Loading of EFER and PERF_GLOBAL_CTRL are toggled dynamically */
46 - return vmcs_config.vmexit_ctrl &
47 + return vmexit_ctrl &
48 ~(VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL | VM_EXIT_LOAD_IA32_EFER);
49 }
50