WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Re: Making pages writable again in paging_log_dirty mode

To: "Tim Deegan" <Tim.Deegan@xxxxxxxxxx>
Subject: Re: [Xen-devel] Re: Making pages writable again in paging_log_dirty mode
From: "Mike Sun" <msun@xxxxxxxxxx>
Date: Mon, 5 Jan 2009 09:54:00 -0500
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 05 Jan 2009 06:54:22 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=cnOuzhykY17yBxxM8ZeZ1eDoltKGmVsYs/sw9oGdZbk=; b=vzmng6OJE4pdfW7tI4/R06ughy1Dg/6ts+dwQMt96AD7TSnf03DUx5x/QgqARXXTH5 K2QyP5UY5rVUe0A3nBB8wGDpAPlWlMLFDAjrwcG40+CojJEopilY8Q9N9TfUxIjJcwXH 3k4gtKR+pxjjxCh4dTQz4ftKzaydEEBgHuTZE=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=xgwJqT3jOI2SndalcYdVs7nYIlX3+JF1QzLZrzQ4zSXzUIOHA/4YrOsjzQhEKuq6wz c1RI+Jh86J8755tExueMDCX2IkGt5bvSIeC0OU8gFsNy+LhN0l0HzcHzpAl0Om2enFwk G2YeJbsRmpSDj7lo60y+VVoAcXNiks9giXFbs=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20090105143914.GK12729@xxxxxxxxxxxxxxxxxxxxx>
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: <e4e579070812191308q77c3a398p6baa246cff5f7ab2@xxxxxxxxxxxxxx> <20090102100725.GB12729@xxxxxxxxxxxxxxxxxxxxx> <e4e579070901020850n1b897c1aob521bf28d125b420@xxxxxxxxxxxxxx> <20090102172058.GC12729@xxxxxxxxxxxxxxxxxxxxx> <e4e579070901031743v5234c2c7g4042f7795ba6c180@xxxxxxxxxxxxxx> <e4e579070901031955g266192d5ra7913c8cd2557fca@xxxxxxxxxxxxxx> <e4e579070901041509p13a25b4u9e980eb8c5472356@xxxxxxxxxxxxxx> <20090105101107.GD12729@xxxxxxxxxxxxxxxxxxxxx> <e4e579070901050624q68115393ka97012b9147a2397@xxxxxxxxxxxxxx> <20090105143914.GK12729@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
> Ideally you'd replicate all the checks that are done in _sh_propagate
> (guest PTE allows writes, target pfn not read-only, target mfn not
> shadowed, maybe some others I don't remember).

For ease of correctness, would using something like validate_g1le()
make all the checks I need (since it calls _sh_propagate down the
line), assuming I call this while in the context of the same domain as
v->domain:

 SHADOW_FOREACH_L2E(sl2mfn, sl2e, 0, done_l2, v->domain,
    {
        flags_l2 = shadow_l2e_get_flags(*sl2e);
        if (flags_l2 & _PAGE_PRESENT)
        {
            sl1mfn = shadow_l2e_get_mfn(*sl2e);
            gl1mfn = _mfn(mfn_to_shadow_page(sl1mfn)->backpointer);
            gl1e = gp = sh_map_domain_page(gl1mfn);

            SHADOW_FOREACH_L1E(sl1mfn, sl1e, &gl1e, done_l1,
            {
                flags_l1 = shadow_l1e_get_flags(*sl1e);
                if ((flags_l1 & _PAGE_PRESENT) && !(flags_l1 & _PAGE_RW))
                {

                    mfn = shadow_l1e_get_mfn(*sl1e);
                    pfn = mfn_to_gfn(v->domain, mfn);
                    log_dirty_lock(v->domain);
                    if (mfn_valid(mfn) && VALID_M2P(pfn) &&
                        sh_mfn_is_dirty(v->domain, mfn))
                    {
                         if (guest_l1e_get_flags(*gl1e) & _PAGE_RW)
                             validate_gl1e(v, gl1e, sl1mfn, sl1e);
                    }
                    log_dirty_unlock(v->domain);
                }
            });
        }
    });

Thanks,
Mike

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel