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 08/12] x86/p2m: allocate CPU masks dynamically

To: Jan Beulich <JBeulich@xxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 08/12] x86/p2m: allocate CPU masks dynamically
From: Tim Deegan <tim@xxxxxxx>
Date: Thu, 20 Oct 2011 15:18:13 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 20 Oct 2011 07:18:46 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4EA0475B020000780005C859@xxxxxxxxxxxxxxxxxxxx>
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>
References: <4EA0413B020000780005C7C2@xxxxxxxxxxxxxxxxxxxx> <20111020140045.GH49983@xxxxxxxxxxxxxxxxxxxxx> <4EA0475B020000780005C859@xxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
At 15:07 +0100 on 20 Oct (1319123275), Jan Beulich wrote:
> >>> On 20.10.11 at 16:00, Tim Deegan <tim@xxxxxxx> wrote:
> > At 14:41 +0100 on 20 Oct (1319121707), Jan Beulich wrote:
> >> --- 2011-10-18.orig/xen/arch/x86/mm/p2m.c  2011-10-14 09:47:46.000000000 
> >> +0200
> >> +++ 2011-10-18/xen/arch/x86/mm/p2m.c       2011-10-18 16:45:49.000000000 
> >> +0200
> >> @@ -81,7 +81,6 @@ static void p2m_initialise(struct domain
> >>      p2m->default_access = p2m_access_rwx;
> >>  
> >>      p2m->cr3 = CR3_EADDR;
> >> -    cpumask_clear(&p2m->p2m_dirty_cpumask);
> >>  
> >>      if ( hap_enabled(d) && (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) 
> >> )
> >>          ept_p2m_init(p2m);
> >> @@ -102,6 +101,8 @@ p2m_init_nestedp2m(struct domain *d)
> >>          d->arch.nested_p2m[i] = p2m = xzalloc(struct p2m_domain);
> >>          if (p2m == NULL)
> >>              return -ENOMEM;
> >> +        if ( !zalloc_cpumask_var(&p2m->dirty_cpumask) )
> >> +            return -ENOMEM;
> > 
> > This leaks 'p2m'.
> 
> If that's really true, then there is a leak already without that patch:
> p2m_init() calls p2m_init_nestedp2m() without recovering from failure
> in that function. It was my understanding that since failure here
> ultimately leads to failure of domain construction, which I thought
> (hoped - didn't verify) would result in p2m_final_teardown() getting
> called.

You're quite right; it will all get tidied up by p2m_final_teardown().
Sorry for the noise.

Tim.


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