[Devel] [PATCH vz7.70] kvm: x86: vmx: fix vpid leak

Roman Kagan rkagan at virtuozzo.com
Mon Aug 13 13:17:09 MSK 2018


On Mon, Aug 13, 2018 at 12:57:17PM +0300, Roman Kagan wrote:
> 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: 5c614b3583e7b6dab0c86356fa36c2bcbb8322a0
> Cc: stable at vger.kernel.org
> Signed-off-by: Roman Kagan <rkagan at virtuozzo.com>
> Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
> 
> (cherry picked from commit 020a90f653dd02dbbae389da91f510d5f33984dc)
... on stable/linux-4.9.y
VZ-Bug: #PSBM-86479

> Signed-off-by: Roman Kagan <rkagan at virtuozzo.com>
> ---
>  arch/x86/kvm/vmx.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)

Roman.


More information about the Devel mailing list