android_kernel_oneplus_msm8998/arch/x86/kvm
Roman Kagan 314b46558c kvm: x86: vmx: fix vpid leak
commit 63aff65573d73eb8dda4732ad4ef222dd35e4862 upstream.

VPID for the nested vcpu is allocated at vmx_create_vcpu whenever nested
vmx is turned on with the module parameter.

However, it's only freed if the L1 guest has executed VMXON which is not
a given.

As a result, on a system with nested==on every creation+deletion of an
L1 vcpu without running an L2 guest results in leaking one vpid.  Since
the total number of vpids is limited to 64k, they can eventually get
exhausted, preventing L2 from starting.

Delay allocation of the L2 vpid until VMXON emulation, thus matching its
freeing.

Fixes: 5c614b3583
Cc: stable@vger.kernel.org
Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-06 16:24:42 +02:00
..
assigned-dev.c
assigned-dev.h
cpuid.c
cpuid.h
emulate.c kvm: x86: use correct privilege level for sgdt/sidt/fxsave/fxrstor access 2018-06-16 09:54:27 +02:00
hyperv.c
hyperv.h
i8254.c
i8254.h
i8259.c
ioapic.c KVM: x86: ioapic: Preserve read-only values in the redirection table 2018-02-03 17:04:26 +01:00
ioapic.h
iommu.c
irq.c
irq.h
irq_comm.c
Kconfig KVM: add X86_LOCAL_APIC dependency 2018-02-25 11:03:49 +01:00
kvm_cache_regs.h
lapic.c KVM: lapic: stop advertising DIRECTED_EOI when in-kernel IOAPIC is in use 2018-05-30 07:49:11 +02:00
lapic.h
Makefile
mmu.c KVM/x86: Reduce retpoline performance impact in slot_handle_level_range(), by always inlining iterator helper methods 2018-02-22 15:44:59 +01:00
mmu.h
mmu_audit.c
mmutrace.h
mtrr.c
paging_tmpl.h
pmu.c
pmu.h
pmu_amd.c
pmu_intel.c
svm.c x86/speculation: Create spec-ctrl.h to avoid include hell 2018-07-25 10:18:25 +02:00
trace.h
tss.h
vmx.c kvm: x86: vmx: fix vpid leak 2018-08-06 16:24:42 +02:00
x86.c kvm: x86: use correct privilege level for sgdt/sidt/fxsave/fxrstor access 2018-06-16 09:54:27 +02:00
x86.h KVM: x86: pass kvm_vcpu to kvm_read_guest_virt and kvm_write_guest_virt_system 2018-06-16 09:54:26 +02:00