Skip to content

pc-dimm: factor out MemoryDevice

David Hildenbrand qemu-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest11 patches 9 repliesIn review
  2. v33 patches 45 repliesSuperseded
  3. v23 patches 2 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches1 replySuperseded

Changes in v4 from the cover letter

- "pc-dimm: factor out MemoryDevice interface"
-- dropped the "errp" parameter from the interface functions
-- made as many pointers const as I could :)
-- s/built/build/
- machine: make MemoryHotplugState accessible via the machine
-- State now kept via a pointer, not queried.
-- Added patches that rename the type and cleanup the terminology for
spapr and pc
- Split up the big "pc-dimm: factor out address space logic into MemoryDevice code" into sub patches
-- We now pass the machine to the pc-dimm and MemoryDevice plug/unplug
functions, so we can avoid qdev_get_machine()
-- Moved some checks around as requested by Igor
- Added a patch to make maxmem not depend on slots

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11pc-dimm: factor out MemoryDevice interfacehw/i386/acpi-build.c hw/mem/Makefile.objs hw/mem/memory-device.c +9 more+242 -660 replies
2/11machine: make MemoryHotplugState accessible via the machinehw/i386/acpi-build.c hw/i386/pc.c hw/ppc/spapr.c +6 more+55 -476 replies
3/11pc-dimm: no need to pass the memory regionhw/i386/pc.c hw/mem/pc-dimm.c hw/ppc/spapr.c +1 more+16 -230 replies
4/11pc-dimm: pass in the machine and to the MemoryHotplugStatehw/i386/pc.c hw/mem/pc-dimm.c hw/ppc/spapr.c +1 more+11 -110 replies
5/11pc-dimm: factor out address search into MemoryDevice codehw/mem/memory-device.c hw/mem/pc-dimm.c include/hw/mem/memory-device.h +1 more+91 -1120 replies
6/11pc-dimm: factor out capacity and slot checks into MemoryDevicehw/mem/memory-device.c hw/mem/pc-dimm.c include/hw/mem/pc-dimm.h+51 -610 replies
7/11pc-dimm: move actual plug/unplug of a memory region to MemoryDevicehw/mem/memory-device.c hw/mem/pc-dimm.c include/hw/mem/memory-device.h+23 -30 replies
8/11machine: rename MemoryHotplugState to DeviceMemoryStatehw/ppc/spapr_hcall.c hw/ppc/spapr_rtas_ddw.c include/hw/boards.h+9 -100 replies
9/11pc: rename "hotplug memory" terminology to "device memory"hw/i386/acpi-build.c hw/i386/pc.c include/hw/i386/pc.h+14 -150 replies
10/11spapr: rename "hotplug memory" terminology to "device memory"hw/ppc/spapr.c include/hw/ppc/spapr.h+16 -161 reply
11/11vl: allow 'maxmem' without 'slot'vl.c+4 -150 replies

Reviews trailers per patch

3 of 11 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchDavid GibsonMichael S. TsirkinMarcel Apfelbaum
SeriesR-b
1/11R-b
2/11R-b
3/11
4/11
5/11
6/11
7/11
8/11
9/11
10/11A-b
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [Qemu-devel] [PATCH v4 00/11] pc-dimm: factor out MemoryDevice

Right now we can only map PCDIMM/NVDIMM into guest address space. In the future, we might want to do the same for virtio devices - e.g. virtio-pmem or virtio-mem. Especially, they should be able to live side by side to each other.

E.g. the virto based memory devices regions will not be exposed via ACPI and friends. They will be detected just like other virtio devices and indicate the applicable memory region. This makes it possible to also use them on architectures without memory device detection support (e.g. s390x).

Let's factor out the memory device code into a MemoryDevice interface.

Please note that the "slots" assignment code is not relevant for memory devices that will not be exposed via ACPI or similar. That's why that part won't be exposed. KVM/vhost "slots" for memory regions are still necessary but don't have to be manually specified (e.g. the slot number doesn't mather).

So we are basically converting the hotplug memory region to a memory device region. I have patches that also set up such a region for s390x.

v3 -> v4:
- "pc-dimm: factor out MemoryDevice interface"
-- dropped the "errp" parameter from the interface functions
-- made as many pointers const as I could :)
-- s/built/build/
- machine: make MemoryHotplugState accessible via the machine
-- State now kept via a pointer, not queried.
-- Added patches that rename the type and cleanup the terminology for
spapr and pc
- Split up the big "pc-dimm: factor out address space logic into MemoryDevice code" into sub patches
-- We now pass the machine to the pc-dimm and MemoryDevice plug/unplug
functions, so we can avoid qdev_get_machine()
-- Moved some checks around as requested by Igor
- Added a patch to make maxmem not depend on slots

v2 -> v3:
- "pc-dimm: factor out MemoryDevice interface" --> Lookup both classes when comparing (David Gibson)

v1 -> v2:
- Fix compile issues on ppc (still untested )

David Hildenbrand (11):
pc-dimm: factor out MemoryDevice interface
machine: make MemoryHotplugState accessible via the machine
pc-dimm: no need to pass the memory region
pc-dimm: pass in the machine and to the MemoryHotplugState
pc-dimm: factor out address search into MemoryDevice code
pc-dimm: factor out capacity and slot checks into MemoryDevice
pc-dimm: move actual plug/unplug of a memory region to MemoryDevice
machine: rename MemoryHotplugState to DeviceMemoryState
pc: rename "hotplug memory" terminology to "device memory"
spapr: rename "hotplug memory" terminology to "device memory"
vl: allow 'maxmem' without 'slot'

 hw/i386/acpi-build.c                         |   7 +-
 hw/i386/pc.c                                 |  65 +++---
 hw/mem/Makefile.objs                         |   1 +
 hw/mem/memory-device.c                       | 275 ++++++++++++++++++++++++
 hw/mem/pc-dimm.c                             | 304 +++++++--------------------
 hw/ppc/spapr.c                               |  65 +++---
 hw/ppc/spapr_hcall.c                         |   7 +-
 hw/ppc/spapr_rtas_ddw.c                      |   5 +-
 include/hw/boards.h                          |  12 ++
 include/hw/i386/pc.h                         |   3 +-
 include/hw/mem/memory-device.h               |  51 +++++
 include/hw/mem/pc-dimm.h                     |  27 +--
 include/hw/ppc/spapr.h                       |   5 +-
 numa.c                                       |   3 +-
 qmp.c                                        |   4 +-
 stubs/Makefile.objs                          |   2 +-
 stubs/{qmp_pc_dimm.c => qmp_memory_device.c} |   4 +-
 vl.c                                         |  19 +-
 18 files changed, 506 insertions(+), 353 deletions(-)
 create mode 100644 hw/mem/memory-device.c
 create mode 100644 include/hw/mem/memory-device.h
 rename stubs/{qmp_pc_dimm.c => qmp_memory_device.c} (61%)
Signature · 1 line
2.14.3