qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/9] Dynamic sysbus device allocation support
@ 2014-07-02 18:01 Alexander Graf
  2014-07-02 18:01 ` [Qemu-devel] [PATCH v2 1/9] qom: Move property helpers to own file Alexander Graf
                   ` (8 more replies)
  0 siblings, 9 replies; 15+ messages in thread
From: Alexander Graf @ 2014-07-02 18:01 UTC (permalink / raw)
  To: qemu-ppc
  Cc: peter.maydell, peter.crosthwaite, eric.auger, qemu-devel,
	sean.stalley, pbonzini, afaerber

Platforms without ISA and/or PCI have had a seriously hard time in the dynamic
device creation world of QEMU. Devices on these were modeled as SysBus devices
which can only be instantiated in machine files, not through -device.

Why is that so?

For Sysbus devices we didn't know who should be responsible for mapping them
when the machine file didn't do it. Turns out, the machine file is the perfect
place to map them even when it doesn't create them :).

This patch set enables machine files to declare sysbus device creation via the
-device command line option as possible. With this we can (in the machine file)
map sysbus devices to whatever the machine thinks is fitting.

Some times users do want to specify manually where to map a device. This is
very useful when you want to have stable offsets in memory and irq space.
This patch set adds support for "user mapping hints" that the machine can use
to map a device at a certain location.

As example this patch set only enables the eTSEC device on the e500plat machine
type. This device was not possible to get added to the machine at all.

  $ qemu-system-ppc -nographic -M ppce500 -device eTSEC,netdev=nd \
                    -netdev user,id=nd

The idea can easily be extended to any sysbus device on any machine type though.


This patch set is based on previous ideas and discussions, most notably:

  https://lists.gnu.org/archive/html/qemu-devel/2013-07/msg03614.html
  https://lists.gnu.org/archive/html/qemu-devel/2014-06/msg00849.html



v1 -> v2:

  - new patch: qom: Move property helpers to own file
  - reworked patch: qom: Expose property helpers for get/set of integers
  - new patch: qom: Add generic object property g_free helper
  - new patch: PPC: Fix default config ordering and add eTSEC for ppc64
  - Rename DECLARE_INTEGER_VISITOR to DECLARE_PROP_SET_GET
  - Make macro take name and type arguments, enabling generation of "bool"
    types later
  - make irq and pio properties uint64
  - ensure qom exposed pointers don't change due to realloc
  - fix sysbus_pass_irq
  - make properties write-once, not write-before-realize
  - make props only available via qom, no state pointers left
  - use bool in MachineClass rather than property
  - access sysbus properties via qom
  - move platform bus definitions to params
  - move platform bus to 36bit address space
  - make naming more consistent
  - remove device_type from platform bus dt node
  - remove id field in dt generation
  - fix device name (base on reg for value after @)
  - use qom properties to fetch mmio and irq props
  - remove useless interrupt-parent
  - make interrupts level triggered

Alexander Graf (9):
  qom: Move property helpers to own file
  qom: macroify integer property helpers
  qom: Expose property helpers for get/set of integers
  qom: Add generic object property g_free helper
  sysbus: Add user map hints
  sysbus: Make devices spawnable via -device
  PPC: e500: Support dynamically spawned sysbus devices
  e500: Add support for eTSEC in device tree
  PPC: Fix default config ordering and add eTSEC for ppc64

 backends/hostmem-file.c           |   1 +
 backends/hostmem.c                |   1 +
 backends/rng-egd.c                |   1 +
 backends/rng-random.c             |   1 +
 backends/rng.c                    |   1 +
 backends/tpm.c                    |   1 +
 default-configs/ppc-softmmu.mak   |   4 +-
 default-configs/ppc64-softmmu.mak |   3 +-
 hw/acpi/ich9.c                    |   1 +
 hw/acpi/pcihp.c                   |   1 +
 hw/acpi/piix4.c                   |   1 +
 hw/core/machine.c                 |  44 ++++++
 hw/core/qdev.c                    |   1 +
 hw/core/sysbus.c                  |  50 +++++--
 hw/i386/acpi-build.c              |   1 +
 hw/isa/lpc_ich9.c                 |   1 +
 hw/ppc/e500.c                     | 288 ++++++++++++++++++++++++++++++++++++++
 hw/ppc/e500.h                     |   5 +
 hw/ppc/e500plat.c                 |   6 +
 hw/ppc/spapr.c                    |   1 +
 include/hw/boards.h               |   8 +-
 include/hw/sysbus.h               |   1 +
 include/qom/object.h              |  85 -----------
 include/qom/property.h            | 244 ++++++++++++++++++++++++++++++++
 memory.c                          |   1 +
 qom/Makefile.objs                 |   2 +-
 qom/object.c                      | 206 +--------------------------
 qom/property.c                    | 179 +++++++++++++++++++++++
 target-i386/cpu.c                 |   1 +
 ui/console.c                      |   1 +
 vl.c                              |   1 +
 31 files changed, 842 insertions(+), 300 deletions(-)
 create mode 100644 include/qom/property.h
 create mode 100644 qom/property.c

-- 
1.8.1.4

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

end of thread, other threads:[~2014-07-31 14:12 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-02 18:01 [Qemu-devel] [PATCH v2 0/9] Dynamic sysbus device allocation support Alexander Graf
2014-07-02 18:01 ` [Qemu-devel] [PATCH v2 1/9] qom: Move property helpers to own file Alexander Graf
2014-07-31 13:46   ` Peter Crosthwaite
2014-07-31 14:12     ` Alexander Graf
2014-07-02 18:01 ` [Qemu-devel] [PATCH v2 2/9] qom: macroify integer property helpers Alexander Graf
2014-07-31 13:44   ` Peter Crosthwaite
2014-07-02 18:01 ` [Qemu-devel] [PATCH v2 3/9] qom: Expose property helpers for get/set of integers Alexander Graf
2014-07-02 18:01 ` [Qemu-devel] [PATCH v2 4/9] qom: Add generic object property g_free helper Alexander Graf
2014-07-02 18:01 ` [Qemu-devel] [PATCH v2 5/9] sysbus: Add user map hints Alexander Graf
2014-07-02 18:01 ` [Qemu-devel] [PATCH v2 6/9] sysbus: Make devices spawnable via -device Alexander Graf
2014-07-02 18:01 ` [Qemu-devel] [PATCH v2 7/9] PPC: e500: Support dynamically spawned sysbus devices Alexander Graf
2014-07-30 14:55   ` Peter Maydell
2014-07-31  4:07     ` Peter Crosthwaite
2014-07-02 18:01 ` [Qemu-devel] [PATCH v2 8/9] e500: Add support for eTSEC in device tree Alexander Graf
2014-07-02 18:01 ` [Qemu-devel] [PATCH v2 9/9] PPC: Fix default config ordering and add eTSEC for ppc64 Alexander Graf

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