All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v5 0/3] Sysbus device generic QAPI plug support
@ 2022-05-24 13:48 Damien Hedde
  2022-05-24 13:48 ` [RFC PATCH v5 1/3] none-machine: allow cold plugging sysbus devices Damien Hedde
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Damien Hedde @ 2022-05-24 13:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Damien Hedde, Philippe Mathieu-Daudé,
	David Hildenbrand, Alistair Francis, Eduardo Habkost,
	Marcel Apfelbaum, Yanan Wang, Paolo Bonzini,
	Daniel P. Berrangé,
	Peter Xu, Eric Blake, Markus Armbruster, Peter Maydell

Hi all,

This series is about enabling to plug sysbus devices with
device_add QAPI command. I've put RFC because, there are several
options and I would like to know if you think the current version
is ok to be added in qemu.

Right now only a few sysbus device can be plugged using "-device"
CLI option and a custom plugging mechanism. A machine defines a
list of allowed/supported sysbus devices and provides some code to
handle the plug. For example, it sets up the memory map and irq
connections.

In order to configure a machine from scratch with qapi, we want to
cold plug sysbus devices to the _none_ machine with qapi commands
without requiring the machine to provide some specific per-device
support.

There are mostly 2 options (option 1 is in these patches). Note that
in any case this only applies to "user-creatable" device.

+ Option 1: Use the current plug mechanism by allowing any sysbus
device, without adding handle code in the machine.

+ Option 2: Add a boolean flag in the machine to allow to plug any
sysbus device. We can additionally differentiate the sysbus devices
requiring the legacy plug mechanism (with a flag, for example) and
the others.

The setup of the memory map and irq connections is not related to
the option choice above. We planned to rely on qapi commands to do
these operations. A new _sysbus-mmio-map_ command is proposed in this
series to setup the mapping. Irqs can already be connected using the
_qom-set_ command.
Alternatively we could probably add parameters/properties to device_add
to handle the memory map, but it looks more complicated to achieve.

Based-on: <20220519153402.41540-1-damien.hedde@greensocs.com>
    ( QAPI support for device cold-plug )
Note that it does not stricly require this to be merged, but this series
does not make much sense without the ability to cold plug with device_add
first.

Thanks for your feedback,
--
Damien

Damien Hedde (3):
  none-machine: allow cold plugging sysbus devices
  softmmu/memory: add memory_region_try_add_subregion function
  add sysbus-mmio-map qapi command

 qapi/qdev.json         | 31 ++++++++++++++++++++++++++
 include/exec/memory.h  | 22 +++++++++++++++++++
 hw/core/null-machine.c |  4 ++++
 hw/core/sysbus.c       | 49 ++++++++++++++++++++++++++++++++++++++++++
 softmmu/memory.c       | 26 ++++++++++++++--------
 5 files changed, 123 insertions(+), 9 deletions(-)

-- 
2.36.1



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

end of thread, other threads:[~2022-06-01 11:21 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-24 13:48 [RFC PATCH v5 0/3] Sysbus device generic QAPI plug support Damien Hedde
2022-05-24 13:48 ` [RFC PATCH v5 1/3] none-machine: allow cold plugging sysbus devices Damien Hedde
2022-05-24 13:48 ` [RFC PATCH v5 2/3] softmmu/memory: add memory_region_try_add_subregion function Damien Hedde
2022-05-24 13:48 ` [RFC PATCH v5 3/3] add sysbus-mmio-map qapi command Damien Hedde
2022-05-24 17:44 ` [RFC PATCH v5 0/3] Sysbus device generic QAPI plug support Mark Cave-Ayland
2022-05-25  9:51   ` Damien Hedde
2022-05-25 11:45     ` Peter Maydell
2022-05-25 13:32       ` Damien Hedde
2022-05-25 19:20       ` Mark Cave-Ayland
2022-05-30  9:50         ` Damien Hedde
2022-05-30 10:25           ` Peter Maydell
2022-05-30 14:05             ` Damien Hedde
2022-05-31  8:00               ` Mark Cave-Ayland
2022-05-31  9:22                 ` Damien Hedde
2022-05-31 20:43                   ` Mark Cave-Ayland
2022-06-01  8:39                     ` Damien Hedde
2022-06-01  9:07                       ` David Hildenbrand
2022-06-01 10:45                         ` Mark Cave-Ayland
2022-06-01 10:36                       ` Mark Cave-Ayland

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.