You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/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>
5 days ago
..
arch_init.c system: Replace arch_type global by qemu_arch_available() helper 4 months ago
async-teardown.c qemu/osdep: Add excluded fd parameter to qemu_close_all_open_fd() 11 months ago
balloon.c include: Rename sysemu/ -> system/ 6 months ago
bootdevice.c include: Rename sysemu/ -> system/ 6 months ago
cpu-timers.c include/exec: Split out icount.h 2 months ago
cpus.c system/runstate: add VM state change cb with return value 2 months ago
datadir.c pc-bios: Move device tree files in their own subdir 2 months ago
device_tree-stub.c hw/core/machine.c: Make -machine dumpdtb=file.dtb with no DTB an error 4 months ago
device_tree.c hw/core/machine.c: Make -machine dumpdtb=file.dtb with no DTB an error 4 months ago
dirtylimit.c Miscellaneous patches for 2025-04-24 2 months ago
dma-helpers.c include/exec: Split out icount.h 2 months ago
globals-target.c system: Extract target-specific globals to their own compilation unit 4 months ago
globals.c accel/tcg: Restrict 'icount_align_option' global to TCG 4 months ago
ioport.c include/system: Move exec/ioport.h to system/ioport.h 2 months ago
main.c system/main: comment lock rationale 1 month ago
memory-internal.h system/memory: Remove DEVICE_HOST_ENDIAN definition 2 months ago
memory.c memory: Unify the definiton of ReplayRamPopulate() and ReplayRamDiscard() 5 days ago
memory_ldst.c.inc memory: pass MemTxAttrs to memory_access_is_direct() 5 months ago
memory_mapping.c include/system: Move exec/address-spaces.h to system/address-spaces.h 2 months ago
meson.build ram-block-attributes: Introduce RamBlockAttributes to manage RAMBlock with guest_memfd 5 days ago
physmem.c physmem: Support coordinated discarding of RAM with guest_memfd 5 days ago
qdev-monitor.c system: Replace arch_type global by qemu_arch_available() helper 4 months ago
qemu-seccomp.c include: Rename sysemu/ -> system/ 6 months ago
qtest.c exec: Rename target_words_bigendian() -> target_big_endian() 2 months ago
ram-block-attributes.c ram-block-attributes: Introduce RamBlockAttributes to manage RAMBlock with guest_memfd 5 days ago
rtc.c include: Rename sysemu/ -> system/ 6 months ago
runstate-action.c include: Rename sysemu/ -> system/ 6 months ago
runstate-hmp-cmds.c qapi: Move include/qapi/qmp/ to include/qobject/ 5 months ago
runstate.c i386/tdx: Wire TDX_REPORT_FATAL_ERROR with GuestPanic facility 1 month ago
tpm-hmp-cmds.c
tpm.c include: Rename sysemu/ -> system/ 6 months ago
trace-events ram-block-attributes: Introduce RamBlockAttributes to manage RAMBlock with guest_memfd 5 days ago
trace.h
vl.c hw/nvram/fw_cfg: Remove legacy FW_CFG_ORDER_OVERRIDE 4 weeks ago
watchpoint.c include/exec: Split out watchpoint.h 2 months ago