This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-devel] Tracking guest pages modified by qemu-dm / backend

To: AP <apxeng@xxxxxxxxx>
Subject: Re: [Xen-devel] Tracking guest pages modified by qemu-dm / backend
From: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Date: Fri, 24 Jun 2011 09:40:10 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 24 Jun 2011 01:41:05 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <BANLkTi=xKF79x-5pg2us7cjZ9-K6kzKfgA@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <BANLkTimiagS5cXj0nOPkCzxMzZMaZH724w@xxxxxxxxxxxxxx> <20110622084953.GR17634@xxxxxxxxxxxxxxxxxxxxxxx> <BANLkTi=xKF79x-5pg2us7cjZ9-K6kzKfgA@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.21 (2010-09-15)
At 11:06 -0700 on 23 Jun (1308827188), AP wrote:
> On Wed, Jun 22, 2011 at 1:49 AM, Tim Deegan <Tim.Deegan@xxxxxxxxxx> wrote:
> > Hi,
> >
> > At 15:43 -0700 on 21 Jun (1308671006), AP wrote:
> >> Consider an HVM domain with EPT. When qemu-dm, backend or any other
> >> device model modifies DomU memory (like on a disk read or packet
> >> received), how does Xen track the pages that have been modified? For
> >> example, when an DomU is being migrated while IO is occurring.
> >
> > Backends use grant tables to map guest memory; the granted pages are
> > marked dirty when the backend disconnects.  Qemu-dm uses the
> > HVMOP_modified memory hypercall to tell Xen that it's written to
> > the guest's memory.
> From what I see for EPT/HAP, log dirty is turned on only during domain
> save.

It's also used to track just the virtual framebuffer so qemu can avoid
having to compute which parts of the screen to send over VNC. 

But for general memory it's only used during save, because there's no
need for it otherwise.  If you're confused about that maybe you should
read the original paper on Xen live migration:

> Is that true or am I missing something. Plus how does dirty
> tracking occur with EPT since those tables don't have a dirty bit? Is
> it using the log_dirty_bitmap?

It sets all memory read-only in the EPT tables.  On an EPT fault it
marks the page dirty in the bitmap and resetd it to r/w. 
See hap_enable_log_dirty() and hvm_hap_nested_page_fault().


Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Principal Software Engineer, Xen Platform Team
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)

Xen-devel mailing list