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] RE: [PATCH][DOM0] Expose physical CPU information in dom

To: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
Subject: Re: [Xen-devel] RE: [PATCH][DOM0] Expose physical CPU information in dom0
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Thu, 12 Nov 2009 10:46:58 -0500
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 12 Nov 2009 07:47:37 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <E2263E4A5B2284449EEBD0AAB751098418E55575DA@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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: <E2263E4A5B2284449EEBD0AAB751098418E4775B9B@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <E2263E4A5B2284449EEBD0AAB751098418E55575DA@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.19 (2009-01-05)
Some little comments..

.. snip ..

> +     if (info->flags & XEN_PCPU_FLAGS_INVALID) {
> +             /* The pcpu has been removed */
> +             *result = 0;

You use #defines for the other cases. Should there be
one for 0? Is 0 PCPU_REMOVED?

> +             if (pcpu) {
> +                     raw_notifier_call_chain(&xen_pcpu_chain,
> +                       XEN_PCPU_REMOVE,
> +                       (void *)(long)pcpu->xen_id);
> +                     xen_pcpu_free(pcpu);
> +                     *result = PCPU_REMOVED;
> +             }
> +             return NULL;
> +     }
> +
> +
> +     if (!pcpu) {
> +             *result = PCPU_ADDED;
> +             pcpu = init_pcpu(info);
> +             if (pcpu == NULL) {
> +                     printk(KERN_WARNING "Failed to init pcpu %x\n",
> +                       info->xen_cpuid);
> +                       *result = -1;

How about #define PCPU_BAD -1?

.. snip..
> +/*
> + * type: 0 add, 1 remove
> + */

Why not make this an enum?

> +int xen_pcpu_hotplug(int type, uint32_t apic_id)

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