qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC qom-cpu v2 00/28] CPUState QOM realizefn support
@ 2013-01-20  7:22 Andreas Färber
  2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 01/28] cpu: Prepare QOM realizefn Andreas Färber
                   ` (27 more replies)
  0 siblings, 28 replies; 29+ messages in thread
From: Andreas Färber @ 2013-01-20  7:22 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Peter C. Crosthwaite, Eduardo Habkost, Jia Liu,
	Alexander Graf, Blue Swirl, Max Filippov, Michael Walle, qemu-ppc,
	Anthony Liguori, Edgar E. Iglesias, Igor Mammedov, Guan Xuetao,
	Andreas Färber, Aurélien Jarno, Richard Henderson

Hello,

This series cleans up cpu_init() by moving code to QOM realizefn and initfn.
As a result, the following target CPUs become fully QOM-instantiatable:
arm, microblaze, openrisc, ppc, s390x and unicore32.
The other targets are still in need of model-specific CPU subclasses.

v2 fixes a bug with gdb arm coprocessor registration spotted by Eduardo and
adjusts m68k as well. It also appends patches to move code to initfn.

In response to conceptual questions raised by Eduardo, I'm letting each
target CPU call its parent's realizefn from the start. This requires knowledge
of what the parent does and how we want to interact with its implementation:
To avoid a local_err variable and dedicated error handling, and in light of
ideas to unify reset handling, the parent realizefn is called last.
NB this is not a general QOM'ism, e.g., CPUClass::reset calls it in the middle.

alpha and unicore32 are lacking a full CPUClass::reset implementation.
ppc, sparc and xtensa do not reset as part of cpu_init() today, still
blocking us from moving cpu_reset() into the base CPUState realizefn,
so that it remains empty (and optional) in this series.

Based on a few cleanups sent out for 1.4, but only cris and microblaze are
affected. Patches are strictly target-specific, so for testing arm just the
two target-arm patches can be picked, not strictly depending on patch 1 even.

I'd like to queue this on my qom-cpu-next branch for v1.5 as base for
further series. Still not fully tested but more so.

Available for testing and cherry-picking from:
git://github.com/afaerber/qemu-cpu.git qom-cpu-realize.v2
https://github.com/afaerber/qemu-cpu/commits/qom-cpu-realize.v2

Regards,
Andreas

v1 -> v2:
* arm: Register cp with gdb from realizefn, spotted by Eduardo.
* m68k: Perform gdb init from realizefn as well.
* Introduce a no-op realizefn at CPU level and call it from each target's realizefn.
* i386: Avoid error handling regression for APIC.
* s390x: Move cpu_reset() from initfn to realizefn.
* Stylistic changes (e.g., white line after NULL-errp object_property_set_bool())
* Appended patches moving TCG initialization from cpu_*_init() to initfn.

Changes from sh4 subclasses series:
* Adopted QOM realizefn signature, dropped error.h inclusion.

Cc: Anthony Liguori <anthony@codemonkey.ws>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Richard Henderson <rth@twiddle.net> (alpha, s390)
Cc: Peter Maydell <peter.maydell@linaro.org> (arm)
Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com> (cris, microblaze)
Cc: Peter C. Crosthwaite <peter.crosthwaite@xilinx.com> (microblaze)
Cc: Michael Walle <michael@walle.cc> (lm32)
Cc: Aurélien Jarno <aurelien@aurel32.net> (mips, sh4)
Cc: Alexander Graf <agraf@suse.de> (ppc, s390)
Cc: qemu-ppc <qemu-ppc@nongnu.org>
Cc: Blue Swirl <blauwirbel@gmail.com> (sparc)
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn> (unicore32)
Cc: Max Filippov <jcmvbkbc@gmail.com> (xtensa)
Cc: Jia Liu <proljc@gmail.com> (openrisc)

Andreas Färber (28):
  cpu: Prepare QOM realizefn
  target-alpha: Update AlphaCPU to QOM realizefn
  target-arm: Update ARMCPU to QOM realizefn
  target-i386: Update X86CPU to QOM realizefn
  target-openrisc: Update OpenRISCCPU to QOM realizefn
  target-ppc: Update PowerPCCPU to QOM realizefn
  target-cris: Introduce QOM realizefn for CRISCPU
  target-lm32: Introduce QOM realizefn for LM32CPU
  target-m68k: Introduce QOM realizefn for M68kCPU
  target-microblaze: Introduce QOM realizefn for MicroBlazeCPU
  target-mips: Introduce QOM realizefn for MIPSCPU
  target-s390x: Introduce QOM realizefn for S390CPU
  target-sh4: Introduce QOM realizefn for SuperHCPU
  target-sparc: Introduce QOM realizefn for SPARCCPU
  target-unicore32: Introduce QOM realizefn for UniCore32CPU
  target-xtensa: Introduce QOM realizefn for XtensaCPU
  target-arm: Move TCG initialization to ARMCPU initfn
  target-cris: Move TCG initialization to CRISCPU initfn
  target-lm32: Move TCG initialization to LM32CPU initfn
  target-m68k: Move TCG initialization to M68kCPU initfn
  target-microblaze: Move TCG initialization to MicroBlazeCPU initfn
  target-mips: Move TCG initialization to MIPSCPU initfn
  target-ppc: Move TCG initialization to PowerPCCPU initfn
  target-s390x: Move TCG initialization to S390CPU initfn
  target-sh4: Move TCG initialization to SuperHCPU initfn
  target-sparc: Move TCG initialization to SPARCCPU initfn
  target-unicore32: Move TCG initialization to UniCore32CPU initfn
  target-xtensa: Move TCG initialization to XtensaCPU initfn

 qom/cpu.c                     |    5 +++++
 target-alpha/cpu-qom.h        |    2 ++
 target-alpha/cpu.c            |   21 +++++++++++++++++----
 target-arm/cpu-qom.h          |    3 ++-
 target-arm/cpu.c              |   27 ++++++++++++++++++++-------
 target-arm/cpu.h              |    1 +
 target-arm/helper.c           |   18 +++++++++---------
 target-cris/cpu-qom.h         |    2 ++
 target-cris/cpu.c             |   25 +++++++++++++++++++++++++
 target-cris/cpu.h             |    3 +++
 target-cris/translate.c       |   22 ++++++----------------
 target-cris/translate_v10.c   |    5 +----
 target-i386/cpu-qom.h         |    5 ++---
 target-i386/cpu.c             |   19 +++++++++++++++----
 target-i386/helper.c          |    2 +-
 target-lm32/cpu-qom.h         |    2 ++
 target-lm32/cpu.c             |   22 +++++++++++++++++++++-
 target-lm32/helper.c          |    8 +-------
 target-m68k/cpu-qom.h         |    2 ++
 target-m68k/cpu.c             |   23 +++++++++++++++++++++++
 target-m68k/cpu.h             |    1 +
 target-m68k/helper.c          |   21 ++++++++++-----------
 target-microblaze/cpu-qom.h   |    2 ++
 target-microblaze/cpu.c       |   21 +++++++++++++++++++++
 target-microblaze/cpu.h       |    1 +
 target-microblaze/translate.c |   16 ++++++----------
 target-mips/cpu-qom.h         |    2 ++
 target-mips/cpu.c             |   19 +++++++++++++++++++
 target-mips/cpu.h             |    1 +
 target-mips/translate.c       |    8 ++++----
 target-openrisc/cpu.c         |   13 ++++++++++---
 target-openrisc/cpu.h         |    4 ++--
 target-ppc/cpu-qom.h          |    2 ++
 target-ppc/translate_init.c   |   21 +++++++++++++--------
 target-s390x/cpu-qom.h        |    2 ++
 target-s390x/cpu.c            |   21 ++++++++++++++++++++-
 target-s390x/helper.c         |    9 ++-------
 target-sh4/cpu-qom.h          |    2 ++
 target-sh4/cpu.c              |   19 +++++++++++++++++++
 target-sh4/cpu.h              |    1 +
 target-sh4/translate.c        |    8 ++++----
 target-sparc/cpu-qom.h        |    2 ++
 target-sparc/cpu.c            |   25 ++++++++++++++++++++-----
 target-unicore32/cpu-qom.h    |    3 +++
 target-unicore32/cpu.c        |   26 ++++++++++++++++++++++++++
 target-unicore32/helper.c     |    7 +------
 target-xtensa/cpu-qom.h       |    2 ++
 target-xtensa/cpu.c           |   21 +++++++++++++++++++++
 target-xtensa/cpu.h           |    1 +
 target-xtensa/helper.c        |   16 +++-------------
 50 Dateien geändert, 383 Zeilen hinzugefügt(+), 131 Zeilen entfernt(-)

-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2013-01-20  7:23 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-20  7:22 [Qemu-devel] [RFC qom-cpu v2 00/28] CPUState QOM realizefn support Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 01/28] cpu: Prepare QOM realizefn Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 02/28] target-alpha: Update AlphaCPU to " Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 03/28] target-arm: Update ARMCPU " Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 04/28] target-i386: Update X86CPU " Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 05/28] target-openrisc: Update OpenRISCCPU " Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 06/28] target-ppc: Update PowerPCCPU " Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 07/28] target-cris: Introduce QOM realizefn for CRISCPU Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 08/28] target-lm32: Introduce QOM realizefn for LM32CPU Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 09/28] target-m68k: Introduce QOM realizefn for M68kCPU Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 10/28] target-microblaze: Introduce QOM realizefn for MicroBlazeCPU Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 11/28] target-mips: Introduce QOM realizefn for MIPSCPU Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 12/28] target-s390x: Introduce QOM realizefn for S390CPU Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 13/28] target-sh4: Introduce QOM realizefn for SuperHCPU Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 14/28] target-sparc: Introduce QOM realizefn for SPARCCPU Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 15/28] target-unicore32: Introduce QOM realizefn for UniCore32CPU Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 16/28] target-xtensa: Introduce QOM realizefn for XtensaCPU Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 17/28] target-arm: Move TCG initialization to ARMCPU initfn Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 18/28] target-cris: Move TCG initialization to CRISCPU initfn Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 19/28] target-lm32: Move TCG initialization to LM32CPU initfn Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 20/28] target-m68k: Move TCG initialization to M68kCPU initfn Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 21/28] target-microblaze: Move TCG initialization to MicroBlazeCPU initfn Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 22/28] target-mips: Move TCG initialization to MIPSCPU initfn Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 23/28] target-ppc: Move TCG initialization to PowerPCCPU initfn Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 24/28] target-s390x: Move TCG initialization to S390CPU initfn Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 25/28] target-sh4: Move TCG initialization to SuperHCPU initfn Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 26/28] target-sparc: Move TCG initialization to SPARCCPU initfn Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 27/28] target-unicore32: Move TCG initialization to UniCore32CPU initfn Andreas Färber
2013-01-20  7:22 ` [Qemu-devel] [RFC qom-cpu v2 28/28] target-xtensa: Move TCG initialization to XtensaCPU initfn Andreas Färber

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).