Skip to content

QEMU: Enable in-place conversion and hugetlb gmem

Xiaoyao Li kvm linux-fsdevel linux-mm lkml qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5update-linux-headers: Add guestmem.hscripts/update-linux-headers.sh+1 -10 replies
2/5headers: Fetch gmem updateslinux-headers/linux/guestmem.h linux-headers/linux/kvm.h+47 -00 replies
3/5memory/guest_memfd: Enable in-place conversion when availableaccel/kvm/kvm-all.c accel/stubs/kvm-stub.c include/system/kvm.h +4 more+90 -222 replies
4/5memory/guest_memfd: Enable hugetlb supportaccel/kvm/kvm-all.c accel/stubs/kvm-stub.c include/system/kvm.h +1 more+17 -10 replies
5/5memory: Don't enable in-place conversion for internal MemoryRegion with gmeminclude/system/memory.h system/memory.c system/physmem.c+9 -40 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [POC PATCH 0/5] QEMU: Enable in-place conversion and hugetlb gmem

Hi all,

This is the POC to enable in-place conversion and hugetlb support of gmem (guest memfd) in QEMU. It can work with 1G gmem support series[1] and TDX hugepage support series[2] to run TDX guest with hugepage. I don't have SNP environment and don't know how it goes with SNP.

It is just the POC and we share it to show how QEMU work with gmem ABI.

The POC uses the simple implementation that switches to use in-place conversion and hugetlb when it is supported and it doesn't introduce new interface in QEMU so that existing command line to boot TDX can work without any change.

Please go to each patch (specifically patch 3/4/5) to discuss the ABI usage, potential issue, and maybe the upstreamable design.

[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/

Xiaoyao Li (4):
update-linux-headers: Add guestmem.h
headers: Fetch gmem updates
memory/guest_memfd: Enable hugetlb support
[HACK] memory: Don't enable in-place conversion for internal
MemoryRegion with gmem

Yan Zhao (1):
memory/guest_memfd: Enable in-place conversion when available

 accel/kvm/kvm-all.c             | 82 ++++++++++++++++++++++++---------
 accel/stubs/kvm-stub.c          |  2 +
 include/system/kvm.h            |  2 +
 include/system/memory.h         |  5 ++
 include/system/ramblock.h       |  1 +
 linux-headers/linux/guestmem.h  | 29 ++++++++++++
 linux-headers/linux/kvm.h       | 18 ++++++++
 scripts/update-linux-headers.sh |  2 +-
 system/memory.c                 |  9 +++-
 system/physmem.c                | 40 ++++++++++++++--
 10 files changed, 163 insertions(+), 27 deletions(-)
 create mode 100644 linux-headers/linux/guestmem.h
Signature · 1 line
2.43.0