From: Paolo Bonzini Subject: Re: [PATCH V4 9/15] KVM: Add flush_link and parent_pte in the struct kvm_mmu_page Date: Mon, 15 Oct 2018 12:12:07 +0200 Message-ID: <638de1c3-0efd-9319-4dcb-86c3ac88ebf3@redhat.com> References: <20181013145406.4911-1-Tianyu.Lan@microsoft.com> <20181013145406.4911-10-Tianyu.Lan@microsoft.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: sthemmin@microsoft.com, kvm@vger.kernel.org, rkrcmar@redhat.com, haiyangz@microsoft.com, x86@kernel.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, michael.h.kelley@microsoft.com, mingo@redhat.com, hpa@zytor.com, Lan Tianyu , tglx@linutronix.de, vkuznets@redhat.com To: lantianyu1986@gmail.com Return-path: In-Reply-To: <20181013145406.4911-10-Tianyu.Lan@microsoft.com> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" List-Id: kvm.vger.kernel.org On 13/10/2018 16:54, lantianyu1986@gmail.com wrote: > From: Lan Tianyu > > PV EPT tlb flush function will accept a list of flush ranges and > use struct kvm_mmu_page as the list entry. > > Signed-off-by: Lan Tianyu > --- > arch/x86/include/asm/kvm_host.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h > index 19985c602ed6..8279235285f8 100644 > --- a/arch/x86/include/asm/kvm_host.h > +++ b/arch/x86/include/asm/kvm_host.h > @@ -316,6 +316,7 @@ struct kvm_rmap_head { > > struct kvm_mmu_page { > struct list_head link; > + struct list_head flush_link; This can be an hlist. However, you are not documenting what's the locking here. There are many places in which KVM does a "cond_resched_lock(&vcpu->kvm->mmu_lock);" and you need to explain how flush_link is not live across that. I would start from a simpler patch that just uses the list-based flush in kvm_mmu_commit_zap_page, where you already have the list of things to flush as invalid_list. > struct hlist_node hash_link; > bool unsync; > > Also this is not adding parent_pte, so the subject is incorrect. Paolo