brintos

brintos / linux-shallow public Read only

0
0
Text · 1.1 KiB · c8e2301 Raw
42 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2/* Copyright(c) 2023 Advanced Micro Devices, Inc. */3 4#ifndef _DIRTY_H_5#define _DIRTY_H_6 7struct pds_vfio_region {8	unsigned long *host_seq;9	unsigned long *host_ack;10	u64 bmp_bytes;11	u64 size;12	u64 start;13	u64 page_size;14	struct pds_lm_sg_elem *sgl;15	dma_addr_t sgl_addr;16	u32 dev_bmp_offset_start_byte;17	u16 num_sge;18};19 20struct pds_vfio_dirty {21	struct pds_vfio_region *regions;22	u8 num_regions;23	bool is_enabled;24};25 26struct pds_vfio_pci_device;27 28bool pds_vfio_dirty_is_enabled(struct pds_vfio_pci_device *pds_vfio);29void pds_vfio_dirty_set_enabled(struct pds_vfio_pci_device *pds_vfio);30void pds_vfio_dirty_set_disabled(struct pds_vfio_pci_device *pds_vfio);31void pds_vfio_dirty_disable(struct pds_vfio_pci_device *pds_vfio,32			    bool send_cmd);33 34int pds_vfio_dma_logging_report(struct vfio_device *vdev, unsigned long iova,35				unsigned long length,36				struct iova_bitmap *dirty);37int pds_vfio_dma_logging_start(struct vfio_device *vdev,38			       struct rb_root_cached *ranges, u32 nnodes,39			       u64 *page_size);40int pds_vfio_dma_logging_stop(struct vfio_device *vdev);41#endif /* _DIRTY_H_ */42