[PATCH v3 0/1] numa: add 'spm' option for Specific Purpose Memory

fanhuang posted 1 patch 5 days, 15 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20251208105137.2058928-1-FangSheng.Huang@amd.com
Maintainers: Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Yanan Wang <wangyanan55@huawei.com>, Zhao Liu <zhao1.liu@intel.com>, "Michael S. Tsirkin" <mst@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>
There is a newer version of this series
[PATCH v3 0/1] numa: add 'spm' option for Specific Purpose Memory
Posted by fanhuang 5 days, 15 hours ago
Hi David and Igor,

Thank you for your patience. It's been about a month since our last
discussion, and I apologize for the delay.

This is v3 of the SPM (Specific Purpose Memory) patch. Following David's
suggestion from v2 review, I've simplified the implementation significantly.

Changes in v3:
- Removed unnecessary RAMBlock traversal and RAM_SPM flag
- Now directly iterates over NUMA nodes to update E820 entries
- Added documentation in qemu-options.hx

Use case reminder:
This feature allows passing EFI_MEMORY_SP (Specific Purpose Memory) from
host to guest VM, useful for memory reserved for specific PCI devices
(e.g., GPU memory via VFIO-PCI). The SPM memory appears as
E820_SOFT_RESERVED to the guest and is managed by device drivers rather
than the OS memory allocator.

Example usage:
  -object memory-backend-ram,size=8G,id=m0
  -object memory-backend-file,size=8G,id=m1,mem-path=/dev/dax0.0
  -numa node,nodeid=0,memdev=m0
  -numa node,nodeid=1,memdev=m1,spm=on

Please review. Thank you for your guidance on this implementation.

Best regards,
Jerry Huang