[pve-devel] [PATCH v3 qemu-server 0/2] add virtio-mem support

Alexandre Derumier aderumier at odiso.com
Fri Nov 18 13:13:18 CET 2022


This patch add virtio-mem support, through a new maxmemory option.

a 4GB static memory is needed for DMA+boot memory, as this memory
is almost always un-unpluggeable.

1 virtio-mem pci device is setup for each numa node on pci.4 bridge

virtio-mem use a fixed blocksize with 32k max blocksize,
so blocksize is computed from the maxmemory/32000 with a minimum of
2MB to map THP.
(lower blocksize = more chance to unplug memory).

guests tested:
- ubuntu 22.04 : kernel 5.15 : works out of the box
- debian11: kernel 5.10 : don't display new memory value

more info about virtio-mem:
https://virtio-mem.gitlab.io/


Changelog v2:

- Allow only multiple of 32MB for memory. With lower values, guest sometimes
  hang.  I have tested with step of 32MB from 4G to 768G, it's working fine.

- rebase tests

Changelog v3:

- rename "maxmemory" option to "memory_max"
- rebase to last git and handle the max_mem changes with phys-bits


Alexandre Derumier (2):
  add virtio-mem support
  tests: add virtio-mem tests

 PVE/QemuServer.pm                           |   9 +-
 PVE/QemuServer/Memory.pm                    | 141 +++++++++++++++-----
 PVE/QemuServer/PCI.pm                       |   8 ++
 test/cfg2cmd/simple-virtio-mem-big.conf     |  12 ++
 test/cfg2cmd/simple-virtio-mem-big.conf.cmd |  59 ++++++++
 test/cfg2cmd/simple-virtio-mem.conf         |  13 ++
 test/cfg2cmd/simple-virtio-mem.conf.cmd     |  31 +++++
 7 files changed, 241 insertions(+), 32 deletions(-)
 create mode 100644 test/cfg2cmd/simple-virtio-mem-big.conf
 create mode 100644 test/cfg2cmd/simple-virtio-mem-big.conf.cmd
 create mode 100644 test/cfg2cmd/simple-virtio-mem.conf
 create mode 100644 test/cfg2cmd/simple-virtio-mem.conf.cmd

-- 
2.30.2





More information about the pve-devel mailing list