From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Crosthwaite <crosthwaitepeter@gmail.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, rth@twiddle.net,
edgar.iglesias@gmail.com, afaerber@suse.de,
Peter Crosthwaite <crosthwaite.peter@gmail.com>
Subject: Re: [Qemu-devel] [RFC v2 00/34] Multi Architecture System Emulation
Date: Mon, 01 Jun 2015 10:44:45 +0200 [thread overview]
Message-ID: <556C1B7D.3090807@redhat.com> (raw)
In-Reply-To: <cover.1433052532.git.crosthwaite.peter@gmail.com>
On 31/05/2015 08:11, Peter Crosthwaite wrote:
> include/exec/*.h and some of the common code needs some refactoring to setup
> this single vs multi compile split. Mostly code movements.
Thanks for attempting this!
The best thing in this series is that a lot of changes can be done
piecewise and are perfectly acceptable even before the main multiarch
emulation goes in. In fact, I hardly see for example any header file
change that is not acceptable (if done for all targets) as an
independent change.
There are two changes I'd make:
1) start with header file cleanups and de-ENV_GET_CPU-ification, then
core code changes, then build system changes.
2) organize patches so that the same changes are done at once to all
architectures. This is of course not always applicable, but it can be
done for things such as changing the cpu.h include to target-FOO/cpu.h,
moving things out of cpu.h to new headers, and even #defining
CPU-specific types.
Paolo
> The interface between the multi compile and single compiled files needs to be
> virtualised using QOM cpu functions. But this is now a very low footprint
> change as most of the virtualised hooks are now in mutli-compiled code (they
> only exist as text once). There are more new hooks than before, but the per
> target change pattern is reduced.
>
> There is a lot more core code changes and less target-foo changes this time.
> Full coversion is looking more feasible for one QEMU that can do everything.
>
> For the implementation of the series, the trickiest part is (still) cpu.h
> inclusion management. There are now more than one cpu.h's and different
> parts of the tree need a different include scheme. target-multi defines
> it's own cpu.h which is bare minimum defs as needed by core code only.
> target-foo/cpu.h are mostly the same but refactored to avoid collisions
> with other cpu.h's. Inclusion scheme goes something like
> this (for the multi-arch build):
>
> *: Core code includes only target-multi/cpu.h
> *: target-foo/ implementation code includes target-foo/cpu.h locally
> *: System level code (e.g. mach models) can use multiple target-foo/cpu.h's
>
> The hardest unasnwered Q is (still) what to do about bootloading. Currently
> each arch has it's own architecture specific bootloading which may assume a
> single architecture. I have applied some hacks to at least get this
> RFC testable using a -kernel -firmware split but going forward being
> able to associate an elf/image with a cpu explictitly needs to be
> solved.
>
> No support for KVM, im not sure if a mix of TCG and KVM is supported even for
> a single arch? (which would be prerequisite to MA KVM).
>
> Depends (not heavily) on some already on list patches:
>
> memory_mapping: Use qemu_common.h include
> configure: Unify arm and aarch64 disas configury
> Makefile.target: set master BUILD_DIR
> cpus: Change exec_init arg to cpu, not env
> cpus: Change tcg_cpu_exec arg to cpu, not env
> gdbserver: _fork: Change fn to accept cpu instead of env
> translate-all: Change tb_flush env argument to cpu
> microblaze: s3adsp: Instantiate CPU using QOM
> disas: cris: QOMify target specific disas setup
> disas: cris: Fix 0 buffer length case
> disas: microblaze: QOMify target specific disas setup
> disas: arm: QOMify target specific disas setup
> disas: arm-a64: Make printfer and stream variable
> disas: QOMify target specific setup
> disas: Add print_insn to disassemble info
> disas: Remove uses of CPU env
> monitor: Split mon_get_cpu fn to remove ENV_GET_CPU
> device-tree: Make a common-obj
>
> These deps do not really inhibit at least a high level review of this series.
>
> Regards,
> Peter
>
> Changed since v1:
> Near total rewrite.
>
> Peter Crosthwaite (34):
> cpu-defs: Move CPU_TEMP_BUF_NLONGS to tcg
> cpu-exec: Purge all uses of CPU_GET_ENV
> Makefile.target: Introduce arch-obj
> cpu-exec: Migrate some generic fns to cpus.c
> translate: Listify tcg_exec_init
> cpu-common: Define tb_page_addr_t for everyone
> exec-all: Move cpu_can_do_io to qom/cpu.h
> translate-all: Move tcg_handle_interrupt to -common
> include/exec: Move standard exceptions to cpu-all.h
> include/exec: Split target_long def to new header
> include/exec: Move cputlb exec.c defs out
> include/exec: Move tb hash functions out
> cpu-defs: Move out TB_JMP defines
> cpu-defs: Allow multiple inclusions
> HACK: monitor: Comment out TCG profile ops
> HACK: Disable list_cpus
> HACK: globalise TCG page size variables
> HACK: monitor: uninclude cpu_ldst
> HACK: disas: Defeature print_target_address
> HACK: exec: comment out use of cpu_get_tb_cpu_from_state
> core: virtualise CPU interfaces completely
> microblaze: enable multi-arch
> arm: cpu: static inline cpu_arm_init
> target-arm: Split cp helper API to new C file
> arm: enable multi-arch
> core: Introduce multi-arch build
> hw: arm: Explicitly include cpu.h for consumers
> arm: Remove ELF_MACHINE from cpu.h
> hw: mb: Explicitly include cpu.h for consumers
> mb: Remove ELF_MACHINE from cpu.h
> arm: boot: Don't assume all CPUs are ARM
> arm: xilinx_zynq: Add a Microblaze
> HACK: mb: boot: Assume using -firmware for mb software
> HACK: mb: boot: Disable dtb load in multi-arch
>
> Makefile.objs | 1 +
> Makefile.target | 34 +++-
> arch_init.c | 4 +-
> configure | 39 ++++-
> cpu-exec.c | 101 ++++--------
> cpus.c | 54 ++++++-
> cputlb.c | 40 +++--
> default-configs/multi-softmmu.mak | 2 +
> disas.c | 12 +-
> exec.c | 40 +++--
> gdbstub.c | 2 +-
> hw/arm/armv7m.c | 2 +-
> hw/arm/boot.c | 8 +-
> hw/arm/strongarm.h | 2 +
> hw/arm/xilinx_zynq.c | 15 ++
> hw/microblaze/boot.c | 12 +-
> hw/microblaze/boot.h | 2 +
> include/exec/cpu-all.h | 6 +
> include/exec/cpu-common.h | 4 +
> include/exec/cpu-defs.h | 50 ++----
> include/exec/cputlb.h | 16 --
> include/exec/exec-all.h | 73 ++-------
> include/exec/target-long.h | 52 ++++++
> include/exec/tb-hash.h | 51 ++++++
> include/hw/arm/arm.h | 3 +
> include/hw/arm/digic.h | 2 +
> include/hw/arm/exynos4210.h | 2 +
> include/hw/arm/omap.h | 2 +
> include/hw/arm/pxa.h | 2 +
> include/qemu-common.h | 5 +
> include/qom/cpu.h | 84 ++++++++++
> include/sysemu/arch_init.h | 1 +
> linux-user/elfload.c | 3 +
> monitor.c | 5 +-
> qom/cpu.c | 1 +
> stubs/Makefile.objs | 1 +
> stubs/cpu-qom.c | 76 +++++++++
> target-arm/Makefile.objs | 24 +--
> target-arm/cpu-qom.h | 2 +
> target-arm/cpu.c | 1 +
> target-arm/cpu.h | 70 +++++++-
> target-arm/helper.c | 331 --------------------------------------
> target-arm/hw/Makefile.objs | 1 +
> target-arm/hw/cp.c | 330 +++++++++++++++++++++++++++++++++++++
> target-microblaze/Makefile.objs | 6 +-
> target-microblaze/cpu-qom.h | 2 +
> target-microblaze/cpu.c | 1 +
> target-microblaze/cpu.h | 44 ++++-
> target-multi/cpu.h | 16 ++
> target-multi/helper.h | 1 +
> tcg/tcg.h | 7 +-
> tcg/tci/tcg-target.h | 3 +-
> tci.c | 2 +-
> translate-all.c | 45 +-----
> translate-all.h | 2 -
> translate-common.c | 89 ++++++++++
> 56 files changed, 1131 insertions(+), 655 deletions(-)
> create mode 100644 default-configs/multi-softmmu.mak
> create mode 100644 include/exec/target-long.h
> create mode 100644 include/exec/tb-hash.h
> create mode 100644 stubs/cpu-qom.c
> create mode 100644 target-arm/hw/Makefile.objs
> create mode 100644 target-arm/hw/cp.c
> create mode 100644 target-multi/cpu.h
> create mode 100644 target-multi/helper.h
> create mode 100644 translate-common.c
>
prev parent reply other threads:[~2015-06-01 8:45 UTC|newest]
Thread overview: 99+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-31 6:11 [Qemu-devel] [RFC v2 00/34] Multi Architecture System Emulation Peter Crosthwaite
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 01/34] cpu-defs: Move CPU_TEMP_BUF_NLONGS to tcg Peter Crosthwaite
2015-06-01 18:57 ` Richard Henderson
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 02/34] cpu-exec: Purge all uses of CPU_GET_ENV Peter Crosthwaite
2015-06-01 19:03 ` Richard Henderson
2015-06-07 22:57 ` Peter Crosthwaite
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 03/34] Makefile.target: Introduce arch-obj Peter Crosthwaite
2015-06-01 19:10 ` Richard Henderson
2015-06-02 9:40 ` Peter Crosthwaite
2015-06-02 10:34 ` Paolo Bonzini
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 04/34] cpu-exec: Migrate some generic fns to cpus.c Peter Crosthwaite
2015-06-01 7:45 ` Paolo Bonzini
2015-07-10 6:37 ` Peter Crosthwaite
2015-06-01 19:12 ` Richard Henderson
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 05/34] translate: Listify tcg_exec_init Peter Crosthwaite
2015-06-01 19:17 ` Richard Henderson
2015-07-10 10:15 ` Peter Crosthwaite
2015-07-11 9:16 ` Peter Crosthwaite
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 06/34] cpu-common: Define tb_page_addr_t for everyone Peter Crosthwaite
2015-06-01 7:51 ` Paolo Bonzini
2015-06-07 23:06 ` Peter Crosthwaite
2015-06-24 9:48 ` Paolo Bonzini
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 07/34] exec-all: Move cpu_can_do_io to qom/cpu.h Peter Crosthwaite
2015-06-01 19:18 ` Richard Henderson
2015-06-24 9:11 ` Paolo Bonzini
2015-06-24 11:40 ` Pavel Dovgaluk
2015-06-24 11:41 ` Paolo Bonzini
2015-06-24 11:59 ` Pavel Dovgaluk
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 08/34] translate-all: Move tcg_handle_interrupt to -common Peter Crosthwaite
2015-06-01 19:20 ` Richard Henderson
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 09/34] include/exec: Move standard exceptions to cpu-all.h Peter Crosthwaite
2015-06-01 19:20 ` Richard Henderson
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 10/34] include/exec: Split target_long def to new header Peter Crosthwaite
2015-06-01 19:24 ` Richard Henderson
2015-06-01 19:51 ` Paolo Bonzini
2015-06-01 20:25 ` Peter Maydell
2015-06-01 20:27 ` Paolo Bonzini
2015-06-01 20:32 ` Richard Henderson
2015-06-01 20:39 ` Paolo Bonzini
2015-06-02 10:14 ` Peter Crosthwaite
2015-06-03 10:01 ` Paolo Bonzini
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 11/34] include/exec: Move cputlb exec.c defs out Peter Crosthwaite
2015-06-01 7:56 ` Paolo Bonzini
2015-06-02 9:44 ` Peter Crosthwaite
2015-06-02 10:38 ` Paolo Bonzini
2015-06-01 19:25 ` Richard Henderson
2015-06-24 9:25 ` Paolo Bonzini
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 12/34] include/exec: Move tb hash functions out Peter Crosthwaite
2015-06-01 7:56 ` Paolo Bonzini
2015-06-01 19:25 ` Richard Henderson
2015-06-24 9:05 ` Paolo Bonzini
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 13/34] cpu-defs: Move out TB_JMP defines Peter Crosthwaite
2015-06-01 19:25 ` Richard Henderson
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 14/34] cpu-defs: Allow multiple inclusions Peter Crosthwaite
2015-06-01 7:59 ` Paolo Bonzini
2015-06-01 19:29 ` Richard Henderson
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 15/34] HACK: monitor: Comment out TCG profile ops Peter Crosthwaite
2015-06-01 8:03 ` Paolo Bonzini
2015-06-01 18:49 ` Richard Henderson
2015-07-11 20:26 ` Peter Crosthwaite
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 16/34] HACK: Disable list_cpus Peter Crosthwaite
2015-06-01 8:04 ` Paolo Bonzini
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 17/34] HACK: globalise TCG page size variables Peter Crosthwaite
2015-06-01 18:52 ` Richard Henderson
2015-06-01 18:58 ` Peter Crosthwaite
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 18/34] HACK: monitor: uninclude cpu_ldst Peter Crosthwaite
2015-07-09 3:08 ` Peter Crosthwaite
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 19/34] HACK: disas: Defeature print_target_address Peter Crosthwaite
2015-06-01 8:08 ` Paolo Bonzini
2015-06-01 18:55 ` Richard Henderson
2015-06-08 0:21 ` Peter Crosthwaite
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 20/34] HACK: exec: comment out use of cpu_get_tb_cpu_from_state Peter Crosthwaite
2015-06-01 8:09 ` Paolo Bonzini
2015-06-08 0:22 ` Peter Crosthwaite
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 21/34] core: virtualise CPU interfaces completely Peter Crosthwaite
2015-06-01 8:11 ` Paolo Bonzini
2015-06-02 9:52 ` Peter Crosthwaite
2015-06-02 10:38 ` Paolo Bonzini
2015-06-01 19:53 ` Richard Henderson
2015-06-02 9:56 ` Peter Crosthwaite
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 22/34] microblaze: enable multi-arch Peter Crosthwaite
2015-06-01 8:16 ` Paolo Bonzini
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 23/34] arm: cpu: static inline cpu_arm_init Peter Crosthwaite
2015-06-01 8:18 ` Paolo Bonzini
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 24/34] target-arm: Split cp helper API to new C file Peter Crosthwaite
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 25/34] arm: enable multi-arch Peter Crosthwaite
2015-06-01 8:22 ` Paolo Bonzini
2015-05-31 6:11 ` [Qemu-devel] [RFC v2 26/34] core: Introduce multi-arch build Peter Crosthwaite
2015-06-01 8:26 ` Paolo Bonzini
2015-05-31 6:12 ` [Qemu-devel] [RFC v2 27/34] hw: arm: Explicitly include cpu.h for consumers Peter Crosthwaite
2015-05-31 6:12 ` [Qemu-devel] [RFC v2 28/34] arm: Remove ELF_MACHINE from cpu.h Peter Crosthwaite
2015-06-01 8:39 ` Paolo Bonzini
2015-05-31 6:12 ` [Qemu-devel] [RFC v2 29/34] hw: mb: Explicitly include cpu.h for consumers Peter Crosthwaite
2015-05-31 6:12 ` [Qemu-devel] [RFC v2 30/34] mb: Remove ELF_MACHINE from cpu.h Peter Crosthwaite
2015-05-31 6:12 ` [Qemu-devel] [RFC v2 31/34] arm: boot: Don't assume all CPUs are ARM Peter Crosthwaite
2015-05-31 6:12 ` [Qemu-devel] [RFC v2 32/34] arm: xilinx_zynq: Add a Microblaze Peter Crosthwaite
2015-05-31 6:12 ` [Qemu-devel] [RFC v2 33/34] HACK: mb: boot: Assume using -firmware for mb software Peter Crosthwaite
2015-05-31 6:12 ` [Qemu-devel] [RFC v2 34/34] HACK: mb: boot: Disable dtb load in multi-arch Peter Crosthwaite
2015-06-01 8:44 ` Paolo Bonzini [this message]
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=556C1B7D.3090807@redhat.com \
--to=pbonzini@redhat.com \
--cc=afaerber@suse.de \
--cc=crosthwaite.peter@gmail.com \
--cc=crosthwaitepeter@gmail.com \
--cc=edgar.iglesias@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@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).