All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH RFC v3 00/21] Introduce QOM CPU and use it for ARM
@ 2012-02-03  2:59 Andreas Färber
  2012-02-03  2:59 ` [Qemu-devel] [PATCH v3 01/21] qom: Register QOM infrastructure early Andreas Färber
                   ` (20 more replies)
  0 siblings, 21 replies; 47+ messages in thread
From: Andreas Färber @ 2012-02-03  2:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Andreas Färber

Hello,

Here's an improved and extended series on incrementally converting CPUState
to QOM, rebased onto Anthony's qom-upstream.14 plus some master updates.

The general idea behind the series is to cease having CPU-dependent code
in generic functions, in favor of storing constant data in CPU classes and
letting instance methods either be dumb initializations or overwritten.
After the initial introduction of the types, this series is mainly mechanical
code movement. This series does NOT yet...
...model ARM CPU has-a cp15 register,
...introduce SoCs (child<CPU> plus devices),
...touch machines.

Patch 1 rearranges module init for QOM, so that objects can really be used
beyond devices. Introduces a neutral type_init() macro for new types.
Does not depend on 3rd QOM series and could be cherry-picked.

Patch 2 adds QOM support to the user emulators. Note that more dependencies
and some stubs were now needed to successfully compile.

Patch 3 introduces the QOM CPU base class.

Patches 4-19 derive and start using a QOM CPU for ARM.
Patch 5 integrates legacy CPUARMState into QOM.
Patch 7 is a proof of concept for CPUState -> CPU lookup.
Patch 19 completes freeing cpu_reset() and cpu_arm_init() of any model logic.

Patch 20 adds a sample read-only property accessing legacy CPUState.
Patch 21 is a hack to allow inspecting this using
QMP/qmp qom-list --path=/cpu --property=halted
For some reason the logic seems inverted (False for -S, True while running)...

Available at:
http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/qom-cpu.v3

TODO: We might want to sort -cpu ? alphabetically; object_class_foreach()
prints them in hash table order.

Agenda:
AF: Convert one other target as proof of concept.
Once Anthony's 3rd QOM series is merged, sort out and merge (what is now) 1-19.
all: Incrementally (hopefully in parallel) derive QOM CPUs for all targets.
Only when all targets are converted will it be possible to move fields from
CPU_COMMON into CPU, to add properties in common code, to simplify some
function names and to eliminate CPUState *env in core code!

Regards,
Andreas

Cc: Anthony Liguori <anthony@codemonkey.ws>
Cc: Peter Maydell <peter.maydell@linaro.org>

v2 -> v3:
* Rebased against qom-upstream.14 branch (and that against master).

* Build common dependencies for user emulators in libuser/.
* New dependencies needed after moving properties into object.c.
* Add a qemu-user.c with stubs needed for successful linking.

* Move cpu.c from hw/ to qom/ (built only once).
* Use proper GPL headers.

* Rename target-arm/cpu-core.c to cpu.c now that we no longer need VPATH.
* Leave cpu-core.h as is to separate from legacy cpu.h.
* Fix -cpu alias "pxa270": handled in cpu_arm_init().
* Use proper GPL headers.

* Start removing CPUID uses in cpu_reset_model_id() and cpu.h.
* Fully convert cpu_reset_model_id() to ARMCPUInfo or per-model code.
* Experiment with adding properties.

v1 -> v2:

* Cherry-pick Anthony's object_class_foreach() patch.

* Don't introduce extra early_init(), just relocate former MODULE_INIT_DEVICE.
* Provide new type_init() macro to be used instead of device_init().

* Drop processor_init() and MODULE_INIT_CPU in favor of MODULE_INIT_DEVICE.
* Prepare cast macros for CPU.
* Add documentation.

* Fix ARMCPUClass type name (arm-cpu-core -> arm-cpu).
* Add documentation.
* Rename ARMCPUDef to ARMCPUInfo.
* Use a C99-style table for initializing the classes through class_data
  instead of individual class_init functions (suggested by Anthony).
* Prepare reset callback.

* Make ENV_GET_OBJECT() use an inline function for readability.
* Invoke the CPU's reset method from cpu_reset().

* Do feature initialization via table where sensible.
* Add feature flags to ARMCPU as well (suggested by PMM for future tweaking,
  also simplifies load/save a bit) and initialize them from ARMCPUClass.
* Make feature inference work for ARMCPU as well by not passing the ARMCPUClass.
  Use function-local macros to avoid the ugliness of deferencing the features pointer.

Andreas Färber (21):
  qom: Register QOM infrastructure early
  qom: Add QOM support to user emulators
  qom: Introduce CPU class
  target-arm: Introduce QOM CPU and use it for CPUID lookup
  target-arm: Embed CPUARMState in QOM ARMCPU
  target-arm: Prepare model-specific class_init function
  target-arm: Overwrite reset handler for ti925t
  target-arm: Move CPU feature flags out of CPUState
  target-arm: No longer abort on unhandled CPUIDs on reset
  target-arm: Store cp15 c0_c1 and c0_c2 in ARMCPUClass
  target-arm: Store cp15 c0_cachetype register in ARMCPUClass
  target-arm: Move cp15 c1_sys register to ARMCPUClass
  target-arm: Store JTAG_ID in ARMCPUClass
  target-arm: Move the PXA270's iwMMXt reset to pxa270_reset()
  target-arm: Store VFP FPSID register in ARMCPUClass
  target-arm: Store VFP MVFR0 and MVFR1 in ARMCPUClass
  target-arm: Store CLIDR in ARMCPUClass
  target-arm: Store CCSIDRs in ARMCPUClass
  target-arm: Kill off cpu_reset_model_id()
  target-arm: Prepare halted property for CPU
  target-arm: Just for testing!

 Makefile.objs         |    6 +
 Makefile.target       |    1 +
 Makefile.user         |    1 +
 bsd-user/main.c       |    2 +
 configure             |    2 +
 darwin-user/main.c    |    3 +
 include/qemu/cpu.h    |   73 ++++++
 linux-user/main.c     |    2 +
 module.h              |    5 +-
 qemu-user.c           |   37 +++
 qom/Makefile          |    1 +
 qom/cpu.c             |   50 ++++
 target-arm/cpu-core.h |   93 ++++++++
 target-arm/cpu.c      |  631 +++++++++++++++++++++++++++++++++++++++++++++++++
 target-arm/cpu.h      |   27 +--
 target-arm/helper.c   |  425 +++------------------------------
 target-arm/machine.c  |    6 +-
 vl.c                  |    4 +-
 18 files changed, 944 insertions(+), 425 deletions(-)
 create mode 100644 include/qemu/cpu.h
 create mode 100644 qemu-user.c
 create mode 100644 qom/cpu.c
 create mode 100644 target-arm/cpu-core.h
 create mode 100644 target-arm/cpu.c

-- 
1.7.7

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

end of thread, other threads:[~2012-02-17 12:44 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-03  2:59 [Qemu-devel] [PATCH RFC v3 00/21] Introduce QOM CPU and use it for ARM Andreas Färber
2012-02-03  2:59 ` [Qemu-devel] [PATCH v3 01/21] qom: Register QOM infrastructure early Andreas Färber
2012-02-06 19:14   ` Anthony Liguori
2012-02-03  2:59 ` [Qemu-devel] [PATCH RFC v3 02/21] qom: Add QOM support to user emulators Andreas Färber
2012-02-06 19:16   ` Anthony Liguori
2012-02-06 23:23     ` Andreas Färber
2012-02-07 17:25     ` Peter Maydell
2012-02-07 17:51       ` Anthony Liguori
2012-02-03  2:59 ` [Qemu-devel] [PATCH RFC v3 03/21] qom: Introduce CPU class Andreas Färber
2012-02-06 19:24   ` Anthony Liguori
2012-02-06 20:01     ` Peter Maydell
2012-02-06 20:14     ` Andreas Färber
2012-02-06 21:22       ` Anthony Liguori
2012-02-03  2:59 ` [Qemu-devel] [PATCH RFC v3 04/21] target-arm: Introduce QOM CPU and use it for CPUID lookup Andreas Färber
2012-02-03  2:59 ` [Qemu-devel] [PATCH RFC v3 05/21] target-arm: Embed CPUARMState in QOM ARMCPU Andreas Färber
2012-02-06 23:00   ` Anthony Liguori
2012-02-06 23:05     ` Andreas Färber
2012-02-03  2:59 ` [Qemu-devel] [PATCH RFC v3 06/21] target-arm: Prepare model-specific class_init function Andreas Färber
2012-02-06 23:03   ` Anthony Liguori
2012-02-06 23:08     ` Andreas Färber
2012-02-03  2:59 ` [Qemu-devel] [PATCH RFC v3 07/21] target-arm: Overwrite reset handler for ti925t Andreas Färber
2012-02-07 17:30   ` Peter Maydell
2012-02-03  2:59 ` [Qemu-devel] [PATCH RFC v3 08/21] target-arm: Move CPU feature flags out of CPUState Andreas Färber
2012-02-07 17:28   ` Peter Maydell
2012-02-07 17:43     ` Andreas Färber
2012-02-03  2:59 ` [Qemu-devel] [PATCH RFC v3 09/21] target-arm: No longer abort on unhandled CPUIDs on reset Andreas Färber
2012-02-03  2:59 ` [Qemu-devel] [PATCH RFC v3 10/21] target-arm: Store cp15 c0_c1 and c0_c2 in ARMCPUClass Andreas Färber
2012-02-03  2:59 ` [Qemu-devel] [PATCH RFC v3 11/21] target-arm: Store cp15 c0_cachetype register " Andreas Färber
2012-02-03  2:59 ` [Qemu-devel] [PATCH RFC v3 12/21] target-arm: Move cp15 c1_sys register to ARMCPUClass Andreas Färber
2012-02-03  2:59 ` [Qemu-devel] [PATCH RFC v3 13/21] target-arm: Store JTAG_ID in ARMCPUClass Andreas Färber
2012-02-07 17:47   ` Peter Maydell
2012-02-07 18:41     ` Andreas Färber
2012-02-07 19:06       ` Peter Maydell
2012-02-07 22:07         ` Andreas Färber
2012-02-07 23:30           ` Peter Maydell
2012-02-03  2:59 ` [Qemu-devel] [PATCH RFC v3 14/21] target-arm: Move the PXA270's iwMMXt reset to pxa270_reset() Andreas Färber
2012-02-17  9:59   ` andrzej zaborowski
2012-02-17 12:03     ` Andreas Färber
2012-02-17 12:44       ` andrzej zaborowski
2012-02-03  2:59 ` [Qemu-devel] [PATCH RFC v3 15/21] target-arm: Store VFP FPSID register in ARMCPUClass Andreas Färber
2012-02-07 17:44   ` Peter Maydell
2012-02-03  2:59 ` [Qemu-devel] [PATCH RFC v3 16/21] target-arm: Store VFP MVFR0 and MVFR1 " Andreas Färber
2012-02-03  2:59 ` [Qemu-devel] [PATCH RFC v3 17/21] target-arm: Store CLIDR " Andreas Färber
2012-02-03  2:59 ` [Qemu-devel] [PATCH RFC v3 18/21] target-arm: Store CCSIDRs " Andreas Färber
2012-02-03  2:59 ` [Qemu-devel] [PATCH RFC v3 19/21] target-arm: Kill off cpu_reset_model_id() Andreas Färber
2012-02-03  2:59 ` [Qemu-devel] [PATCH RFC v3 20/21] target-arm: Prepare halted property for CPU Andreas Färber
2012-02-03  2:59 ` [Qemu-devel] [FYI v3 21/21] target-arm: Just for testing! Andreas Färber

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.