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] p2m: use xzalloc() for struct p2m_domain allocation

To: Jan Beulich <JBeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] p2m: use xzalloc() for struct p2m_domain allocation
From: Keir Fraser <keir.xen@xxxxxxxxx>
Date: Fri, 14 Oct 2011 08:59:52 +0100
Cc: Tim Deegan <tim@xxxxxxx>
Delivery-date: Fri, 14 Oct 2011 01:02:55 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=user-agent:date:subject:from:to:cc:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=48ZB1UhhWCmlKP3/l6rjgEQwRDpAfD37ms/l/D30wGk=; b=hNplEP6Ls0Ed68p2KUvrJOn3wYaYHQ/0NbbpuH6FyBuFRd2KgvC/Qx6fJ+aZXos+d3 dFaYxMngea0Ae3gyEEdX6Amo/wEnvG7OqdUSD1EfvBVeLcqifjBuIO2CICdsVe66iGPT sLgdjn65ZLmIOiaMr0yLFvzUiDt118ErPQCwg=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4E980034020000780005B559@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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcyKR0C3ZojxaI9EkkWk540yngkuNA==
Thread-topic: [Xen-devel] p2m: use xzalloc() for struct p2m_domain allocation
User-agent: Microsoft-Entourage/12.30.0.110427
On 14/10/2011 08:26, "Jan Beulich" <JBeulich@xxxxxxxx> wrote:

> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

I'll leave this one for Tim to ack/nack.

> --- a/xen/arch/x86/mm/p2m.c
> +++ b/xen/arch/x86/mm/p2m.c
> @@ -71,7 +71,6 @@ boolean_param("hap_2mb", opt_hap_2mb);
>  /* Init the datastructures for later use by the p2m code */
>  static void p2m_initialise(struct domain *d, struct p2m_domain *p2m)
>  {
> -    memset(p2m, 0, sizeof(*p2m));
>      mm_lock_init(&p2m->lock);
>      INIT_LIST_HEAD(&p2m->np2m_list);
>      INIT_PAGE_LIST_HEAD(&p2m->pages);
> @@ -100,7 +99,7 @@ p2m_init_nestedp2m(struct domain *d)
>  
>      mm_lock_init(&d->arch.nested_p2m_lock);
>      for (i = 0; i < MAX_NESTEDP2M; i++) {
> -        d->arch.nested_p2m[i] = p2m = xmalloc(struct p2m_domain);
> +        d->arch.nested_p2m[i] = p2m = xzalloc(struct p2m_domain);
>          if (p2m == NULL)
>              return -ENOMEM;
>          p2m_initialise(d, p2m);
> @@ -115,7 +114,7 @@ int p2m_init(struct domain *d)
>  {
>      struct p2m_domain *p2m;
>  
> -    p2m_get_hostp2m(d) = p2m = xmalloc(struct p2m_domain);
> +    p2m_get_hostp2m(d) = p2m = xzalloc(struct p2m_domain);
>      if ( p2m == NULL )
>          return -ENOMEM;
>      p2m_initialise(d, p2m);
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



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

<Prev in Thread] Current Thread [Next in Thread>