From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.80.166.35 with SMTP id d32csp1143160edc; Tue, 18 Oct 2016 11:45:56 -0700 (PDT) X-Received: by 10.55.168.209 with SMTP id r200mr2245237qke.160.1476816356487; Tue, 18 Oct 2016 11:45:56 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id s129si7468410qkb.141.2016.10.18.11.45.49 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 18 Oct 2016 11:45:56 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Received: from localhost ([::1]:43307 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwZOW-0006v9-Oc for alex.bennee@linaro.org; Tue, 18 Oct 2016 14:45:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwZOO-0006tR-9g for qemu-arm@nongnu.org; Tue, 18 Oct 2016 14:45:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwZOK-0004UW-EY for qemu-arm@nongnu.org; Tue, 18 Oct 2016 14:45:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60148) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bwZOK-0004U9-4F; Tue, 18 Oct 2016 14:45:36 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DF4A4C04B319; Tue, 18 Oct 2016 18:45:34 +0000 (UTC) Received: from localhost (ovpn-116-159.phx2.redhat.com [10.3.116.159]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9IIjX5U005394; Tue, 18 Oct 2016 14:45:33 -0400 Date: Tue, 18 Oct 2016 16:45:32 -0200 From: Eduardo Habkost To: Peter Maydell Message-ID: <20161018184532.GC3275@thinpad.lan.raisama.net> References: <1476485569-6744-3-git-send-email-lvivier@redhat.com> <20161017192022.GA3275@thinpad.lan.raisama.net> <20161018130007.k7hhxovkxiqiumfj@kamzik.brq.redhat.com> <20161018131829.GQ3275@thinpad.lan.raisama.net> <20161018142247.55d4aymduofvhy3r@kamzik.brq.redhat.com> <20161018152207.GZ3275@thinpad.lan.raisama.net> <20161018162202.pmui5rv3va7ubcrv@kamzik.brq.redhat.com> <20161018175737.3biqteztu3esvaaq@kamzik.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Fnord: you can see the fnord User-Agent: Mutt/1.7.0 (2016-08-17) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 18 Oct 2016 18:45:35 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-arm] QOM properties vs C functions/fields (was Re: [Qemu-devel] [PATCH v3 2/3] exec: rename cpu_exec_init() as cpu_exec_realizefn()) X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anthony Green , QEMU Developers , Alexander Graf , Max Filippov , Greg Ungerer , Guan Xuetao , Jia Liu , Markus Armbruster , Bharata B Rao , Richard Henderson , Artyom Tarasenko , Laurent Vivier , Andrew Jones , Chen Gang , Greg Kurz , qemu-arm , Paolo Bonzini , David Gibson , Matthew Rosato , Bastian Koppelmann , Michael Walle , "qemu-ppc@nongnu.org" , Igor Mammedov , Aurelien Jarno Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: IndWHbnFxrV8 On Tue, Oct 18, 2016 at 07:12:51PM +0100, Peter Maydell wrote: > On 18 October 2016 at 18:57, Andrew Jones wrote: > > On Tue, Oct 18, 2016 at 06:07:49PM +0100, Peter Maydell wrote: > >> Why do you want to un-property mp_affinity? Eventually it would > >> be nice for the machine model to be able to use it to set up > >> a specific NUMA configuration. > > > > I thought about that, but I think we'll want to specify machine > > properties; nr_sockets, nr_cores, nr_threads and use the -device > > command line for the cpu to specify which socket, which core, > > which thread it is. This would be consistent with other architectures > > and easily map to the MPIDR & cpu topology hardware descriptions. > > I was thinking more about "modelling board X, which we know > always has 2xA53 and 4xA57 with these MPIDRs". > > We actually have a concrete instance in the tree at the moment: > the raspberry pi 2. Specifically hw/arm/bcm2836.c sets the > mp_affinity for each cpu to 0xF00 | n (where n is the CPUID). > Currently it's doing that by reaching in and messing with > the mp_affinity field directly, but really it ought to be > doing it by setting a property on the CPU, and what it > wants isn't somethnig that can be expressed with a simple > nr_sockets/nr_cores/etc scheme. I am confused now. I thought QOM properties were meant for user-visible and/or user-configurable data. I assumed that if it's only meant to be used by C code inside QEMU, C functions and/or C struct fields were the way to go. See a previous thread where this was discussed: https://www.mail-archive.com/qemu-devel@nongnu.org/msg387169.html (Subject: "QOM: best way for parents to pass information to children?") > > > Anyway, atm, I don't know of any reason to have the property user- > > settable, so it seems safest to keep it hidden until we decide. > > I agree that it doesn't make sense to let the user mess with it, > but it should be available for the board code to read and write. If it doesn't make sense to let the user mess with it, why would we make it a QOM property? -- Eduardo From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.80.166.35 with SMTP id d32csp1143353edc; Tue, 18 Oct 2016 11:46:24 -0700 (PDT) X-Received: by 10.237.41.196 with SMTP id o62mr2132072qtd.122.1476816384381; Tue, 18 Oct 2016 11:46:24 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id o18si21777604qki.199.2016.10.18.11.46.24 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 18 Oct 2016 11:46:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org Received: from localhost ([::1]:43309 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwZP5-00070Z-TR for alex.bennee@linaro.org; Tue, 18 Oct 2016 14:46:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwZOQ-0006ud-GP for qemu-devel@nongnu.org; Tue, 18 Oct 2016 14:45:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwZOP-0004Wf-H5 for qemu-devel@nongnu.org; Tue, 18 Oct 2016 14:45:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60148) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bwZOK-0004U9-4F; Tue, 18 Oct 2016 14:45:36 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DF4A4C04B319; Tue, 18 Oct 2016 18:45:34 +0000 (UTC) Received: from localhost (ovpn-116-159.phx2.redhat.com [10.3.116.159]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9IIjX5U005394; Tue, 18 Oct 2016 14:45:33 -0400 Date: Tue, 18 Oct 2016 16:45:32 -0200 From: Eduardo Habkost To: Peter Maydell Message-ID: <20161018184532.GC3275@thinpad.lan.raisama.net> References: <1476485569-6744-3-git-send-email-lvivier@redhat.com> <20161017192022.GA3275@thinpad.lan.raisama.net> <20161018130007.k7hhxovkxiqiumfj@kamzik.brq.redhat.com> <20161018131829.GQ3275@thinpad.lan.raisama.net> <20161018142247.55d4aymduofvhy3r@kamzik.brq.redhat.com> <20161018152207.GZ3275@thinpad.lan.raisama.net> <20161018162202.pmui5rv3va7ubcrv@kamzik.brq.redhat.com> <20161018175737.3biqteztu3esvaaq@kamzik.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Fnord: you can see the fnord User-Agent: Mutt/1.7.0 (2016-08-17) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 18 Oct 2016 18:45:35 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] QOM properties vs C functions/fields (was Re: [PATCH v3 2/3] exec: rename cpu_exec_init() as cpu_exec_realizefn()) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anthony Green , QEMU Developers , Alexander Graf , Max Filippov , Greg Ungerer , "Edgar E . Iglesias" , Guan Xuetao , Jia Liu , Markus Armbruster , Bharata B Rao , Richard Henderson , Artyom Tarasenko , Laurent Vivier , Andrew Jones , Chen Gang , Greg Kurz , qemu-arm , Paolo Bonzini , David Gibson , Matthew Rosato , Bastian Koppelmann , Michael Walle , "qemu-ppc@nongnu.org" , Igor Mammedov , Aurelien Jarno Errors-To: qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-devel" X-TUID: WP/rL3saGBu0 Message-ID: <20161018184532.kkDQs10FUu75Y4y0KBVX9DaWSpRdmXZ5y1dK-DMU4VY@z> On Tue, Oct 18, 2016 at 07:12:51PM +0100, Peter Maydell wrote: > On 18 October 2016 at 18:57, Andrew Jones wrote: > > On Tue, Oct 18, 2016 at 06:07:49PM +0100, Peter Maydell wrote: > >> Why do you want to un-property mp_affinity? Eventually it would > >> be nice for the machine model to be able to use it to set up > >> a specific NUMA configuration. > > > > I thought about that, but I think we'll want to specify machine > > properties; nr_sockets, nr_cores, nr_threads and use the -device > > command line for the cpu to specify which socket, which core, > > which thread it is. This would be consistent with other architectures > > and easily map to the MPIDR & cpu topology hardware descriptions. > > I was thinking more about "modelling board X, which we know > always has 2xA53 and 4xA57 with these MPIDRs". > > We actually have a concrete instance in the tree at the moment: > the raspberry pi 2. Specifically hw/arm/bcm2836.c sets the > mp_affinity for each cpu to 0xF00 | n (where n is the CPUID). > Currently it's doing that by reaching in and messing with > the mp_affinity field directly, but really it ought to be > doing it by setting a property on the CPU, and what it > wants isn't somethnig that can be expressed with a simple > nr_sockets/nr_cores/etc scheme. I am confused now. I thought QOM properties were meant for user-visible and/or user-configurable data. I assumed that if it's only meant to be used by C code inside QEMU, C functions and/or C struct fields were the way to go. See a previous thread where this was discussed: https://www.mail-archive.com/qemu-devel@nongnu.org/msg387169.html (Subject: "QOM: best way for parents to pass information to children?") > > > Anyway, atm, I don't know of any reason to have the property user- > > settable, so it seems safest to keep it hidden until we decide. > > I agree that it doesn't make sense to let the user mess with it, > but it should be available for the board code to read and write. If it doesn't make sense to let the user mess with it, why would we make it a QOM property? -- Eduardo