From: Keir Fraser Subject: Re: doubt on releasing domain pages Date: Fri, 22 Aug 2008 08:18:07 +0100 Message-ID: References: <1219354128.4327.16.camel@ec4t16cg-1518809> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1219354128.4327.16.camel@ec4t16cg-1518809> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Sandesh , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 21/8/08 22:28, "Sandesh" wrote: > I am trying to release domU pages from page_list and xenpage_list > after domU shutdown while retaining the rest of the domain information. > To achieve this in __domain_finalise_shutdown i call > domain_relinquish_resources. This is failing to release pages from > page_list for type PGT_l2_page_tables and crashing dom0. > To be specific, while testing on mini-os i saw that when > domain_relinquish_resources calls relinquish_memory for > PGT_l2_page_tables, this eventually calls free_l2_table which fails at > map_domain_page() by returning an invalid virtual address, due to which > dom0 crashes immediately. > > When the same sequence of functions works perfectly fine during domU > destruction, why not during shutdown. Am I missing anything important? I wouldn't guarantee that calling from shutdown will work entirely race-free in all cases, but I would think it would generally work okay. A bad pointer from map_domain_page() is odd -- make a debug build 'debug=y make' and perhaps add tracing to see what's going wrong there. -- Keir