From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [RFC] KEXEC: allocate crash note buffers at boot time v4 Date: Fri, 2 Dec 2011 12:33:22 +0000 Message-ID: <4ED8C592.3010603@citrix.com> References: <4ED62C50.7060204@citrix.com> <4ED666D5.5060603@citrix.com> <4ED7522E0200007800064973@nat28.tlf.novell.com> <4ED74DAD.1040903@citrix.com> <4ED75E8402000078000649E6@nat28.tlf.novell.com> <4ED77347.6060200@citrix.com> <4ED787870200007800064B6F@nat28.tlf.novell.com> <4ED79722.7090404@citrix.com> <4ED7A8110200007800064C50@nat28.tlf.novell.com> <4ED7B5FF.2090305@citrix.com> <4ED894100200007800064FE3@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4ED894100200007800064FE3@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich Cc: Keir Fraser , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 02/12/11 08:02, Jan Beulich wrote: >>>> On 01.12.11 at 18:14, Andrew Cooper wrote: > Looks good to me now except for one minor thing (below), and the > fact that you still decided to retain the two duplicates of the size > calculation (I'll have to remember to clean this up if you don't, unless > Keir explicitly agrees with the duplication). Ok - I will turn them into a start,size pair >> + /* Try once again to allocate room for the crash notes. It is just possible >> + * that more space has become available since we last tried. If space has >> + * already been allocated, kexec_init_cpu_notes() will return early with 0. >> + */ >> + if ( kexec_init_cpu_notes(nr) ) >> return -EINVAL; > The function can fail only with -ENOMEM, so why not return this here? > > Jan > Actually, returning -EINVAL here is counter productive. -EINVAL is used by dom0 to work out when it has asked for each CPU. This in itself is a little broken because there is nothing stopping a middle CPU from being offline at the time these hypercalls are made. The other thing is that there is nothing stopping an offline cpu from having a valid notes section. Therefore, the test of online should be removed, so -EINVAL only gets returned for cpu out of range, or not set up notes at all in the first place. -- Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer T: +44 (0)1223 225 900, http://www.citrix.com