qemu/accel/kvm
Chenyi Qiang 2fde3fb916 physmem: Support coordinated discarding of RAM with guest_memfd
A new field, attributes, was introduced in RAMBlock to link to a
RamBlockAttributes object, which centralizes all guest_memfd related
information (such as fd and status bitmap) within a RAMBlock.

Create and initialize the RamBlockAttributes object upon ram_block_add().
Meanwhile, register the object in the target RAMBlock's MemoryRegion.
After that, guest_memfd-backed RAMBlock is associated with the
RamDiscardManager interface, and the users can execute RamDiscardManager
specific handling. For example, VFIO will register the
RamDiscardListener and get notifications when the state_change() helper
invokes.

As coordinate discarding of RAM with guest_memfd is now supported, only
block uncoordinated discard.

Tested-by: Alexey Kardashevskiy <aik@amd.com>
Reviewed-by: Alexey Kardashevskiy <aik@amd.com>
Acked-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Chenyi Qiang <chenyi.qiang@intel.com>
Link: https://lore.kernel.org/r/20250612082747.51539-6-chenyi.qiang@intel.com
Signed-off-by: Peter Xu <peterx@redhat.com>
2025-06-23 16:03:59 -04:00
..
kvm-accel-ops.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
kvm-all.c physmem: Support coordinated discarding of RAM with guest_memfd 2025-06-23 16:03:59 -04:00
kvm-cpus.h accel/kvm: Remove unused 'system/cpus.h' header in kvm-cpus.h 2025-03-06 15:46:18 +01:00
meson.build target/i386/kvm: Restrict SEV stubs to x86 architecture 2021-10-13 10:47:49 +02:00
trace-events KVM: Dynamic sized kvm memslots array 2024-10-17 19:41:30 +02:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00