qemu/accel
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
..
hvf accel/hvf: Fix TYPE_HVF_ACCEL instance size 2025-06-10 12:59:09 +02:00
kvm physmem: Support coordinated discarding of RAM with guest_memfd 2025-06-23 16:03:59 -04:00
qtest qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
stubs system/hvf: Expose hvf_enabled() to common code 2025-05-08 14:22:12 +02:00
tcg * target/i386/kvm: Intel TDX support 2025-05-30 11:41:07 -04:00
xen qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
accel-blocker.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
accel-common.c accel: Move target-agnostic code from accel-target.c -> accel-common.c 2025-04-25 17:09:58 +02:00
accel-internal.h accel: Include missing 'qemu/accel.h' header in accel-internal.h 2025-04-25 17:09:58 +02:00
accel-system.c accel: Implement accel_init_ops_interfaces() for both system/user mode 2025-04-25 17:09:58 +02:00
accel-target.c accel: Move target-agnostic code from accel-target.c -> accel-common.c 2025-04-25 17:09:58 +02:00
accel-user.c accel: Implement accel_init_ops_interfaces() for both system/user mode 2025-04-25 17:09:58 +02:00
dummy-cpus.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
Kconfig hw/xen: Link XenPVH with GPEX PCIe bridge 2025-03-04 14:45:34 +01:00
meson.build accel: Move target-agnostic code from accel-target.c -> accel-common.c 2025-04-25 17:09:58 +02:00