From mboxrd@z Thu Jan 1 00:00:00 1970 From: Izik Eidus Subject: Re: [PATCH 2/2] kvm: change the dirty page tracking to work with dirty bity Date: Thu, 11 Jun 2009 14:27:46 +0300 Message-ID: <4A30EA32.7010000@redhat.com> References: <1244651005-18322-1-git-send-email-ieidus@redhat.com> <1244651005-18322-2-git-send-email-ieidus@redhat.com> <1244651005-18322-3-git-send-email-ieidus@redhat.com> <20090610204227.GA12682@amt.cnet> <4A30484E.1040708@redhat.com> <20090611010413.GB15350@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, avi@redhat.com To: Marcelo Tosatti Return-path: Received: from mx2.redhat.com ([66.187.237.31]:55878 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756122AbZFKL1k (ORCPT ); Thu, 11 Jun 2009 07:27:40 -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 n5BBRhYc016863 for ; Thu, 11 Jun 2009 07:27:43 -0400 In-Reply-To: <20090611010413.GB15350@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: Marcelo Tosatti wrote: > > > What i'm saying is with shadow and NPT (i believe) you can mark a spte > writable but not dirty, which gives you the ability to know whether > certain pages have been dirtied. > Isnt this what this patch is doing? > Should be ok todo that with shadow, as long as the gpte is already > dirty, right? So: > > - guest create writable pte > - guest write fault on that pte > - vmexit > - write dirty bit to gpte > - create writable spte > -> > > from this point on, you can create a writable spte which is not dirtied, > and use the dirty bit to know whether a page has been written to? > > And unless i'm mistaken NPT gives you that for free since the hw updates > the spte with accessed/dirty bits. > Yes > Maybe this is a stupid idea. > I dont sure if i am missing it, or if this what i tried to do with this patch. > >>> * EPT violations do no transfer fault information to the page fault >>> handler, but its available (there's a vm-exit field). >>> >>> >> EPT in this patch, run as before, (using page faults with >> mark_page_dirty() inside set_spte()) >> > > Right, i was talking about gup(write=0) when guest fault is read-only to > relief KSM of wrprotecting host ptes, but that is quite different. > > >>> >>> >>>> r = -ENOMEM; >>>> @@ -1279,6 +1282,7 @@ int kvm_get_dirty_log(struct kvm *kvm, >>>> if (!memslot->dirty_bitmap) >>>> goto out; >>>> + kvm_arch_get_dirty_log(kvm, memslot); >>>> n = ALIGN(memslot->npages, BITS_PER_LONG) / 8; >>>> for (i = 0; !any && i < n/sizeof(long); ++i) >>>> -- >>>> 1.5.6.5 >>>> >>>> -- >>>> To unsubscribe from this list: send the line "unsubscribe kvm" in >>>> the body of a message to majordomo@vger.kernel.org >>>> More majordomo info at http://vger.kernel.org/majordomo-info.html >>>> >>>> >> Thanks :). >>