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: Sun, 4 Jan 2009 18:09:42 -0500
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sun, 04 Jan 2009 15:10:08 -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=0vDKTPOX1zQKkt78pdxExXcwyT9rtmix5hmPp1AVffE=; b=Ib9KsYoMr0bbf6TIVaHE2L20++lbCTUMDDdAQPYITF6OG8s1bJpU6IYWiej2GR4RR/ ubMjzYgl/uyqQEFHMEcNKEIHsTqOClJWp74zEQcqGqH51PXdk1kNytO/z7ABQgH20RSz 1OfomkNbtR4cA4ojnE/HCQEfIs1GBmk91rRIQ=
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=o0HazllU6d9A3Ua2YE14fkcunYA7xUCyBYeL5l1q6CPHeCZBejNdIuXGdRumHHGlXS HS8eqXqBnp5mNhxTEDow4pCLBEVw5ijdZOnefT0wSjrkhw/QYwxmSuUyreIiOEC/GfPe Ir+5yn5VRKrCwm4jJU/woCQ0c6cc1asoJQoJ0=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <e4e579070901031955g266192d5ra7913c8cd2557fca@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: <e4e579070812191254k6bc57cf7hfb60e900c1a3c0aa@xxxxxxxxxxxxxx> <e4e579070812191308q77c3a398p6baa246cff5f7ab2@xxxxxxxxxxxxxx> <e4e579070812191359t1bd3a8cand9bb01cd62da9696@xxxxxxxxxxxxxx> <20090102100725.GB12729@xxxxxxxxxxxxxxxxxxxxx> <e4e579070901020850n1b897c1aob521bf28d125b420@xxxxxxxxxxxxxx> <20090102172058.GC12729@xxxxxxxxxxxxxxxxxxxxx> <e4e579070901031743v5234c2c7g4042f7795ba6c180@xxxxxxxxxxxxxx> <e4e579070901031955g266192d5ra7913c8cd2557fca@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>> (XEN) sh error: sh_remove_shadows(): can't find all shadows of mfn
>> 02673 (shadow_flags=00000008)

Premature declaration of success.  I'm still getting the panic above
from this piece of code.

           SHADOW_FOREACH_L1E(sl1mfn, sl1e, 0, 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))
                   {
                       /* hack: because of the external mapping condition
                        * ref count not incremented when this is called from
                        * hypercall originating from dom0, need to do it
                        * manually
                        */
                       struct page_info *page = mfn_to_page(mfn);
                       if (((page->u.inuse.type_info & PGT_type_mask)
                               == PGT_writable_page)
                           && ((page->u.inuse.type_info & PGT_count_mask) == 0)
                           && get_page_type(page, PGT_writable_page))
                       {
                           shadow_l1e_t rw_sl1e =
                               shadow_l1e_add_flags(*sl1e, _PAGE_RW);
                           shadow_write_entries(sl1e, &rw_sl1e, 1, sl1mfn);
                           cow.made_rw_count++;
                       }
                   }
                   log_dirty_unlock(v->domain);
               }
           });

Am I failing to update the page count somewhere?  Or are there more
conditions I need to check for the page that I'm adding a RW mapping
to?

Thanks,
Mike

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