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. All that mmu notifier does is to protect against pageout until the mmu_lock is released. So that you can send a single ipi to the other physical cpus after a flood of rmap_remove, without having to do the array of pages like arch/x86/include/asm/tlb.h. This because if the VM was in the process of swapping out that page while we were inside the mmu_lock protected critical section, the mmu notifier will force the swap path to take the vcpu->kvm->mmu_lock first for each kvm instance registered with the mmu notifier. But after taking that lock, the mmu notifier will do nothing if rmap_remove already run before the mmu_lock was released (like in this case). The mmu_lock is just to stop temporarily the swap, so that it waits the ipi is delivered to all cpus before proceeding freeing the page. It's up to the kvm code that takes the lock to flush the tlb of any other running guest, before it is allowed to release the mmu_lock as far as I can tell. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html