From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: missing kvm smp tlb flush in invlpg Date: Sun, 15 Mar 2009 18:19:58 +0200 Message-ID: <49BD2AAE.1040402@redhat.com> References: <20090312171843.GU27823@random.random> <49BCDA04.1020602@redhat.com> <20090315161642.GH27823@random.random> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Marcelo Tosatti To: Andrea Arcangeli Return-path: Received: from mx2.redhat.com ([66.187.237.31]:53767 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752977AbZCOQUB (ORCPT ); Sun, 15 Mar 2009 12:20:01 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n2FGJxCb019873 for ; Sun, 15 Mar 2009 12:19:59 -0400 In-Reply-To: <20090315161642.GH27823@random.random> Sender: kvm-owner@vger.kernel.org List-ID: Andrea Arcangeli wrote: > On Sun, Mar 15, 2009 at 12:35:48PM +0200, Avi Kivity wrote: > >> Izik pointed out that for invlpg, the guest is responsible for smp tlb >> flushes, and mmu notifiers will protect against pageout. >> > > How will mmu notifier protect against pageout if the spte is already > invalid and removed from the rmapp chain? mmu notifier will search the > rmapp chain and it'll find nothing, it'll do nothing, so then the page > will be freed under the other cpus without no ipi flushing their VT > tlbs. > I mentioned this: > I think we can fix this without taking the hit of the IPI by > - running a local invlpg() > - making need_flush a vm flag instead of a local > - clearing need_flush whenever remote tlbs are flushed > - flushing remote tlbs on an mmu_notifier call when need_flush is set -- error compiling committee.c: too many arguments to function