STRUCT VFIO_LOG_OPS(9)
π struct vfio_log_ops(9) π
okay so bestie, welcome to the kernel API manual page for struct vfio_log_ops β VFIO bus device driver logging callbacks. yes that's a mouthful. we're gonna get through it together π«Ά
β¨ NAME β¨
struct vfio_log_ops β literally the VFIO bus device driver logging callbacks. that's the whole vibe. no cap.
π¦ SYNOPSIS π¦
struct vfio_log_ops {
int (*log_start)(struct vfio_device *device, struct rb_root_cached *ranges, u32 nnodes, u64 *page_size);
int (*log_stop)(struct vfio_device *device);
int (*log_read_and_clear)(struct vfio_device *device, unsigned long iova, unsigned long length, struct iova_bitmap *dirty);
};
like, three function pointers. that's the girlies. look at them go β¨
πΈ Members πΈ
log_startβ an optional callback that asks the device to start DMA logging. key word optional, so don't come for me if your driver doesn't have one πlog_stopβ another optional callback, this one asking the device to stop DMA logging. cute, simple, iconic.log_read_and_clearβ the third optional callback, and it's the busy one: it asks the device to read and clear the dirty DMAs in some given range. two jobs, one callback, main character energy fr fr π
π Description π
okay so this is the part where it gets real. the vfio core implementation of the DEVICE_FEATURE_DMA_LOGGING_ set of features does not track logging state relative to the device. read that again. the core is not keeping score for you. π
so because of that, the device implementation of vfio_log_ops has to handle arbitrary user requests. yes, arbitrary. the users are feral and the core is not your mom.
that means, highkey:
- you must reject subsequent calls to
log_startwithout an interveninglog_stop(no sneaky double-starts, bestie, that's not the vibe) - you must gracefully handle
log_stopandlog_read_and_clearfrom invalid states (graceful. not dramatic. we don't throw tantrums in kernel space π)
that's it. that's the whole contract. slay.
π SEE ALSO π
go touch grass in these files and pages, iykyk:
- Kernel file
./include/linux/vfio.h struct vfio_device_ops(9)struct vfio_migration_ops(9)vfio_check_feature(9)vfio_check_precopy_ioctl(9)
β reminder bestie:log_start,log_stop, andlog_read_and_clearare all optional callbacks β but the state-handling rules in the Description are not. if the core isn't tracking state for you, you're the one doing the tracking. periodt.
π that's the page!! this one lives in ./include/linux, dated October 2026 β mwah, take care of her, she's iconic ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms