From: David Hildenbrand Subject: Re: [PATCH] kvm: vmx: Don't use INVVPID when EPT is enabled Date: Thu, 16 Mar 2017 10:25:13 +0100 Message-ID: <6dfde847-9478-28a2-43d4-3fef8aca1f4a@redhat.com> References: <20170315145611.16880-1-jmattson@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: kvm list To: Jim Mattson Return-path: Received: from mx1.redhat.com ([209.132.183.28]:42186 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751204AbdCPJZQ (ORCPT ); Thu, 16 Mar 2017 05:25:16 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 15.03.2017 16:53, Jim Mattson wrote: > Assuming the CPU supports INVEPT by context... > > Things are actually simpler if the nested guest does not use EPT, > because then L1 and L2 share an EP4TA, and the INVEPT invoked by > ept_sync_context will invalidate any cached mappings that either L1 or > L2 might use. > > If the nested guest *does* use EPT, then ept_sync_context will only > invalidate the cached mappings associated with L1 or L2, but not both. > If there is ever a mismatch between vcpu->arch.mmu.root_hpa and > vmx->vpid (i.e. one belongs to L1 and the other belongs to L2), then > the original version of this code would have invalidated the combined > mappings of both L1 and L2, but it still would have invalidated only > the guest-physical mappings associated with the current > vcpu->arch.mmu.root_hpa. > Thanks for the explanation! Complicated stuff, so highly appreciated! Reviewed-by: David Hildenbrand -- Thanks, David