diff options
| author | Li Zhe <lizhe.67@bytedance.com> | 2025-08-14 14:47:13 +0800 |
|---|---|---|
| committer | Alex Williamson <alex.williamson@redhat.com> | 2025-10-06 11:21:26 -0600 |
| commit | 089722e8939e580c9ccc64678ba22f563fdf3bb5 (patch) | |
| tree | 99bd421b17ce48d9f9336115f81a12655145eaca | |
| parent | d10872050ffeda8c3bdc08f3376bb49b34b4e643 (diff) | |
vfio/type1: introduce a new member has_rsvd for struct vfio_dma
Introduce a new member has_rsvd for struct vfio_dma. This member is
used to indicate whether there are any reserved or invalid pfns in
the region represented by this vfio_dma. If it is true, it indicates
that there is at least one pfn in this region that is either reserved
or invalid.
Signed-off-by: Li Zhe <lizhe.67@bytedance.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Link: https://lore.kernel.org/r/20250814064714.56485-5-lizhe.67@bytedance.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| -rw-r--r-- | drivers/vfio/vfio_iommu_type1.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index dbacd852efae..30e1b54f6c25 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -93,6 +93,7 @@ struct vfio_dma { bool iommu_mapped; bool lock_cap; /* capable(CAP_IPC_LOCK) */ bool vaddr_invalid; + bool has_rsvd; /* has 1 or more rsvd pfns */ struct task_struct *task; struct rb_root pfn_list; /* Ex-user pinned pfn list */ unsigned long *bitmap; @@ -782,6 +783,7 @@ static long vfio_pin_pages_remote(struct vfio_dma *dma, unsigned long vaddr, } out: + dma->has_rsvd |= rsvd; ret = vfio_lock_acct(dma, lock_acct, false); unpin_out: |
