From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: RE: [PATCH][DOM0] Expose physical CPU information in dom0 Date: Thu, 12 Nov 2009 10:46:58 -0500 Message-ID: <20091112154658.GA32409@phenom.dumpdata.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Jiang, Yunhong" Cc: Jeremy Fitzhardinge , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org 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)