Received: from eggs.gnu.org ([2001:4830:134:3::10]:55409) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aagb2-0004g7-ID for qemu-devel@nongnu.org; Tue, 01 Mar 2016 04:28:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aagax-00034J-Us for qemu-devel@nongnu.org; Tue, 01 Mar 2016 04:28:00 -0500 Date: Tue, 1 Mar 2016 10:27:49 +0100 From: Igor Mammedov Message-ID: <20160301102749.04a363df@nial.brq.redhat.com> In-Reply-To: <20160301012127.GJ5427@voom.redhat.com> References: <1456417362-20652-1-git-send-email-bharata@linux.vnet.ibm.com> <1456417362-20652-3-git-send-email-bharata@linux.vnet.ibm.com> <20160226181339.5592.52630@loki> <20160229055018.GE5756@in.ibm.com> <20160229110316.02ab92d5@nial.brq.redhat.com> <20160229125525.GF5756@in.ibm.com> <20160229161525.566bee7b@nial.brq.redhat.com> <20160301012127.GJ5427@voom.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v0 2/6] spapr: CPU core device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: mjrosato@linux.vnet.ibm.com, thuth@redhat.com, pkrempa@redhat.com, ehabkost@redhat.com, aik@ozlabs.ru, qemu-devel@nongnu.org, agraf@suse.de, Michael Roth , borntraeger@de.ibm.com, qemu-ppc@nongnu.org, Bharata B Rao , pbonzini@redhat.com, afaerber@suse.de, armbru@redhat.com On Tue, 1 Mar 2016 12:21:27 +1100 David Gibson wrote: > On Mon, Feb 29, 2016 at 04:15:25PM +0100, Igor Mammedov wrote: > > On Mon, 29 Feb 2016 18:25:25 +0530 > > Bharata B Rao wrote: > > > On Mon, Feb 29, 2016 at 11:03:16AM +0100, Igor Mammedov wrote: > > > > On Mon, 29 Feb 2016 11:20:19 +0530 > > > > Bharata B Rao wrote: > [snip] > > > > > > "slot" seems intended to be a machine-agnostic of mapping device > > > > > > types discovered from qmp_query_cpu_slots() to an appropriate > > > > > > "bus" location, but here's it a field specific to TYPE_SPAPR_CPU_CORE. > > > > > > It seems like maybe TYPE_CPU_CORE is a better place, but then on > > > > > > x86 I suppose it might be TYPE_CPU_SOCKET or something instead... > > > > > > > > > > Correct. > > > > > > > > > > > > > > > > > It almost seems like a TYPE_INTERFACE_SLOTABLE would be the > > > > > > right approach, but I don't know how we could expose that as > > > > > > a property. I guess it's somewhat implied that this "interface" > > > > > > exists if qmp_query_cpu_slots() returns the type, but I wonder > > > > > > if something a bit more formal should be modeled to make the > > > > > > implementation requirements a bit clearer. > > > > > > > > > > > > Maybe have TYPE_CPU_{CORE,SOCKET} classes have a get_slot/set_slot > > > > > > class method, expose them via "slot" property, then have the > > > > > > defaults generate "not implemented" errors? > > > > > > > > > > Yes makes sense. In fact David has often times said that generic > > > > > properties/routines should be pushed to base class wherever possible. > > > > > > > > > > I didn't do that in this first iteration to keep the generic changes > > > > > as minimum as possible, but yes slot should be a property of the > > > > > base class of core or socket. > > > > Then what will happen to slot if there isn't any core/socket device > > > > to query it, i.e. cpu hasn't been plugged in yet? > > > > To me slot looks like a machine belonged feature. > > > > > > Yes slot belongs to the machine and it is represented by a link that > > > is created b/n the machine object and the core object that sits in > > > the slot. > > > > > > In the context of this thread, slot is actually the slot name that > > > identifies the machine slot which the core occupies or will occupy after > > > hotplug. Thus slot name which is named slot here, it is a property of the > > > core device. > > > > > > (qemu) device_add spapr-cpu-core,slot=core[2] > > > ^ > > Is 'slot' a term used by SPAPR on real hardware? > > So.. PAPR is a para-virtualized interface, so it never appears on real > hardware. > > But, no, "slot" is not a term used by PAPR. > > > I'd thought that it's 'core', that's why I suggested to use > > 'core' for POWER as that matched real world concept, see > > my other reply in "[RFC PATCH v0 4/6] spapr: CPU hotplug support" thread > > of this series. > > I don't think it uses "core" either, I believe it uses just "cpu" but > meaning a multi-thread core, rather than a single logical cpu thread. then calling property 'cpu' is fine or one could go by meaning and use 'core' property (reusing 'core' property)