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 KVM: x86: move kvm_set_irq_inatomic to legacy device assignment 2015-11-04 16:24:36 +01:00
assigned-dev.h KVM: x86: move device assignment out of kvm_host.h 2014-11-24 16:53:50 +01:00
cpuid.c KVM: x86: disable MPX if host did not enable MPX XSAVE features 2017-07-21 07:44:59 +02:00
cpuid.h kvm: x86: Guest BNDCFGS requires guest MPX support 2017-07-21 07:44:59 +02:00
emulate.c kvm: x86: use correct privilege level for sgdt/sidt/fxsave/fxrstor access 2018-06-16 09:54:27 +02:00
hyperv.c kvm/x86: Hyper-V HV_X64_MSR_VP_RUNTIME support 2015-10-01 15:06:33 +02:00
hyperv.h kvm/x86: added hyper-v crash msrs into kvm hyperv context 2015-07-23 08:27:06 +02:00
i8254.c KVM: i8254: change PIT discard tick policy 2016-04-12 09:08:33 -07:00
i8254.h KVM: move iodev.h from virt/kvm/ to include/kvm 2015-03-26 21:43:12 +00:00
i8259.c KVM: x86: clean/fix memory barriers in irqchip_in_kernel 2015-07-30 16:02:56 +02:00
ioapic.c KVM: x86: ioapic: Preserve read-only values in the redirection table 2018-02-03 17:04:26 +01:00
ioapic.h KVM: x86: Add EOI exit bitmap inference 2015-10-01 15:06:28 +02:00
iommu.c KVM: count number of assigned devices 2015-07-10 13:25:26 +02:00
irq.c KVM: x86: Add support for local interrupt requests from userspace 2015-10-01 15:06:29 +02:00
irq.h KVM: x86: Add support for local interrupt requests from userspace 2015-10-01 15:06:29 +02:00
irq_comm.c KVM: x86: check for pic and ioapic presence before use 2016-12-02 09:09:00 +01:00
Kconfig KVM: add X86_LOCAL_APIC dependency 2018-02-25 11:03:49 +01:00
kvm_cache_regs.h KVM: x86: API changes for SMM support 2015-06-04 16:01:11 +02:00
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 KVM: x86: flush pending lapic jump label updates on module unload 2017-01-19 20:17:19 +01:00
Makefile kvm/x86: move Hyper-V MSR's/hypercall code into hyperv.c file 2015-07-23 08:27:06 +02:00
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 KVM: async_pf: avoid async pf injection when in guest mode 2017-06-14 13:16:21 +02:00
mmu_audit.c Minor merge needed, due to function move. 2015-07-01 10:49:25 -07:00
mmutrace.h tracing: Rename ftrace_event.h to trace_events.h 2015-05-13 14:05:12 -04:00
mtrr.c KVM: MTRR: fix kvm_mtrr_check_gfn_range_consistency page fault 2016-08-20 18:09:17 +02:00
paging_tmpl.h KVM: x86: MMU: fix ubsan index-out-of-range warning 2016-03-03 15:07:29 -08:00
pmu.c KVM: x86/vPMU: Define kvm_pmu_ops to support vPMU function dispatch 2015-06-23 14:12:14 +02:00
pmu.h KVM: x86/vPMU: Define kvm_pmu_ops to support vPMU function dispatch 2015-06-23 14:12:14 +02:00
pmu_amd.c KVM: x86/vPMU: Fix unnecessary signed extension for AMD PERFCTRn 2015-08-11 15:19:41 +02:00
pmu_intel.c KVM: x86/vPMU: fix undefined shift in intel_pmu_refresh() 2017-07-05 14:37:23 +02:00
svm.c x86/speculation: Create spec-ctrl.h to avoid include hell 2018-07-25 10:18:25 +02:00
trace.h KVM: x86: correctly print #AC in traces 2016-01-31 11:28:54 -08:00
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