All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Anthony Green <green@moxielogic.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Alexander Graf <agraf@suse.de>, Max Filippov <jcmvbkbc@gmail.com>,
	Greg Ungerer <gerg@uclinux.org>,
	Guan Xuetao <gxt@mprc.pku.edu.cn>, Jia Liu <proljc@gmail.com>,
	Markus Armbruster <armbru@redhat.com>,
	Bharata B Rao <bharata@linux.vnet.ibm.com>,
	Richard Henderson <rth@twiddle.net>,
	Artyom Tarasenko <atar4qemu@gmail.com>,
	Laurent Vivier <lvivier@redhat.com>,
	Andrew Jones <drjones@redhat.com>,
	Chen Gang <gang.chen.5i5j@gmail.com>, Greg Kurz <groug@kaod.org>,
	qemu-arm <qemu-arm@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	David Gibson <david@gibson.dropbear.id.au>,
	Matthew Rosato <mjrosato@linux.vnet.ibm.com>,
	Bastian Koppelmann <kbastian@mail.uni-paderborn.de>,
	Michael Walle <michael@walle.cc>,
	"qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
	Igor Mammedov <imammedo@redhat.com>,
	Aurelien Jarno <aurelien@aurel32.net>
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())
Date: Tue, 18 Oct 2016 16:45:32 -0200	[thread overview]
Message-ID: <20161018184532.GC3275@thinpad.lan.raisama.net> (raw)
In-Reply-To: <CAFEAcA-TxifV3Wfnv=6byJSABnLyPnbtfMsK+aPvwGd-p5sqLA@mail.gmail.com>

On Tue, Oct 18, 2016 at 07:12:51PM +0100, Peter Maydell wrote:
> On 18 October 2016 at 18:57, Andrew Jones <drjones@redhat.com> 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

WARNING: multiple messages have this Message-ID (diff)
From: Eduardo Habkost <ehabkost@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Anthony Green <green@moxielogic.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Alexander Graf <agraf@suse.de>, Max Filippov <jcmvbkbc@gmail.com>,
	Greg Ungerer <gerg@uclinux.org>,
	"Edgar E . Iglesias" <edgar.iglesias@gmail.com>,
	Guan Xuetao <gxt@mprc.pku.edu.cn>, Jia Liu <proljc@gmail.com>,
	Markus Armbruster <armbru@redhat.com>,
	Bharata B Rao <bharata@linux.vnet.ibm.com>,
	Richard Henderson <rth@twiddle.net>,
	Artyom Tarasenko <atar4qemu@gmail.com>,
	Laurent Vivier <lvivier@redhat.com>,
	Andrew Jones <drjones@redhat.com>,
	Chen Gang <gang.chen.5i5j@gmail.com>, Greg Kurz <groug@kaod.org>,
	qemu-arm <qemu-arm@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	David Gibson <david@gibson.dropbear.id.au>,
	Matthew Rosato <mjrosato@linux.vnet.ibm.com>,
	Bastian Koppelmann <kbastian@mail.uni-paderborn.de>,
	Michael Walle <michael@walle.cc>,
	"qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
	Igor Mammedov <imammedo@redhat.com>,
	Aurelien Jarno <aurelien@aurel32.net>
Subject: [Qemu-devel] QOM properties vs C functions/fields (was Re: [PATCH v3 2/3] exec: rename cpu_exec_init() as cpu_exec_realizefn())
Date: Tue, 18 Oct 2016 16:45:32 -0200	[thread overview]
Message-ID: <20161018184532.GC3275@thinpad.lan.raisama.net> (raw)
Message-ID: <20161018184532.kkDQs10FUu75Y4y0KBVX9DaWSpRdmXZ5y1dK-DMU4VY@z> (raw)
In-Reply-To: <CAFEAcA-TxifV3Wfnv=6byJSABnLyPnbtfMsK+aPvwGd-p5sqLA@mail.gmail.com>

On Tue, Oct 18, 2016 at 07:12:51PM +0100, Peter Maydell wrote:
> On 18 October 2016 at 18:57, Andrew Jones <drjones@redhat.com> 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

  reply	other threads:[~2016-10-18 18:45 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-14 22:52 [Qemu-arm] [PATCH v3 0/3] Split cpu_exec_init() into an init and a realize part Laurent Vivier
2016-10-14 22:52 ` [Qemu-arm] [PATCH v3 1/3] exec: split cpu_exec_init() Laurent Vivier
2016-10-17  3:43   ` David Gibson
2016-10-17 11:15   ` Igor Mammedov
2016-10-17 18:46   ` Eduardo Habkost
2016-10-14 22:52 ` [Qemu-arm] [PATCH v3 2/3] exec: rename cpu_exec_init() as cpu_exec_realizefn() Laurent Vivier
2016-10-17  3:43   ` [Qemu-devel] " David Gibson
2016-10-17 11:20   ` [Qemu-arm] " Igor Mammedov
2016-10-17 14:03   ` Eduardo Habkost
2016-10-17 14:25     ` Laurent Vivier
2016-10-17 19:20   ` Eduardo Habkost
2016-10-18 10:48     ` Igor Mammedov
2016-10-18 13:00     ` [Qemu-arm] [Qemu-devel] " Andrew Jones
2016-10-18 13:18       ` Eduardo Habkost
2016-10-18 14:22         ` Andrew Jones
2016-10-18 15:22           ` [Qemu-arm] " Eduardo Habkost
2016-10-18 16:22             ` Andrew Jones
2016-10-18 16:57               ` [Qemu-arm] " Laurent Vivier
2016-10-18 17:07               ` Peter Maydell
2016-10-18 17:57                 ` Andrew Jones
2016-10-18 18:12                   ` Peter Maydell
2016-10-18 18:45                     ` Eduardo Habkost [this message]
2016-10-18 18:45                       ` [Qemu-devel] QOM properties vs C functions/fields (was Re: [PATCH v3 2/3] exec: rename cpu_exec_init() as cpu_exec_realizefn()) Eduardo Habkost
2016-10-18 20:30                       ` [Qemu-arm] QOM properties vs C functions/fields (was Re: [Qemu-devel] " Peter Maydell
2016-10-18 20:30                         ` [Qemu-devel] QOM properties vs C functions/fields (was " Peter Maydell
2016-10-18 20:49                         ` [Qemu-arm] QOM properties vs C functions/fields (was Re: [Qemu-devel] " Eduardo Habkost
2016-10-18 20:49                           ` [Qemu-devel] QOM properties vs C functions/fields (was " Eduardo Habkost
2016-10-18 21:08                           ` Peter Maydell
2016-10-18 21:08                             ` [Qemu-arm] QOM properties vs C functions/fields (was Re: [Qemu-devel] " Peter Maydell
2016-10-19 11:11                             ` Eduardo Habkost
2016-10-19 11:11                               ` [Qemu-devel] QOM properties vs C functions/fields (was " Eduardo Habkost
2016-10-19 11:22                               ` [Qemu-arm] QOM properties vs C functions/fields (was Re: [Qemu-devel] " Peter Maydell
2016-10-19 11:22                                 ` [Qemu-devel] QOM properties vs C functions/fields (was " Peter Maydell
2016-10-21 18:26                             ` [Qemu-arm] " Markus Armbruster
2016-10-22  9:31                               ` Peter Maydell
2016-10-24  7:24                                 ` Markus Armbruster
2016-10-14 22:52 ` [Qemu-arm] [PATCH v3 3/3] exec: call cpu_exec_exit() from a CPU unrealize common function Laurent Vivier
2016-10-17  3:43   ` [Qemu-devel] " David Gibson
2016-10-17 11:30   ` Igor Mammedov
2016-10-17  3:44 ` [Qemu-arm] [PATCH v3 0/3] Split cpu_exec_init() into an init and a realize part David Gibson
2016-10-17 18:47   ` Eduardo Habkost
2016-10-17 22:50     ` David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161018184532.GC3275@thinpad.lan.raisama.net \
    --to=ehabkost@redhat.com \
    --cc=agraf@suse.de \
    --cc=armbru@redhat.com \
    --cc=atar4qemu@gmail.com \
    --cc=aurelien@aurel32.net \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=drjones@redhat.com \
    --cc=gang.chen.5i5j@gmail.com \
    --cc=gerg@uclinux.org \
    --cc=green@moxielogic.com \
    --cc=groug@kaod.org \
    --cc=gxt@mprc.pku.edu.cn \
    --cc=imammedo@redhat.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=kbastian@mail.uni-paderborn.de \
    --cc=lvivier@redhat.com \
    --cc=michael@walle.cc \
    --cc=mjrosato@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=proljc@gmail.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.