drm/nouveau: consume the return of large GSP message
[drm/drm-misc.git] / drivers / vfio / pci / pds / lm.h
blob9511b1afc6a112abf4ff20d7c1d0d83365015a06
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright(c) 2023 Advanced Micro Devices, Inc. */
4 #ifndef _LM_H_
5 #define _LM_H_
7 #include <linux/fs.h>
8 #include <linux/mutex.h>
9 #include <linux/scatterlist.h>
10 #include <linux/types.h>
12 #include <linux/pds/pds_common.h>
13 #include <linux/pds/pds_adminq.h>
15 struct pds_vfio_lm_file {
16 struct file *filep;
17 struct mutex lock; /* protect live migration data file */
18 u64 size; /* Size with valid data */
19 u64 alloc_size; /* Total allocated size. Always >= len */
20 void *page_mem; /* memory allocated for pages */
21 struct page **pages; /* Backing pages for file */
22 unsigned long long npages;
23 struct sg_table sg_table; /* SG table for backing pages */
24 struct pds_lm_sg_elem *sgl; /* DMA mapping */
25 dma_addr_t sgl_addr;
26 u16 num_sge;
27 struct scatterlist *last_offset_sg; /* Iterator */
28 unsigned int sg_last_entry;
29 unsigned long last_offset;
30 bool disabled;
33 struct pds_vfio_pci_device;
35 struct file *
36 pds_vfio_step_device_state_locked(struct pds_vfio_pci_device *pds_vfio,
37 enum vfio_device_mig_state next);
39 void pds_vfio_put_save_file(struct pds_vfio_pci_device *pds_vfio);
40 void pds_vfio_put_restore_file(struct pds_vfio_pci_device *pds_vfio);
42 #endif /* _LM_H_ */