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] 15142:78389dbb08bb and domain state

To: John Levon <levon@xxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] 15142:78389dbb08bb and domain state
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Tue, 20 Nov 2007 15:35:40 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, jbeulich@xxxxxxxxxx
Delivery-date: Tue, 20 Nov 2007 07:36:37 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20071119101920.GA15940@xxxxxxxxxxxxxxxxxxxxxxx>
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: AcgriwEpP41UpJd+EdyYrAAX8io7RQ==
Thread-topic: [Xen-devel] 15142:78389dbb08bb and domain state
User-agent: Microsoft-Entourage/11.3.6.070618
Yeah, that's a nasty one. I committed an alternative fix, which I think is
clearer, as c/s 16401. Please give it a spin.

I'll also queue it for 3.1.3.

 -- Keir

On 19/11/07 10:19, "John Levon" <levon@xxxxxxxxxxxxxxxxx> wrote:

> On Fri, Nov 16, 2007 at 12:01:38AM +0000, Keir Fraser wrote:
> 
>> Reference counting for l4 pagetable entries happens in
>> get_page_from_l4e(),
> 
> The circular reference was a red herring - I was looking at Xen's own
> mapping in its private PTEs (d'oh).
> 
> However, I did notice that we leak a ref count per VCPU, which gave me a
> big clue. Changeset 13302:7c5eea5feebd from Jan added this code:
> 
> +#ifdef __x86_64__
> +            if ( pfn == pagetable_get_pfn(v->arch.guest_table_user) )
> +                v->arch.guest_table_user = pagetable_null();
> +#endif
> 
> Presumably for the benefit of compat guests where this is always true.
> 
> However, it can be true on native Solaris guests too - when we switch
> to the kernel L4 we also load it into _USER_BASEPTR.
> 
> The patch below fixes it for me (though I'm not positive it's correct).
> Assuming this or something like it is the right thing, that will still
> leave the 'xm list' problem, which I see with both Solaris and Linux
> domU's. Still looking at that.
> 
> cheers,
> john
> 
> # HG changeset patch
> # User john.levon@xxxxxxx
> # Date 1195467196 28800
> # Node ID b972585a05838dc3a622438299572423a7a8de8d
> # Parent  00c6696dcc8b17cd9ea2325f260899e489e262e0
> Fix VCPU pagetable cleanup
> 
> Solaris can have the same PT in guest_table and guest_table_user without
> it being a compat domain. Be more careful when cleaning up.
> 
> Signed-off-by: John Levon <john.levon@xxxxxxx>
> 
> diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
> --- a/xen/arch/x86/domain.c
> +++ b/xen/arch/x86/domain.c
> @@ -1625,7 +1625,8 @@ static void vcpu_destroy_pagetables(stru
>          else
>              put_page_and_type(mfn_to_page(pfn));
>  #ifdef __x86_64__
> -        if ( pfn == pagetable_get_pfn(v->arch.guest_table_user) )
> +        if ( is_pv_32on64_vcpu(v) &&
> +      pfn == pagetable_get_pfn(v->arch.guest_table_user) )
>              v->arch.guest_table_user = pagetable_null();
>  #endif
>          v->arch.guest_table = pagetable_null();



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