From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH]Add a flag for shadow pages Date: Wed, 04 Mar 2009 09:56:29 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Jiang, Yunhong" , Tim Deegan Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 04/03/2009 09:28, "Jiang, Yunhong" wrote: > Keir Fraser 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 pointer'. 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