On Thu, Jun 19, 2014 at 11:17:19AM +0300, Gleb Natapov wrote: > On Wed, Jun 18, 2014 at 08:12:07PM -0300, mtosatti@xxxxxxxxxx wrote: > > Reload remote vcpus MMU from GET_DIRTY_LOG codepath, before > > deleting a pinned spte. > > > > Signed-off-by: Marcelo Tosatti <mtosatti@xxxxxxxxxx> > > > > --- > > arch/x86/kvm/mmu.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > Index: kvm.pinned-sptes/arch/x86/kvm/mmu.c > > =================================================================== > > --- kvm.pinned-sptes.orig/arch/x86/kvm/mmu.c 2014-06-13 16:50:50.040140594 -0300 > > +++ kvm.pinned-sptes/arch/x86/kvm/mmu.c 2014-06-13 16:51:05.620104451 -0300 > > @@ -1247,6 +1247,9 @@ > > spte &= ~SPTE_MMU_WRITEABLE; > > spte = spte & ~PT_WRITABLE_MASK; > > > > + if (is_pinned_spte(spte)) > > + mmu_reload_pinned_vcpus(kvm); > > + > Why write protect it at all? mmu_reload_pinned_vcpus() will unprotected it anyway > on the next vmentry. Isn't it better to just report all pinned pages as dirty alway. That was the initial plan, however its awkward to stop vcpus, execute get_dirty_log twice, and have pages marked as dirty on the second execution. That is, it is in "incorrect" to report pages as dirty when they are clean. Moreover, if the number of pinned pages is larger than the dirty threshold to stop VM and migrate, you'll never migrate. If vcpus are in HLT and don't VM-enter immediately, the pages should not be refaulted right away. Do you think the optimization is worthwhile ? -- 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