From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVgTy-0000lM-3n for qemu-devel@nongnu.org; Fri, 05 Aug 2016 10:52:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVgTt-00010Q-2I for qemu-devel@nongnu.org; Fri, 05 Aug 2016 10:52:18 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:33808) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVgTs-00010A-QI for qemu-devel@nongnu.org; Fri, 05 Aug 2016 10:52:12 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u75EnRxl146664 for ; Fri, 5 Aug 2016 10:52:10 -0400 Received: from e23smtp07.au.ibm.com (e23smtp07.au.ibm.com [202.81.31.140]) by mx0a-001b2d01.pphosted.com with ESMTP id 24kkajkfp3-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 05 Aug 2016 10:52:10 -0400 Received: from localhost by e23smtp07.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 6 Aug 2016 00:52:08 +1000 Date: Fri, 5 Aug 2016 20:21:59 +0530 From: Bharata B Rao Reply-To: bharata@linux.vnet.ibm.com References: <1470383429-11526-1-git-send-email-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1470383429-11526-1-git-send-email-david@gibson.dropbear.id.au> Message-Id: <20160805145159.GA8994@in.ibm.com> Subject: Re: [Qemu-devel] [PATCH] spapr: Correctly set query_hotpluggable_cpus hook based on machine version List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: imammedo@redhat.com, agraf@suse.de, qemu-ppc@nongnu.org, qemu-devel@nongnu.org On Fri, Aug 05, 2016 at 05:50:29PM +1000, David Gibson wrote: > Prior to c8721d3 "spapr: Error out when CPU hotplug is attempted on older > pseries machines", attempting to use query-hotpluggable-cpus on pseries-2.6 > and earlier machine types would SEGV. > > That change fixed that, but due to some unexpected interactions in init > order and a brown-paper-bag worthy failure to test, it accidentally > disabled query-hotpluggable-cpus for all pseries machine types, including > the current one which should allow it. > > In fact, query_hotpluggable_cpus needs to be non-NULL when and only when > the dr_cpu_enabled flag in sPAPRMachineClass is set, which makes > dr_cpu_enabled itself redundant. > > This patch removes dr_cpu_enabled, instead directly setting > query_hotpluggable_cpus from the machine class_init functions, and using > that to determine the availability of CPU hotplug when necessary. dr_cpu_enabled actually determines if CPU hotplug feature is present or not. It also controls the creation of DRC-specific properties in /cpus DT node like ibm,drc-indexes etc query_hotpluggable_cpus just tells us if the machine supports the querying of hotpluggable CPUS. query_hotpluggable_cpus definitely implies dr_cpu_enabled but dr_cpu_enabled can exist on its own (theoretically at the least) without query_hotpluggable_cpus. So I think we should not replace dr_cpu_enabled with query_hotpluggable_cpus. However, I tested this patch and it works as intended. Regards, Bharata.