From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Stefano Stabellini" <stefano.stabellini@eu.citrix.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Alexander Graf" <agraf@suse.de>,
"Blue Swirl" <blauwirbel@gmail.com>,
"Anthony Liguori" <anthony@codemonkey.ws>,
"Scott Wood" <scottwood@freescale.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Andreas Färber" <afaerber@suse.de>,
"Aurélien Jarno" <aurelien@aurel32.net>
Subject: [Qemu-devel] [PATCH qom-cpu v2 00/29] QOM CPUState, part 10: CPU loops
Date: Sun, 16 Jun 2013 17:57:20 +0200 [thread overview]
Message-ID: <1371398269-6213-1-git-send-email-afaerber@suse.de> (raw)
Hello,
This series changes cpu_single_env, first_cpu, next_cpu and thread_env to CPUState.
qemu_init_vcpu() is converted to CPUState and moved away from targets.
cpu_unassigned_access(), cpu_dump_state() and cpu_dump_statistics() are turned
into CPUClass methods. exec/hwaddr.h is modified to allow its use in qom/cpu.h.
v2 takes the approach of leaving open-coded CPU loops in place and just changing
them over to CPUState in one big patch. It goes on to remove qemu_for_each_cpu()
and demonstrates the benefits of this invasive series by making a few devices
target-independent.
Available for testing at:
git://github.com/afaerber/qemu-cpu.git qom-cpu-10.v2
https://github.com/afaerber/qemu-cpu/commits/qom-cpu-10.v2
Regards,
Andreas
v1 -> v2:
* Fixed typo spotted by Li Guang.
* Dropped qemu_for_each_cpu() conversion patches.
* Applied most qemu_get_cpu() patches already.
* Fixed Xen breakage due to NULL cpu_single_env (reported by Stefano).
* Appended patch to drop qemu_for_each_cpu() (suggested by Markus).
* Appended patches to build arm_gic, arm_mptimer, openpic and sh_intc only once.
* Avoided some un-typed uses of CPUState::env_ptr.
Cc: Anthony Liguori <anthony@codemonkey.ws>
Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Aurélien Jarno <aurelien@aurel32.net>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com> (cpu_unassigned_access)
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> (dummy CPU thread changes)
Cc: Peter Maydell <peter.maydell@linaro.org> (hwaddr, arm devs)
Cc: Alexander Graf <agraf@suse.de> (openpic)
Cc: Scott Wood <scottwood@freescale.com> (openpic)
Andreas Färber (29):
kvm: Change kvm_cpu_synchronize_state() argument to CPUState
kvm: Change cpu_synchronize_state() argument to CPUState
gdbstub: Simplify find_cpu()
cpu: Change cpu_exit() argument to CPUState
cpus: Change cpu_thread_is_idle() argument to CPUState
cpus: Change qemu_kvm_wait_io_event() argument to CPUState
kvm: Change kvm_set_signal_mask() argument to CPUState
cpus: Change qemu_kvm_init_cpu_signals() argument to CPUState
cpu: Turn cpu_dump_{state,statistics}() into CPUState hooks
kvm: Change kvm_handle_internal_error() argument to CPUState
kvm: Change kvm_cpu_exec() argument to CPUState
gdbstub: Set gdb_set_stop_cpu() argument to CPUState
cpus: Change cpu_handle_guest_debug() argument to CPUState
cpus: Change qemu_kvm_start_vcpu() argument to CPUState
cpus: Change qemu_dummy_start_vcpu() argument to CPUState
cpu: Change qemu_init_vcpu() argument to CPUState
hwaddr: Make hwaddr type usable beyond softmmu
cpu: Turn cpu_unassigned_access() into a CPUState hook
cpu: Replace cpu_single_env with CPUState cpu_single_cpu
kvm: Change kvm_remove_all_breakpoints() argument to CPUState
cpu: Make first_cpu and next_cpu CPUState
linux-user: Change thread_env to CPUState
bsd-user: Change thread_env to CPUState
cpu: Drop qemu_for_each_cpu()
cpu: Move CPU_INTERRUPT_* to qom/cpu.h
intc/sh_intc: Build sh_intc only once
intc/arm_gic: Build arm_gic only once
intc/openpic: Build openpic only once
timer/arm_mptimer: Build arm_mptimer only once
bsd-user/elfload.c | 6 +-
bsd-user/main.c | 9 +-
bsd-user/qemu.h | 2 +-
cpu-exec.c | 13 +--
cpus.c | 227 ++++++++++++++++++++----------------------
cputlb.c | 19 ++--
dump.c | 16 ++-
exec.c | 67 +++++--------
gdbstub.c | 61 +++++++-----
hw/acpi/piix4.c | 20 ++--
hw/alpha/typhoon.c | 12 +--
hw/arm/boot.c | 10 +-
hw/arm/exynos4_boards.c | 4 +-
hw/arm/highbank.c | 2 +-
hw/arm/pxa2xx.c | 3 +-
hw/arm/realview.c | 2 +-
hw/arm/vexpress.c | 2 +-
hw/arm/xilinx_zynq.c | 2 +-
hw/i386/kvm/apic.c | 2 +-
hw/i386/kvm/clock.c | 12 ++-
hw/i386/kvmvapic.c | 21 ++--
hw/i386/pc.c | 28 +++---
hw/i386/pc_piix.c | 3 +-
hw/intc/Makefile.objs | 6 +-
hw/intc/arm_gic.c | 4 +-
hw/intc/armv7m_nvic.c | 11 +-
hw/intc/openpic.c | 7 +-
hw/intc/sh_intc.c | 6 +-
hw/isa/lpc_ich9.c | 2 +-
hw/mips/mips_fulong2e.c | 6 +-
hw/mips/mips_jazz.c | 6 +-
hw/mips/mips_malta.c | 9 +-
hw/misc/vmport.c | 26 +++--
hw/ppc/mpc8544_guts.c | 3 +-
hw/ppc/ppc.c | 12 +--
hw/ppc/ppce500_spin.c | 2 +-
hw/ppc/prep.c | 12 ++-
hw/ppc/spapr.c | 27 +++--
hw/ppc/spapr_rtas.c | 2 +-
hw/sparc/sun4m.c | 5 +-
hw/timer/Makefile.objs | 2 +-
hw/timer/arm_mptimer.c | 3 +-
include/exec/cpu-all.h | 66 ------------
include/exec/cpu-common.h | 2 +
include/exec/cpu-defs.h | 3 +-
include/exec/gdbstub.h | 2 +-
include/exec/hwaddr.h | 4 -
include/exec/memory.h | 2 +
include/exec/poison.h | 13 ---
include/hw/ppc/ppc.h | 2 -
include/hw/ppc/ppc_e500.h | 6 ++
include/hw/sh4/sh.h | 2 +
include/qemu-common.h | 8 --
include/qemu/log.h | 2 +-
include/qom/cpu.h | 165 ++++++++++++++++++++++++++++--
include/sysemu/kvm.h | 12 +--
kvm-all.c | 45 ++++-----
kvm-stub.c | 10 +-
linux-user/elfload.c | 21 ++--
linux-user/linuxload.c | 3 +-
linux-user/main.c | 56 ++++++-----
linux-user/qemu.h | 2 +-
linux-user/signal.c | 12 ++-
linux-user/syscall.c | 15 +--
memory.c | 12 +--
memory_mapping.c | 16 +--
monitor.c | 23 ++---
qom/cpu.c | 60 +++++++----
stubs/cpus.c | 5 +
target-alpha/cpu-qom.h | 2 +
target-alpha/cpu.c | 5 +-
target-alpha/cpu.h | 6 +-
target-alpha/helper.c | 6 +-
target-alpha/mem_helper.c | 10 +-
target-arm/arm-semi.c | 3 +-
target-arm/cpu-qom.h | 3 +
target-arm/cpu.c | 2 +-
target-arm/translate.c | 6 +-
target-cris/cpu-qom.h | 3 +
target-cris/cpu.c | 2 +-
target-cris/helper.c | 4 +-
target-cris/translate.c | 6 +-
target-i386/arch_dump.c | 7 +-
target-i386/cpu-qom.h | 3 +
target-i386/cpu.c | 2 +-
target-i386/helper.c | 26 +++--
target-i386/kvm.c | 20 ++--
target-i386/misc_helper.c | 2 +-
target-lm32/cpu-qom.h | 2 +
target-lm32/cpu.c | 3 +-
target-lm32/translate.c | 6 +-
target-m68k/cpu-qom.h | 2 +
target-m68k/cpu.c | 2 +-
target-m68k/translate.c | 6 +-
target-microblaze/cpu-qom.h | 2 +
target-microblaze/cpu.c | 4 +-
target-microblaze/cpu.h | 5 +-
target-microblaze/helper.c | 4 +-
target-microblaze/op_helper.c | 17 +++-
target-microblaze/translate.c | 6 +-
target-mips/cpu-qom.h | 2 +
target-mips/cpu.c | 3 +-
target-mips/cpu.h | 5 +-
target-mips/op_helper.c | 38 +++----
target-mips/translate.c | 6 +-
target-moxie/cpu.c | 8 +-
target-moxie/cpu.h | 2 +
target-moxie/helper.c | 4 +-
target-moxie/translate.c | 6 +-
target-openrisc/cpu.c | 2 +-
target-openrisc/cpu.h | 2 +
target-openrisc/translate.c | 12 ++-
target-ppc/cpu-qom.h | 4 +
target-ppc/excp_helper.c | 9 +-
target-ppc/kvm.c | 2 +-
target-ppc/mmu-hash64.c | 2 +-
target-ppc/translate.c | 15 +--
target-ppc/translate_init.c | 4 +-
target-s390x/cpu-qom.h | 2 +
target-s390x/cpu.c | 2 +-
target-s390x/kvm.c | 9 +-
target-s390x/translate.c | 6 +-
target-sh4/cpu-qom.h | 2 +
target-sh4/cpu.c | 2 +-
target-sh4/translate.c | 7 +-
target-sparc/cpu-qom.h | 2 +
target-sparc/cpu.c | 11 +-
target-sparc/cpu.h | 5 +-
target-sparc/ldst_helper.c | 27 +++--
target-unicore32/cpu-qom.h | 2 +
target-unicore32/cpu.c | 4 +-
target-unicore32/translate.c | 6 +-
target-xtensa/cpu-qom.h | 2 +
target-xtensa/cpu.c | 4 +-
target-xtensa/op_helper.c | 4 +-
target-xtensa/translate.c | 6 +-
translate-all.c | 32 +++---
user-exec.c | 9 +-
138 files changed, 964 insertions(+), 746 deletions(-)
create mode 100644 include/hw/ppc/ppc_e500.h
--
1.8.1.4
next reply other threads:[~2013-06-16 15:58 UTC|newest]
Thread overview: 81+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-16 15:57 Andreas Färber [this message]
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 01/29] kvm: Change kvm_cpu_synchronize_state() argument to CPUState Andreas Färber
2013-06-17 19:48 ` Richard Henderson
[not found] ` <51BF360E.8090402@redhat.com>
2013-06-18 16:36 ` Andreas Färber
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 02/29] kvm: Change cpu_synchronize_state() " Andreas Färber
2013-06-17 19:46 ` Richard Henderson
2013-06-17 20:58 ` Andreas Färber
2013-06-17 21:02 ` Richard Henderson
2013-06-17 21:09 ` Andreas Färber
2013-06-18 9:39 ` Igor Mammedov
2013-06-21 10:25 ` Andreas Färber
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 03/29] gdbstub: Simplify find_cpu() Andreas Färber
2013-06-17 19:54 ` Richard Henderson
2013-06-19 17:30 ` Andreas Färber
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 04/29] cpu: Change cpu_exit() argument to CPUState Andreas Färber
2013-06-17 19:59 ` Richard Henderson
2013-06-17 21:00 ` Andreas Färber
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 05/29] cpus: Change cpu_thread_is_idle() " Andreas Färber
2013-06-17 20:00 ` Richard Henderson
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 06/29] cpus: Change qemu_kvm_wait_io_event() " Andreas Färber
2013-06-17 20:02 ` Richard Henderson
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 07/29] kvm: Change kvm_set_signal_mask() " Andreas Färber
2013-06-17 16:15 ` Paolo Bonzini
2013-06-17 20:03 ` Richard Henderson
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 08/29] cpus: Change qemu_kvm_init_cpu_signals() " Andreas Färber
2013-06-17 20:04 ` Richard Henderson
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 09/29] cpu: Turn cpu_dump_{state, statistics}() into CPUState hooks Andreas Färber
2013-06-17 20:12 ` Richard Henderson
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 10/29] kvm: Change kvm_handle_internal_error() argument to CPUState Andreas Färber
2013-06-17 16:16 ` Paolo Bonzini
2013-06-17 20:13 ` Richard Henderson
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 11/29] kvm: Change kvm_cpu_exec() " Andreas Färber
2013-06-17 16:17 ` Paolo Bonzini
2013-06-17 20:14 ` Richard Henderson
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 12/29] gdbstub: Set gdb_set_stop_cpu() " Andreas Färber
2013-06-17 20:15 ` Richard Henderson
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 13/29] cpus: Change cpu_handle_guest_debug() " Andreas Färber
2013-06-17 20:17 ` Richard Henderson
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 14/29] cpus: Change qemu_kvm_start_vcpu() " Andreas Färber
2013-06-17 20:18 ` Richard Henderson
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 15/29] cpus: Change qemu_dummy_start_vcpu() " Andreas Färber
2013-06-17 20:19 ` Richard Henderson
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 16/29] cpu: Change qemu_init_vcpu() " Andreas Färber
2013-06-17 20:23 ` Richard Henderson
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 17/29] hwaddr: Make hwaddr type usable beyond softmmu Andreas Färber
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 18/29] cpu: Turn cpu_unassigned_access() into a CPUState hook Andreas Färber
2013-06-17 20:34 ` Richard Henderson
2013-06-21 10:31 ` Andreas Färber
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 19/29] cpu: Replace cpu_single_env with CPUState cpu_single_cpu Andreas Färber
2013-06-16 20:49 ` Blue Swirl
2013-06-18 16:52 ` Andreas Färber
2013-06-19 12:59 ` Paolo Bonzini
2013-06-17 20:40 ` Richard Henderson
2013-06-21 10:32 ` Andreas Färber
2013-07-15 14:56 ` Paolo Bonzini
2013-07-15 15:20 ` Andreas Färber
2013-07-15 15:29 ` Paolo Bonzini
2013-07-18 10:25 ` Andreas Färber
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 20/29] kvm: Change kvm_remove_all_breakpoints() argument to CPUState Andreas Färber
2013-06-17 16:17 ` Paolo Bonzini
2013-06-27 15:58 ` Andreas Färber
2013-06-17 20:41 ` Richard Henderson
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 21/29] cpu: Make first_cpu and next_cpu CPUState Andreas Färber
2013-06-17 16:20 ` Paolo Bonzini
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 22/29] linux-user: Change thread_env to CPUState Andreas Färber
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 23/29] bsd-user: " Andreas Färber
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 24/29] cpu: Drop qemu_for_each_cpu() Andreas Färber
2013-06-16 20:26 ` Michael S. Tsirkin
2013-06-16 20:30 ` Peter Maydell
2013-06-16 20:36 ` Michael S. Tsirkin
2013-06-16 20:41 ` Andreas Färber
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 25/29] cpu: Move CPU_INTERRUPT_* to qom/cpu.h Andreas Färber
2013-06-17 20:59 ` Richard Henderson
2013-06-17 21:13 ` Andreas Färber
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 26/29] intc/sh_intc: Build sh_intc only once Andreas Färber
2013-06-17 21:08 ` Richard Henderson
2013-06-17 21:17 ` Andreas Färber
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 27/29] intc/arm_gic: Build arm_gic " Andreas Färber
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 28/29] intc/openpic: Build openpic " Andreas Färber
2013-06-16 15:57 ` [Qemu-devel] [PATCH qom-cpu v2 29/29] timer/arm_mptimer: Build arm_mptimer " Andreas Färber
2013-06-26 14:20 ` [Qemu-devel] [PATCH qom-cpu v2 00/29] QOM CPUState, part 10: CPU loops Andreas Färber
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=1371398269-6213-1-git-send-email-afaerber@suse.de \
--to=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=anthony@codemonkey.ws \
--cc=armbru@redhat.com \
--cc=aurelien@aurel32.net \
--cc=blauwirbel@gmail.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=scottwood@freescale.com \
--cc=stefano.stabellini@eu.citrix.com \
/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).