[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v1 00/11] memory-device: complete refactoring
From: |
David Hildenbrand |
Subject: |
[Qemu-devel] [PATCH v1 00/11] memory-device: complete refactoring |
Date: |
Thu, 5 Jul 2018 13:59:32 +0200 |
This is another part of the original series
[PATCH v4 00/14] MemoryDevice: use multi stage hotplug handlers
And is based on
[PATCH v3 0/4] pc-dimm: pre_plug "slot" and "addr" assignment
This series completes refactoring of pre_plug, plug and unplug logic of
memory devices. With this as a basis, one can easily have e.g. virtio
based memory devices (virtio-mem, virtio-pmem, virtio-fs?) with minor
modifications on e.g. x86 and s390x.
Unfortunately, the "addr" property is already used for virtio devices, so
we will have to deal with device specific properties. So
set_addr() for memory devices is introduced to handle that (we already
have get_addr()).
The only way I see to avoid that would be for virtio based devices to
introduce an indirection:
E.g. right now for my virtio-mem prototype:
... -object memory-backend-ram,id=mem0,size=8G \
-device virtio-mem-pci,id=vm0,memdev=mem0,node=0,phys-addr=0x12345
To something like:
... -object memory-backend-ram,id=mem0,size=8G \
-object virtio-mem-backend,id=vmb0,memdev=mem0,addr=0x12345 \
-device virtio-mem-pci,id=vm0,vmem=vmb0 \
Or something like (that might be interesting for virtio-pmem):
... -device virtio-mem-pci \ /* a virtio-mem bus */
-object memory-backend-ram,id=mem0,size=8G \
-device virtio-mem-backend,memdev=mem0,addr=0x12345 \
But both alternatives have their pros and cons.
Opinions?
David Hildenbrand (11):
memory-device: fix error message when hinted address is too small
memory-device: introduce separate config option
memory-device: get_region_size()/get_plugged_size() might fail
memory-device: convert get_region_size() to get_memory_region()
memory-device: document MemoryDeviceClass
memory-device: add device class function set_addr()
pc-dimm: implement memory device class function set_addr()
memory-device: complete factoring out pre_plug handling
memory-device: complete factoring out plug handling
memory-device: complete factoring out unplug handling
memory-device: trace when pre_assigning/assigning/unassigning
addresses
default-configs/i386-softmmu.mak | 3 +-
default-configs/ppc64-softmmu.mak | 3 +-
default-configs/x86_64-softmmu.mak | 3 +-
hw/Makefile.objs | 2 +-
hw/mem/Makefile.objs | 4 +-
hw/mem/memory-device.c | 60 +++++++++++++++++++-----
hw/mem/pc-dimm.c | 75 +++++++++++++++++-------------
hw/mem/trace-events | 5 +-
include/hw/mem/memory-device.h | 30 ++++++++----
qapi/misc.json | 2 +-
10 files changed, 126 insertions(+), 61 deletions(-)
--
2.17.1
- [Qemu-devel] [PATCH v1 00/11] memory-device: complete refactoring,
David Hildenbrand <=
- [Qemu-devel] [PATCH v1 02/11] memory-device: introduce separate config option, David Hildenbrand, 2018/07/05
- [Qemu-devel] [PATCH v1 01/11] memory-device: fix error message when hinted address is too small, David Hildenbrand, 2018/07/05
- [Qemu-devel] [PATCH v1 03/11] memory-device: get_region_size()/get_plugged_size() might fail, David Hildenbrand, 2018/07/05
- [Qemu-devel] [PATCH v1 04/11] memory-device: convert get_region_size() to get_memory_region(), David Hildenbrand, 2018/07/05
- [Qemu-devel] [PATCH v1 05/11] memory-device: document MemoryDeviceClass, David Hildenbrand, 2018/07/05
- [Qemu-devel] [PATCH v1 06/11] memory-device: add device class function set_addr(), David Hildenbrand, 2018/07/05
- [Qemu-devel] [PATCH v1 07/11] pc-dimm: implement memory device class function set_addr(), David Hildenbrand, 2018/07/05
- [Qemu-devel] [PATCH v1 08/11] memory-device: complete factoring out pre_plug handling, David Hildenbrand, 2018/07/05
- [Qemu-devel] [PATCH v1 10/11] memory-device: complete factoring out unplug handling, David Hildenbrand, 2018/07/05
- [Qemu-devel] [PATCH v1 09/11] memory-device: complete factoring out plug handling, David Hildenbrand, 2018/07/05