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

Re: [Xen-devel] [Patch] [libxc] add missing free in xc_finish_mmu_update

To: Stephan Creutz <stephan.creutz@xxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [Patch] [libxc] add missing free in xc_finish_mmu_updates to avoid memory leak
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Fri, 13 Apr 2007 15:42:36 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 13 Apr 2007 07:39:58 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070413163143.089fb5f3.stephan.creutz@xxxxxxxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acd92foOOHmKZunNEduH7gAWy6hiGQ==
Thread-topic: [Xen-devel] [Patch] [libxc] add missing free in xc_finish_mmu_updates to avoid memory leak
User-agent: Microsoft-Entourage/11.3.3.061214
On 13/4/07 15:31, "Stephan Creutz" <stephan.creutz@xxxxxxxxxxxxxxxxx> wrote:

>> You could work around by stripping all pagetable-type pinning, then
>> make updates to all memory pages, then reapply pagetable-type pinning.
>> This would mean that your memory rollback code would not need to take
>> special account of pagetables.
> 
> That was my first approach to solve the problem, but it failed. As far
> as I understand it is not that easy because to unpin a frame its
> typecount have to be 0. What is the general approach to decrease the
> typecount to 0?

If you reset all VCPU states (setvcpucontext(NULL)) to clear all %cr3
references, and all pinnings are got rid of, then the type counts should
naturally fall to zero. One exception is linear pagetables (tables mapping
themselves) because these introduce circular references, which would need to
be handled somehow. Linux at least doesn't use linear page tables though.

I don't think you can avoid this type-count issue by the way. If you want to
do arbitrary rollback you have to be able to handle modifying the guest
state arbitrarily, including any kinds of updates to guest page types etc.
To me, that would suggest that just zapping all the existing metadata and
rebuilding from scratch is at least a good initial approach, which you might
then measure and improve upon.

 -- Keir



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