qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Laurent Vivier <lvivier@redhat.com>,
	Bharata B Rao <bharata@linux.vnet.ibm.com>,
	David Gibson <david@gibson.dropbear.id.au>,
	Peter Maydell <peter.maydell@linaro.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Alexander Graf <agraf@suse.de>,
	Matthew Rosato <mjrosato@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org, Richard Henderson <rth@twiddle.net>,
	qemu-arm@nongnu.org, Greg Ungerer <gerg@uclinux.org>,
	Guan Xuetao <gxt@mprc.pku.edu.cn>, Jia Liu <proljc@gmail.com>,
	Markus Armbruster <armbru@redhat.com>,
	Artyom Tarasenko <atar4qemu@gmail.com>,
	"Edgar E . Iglesias" <edgar.iglesias@gmail.com>,
	Michael Walle <michael@walle.cc>,
	Chen Gang <gang.chen.5i5j@gmail.com>,
	Aurelien Jarno <aurelien@aurel32.net>,
	Anthony Green <green@moxielogic.com>,
	qemu-ppc@nongnu.org,
	Bastian Koppelmann <kbastian@mail.uni-paderborn.de>,
	Greg Kurz <groug@kaod.org>, Max Filippov <jcmvbkbc@gmail.com>,
	drjones@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 2/3] exec: rename cpu_exec_init() as cpu_exec_realizefn()
Date: Tue, 18 Oct 2016 12:48:16 +0200	[thread overview]
Message-ID: <20161018124816.1b88dc80@nial.brq.redhat.com> (raw)
In-Reply-To: <20161017192022.GA3275@thinpad.lan.raisama.net>

On Mon, 17 Oct 2016 17:20:22 -0200
Eduardo Habkost <ehabkost@redhat.com> wrote:

> On Sat, Oct 15, 2016 at 12:52:48AM +0200, Laurent Vivier wrote:
> > Modify all CPUs to call it from XXX_cpu_realizefn() function.
> > 
> > Remove all the cannot_destroy_with_object_finalize_yet as
> > unsafe references have been moved to cpu_exec_realizefn().
> > (tested with QOM command provided by commit 4c315c27)
> > 
> > for arm:
> > 
> > Setting of cpu->mp_affinity is moved from arm_cpu_initfn()
> > to arm_cpu_realizefn() as setting of cpu_index is now done
> > in cpu_exec_realizefn().
> > 
> > Signed-off-by: Laurent Vivier <lvivier@redhat.com>  
> [...]
> > diff --git a/target-arm/cpu.c b/target-arm/cpu.c
> > index 1b9540e..364a45d 100644
> > --- a/target-arm/cpu.c
> > +++ b/target-arm/cpu.c
> > @@ -441,22 +441,11 @@ static void arm_cpu_initfn(Object *obj)
> >      CPUState *cs = CPU(obj);
> >      ARMCPU *cpu = ARM_CPU(obj);
> >      static bool inited;
> > -    uint32_t Aff1, Aff0;
> >  
> >      cs->env_ptr = &cpu->env;
> > -    cpu_exec_init(cs, &error_abort);
> >      cpu->cp_regs = g_hash_table_new_full(g_int_hash, g_int_equal,
> >                                           g_free, g_free);
> >  
> > -    /* This cpu-id-to-MPIDR affinity is used only for TCG; KVM will override it.
> > -     * We don't support setting cluster ID ([16..23]) (known as Aff2
> > -     * in later ARM ARM versions), or any of the higher affinity level fields,
> > -     * so these bits always RAZ.
> > -     */
> > -    Aff1 = cs->cpu_index / ARM_CPUS_PER_CLUSTER;
> > -    Aff0 = cs->cpu_index % ARM_CPUS_PER_CLUSTER;
> > -    cpu->mp_affinity = (Aff1 << ARM_AFF1_SHIFT) | Aff0;
> > -
> >  #ifndef CONFIG_USER_ONLY
> >      /* Our inbound IRQ and FIQ lines */
> >      if (kvm_enabled()) {  
> [...]
> > @@ -631,6 +628,15 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
> >          set_feature(env, ARM_FEATURE_THUMB_DSP);
> >      }
> >  
> > +    /* This cpu-id-to-MPIDR affinity is used only for TCG; KVM will override it.
> > +     * We don't support setting cluster ID ([16..23]) (known as Aff2
> > +     * in later ARM ARM versions), or any of the higher affinity level fields,
> > +     * so these bits always RAZ.
> > +     */
> > +    Aff1 = cs->cpu_index / ARM_CPUS_PER_CLUSTER;
> > +    Aff0 = cs->cpu_index % ARM_CPUS_PER_CLUSTER;
> > +    cpu->mp_affinity = (Aff1 << ARM_AFF1_SHIFT) | Aff0;
> > +  
>
> This will override any value set in the "mp-affinity" property,
> The mp-affinity property can be set by the user in the
> command-line, and it is also set by machvirt_init() in
> hw/arm/virt.c.
> 
> Considering that each CPU is supposed to have a different value,
> I doubt there are existing use cases for mp-affinity being set
> directly by the user.
> 
> I suggest having a "cluster-size" property, instead of
> "mp-affinity". This way the mp_affinity field can be calculated
> on realize, based on the configured cluster-size.
CCing Drew as he knows more about MPIDR stuff more.

> 
> >      if (cpu->reset_hivecs) {
> >              cpu->reset_sctlr |= (1 << 13);
> >      }  
> [...]
> 

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

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-14 22:52 [Qemu-devel] [PATCH v3 0/3] Split cpu_exec_init() into an init and a realize part Laurent Vivier
2016-10-14 22:52 ` [Qemu-devel] [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-devel] [PATCH v3 2/3] exec: rename cpu_exec_init() as cpu_exec_realizefn() Laurent Vivier
2016-10-17  3:43   ` David Gibson
2016-10-17 11:20   ` 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 [this message]
2016-10-18 13:00     ` Andrew Jones
2016-10-18 13:18       ` Eduardo Habkost
2016-10-18 14:22         ` Andrew Jones
2016-10-18 15:22           ` Eduardo Habkost
2016-10-18 16:22             ` Andrew Jones
2016-10-18 16:57               ` 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                     ` [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                       ` Peter Maydell
2016-10-18 20:49                         ` Eduardo Habkost
2016-10-18 21:08                           ` Peter Maydell
2016-10-19 11:11                             ` Eduardo Habkost
2016-10-19 11:22                               ` Peter Maydell
2016-10-21 18:26                             ` Markus Armbruster
2016-10-22  9:31                               ` Peter Maydell
2016-10-24  7:24                                 ` Markus Armbruster
2016-10-14 22:52 ` [Qemu-devel] [PATCH v3 3/3] exec: call cpu_exec_exit() from a CPU unrealize common function Laurent Vivier
2016-10-17  3:43   ` David Gibson
2016-10-17 11:30   ` Igor Mammedov
2016-10-17  3:44 ` [Qemu-devel] [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=20161018124816.1b88dc80@nial.brq.redhat.com \
    --to=imammedo@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=edgar.iglesias@gmail.com \
    --cc=ehabkost@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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).