]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.32.12/kvm-vmx-disable-unrestricted-guest-when-ept-disabled.patch
fix up queue-5.15/mm-fix-race-between-__split_huge_pmd_locked-and-gup-.patch
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.12 / kvm-vmx-disable-unrestricted-guest-when-ept-disabled.patch
1 From stefan.bader@canonical.com Wed Apr 7 14:48:04 2010
2 From: Sheng Yang <sheng@linux.intel.com>
3 Date: Fri, 19 Mar 2010 15:47:38 +0100
4 Subject: KVM: VMX: Disable unrestricted guest when EPT disabled
5 To: stable@kernel.org
6 Cc: Marcelo Tosatti <mtosatti@redhat.com>, Avi Kivity <avi@redhat.com>, Gleb Natapov <gleb@redhat.com>
7 Message-ID: <1269010059-25309-11-git-send-email-stefan.bader@canonical.com>
8
9
10 From: Sheng Yang <sheng@linux.intel.com>
11
12 commit 046d87103addc117f0d397196e85189722d4d7de upstream
13
14 Otherwise would cause VMEntry failure when using ept=0 on unrestricted guest
15 supported processors.
16
17 Signed-off-by: Sheng Yang <sheng@linux.intel.com>
18 Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
19 Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
21 ---
22 arch/x86/kvm/vmx.c | 4 +++-
23 1 file changed, 3 insertions(+), 1 deletion(-)
24
25 --- a/arch/x86/kvm/vmx.c
26 +++ b/arch/x86/kvm/vmx.c
27 @@ -2302,8 +2302,10 @@ static int vmx_vcpu_setup(struct vcpu_vm
28 ~SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
29 if (vmx->vpid == 0)
30 exec_control &= ~SECONDARY_EXEC_ENABLE_VPID;
31 - if (!enable_ept)
32 + if (!enable_ept) {
33 exec_control &= ~SECONDARY_EXEC_ENABLE_EPT;
34 + enable_unrestricted_guest = 0;
35 + }
36 if (!enable_unrestricted_guest)
37 exec_control &= ~SECONDARY_EXEC_UNRESTRICTED_GUEST;
38 vmcs_write32(SECONDARY_VM_EXEC_CONTROL, exec_control);