Skip to content

ACPI memory hotplug

Hu Tao qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v5 Latest14 patches 30 repliesIn review

Changes in v5 from the cover letter

- rebased on a recent qemu-git
- based on another series which seperates i440fx refactor from v4.

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14qapi: make visit_type_size fallback to v->type_int()qapi/qapi-visit-core.c+5 -10 replies
2/14Add SIZE type to qdev propertieshw/core/qdev-properties.c include/hw/qdev-properties.h include/qemu/option.h +1 more+68 -22 replies
3/14qemu-option: export parse_option_numberinclude/qemu/option.h util/qemu-option.c+4 -20 replies
4/14Implement dimm device abstractiondefault-configs/x86_64-softmmu.mak hw/Makefile.objs hw/mem-hotplug/Makefile.objs +2 more+321 -00 replies
5/14vl: handle "-device dimm"vl.c+51 -018 replies
6/14acpi_piix4 : Implement memory device hotplug registersdocs/specs/acpi_mem_hotplug.txt hw/acpi/piix4.c+85 -10 replies
7/14acpi_ich9 : Implement memory device hotplug registershw/acpi/ich9.c include/hw/acpi/ich9.h+64 -20 replies
8/14memory: record below_4g_mem_size, above_4g_mem_sizehw/i386/pc.c include/hw/i386/pc.h+10 -90 replies
9/14memory controller: initialize dram controller.hw/i386/pc.c include/hw/i386/pc.h+32 -00 replies
10/14pc: Add dimm paravirt SRAT infodocs/specs/fwcfg.txt hw/i386/pc.c hw/i386/pc_piix.c +3 more+60 -85 replies
11/14Introduce paravirt interface QEMU_CFG_PCI_WINDOWhw/i386/pc_q35.c hw/pci-host/piix.c include/hw/nvram/fw_cfg.h+24 -00 replies
12/14Implement "info memory" and "query-memory"hmp-commands.hx hmp.c hmp.h +6 more+77 -01 reply
13/14balloon: update with hotplugged memoryhw/virtio/virtio-balloon.c+9 -40 replies
14/14Implement dimm-infohmp-commands.hx hmp.c hmp.h +3 more+97 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [Qemu-devel] [PATCH v5 00/14] ACPI memory hotplug

It's been quite a while since v4 and lots of changes happend in qemu and v4 just can't apply anymore. So this series is basically a rebase. Another purpose is to bring up discussions to make consensus on some questions since v4, see
http://lists.gnu.org/archive/html/qemu-devel/2013-01/msg01219.html
and http://lists.gnu.org/archive/html/qemu-devel/2013-02/msg05332.html

This series works with seabios counterpart.

changes from v4:

- rebased on a recent qemu-git
- based on another series which seperates i440fx refactor from v4.

    http://lists.nongnu.org/archive/html/qemu-devel/2013-06/msg03500.html

- hot-unplug patches not included, as suggested by Vasilis, since hot-unplug has some more complications with refcounting memory regions.
- fix some copy-paste errors in qapi-schema.json.

v4: http://lists.gnu.org/archive/html/qemu-devel/2012-12/msg02693.html

Issues:

- hot-remove needs to only unmap the dimm device from guest's view. Freeing the memory should happen when the last user of the device (e.g. virtio-blk) unrefs the device. A testcase is needed for this.

- Live Migration: Ramblocks are migrated before qdev VMStates are migrated. So the DimmDevice is handled diferrently than other devices. Should this be reworked ?( DimmDevice structure currently does not define a VMStateDescription) Live migration works as long as the dimm layout (command line args) are identical at the source and destination qemu command line, and destination takes into account hot-operations that have occured on source. (v3 patch 10/19 created the DimmDevice that corresponds to an unknown incoming ramblock, e.g. for a dimm that was hot-added on source. but has been dropped for the moment).

- A main blocker issue is windows guest functionality. The patchset does not work for windows currently. Testing on win2012 server RC or windows2008 consumer prerelease, when adding a DIMM, there is a BSOD with ACPI_BIOS_ERROR message. After this, the VM keeps rebooting with ACPI_BIOS_ERROR. The windows pnpmem driver obviosuly has a problem with the seabios dimm implementation (or the seabios dimm implementation is not fully ACPI-compliant). If someone can review the seabios patches or has any ideas to debug this, let me know.

- hot-operation notification lists need to be added to migration state.

- If a virtio sg element straddles a ramblock boundary, virtio_map_sg can't handle this and qemu exits with "virtio: Trying to map MMIO memory" assertion. This was discovered with stress testing in a VM with hotplugged DIMMs. The top-most commit in the qemu repo above tries to fix this (803aedf0) but maybe you have a better idea. This problem is critical for hot-add upstreaming and needs to be solved. Review/discussion on the list/irc is necessary.

- q35 was supposed/rumoured to have native acpi hotplug support, but I haven't found it in the spec (and I think other people in the list didn't either). Iiuc the plan is to support paravirtual memory hotplug for both piix4 and q35.

Hu Tao (5):
qapi: make visit_type_size fallback to v->type_int() Implement dimm device abstraction
memory: record below_4g_mem_size, above_4g_mem_size memory controller: initialize dram controller.
pc: Add dimm paravirt SRAT info

Vasilis Liaskovitis (9):
Add SIZE type to qdev properties
qemu-option: export parse_option_number
vl: handle "-device dimm"
acpi_piix4 : Implement memory device hotplug registers acpi_ich9 : Implement memory device hotplug registers Introduce paravirt interface QEMU_CFG_PCI_WINDOW Implement "info memory" and "query-memory"
balloon: update with hotplugged memory Implement dimm-info

 default-configs/x86_64-softmmu.mak |   1 +
 docs/specs/acpi_mem_hotplug.txt    |  14 ++
 docs/specs/fwcfg.txt               |  28 ++++
 hmp-commands.hx                    |   4 +
 hmp.c                              |  25 ++++
 hmp.h                              |   2 +
 hw/Makefile.objs                   |   1 +
 hw/acpi/ich9.c                     |  56 ++++++-
 hw/acpi/piix4.c                    |  72 ++++++++-
 hw/core/qdev-properties.c          |  61 ++++++++
 hw/i386/pc.c                       |  74 +++++++--
 hw/i386/pc_piix.c                  |   1 +
 hw/i386/pc_q35.c                   |  17 ++-
 hw/mem-hotplug/Makefile.objs       |   1 +
 hw/mem-hotplug/dimm.c              | 298 +++++++++++++++++++++++++++++++++++++
 hw/pci-host/piix.c                 |  13 ++
 hw/virtio/virtio-balloon.c         |  13 +-
 include/hw/acpi/ich9.h             |  10 ++
 include/hw/i386/pc.h               |   8 +
 include/hw/mem-hotplug/dimm.h      |  78 ++++++++++
 include/hw/nvram/fw_cfg.h          |   1 +
 include/hw/qdev-properties.h       |   3 +
 include/qemu/option.h              |   4 +
 include/sysemu/sysemu.h            |   1 +
 monitor.c                          |  14 ++
 qapi-schema.json                   |  40 +++++
 qapi/qapi-visit-core.c             |   6 +-
 qmp-commands.hx                    |  22 +++
 util/qemu-option.c                 |   8 +-
 vl.c                               |  60 ++++++++
 30 files changed, 907 insertions(+), 29 deletions(-)
 create mode 100644 docs/specs/acpi_mem_hotplug.txt
 create mode 100644 docs/specs/fwcfg.txt
 create mode 100644 hw/mem-hotplug/Makefile.objs
 create mode 100644 hw/mem-hotplug/dimm.c
 create mode 100644 include/hw/mem-hotplug/dimm.h
Signature · 1 line
1.8.3.1