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

[Xen-devel] page counts & type counts

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] page counts & type counts
From: "Mike Sun" <msun@xxxxxxxxxx>
Date: Sun, 4 Jan 2009 22:18:12 -0500
Delivery-date: Sun, 04 Jan 2009 19:18:35 -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:mime-version:content-type:content-transfer-encoding :content-disposition:x-google-sender-auth; bh=HXlCSiDlG/exVN/o72qmlGe669tPaAxDQtHd59gmV74=; b=jC80VAu80oDVjnrciyzpqExaAgDVUdNtbRLnKMIm75jcx5ZLvFM2/sVW4Cg9DoSfmF Dk8cnirJggiOoU+SAyhXMdl6lqEFeAGr+hatLukDyvRucF01q7ZZcp9OOd36bl4yaIwe i2Wkh2+zEwbImhRVuszxDDCPl2E3K01/qgmY0=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition:x-google-sender-auth; b=pEb63hi6vfJSpl3+kY3MMAfev3YF1zoa/7GlSCknnb881/fqRds9YkBBkqhFidzs/S seZ/jr1qgXLVMbDXkzST4sesC3qvBd8exbOVbKX9C4TqCPLScu4IaG7NvJF1dyn4p8df D9gMAQrwxuw6ju5RIDQa8zeXUr7a48y1S9usQ=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi,

I'm working with Xen 3.2 and having a hard time understanding what's
going on in this piece of code used to do ref and type counting.

int get_page_type(struct page_info *page, unsigned long type)
{
   ...
        else if ( unlikely((x & PGT_count_mask) == 0) )
        {
            struct domain *d = page_get_owner(page);

            /* Never allow a shadowed frame to go from type count 0 to 1 */
            if ( d && shadow_mode_enabled(d) )
                shadow_remove_all_shadows(d->vcpu[0], _mfn(page_to_mfn(page)));

Does this mean that every time a page goes from read-only to writable,
the shadow PTE mapping that page is destroyed and recreated?  In
particular, if I wanted to restore writable access to a page during
log-dirty mode (such as what occurs when a fault is taken and that
page is then marked dirty and RW is not revoked in _sh_propagate()),
will the shadow always be destroyed and then recreated?

>From what I understand, shadow_remove_all_shadows() will remove all
shadows of the gmfn, which should be a guest PT.  Basically, it'll
remove all shadows inserted in the shadow_hash table for that gmfn.
It IS NOT removing shadow PTEs mapping that gmfn.  Is this a correct
understanding?  I don't understand how get_page_type() would know in
the code that is there how the given page is actually a guest PT?

-- Mike

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

<Prev in Thread] Current Thread [Next in Thread>