qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v3 0/7] Dynamic sysbus device allocation support


From: Alexander Graf
Subject: [Qemu-devel] [PATCH v3 0/7] Dynamic sysbus device allocation support
Date: Wed, 24 Sep 2014 17:22:16 +0200

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.
Everything that a machine has to do is spawn a "platform-bus-device" and 
generate
the correct device tree for the guest to see the new devices.


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
  https://lists.gnu.org/archive/html/qemu-ppc/2014-07/msg00047.html

In this incarnation, it also depends on Peter Crosthwaite's IRQ QOMification:

  https://lists.nongnu.org/archive/html/qemu-devel/2014-08/msg02387.html

So if you just want something to run, try this git branch:

  https://github.com/agraf/qemu.git sysbus-hints-v3


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

v2 -> v3:

  - switch from qom property hints to implicit map evaluation
  - new patch: sysbus: Add dynamic sysbus device search
  - new patch: sysbus: Expose IRQ enumeration helpers
  - new patch: sysbus: Expose MMIO enumeration helper
  - new patch: sysbus: Add new platform bus helper device
  - dropped QOM rework patches
  - base on QOMified IRQs
  - rework dynamic sysbus device search
  - add notifier for device tree regeneration 

Alexander Graf (7):
  sysbus: Add dynamic sysbus device search
  sysbus: Make devices spawnable via -device
  sysbus: Expose IRQ enumeration helpers
  sysbus: Expose MMIO enumeration helper
  sysbus: Add new platform bus helper device
  PPC: e500: Support dynamically spawned sysbus devices
  e500: Add support for eTSEC in device tree

 hw/core/Makefile.objs     |   1 +
 hw/core/machine.c         |  34 +++++++
 hw/core/platform-bus.c    | 253 ++++++++++++++++++++++++++++++++++++++++++++++
 hw/core/qdev.c            |  11 ++
 hw/core/sysbus.c          |  79 +++++++++++++--
 hw/ppc/e500.c             | 143 ++++++++++++++++++++++++++
 hw/ppc/e500.h             |   5 +
 hw/ppc/e500plat.c         |   6 ++
 include/hw/boards.h       |   8 +-
 include/hw/platform-bus.h |  57 +++++++++++
 include/hw/qdev-core.h    |   1 +
 include/hw/sysbus.h       |   9 ++
 vl.c                      |   1 +
 13 files changed, 599 insertions(+), 9 deletions(-)
 create mode 100644 hw/core/platform-bus.c
 create mode 100644 include/hw/platform-bus.h

-- 
1.8.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]