qemu-cr16/include/system
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
..
accel-blocker.h
accel-ops.h
address-spaces.h include/system: Move exec/address-spaces.h to system/address-spaces.h 2025-04-23 14:08:21 -07:00
arch_init.h system: Replace arch_type global by qemu_arch_available() helper 2025-03-11 20:03:26 +01:00
balloon.h
block-backend-common.h
block-backend-global-state.h block: Remove unused blk_op_is_blocked() 2025-03-11 15:49:14 +01:00
block-backend-io.h
block-backend.h
block-ram-registrar.h
blockdev.h
confidential-guest-support.h meson: Only allow CONFIG_USER_ONLY from certain source sets 2025-04-23 14:08:44 -07:00
cpu-throttle.h
cpu-timers-internal.h
cpu-timers.h include/exec: Split out icount.h 2025-04-23 14:08:44 -07:00
cpus.h
cryptodev-vhost-user.h
cryptodev-vhost.h
cryptodev.h
device_tree.h
dirtylimit.h
dirtyrate.h
dma.h include/system: Move exec/address-spaces.h to system/address-spaces.h 2025-04-23 14:08:21 -07:00
dump-arch.h
dump.h
event-loop-base.h
host_iommu_device.h vfio/iommufd: Save vendor specific device info 2025-06-05 10:40:38 +02:00
hostmem.h include/system: Move exec/memory.h to system/memory.h 2025-04-23 14:08:21 -07:00
hvf.h include/system/hvf: missing vaddr include 2025-05-14 15:12:40 +01:00
hvf_int.h accel/hvf: Fix TYPE_HVF_ACCEL instance size 2025-06-10 12:59:09 +02:00
hw_accel.h
iommufd.h vfio/iommufd: Add properties and handlers to TYPE_HOST_IOMMU_DEVICE_IOMMUFD 2025-06-05 10:40:38 +02:00
ioport.h include/system: Move exec/ioport.h to system/ioport.h 2025-04-23 14:08:21 -07:00
iothread.h
kvm.h i386/kvm: Prefault memory on page state change 2025-06-06 14:32:54 +02:00
kvm_int.h include/system: Move exec/memory.h to system/memory.h 2025-04-23 14:08:21 -07:00
kvm_xen.h
memory.h memory: Unify the definiton of ReplayRamPopulate() and ReplayRamDiscard() 2025-06-23 16:03:59 -04:00
memory_mapping.h
numa.h
nvmm.h
os-posix.h
os-wasm.h include/qemu/osdep.h: Add Emscripten-specific OS dependencies 2025-05-06 16:02:04 +02:00
os-win32.h cleanup: Drop pointless return at end of function 2025-04-24 09:33:42 +02:00
qtest.h include/system: Remove ifndef CONFIG_USER_ONLY in qtest.h 2025-04-23 14:08:44 -07:00
ram_addr.h include: Remove 'exec/exec-all.h' 2025-04-30 12:45:05 -07:00
ramblock.h physmem: Support coordinated discarding of RAM with guest_memfd 2025-06-23 16:03:59 -04:00
replay.h meson: Only allow CONFIG_USER_ONLY from certain source sets 2025-04-23 14:08:44 -07:00
reset.h
rng-random.h
rng.h
rtc.h
runstate-action.h
runstate.h system/runstate: add VM state change cb with return value 2025-05-14 05:39:14 -04:00
seccomp.h
spdm-socket.h
stats.h
system.h
tcg.h tcg: Move qemu_tcg_mttcg_enabled() to 'system/tcg.h' 2025-04-23 15:07:32 -07:00
tpm.h
tpm_backend.h
tpm_util.h
vhost-user-backend.h vhost-user: return failure if backend crash when live migration 2025-05-14 05:39:15 -04:00
watchdog.h
whpx.h
xen-mapcache.h system/xen: remove inline stubs 2025-04-23 13:52:37 -07:00
xen.h meson: Only allow CONFIG_USER_ONLY from certain source sets 2025-04-23 14:08:44 -07:00