From: Laurent Vivier <lvivier@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>,
Igor Mammedov <imammedo@redhat.com>,
Bharata B Rao <bharata@linux.vnet.ibm.com>,
David Gibson <david@gibson.dropbear.id.au>,
Peter Maydell <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Anthony Green <green@moxielogic.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>,
Markus Armbruster <armbru@redhat.com>, Jia Liu <proljc@gmail.com>,
Artyom Tarasenko <atar4qemu@gmail.com>,
"Edgar E . Iglesias" <edgar.iglesias@gmail.com>,
Michael Walle <michael@walle.cc>,
Andrew Jones <drjones@redhat.com>,
Aurelien Jarno <aurelien@aurel32.net>,
Chen Gang <gang.chen.5i5j@gmail.com>,
qemu-ppc@nongnu.org,
Bastian Koppelmann <kbastian@mail.uni-paderborn.de>,
Greg Kurz <groug@kaod.org>, Max Filippov <jcmvbkbc@gmail.com>,
Laurent Vivier <lvivier@redhat.com>
Subject: [Qemu-devel] [PATCH v4 0/3] Split cpu_exec_init() into an init and a realize part
Date: Tue, 18 Oct 2016 21:22:50 +0200 [thread overview]
Message-ID: <1476818573-5228-1-git-send-email-lvivier@redhat.com> (raw)
Since commit 42ecaba ("target-i386: Call cpu_exec_init() on realize"),
, commit 6dd0f83 ("target-ppc: Move cpu_exec_init() call to realize function"),
and commit c6644fc ("s390x/cpu: Get rid of side effects when creating a vcpu"),
cpu_exec_init() has been moved to realize function for some architectures
to implement CPU htoplug. This allows any failures from cpu_exec_init() to be
handled appropriately.
This series tries to do the same work for all the other CPUs.
But as the ARM Virtual Machine ("virt") needs the "memory" property of the CPU
in the machine init function (the "memory" property is created in
cpu_exec_init() we want to move to the realize part), split cpu_exec_init() in
two parts: a realize part (cpu_exec_realizefn(), adding the CPU in the
environment) and an init part (cpu_exec_initfn(), initializing the CPU, like
adding the "memory" property). To mirror the realize part, add an unrealize
part, and remove the cpu_exec_exit() call from the finalize part.
This also allows to remove all the "cannot_destroy_with_object_finalize_yet"
properties from the CPU device class.
v4:
- arm: update mp_affinity in realize only if it s not set by the user
- i386 and ppc: add an parent_unrealize to call the Device unrealize
because it is overwritten by the CPU unrealize
- update commit messages
v3:
- reorganize the series in 3 patches:
1- split cpu_exec_init() and call the init part from
cpu_common_initfn()
2- move all the cpu_exec_realize() calls to the
XXX_cpu_realizefn() functions
3- create a cpu_common_unrealizefn() function
and call the cpu_exec_unrealize() function from here,
except for ppc64 and i386 that have their own XX_cpu_unrealizefn()
functions
- rename cpu_exec_init(), cpu_exec_realize(), cpu_exec_unrealize()
to cpu_exec_initfn(), cpu_exec_realizefn() and cpu_exec_unrealizefn(),
- move cpu_exec_unrealizefn() to the device class unrealize
and declare it in qom/cpu.h instead of exec/exec-all.h
v2:
- rename cpu_exec_exit() as cpu_exec_unrealize(),
as it un-does what cpu_exec_realize() does,
- remove cpu_exec_exit() from ppc_cpu_unrealizefn() as
it is called from cpu_common_finalize(),
- add a patch to move all cpu_exec_init() from
all XX_cpu_initfn() to cpu_common_initfn(),
- arm: move setting of cpu->mp_affinity to
arm_cpu_realizefn() as the cpu_index is now set in
cpu_exec_realizefn().
- update some commit messages
Laurent Vivier (3):
exec: split cpu_exec_init()
exec: move cpu_exec_init() calls to realize functions
exec: call cpu_exec_exit() from a CPU unrealize common function
exec.c | 12 +++++++-----
include/exec/exec-all.h | 1 -
include/qom/cpu.h | 4 +++-
qom/cpu.c | 10 +++++++++-
target-alpha/cpu.c | 15 +++++++--------
target-arm/cpu.c | 45 ++++++++++++++++++++++-----------------------
target-cris/cpu.c | 15 +++++++--------
target-i386/cpu-qom.h | 1 +
target-i386/cpu.c | 20 ++++++++++++++------
target-lm32/cpu.c | 15 +++++++--------
target-m68k/cpu.c | 15 +++++++--------
target-microblaze/cpu.c | 14 +++++++-------
target-mips/cpu.c | 15 +++++++--------
target-moxie/cpu.c | 15 +++++++--------
target-openrisc/cpu.c | 15 +++++++--------
target-ppc/cpu-qom.h | 1 +
target-ppc/translate_init.c | 11 +++++++++--
target-s390x/cpu.c | 8 +-------
target-sh4/cpu.c | 15 +++++++--------
target-sparc/cpu.c | 18 +++++++++---------
target-tilegx/cpu.c | 15 +++++++--------
target-tricore/cpu.c | 15 +++++++--------
target-unicore32/cpu.c | 18 +++++++++---------
target-xtensa/cpu.c | 15 +++++++--------
24 files changed, 169 insertions(+), 159 deletions(-)
--
2.7.4
next reply other threads:[~2016-10-18 19:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-18 19:22 Laurent Vivier [this message]
2016-10-18 19:22 ` [Qemu-devel] [PATCH v4 1/3] exec: split cpu_exec_init() Laurent Vivier
2016-10-18 19:22 ` [Qemu-devel] [PATCH v4 2/3] exec: move cpu_exec_init() calls to realize functions Laurent Vivier
2016-10-19 8:13 ` Andrew Jones
2016-10-19 8:30 ` Laurent Vivier
2016-10-19 13:46 ` Andrew Jones
2016-10-19 13:56 ` Laurent Vivier
2016-10-18 19:22 ` [Qemu-devel] [PATCH v4 3/3] exec: call cpu_exec_exit() from a CPU unrealize common function Laurent Vivier
2016-10-18 19:56 ` [Qemu-devel] [PATCH v4 0/3] Split cpu_exec_init() into an init and a realize part Eduardo Habkost
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=1476818573-5228-1-git-send-email-lvivier@redhat.com \
--to=lvivier@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=imammedo@redhat.com \
--cc=jcmvbkbc@gmail.com \
--cc=kbastian@mail.uni-paderborn.de \
--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).