Add Hyper-V Dynamic Memory Protocol driver (hv-balloon) hot-add support
authorMaciej S. Szmigiero <maciej.szmigiero@oracle.com>
Sun, 22 Oct 2023 15:20:20 +0000 (17:20 +0200)
committerMaciej S. Szmigiero <maciej.szmigiero@oracle.com>
Mon, 6 Nov 2023 13:08:10 +0000 (14:08 +0100)
commit99a4706ae81efa51b21871af643626730a6719d4
treec92fc258d9fb8d63471bcbfce81c6f1219916468
parent0d9e8c0b670b7856d36ed155d43548d2491230e7
Add Hyper-V Dynamic Memory Protocol driver (hv-balloon) hot-add support

One of advantages of using this protocol over ACPI-based PC DIMM hotplug is
that it allows hot-adding memory in much smaller granularity because the
ACPI DIMM slot limit does not apply.

In order to enable this functionality a new memory backend needs to be
created and provided to the driver via the "memdev" parameter.

This can be achieved by, for example, adding
"-object memory-backend-ram,id=mem1,size=32G" to the QEMU command line and
then instantiating the driver with "memdev=mem1" parameter.

The device will try to use multiple memslots to cover the memory backend in
order to reduce the size of metadata for the not-yet-hot-added part of the
memory backend.

Co-developed-by: David Hildenbrand <david@redhat.com>
Acked-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
hw/hyperv/hv-balloon-our_range_memslots.c [new file with mode: 0644]
hw/hyperv/hv-balloon-our_range_memslots.h [new file with mode: 0644]
hw/hyperv/hv-balloon.c
hw/hyperv/meson.build
hw/hyperv/trace-events