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

xen-devel

[Top] [All Lists]

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

To: Mike Sun <msun@xxxxxxxxxx>
Subject: Re: [Xen-devel] Re: Making pages writable again in paging_log_dirty mode
From: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Date: Fri, 2 Jan 2009 17:20:58 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: 2009年1月02日 09:21:25 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <e4e579070901020850n1b897c1aob521bf28d125b420@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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.17 (2007年11月01日)
Hi,
At 11:50 -0500 on 02 Jan (1230897005), Mike Sun wrote:
> /* Foreign mappings into guests in shadow external mode don't
> * contribute to writeable mapping refcounts. (This allows the
> * qemu-dm helper process in dom0 to map the domain's memory without
> * messing up the count of "real" writable mappings.) */
> okay = (((l1f & _PAGE_RW) &&
> !(unlikely(paging_mode_external(d) && (d != curr->domain))))
> ? get_page_and_type(page, d, PGT_writable_page)
> : get_page(page, d));
>
> Basically, I'm trying to make an HVM guest's pages writable again via
> a hypercall from dom0, and so this piece of code messes up the type
> count since I'm actually changing "proper" writeable mapping
> refcounts.
Right; manipulating the shadow from dom0 will make a writeable shadow
PTE with no matching typecount and when it's torn down later the
typecount will underflow. :(
> For now, I'm just calling an extra
> "get_page_and_type(page, d, PGT_writable_page)" manually, and I think
> it solves this problem, but I'm getting a different kind of kernel
> panic now where it complains about not being able to
> "rm_write_access()" due to some special mappings. Any ideas?
That's the opposite problem. The shadow code needs to remove all the
writeable mappings of a page (because the guest is using it as a
pagetable) and finds that after removing all writeable shadow PTEs that
map the page, the typecount has not reached zero. So:
 - there is some other special reason for the frame to have a
 typecount. Or,
 - somehow you've removed a writeable shadow entry without decrementing
 the type count. That shouldn't be a problem because we know that
 actions by dom0 (p2m changes, for example) cause writeable shadow
 PTEs to be torn down (via shadow_put_page_from_l1e) correctly. Or,
 - you've accidentally called get_page_and_type() once too often, 
 creating two typecounts for only one shadow PTE.
This is all confused further by the fact that the checks for these
un-type-counted mappings in put_page_from_l1e() doesn't quite match the
check in get_page_from_l1e(); ISTR there's a difference in the semantics
of the domain pointer argument to the two functions; maybe Keir can
refresh my memory.
Cheers,
Tim.
-- 
Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Principal Software Engineer, Citrix Systems (R&D) Ltd.
[Company #02300071, SL9 0DZ, UK.]
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
Previous by Date: Re: [Xen-devel] Re: Making pages writable again in paging_log_dirty mode , Mike Sun
Next by Date: Re: [Xen-devel] Re: Making pages writable again in paging_log_dirty mode , Keir Fraser
Previous by Thread: Re: [Xen-devel] Re: Making pages writable again in paging_log_dirty mode , Mike Sun
Next by Thread: Re: [Xen-devel] Re: Making pages writable again in paging_log_dirty mode , Keir Fraser
Indexes: [Date] [Thread] [Top] [All Lists]

Copyright ©, Citrix Systems Inc. All rights reserved. Legal and Privacy
Citrix This site is hosted by Citrix

AltStyle によって変換されたページ (->オリジナル) /