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


[Xen-devel] Re: [PATCH]Add a flag for shadow pages

To: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>, Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH]Add a flag for shadow pages
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Wed, 04 Mar 2009 09:56:29 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 04 Mar 2009 01:58:24 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <E2263E4A5B2284449EEBD0AAB751098401C7C9DD9D@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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
Thread-index: AcmcpbnsO+Hd65wBRsq7KCOjKnHUNQAAtTT+AAANk1AAAH+w/wAABzXgAAEnI6U=
Thread-topic: [PATCH]Add a flag for shadow pages
User-agent: Microsoft-Entourage/
On 04/03/2009 09:28, "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx> wrote:

> Keir Fraser <mailto:keir.fraser@xxxxxxxxxxxxx> wrote:
>> I just realised that. You use get_page() to lock down a page's owner.
>> Otherwise it can change under your feet anyway. You don't need
> With get_page_owner() in get_page() will cause fault if it is a shadow page.
> Or you mean use exception table to protect it?

There are a few solutions. One would be to remove the debug printk from
get_page() since it is the only thing which dereferences the bogus 'domain

Another would be to create a new function page_get_reference_and_owner()
which obtains a reference on a guest page and *returns* the (now known
valid) domain pointer. Probably this is nicer actually. Then all existing
users of page_get_owner() need checking to ensure they don't need to use the
new more expensive function -- I think some are probably actually unsafe now
that shadow pages clobber the domain field.

 -- Keir

Xen-devel mailing list