Subject: linux-next: manual merge of the iommufd tree with the vfio tree

From: Stephen Rothwell <[email-masked]>
Date: Mon, 1 Dec 2025 12:43:40 +1100

Hi all,

Today's linux-next merge of the iommufd tree got a conflict in:

  include/linux/vfio_pci_core.h

between commit:

  9b92bc7554b5 ("vfio: refactor vfio_pci_mmap_huge_fault function")

from the vfio tree and commit:

  96ce2aeb15bd ("vfio/pci: Add vfio_pci_dma_buf_iommufd_map()")

from the iommufd tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc include/linux/vfio_pci_core.h
index 336a0e58b443,6a3074f2cf1c..000000000000
--- a/include/linux/vfio_pci_core.h
+++ b/include/linux/vfio_pci_core.h
@@@ -29,12 -28,8 +29,13 @@@ struct vfio_pci_core_device
  struct vfio_pci_region;
  struct p2pdma_provider;
  struct dma_buf_phys_vec;
+ struct dma_buf_attachment;
  
 +struct vfio_pci_eventfd {
 +	struct eventfd_ctx	*ctx;
 +	struct rcu_head		rcu;
 +};
 +
  struct vfio_pci_regops {
  	ssize_t (*rw)(struct vfio_pci_core_device *vdev, char __user *buf,
  		      size_t count, loff_t *ppos, bool iswrite);
@@@ -216,14 -204,7 +217,17 @@@ VFIO_IOREAD_DECLARATION(32
  VFIO_IOREAD_DECLARATION(64)
  #endif
  
 +static inline bool is_aligned_for_order(struct vm_area_struct *vma,
 +					unsigned long addr,
 +					unsigned long pfn,
 +					unsigned int order)
 +{
 +	return !(order && (addr < vma->vm_start ||
 +			   addr + (PAGE_SIZE << order) > vma->vm_end ||
 +			   !IS_ALIGNED(pfn, 1 << order)));
 +}
 +
+ int vfio_pci_dma_buf_iommufd_map(struct dma_buf_attachment *attachment,
+ 				 struct dma_buf_phys_vec *phys);
+ 
  #endif /* VFIO_PCI_CORE_H */