From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH v5 12/17] xen/libxc: sched: DOMCTL_*vcpuaffinity works with hard and soft affinity Date: Tue, 3 Dec 2013 18:37:43 +0000 Message-ID: <529E24F7.90402@eu.citrix.com> References: <20131202180129.29026.81543.stgit@Solace> <20131202182908.29026.23720.stgit@Solace> <529DBA3F02000078001093CF@nat28.tlf.novell.com> <529DBB4A02000078001093E5@nat28.tlf.novell.com> <529E212C.8070205@eu.citrix.com> <1386095387.5338.361.camel@Solace> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Vnuqz-0008CV-1f for xen-devel@lists.xenproject.org; Tue, 03 Dec 2013 18:37:49 +0000 In-Reply-To: <1386095387.5338.361.camel@Solace> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dario Faggioli Cc: Marcus Granado , Justin Weaver , Jan Beulich , Li Yechen , Andrew Cooper , Juergen Gross , Ian Jackson , Matt Wilson , xen-devel , Keir Fraser , Elena Ufimtseva , Ian Campbell List-Id: xen-devel@lists.xenproject.org On 12/03/2013 06:29 PM, Dario Faggioli wrote: > On mar, 2013-12-03 at 18:21 +0000, George Dunlap wrote: >> On 12/03/2013 10:06 AM, Jan Beulich wrote: >>>>>> On 03.12.13 at 11:02, "Jan Beulich" wrote: >>>>>>> On 02.12.13 at 19:29, Dario Faggioli wrote: >>>>> + goto setvcpuaffinity_out; >>>>> + >>>>> + /* >>>>> + * We both set a new affinity and report back to the caller what >>>>> + * the scheduler will be effectively using. >>>>> + */ >>>>> + if ( vcpuaff->flags & XEN_VCPUAFFINITY_HARD ) >>>>> + { >>>>> + ret = xenctl_bitmap_to_bitmap(cpumask_bits(new_affinity), >>>>> + &vcpuaff->cpumap_hard, >>>>> + vcpuaff->cpumap_hard.nr_bits); >>>> >>>> There's no code above range checking vcpuaff->cpumap_hard.nr_bits, >>>> yet xenctl_bitmap_to_bitmap() uses the passed in value to write into >>>> the array pointed to by the first argument. Why is this not >>>> xenctl_bitmap_to_cpumask() in the first place? >>> >>> And just to make it explicit - with fundamental flaws like this, I'm >>> not certain anymore whether we really ought to rush this series >>> in for 4.4. >> >> I'm certainly getting nervous about the prospect. >> > Sory. :-/ Nothing to be sorry about, Dario -- this is software development. Not predictable, not really going to try. :-) The core functionality was simple and easy and finished months ago; what we've been working out is the interface into that functionality, which always takes a lot longer than you think it possibly could. (My USB hotplug series didn't make it in for 4.3 for similar reasons.) It is worth looking at the whole series again to try to see what the risks are, and if it's still worth taking. I'll probably send something out tomorrow. -George