Use memfd for guest vm memory allocation
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest17 patches 18 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/17 | Initialize the return value in kvm__for_each_mem_bank()kvm.c | +1 | 3 replies | |
| 2/17 | Make mmap_hugetlbfs() staticinclude/ util/ | +1 | 1 reply | |
| 3/17 | Rename parameter in mmap_anon_or_hugetlbfs()include/ util/ | +4 | 2 replies | |
| 4/17 | Add hostmem va to debug printarm/ | +2 | 0 replies | |
| 5/17 | Factor out getting the hugetlb block sizeutil/ | +15 | 0 replies | |
| 6/17 | Use memfd for hugetlbfs when allocating guest ramutil/ | +20 | 2 replies | |
| 7/17 | Make blk_size a parameter and pass it to mmap_hugetlbfs()util/ | +19 | 0 replies | |
| 8/17 | Use memfd for all guest ram allocationsinclude/ include/ kvm.c +1 more | +28 | 10 replies | |
| 9/17 | Allocate pvtime memory with memfdarm/ | +15 | 0 replies | |
| 10/17 | Allocate vesa memory with memfdframebuffer.c hw/ include/ | +16 | 0 replies | |
| 11/17 | Add a function that allocates aligned memory if specifiedutil/ | +38 | 0 replies | |
| 12/17 | Use new function to align memoryarm/ riscv/ | +10 | 0 replies | |
| 13/17 | Remove struct fields and code used for alignmentarm/ arm/ riscv/ +1 more | +18 | 0 replies | |
| 14/17 | Replace kvm_arch_delete_ram with kvm_delete_ramarm/ include/ kvm.c +4 more | +9 | 0 replies | |
| 15/17 | Remove no-longer unused macroinclude/ | +0 | 0 replies | |
| 16/17 | Factor out set_user_memory_region codekvm.c | +28 | 0 replies | |
| 17/17 | Pass the memory file descriptor and offset when registering ramarm/ arm/ hw/ +8 more | +28 | 0 replies |
Reviews trailers per patch
2 of 17 patches have a Reviewed-by or Acked-by.
| Patch | Andre Przywara |
|---|---|
| 1/17 | R-b |
| 2/17 | R-b |
| 3/17 | |
| 4/17 | |
| 5/17 | |
| 6/17 | |
| 7/17 | |
| 8/17 | |
| 9/17 | |
| 10/17 | |
| 11/17 | |
| 12/17 | |
| 13/17 | |
| 14/17 | |
| 15/17 | |
| 16/17 | |
| 17/17 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH kvmtool v1 00/17] Use memfd for guest vm memory allocation
This patch series moves kvmtool from allocating guest vm memory using anonymous mmap to using memfd/ftruncate. The main motivation is to ease the transition to the fd-based kvm guest memory proposal [*]. It also facilitates using ipc memory sharing should that be needed in the future. Moreover, it removes the need for using temporary files if the memory is backed by hugetlbfs.
In the process of this rework, this patch series fixes a bug (uninitalized return value). It also adds a memory allocation function that allocates aligned memory without the need to over-map/allocate. This facilitates refactoring, which simplifies the code and removes a lot of the arch-specific code.
Cheers,
/fuad
[*] https://lore.kernel.org/all/[email protected]/
Fuad Tabba (17):
Initialize the return value in kvm__for_each_mem_bank() Make mmap_hugetlbfs() static
Rename parameter in mmap_anon_or_hugetlbfs()
Add hostmem va to debug print
Factor out getting the hugetlb block size
Use memfd for hugetlbfs when allocating guest ram Make blk_size a parameter and pass it to mmap_hugetlbfs() Use memfd for all guest ram allocations
Allocate pvtime memory with memfd
Allocate vesa memory with memfd
Add a function that allocates aligned memory if specified Use new function to align memory
Remove struct fields and code used for alignment Replace kvm_arch_delete_ram with kvm_delete_ram Remove no-longer unused macro
Factor out set_user_memory_region code
Pass the memory file descriptor and offset when registering ram
arm/aarch64/pvtime.c | 20 ++++- arm/include/arm-common/kvm-arch.h | 7 -- arm/kvm.c | 35 +++------ framebuffer.c | 2 + hw/cfi_flash.c | 4 +- hw/vesa.c | 17 ++++- include/kvm/framebuffer.h | 1 + include/kvm/kvm.h | 19 ++--- include/kvm/util.h | 7 +- kvm.c | 69 ++++++++++------- mips/kvm.c | 11 +-- powerpc/kvm.c | 7 +- riscv/include/kvm/kvm-arch.h | 7 -- riscv/kvm.c | 26 ++----- util/util.c | 119 +++++++++++++++++++++++------- vfio/core.c | 3 +- x86/kvm.c | 11 +-- 17 files changed, 209 insertions(+), 156 deletions(-)
base-commit: e17d182ad3f797f01947fc234d95c96c050c534b
Signature · 1 line
2.38.1.431.g37b22c650d-goog