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:24:42 -0500
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 05 Jan 2009 06:26:07 -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=eHDLsZp/62VWDuh4g2j5m1SWxlVZ9Qrv19z9XgXCXCM=; b=bOTIK8V56fZ0myxSusOuHvL50LHNyg7kmTj0YJoqriyY8sUNahj0i1vInGaH21Ijkl c6l7V2xiwM817veA51RYdnxkyo75EpueYHldZQzW3fyQ2jlRbK3nwfwHaI3qnN4KIPgd Hk/NkAWSZj/NF8eq4JZN1AP8cpPDRc74MCCVQ=
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=rEM/TWKgWffSwmqKy3Uhq9QFr1D2UiDuNJFWMD1bqHmOjw0M/6qLsOyImd6OD8T1+n ugkeWYN78p1zlNiuAUeWPEkUS5G0x3nTeX+FbSAozQ+XeR2H9JIYogw9YPO5pi65kTP8 zRB2LuTS4I6GFM66MXKWbMlWxLTnfG9Bkjk80=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20090105101107.GD12729@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: <e4e579070812191254k6bc57cf7hfb60e900c1a3c0aa@xxxxxxxxxxxxxx> <e4e579070812191308q77c3a398p6baa246cff5f7ab2@xxxxxxxxxxxxxx> <e4e579070812191359t1bd3a8cand9bb01cd62da9696@xxxxxxxxxxxxxx> <20090102100725.GB12729@xxxxxxxxxxxxxxxxxxxxx> <e4e579070901020850n1b897c1aob521bf28d125b420@xxxxxxxxxxxxxx> <20090102172058.GC12729@xxxxxxxxxxxxxxxxxxxxx> <e4e579070901031743v5234c2c7g4042f7795ba6c180@xxxxxxxxxxxxxx> <e4e579070901031955g266192d5ra7913c8cd2557fca@xxxxxxxxxxxxxx> <e4e579070901041509p13a25b4u9e980eb8c5472356@xxxxxxxxxxxxxx> <20090105101107.GD12729@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
> That looks quite strange to me; it will select every dirty page that is
> not currently writeable

Ah yes, I should probably explain what I'm doing.  I'm using the
log-dirty mode to catch any writes to pages that I haven't yet
"copied" via a background copy mechanism, similar to the live
migration copy.  If I have copied it already, then I manually mark it
dirty to indicate that it can be made writable again.  That's what I'm
trying to do in this code.

>  - regardless of whether the guest asked for a writeable mapping
>   (e.g. user-mode read-only maps of kernel structures); and
>  - regardless of whether it's currently shadowed!

Yeah, I've tried adding checks as well (not seen in this version of
the code) to first check the guest PTE to see if it's writable and to
check to see if it's shadowed.  But I also thought that if I check
that that mapped page type was PGT_writable_page with a type count of
0, I could assume that the guest PTE mapped the page as writable, no?

>>                            && get_page_type(page, PGT_writable_page))
>>                        {
>>                            shadow_l1e_t rw_sl1e =
>>                                shadow_l1e_add_flags(*sl1e, _PAGE_RW);
>
> Did you by any chance make this shadow_l1e_add_flags() operator by
> copying l1e_add_flags from asm/page.h?  That's a macro which modifies
> its arguments, which you are definitely not allowed to do to a live
> shadow pagetable. :)

Now this is probably a big problem, that's exactly what I'm doing and
I didn't think about that!  I'll fix that and see what happens.

Thanks for all the help!
Mike

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