linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the iommufd tree with the iommu tree
@ 2023-10-27  4:55 Stephen Rothwell
  2023-10-27  6:15 ` Stephen Rothwell
  0 siblings, 1 reply; 23+ messages in thread
From: Stephen Rothwell @ 2023-10-27  4:55 UTC (permalink / raw)
  To: Jason Gunthorpe, Joerg Roedel
  Cc: Jason Gunthorpe, Joao Martins, Joerg Roedel,
	Linux Kernel Mailing List, Linux Next Mailing List, Nicolin Chen,
	Yi Liu

[-- Attachment #1: Type: text/plain, Size: 2645 bytes --]

Hi all,

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

  drivers/iommu/iommufd/selftest.c

between commits:

  1c68cbc64fe6 ("iommu: Add IOMMU_DOMAIN_PLATFORM")
  13fbceb1b8e9 ("iommufd: Convert to alloc_domain_paging()")

from the iommu tree and commits:

  408663619fcf ("iommufd/selftest: Add domain_alloc_user() support in iommu mock")
  266ce58989ba ("iommufd/selftest: Test IOMMU_HWPT_ALLOC_DIRTY_TRACKING")
  7adf267d66d1 ("iommufd/selftest: Test IOMMU_HWPT_SET_DIRTY_TRACKING")
  a9af47e382a4 ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP")
  0795b305da89 ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP_NO_CLEAR flag")
  65fe32f7a447 ("iommufd/selftest: Add nested domain allocation for mock domain")

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 drivers/iommu/iommufd/selftest.c
index ee6079847091,6684ab4cdc7a..000000000000
--- a/drivers/iommu/iommufd/selftest.c
+++ b/drivers/iommu/iommufd/selftest.c
@@@ -272,9 -435,28 +430,20 @@@ static phys_addr_t mock_domain_iova_to_
  
  static bool mock_domain_capable(struct device *dev, enum iommu_cap cap)
  {
- 	return cap == IOMMU_CAP_CACHE_COHERENCY;
+ 	struct mock_dev *mdev = container_of(dev, struct mock_dev, dev);
+ 
+ 	switch (cap) {
+ 	case IOMMU_CAP_CACHE_COHERENCY:
+ 		return true;
+ 	case IOMMU_CAP_DIRTY_TRACKING:
+ 		return !(mdev->flags & MOCK_FLAGS_DEVICE_NO_DIRTY);
+ 	default:
+ 		break;
+ 	}
+ 
+ 	return false;
  }
  
 -static void mock_domain_set_plaform_dma_ops(struct device *dev)
 -{
 -	/*
 -	 * mock doesn't setup default domains because we can't hook into the
 -	 * normal probe path
 -	 */
 -}
 -
  static struct iommu_device mock_iommu_device = {
  };
  
@@@ -293,8 -469,10 +462,9 @@@ static const struct iommu_ops mock_ops 
  	.owner = THIS_MODULE,
  	.pgsize_bitmap = MOCK_IO_PAGE_SIZE,
  	.hw_info = mock_domain_hw_info,
 -	.domain_alloc = mock_domain_alloc,
 +	.domain_alloc_paging = mock_domain_alloc_paging,
+ 	.domain_alloc_user = mock_domain_alloc_user,
  	.capable = mock_domain_capable,
 -	.set_platform_dma_ops = mock_domain_set_plaform_dma_ops,
  	.device_group = generic_device_group,
  	.probe_device = mock_probe_device,
  	.default_domain_ops =

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: manual merge of the iommufd tree with the iommu tree
  2023-10-27  4:55 linux-next: manual merge of the iommufd tree with the iommu tree Stephen Rothwell
@ 2023-10-27  6:15 ` Stephen Rothwell
  2023-10-30 18:26   ` Jason Gunthorpe
  0 siblings, 1 reply; 23+ messages in thread
From: Stephen Rothwell @ 2023-10-27  6:15 UTC (permalink / raw)
  To: Jason Gunthorpe, Joerg Roedel
  Cc: Jason Gunthorpe, Joao Martins, Joerg Roedel,
	Linux Kernel Mailing List, Linux Next Mailing List, Nicolin Chen,
	Yi Liu

[-- Attachment #1: Type: text/plain, Size: 5682 bytes --]

Hi all,

On Fri, 27 Oct 2023 15:55:22 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the iommufd tree got a conflict in:
> 
>   drivers/iommu/iommufd/selftest.c
> 
> between commits:
> 
>   1c68cbc64fe6 ("iommu: Add IOMMU_DOMAIN_PLATFORM")
>   13fbceb1b8e9 ("iommufd: Convert to alloc_domain_paging()")
> 
> from the iommu tree and commits:
> 
>   408663619fcf ("iommufd/selftest: Add domain_alloc_user() support in iommu mock")
>   266ce58989ba ("iommufd/selftest: Test IOMMU_HWPT_ALLOC_DIRTY_TRACKING")
>   7adf267d66d1 ("iommufd/selftest: Test IOMMU_HWPT_SET_DIRTY_TRACKING")
>   a9af47e382a4 ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP")
>   0795b305da89 ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP_NO_CLEAR flag")
>   65fe32f7a447 ("iommufd/selftest: Add nested domain allocation for mock domain")
> 
> 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.

The resolution should have been as below (I think).

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/iommu/iommufd/selftest.c
index ee6079847091,6684ab4cdc7a..7d28ff9a278e
--- a/drivers/iommu/iommufd/selftest.c
+++ b/drivers/iommu/iommufd/selftest.c
@@@ -155,6 -244,80 +239,76 @@@ __mock_domain_alloc_paging(unsigned in
  	return &mock->domain;
  }
  
+ static struct iommu_domain *
+ __mock_domain_alloc_nested(struct mock_iommu_domain *mock_parent,
+ 			   const struct iommu_hwpt_selftest *user_cfg)
+ {
+ 	struct mock_iommu_domain_nested *mock_nested;
+ 	int i;
+ 
+ 	mock_nested = kzalloc(sizeof(*mock_nested), GFP_KERNEL);
+ 	if (!mock_nested)
+ 		return ERR_PTR(-ENOMEM);
+ 	mock_nested->parent = mock_parent;
+ 	mock_nested->domain.ops = &domain_nested_ops;
+ 	mock_nested->domain.type = IOMMU_DOMAIN_NESTED;
+ 	for (i = 0; i < MOCK_NESTED_DOMAIN_IOTLB_NUM; i++)
+ 		mock_nested->iotlb[i] = user_cfg->iotlb;
+ 	return &mock_nested->domain;
+ }
+ 
 -static struct iommu_domain *mock_domain_alloc(unsigned int iommu_domain_type)
++static struct iommu_domain *mock_domain_alloc_paging(struct device *dev)
+ {
+ 	struct iommu_domain *domain;
+ 
 -	if (iommu_domain_type == IOMMU_DOMAIN_BLOCKED)
 -		return &mock_blocking_domain;
 -	if (iommu_domain_type != IOMMU_DOMAIN_UNMANAGED)
 -		return NULL;
 -	domain = __mock_domain_alloc_paging(iommu_domain_type, false);
++	domain = __mock_domain_alloc_paging(IOMMU_DOMAIN_UNMANAGED, false);
+ 	if (IS_ERR(domain))
+ 		domain = NULL;
+ 	return domain;
+ }
+ 
+ static struct iommu_domain *
+ mock_domain_alloc_user(struct device *dev, u32 flags,
+ 		       struct iommu_domain *parent,
+ 		       const struct iommu_user_data *user_data)
+ {
+ 	struct mock_iommu_domain *mock_parent;
+ 	struct iommu_hwpt_selftest user_cfg;
+ 	int rc;
+ 
+ 	/* must be mock_domain */
+ 	if (!parent) {
+ 		struct mock_dev *mdev = container_of(dev, struct mock_dev, dev);
+ 		bool has_dirty_flag = flags & IOMMU_HWPT_ALLOC_DIRTY_TRACKING;
+ 		bool no_dirty_ops = mdev->flags & MOCK_FLAGS_DEVICE_NO_DIRTY;
+ 
+ 		if (flags & (~(IOMMU_HWPT_ALLOC_NEST_PARENT |
+ 			       IOMMU_HWPT_ALLOC_DIRTY_TRACKING)))
+ 			return ERR_PTR(-EOPNOTSUPP);
+ 		if (user_data || (has_dirty_flag && no_dirty_ops))
+ 			return ERR_PTR(-EOPNOTSUPP);
+ 		return __mock_domain_alloc_paging(IOMMU_DOMAIN_UNMANAGED,
+ 						  has_dirty_flag);
+ 	}
+ 
+ 	/* must be mock_domain_nested */
+ 	if (user_data->type != IOMMU_HWPT_DATA_SELFTEST || flags)
+ 		return ERR_PTR(-EOPNOTSUPP);
+ 	if (!parent || parent->ops != mock_ops.default_domain_ops)
+ 		return ERR_PTR(-EINVAL);
+ 
+ 	mock_parent = container_of(parent, struct mock_iommu_domain, domain);
+ 	if (!mock_parent)
+ 		return ERR_PTR(-EINVAL);
+ 
+ 	rc = iommu_copy_struct_from_user(&user_cfg, user_data,
+ 					 IOMMU_HWPT_DATA_SELFTEST, iotlb);
+ 	if (rc)
+ 		return ERR_PTR(rc);
+ 
+ 	return __mock_domain_alloc_nested(mock_parent, &user_cfg);
+ }
+ 
  static void mock_domain_free(struct iommu_domain *domain)
  {
  	struct mock_iommu_domain *mock =
@@@ -272,9 -435,28 +426,20 @@@ static phys_addr_t mock_domain_iova_to_
  
  static bool mock_domain_capable(struct device *dev, enum iommu_cap cap)
  {
- 	return cap == IOMMU_CAP_CACHE_COHERENCY;
+ 	struct mock_dev *mdev = container_of(dev, struct mock_dev, dev);
+ 
+ 	switch (cap) {
+ 	case IOMMU_CAP_CACHE_COHERENCY:
+ 		return true;
+ 	case IOMMU_CAP_DIRTY_TRACKING:
+ 		return !(mdev->flags & MOCK_FLAGS_DEVICE_NO_DIRTY);
+ 	default:
+ 		break;
+ 	}
+ 
+ 	return false;
  }
  
 -static void mock_domain_set_plaform_dma_ops(struct device *dev)
 -{
 -	/*
 -	 * mock doesn't setup default domains because we can't hook into the
 -	 * normal probe path
 -	 */
 -}
 -
  static struct iommu_device mock_iommu_device = {
  };
  
@@@ -293,8 -469,10 +458,9 @@@ static const struct iommu_ops mock_ops 
  	.owner = THIS_MODULE,
  	.pgsize_bitmap = MOCK_IO_PAGE_SIZE,
  	.hw_info = mock_domain_hw_info,
 -	.domain_alloc = mock_domain_alloc,
 +	.domain_alloc_paging = mock_domain_alloc_paging,
+ 	.domain_alloc_user = mock_domain_alloc_user,
  	.capable = mock_domain_capable,
 -	.set_platform_dma_ops = mock_domain_set_plaform_dma_ops,
  	.device_group = generic_device_group,
  	.probe_device = mock_probe_device,
  	.default_domain_ops =

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: manual merge of the iommufd tree with the iommu tree
  2023-10-27  6:15 ` Stephen Rothwell
@ 2023-10-30 18:26   ` Jason Gunthorpe
  2023-10-31  5:12     ` Stephen Rothwell
  0 siblings, 1 reply; 23+ messages in thread
From: Jason Gunthorpe @ 2023-10-30 18:26 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Joerg Roedel, Joao Martins, Joerg Roedel,
	Linux Kernel Mailing List, Linux Next Mailing List, Nicolin Chen,
	Yi Liu

On Fri, Oct 27, 2023 at 05:15:22PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> On Fri, 27 Oct 2023 15:55:22 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > Today's linux-next merge of the iommufd tree got a conflict in:
> > 
> >   drivers/iommu/iommufd/selftest.c
> > 
> > between commits:
> > 
> >   1c68cbc64fe6 ("iommu: Add IOMMU_DOMAIN_PLATFORM")
> >   13fbceb1b8e9 ("iommufd: Convert to alloc_domain_paging()")
> > 
> > from the iommu tree and commits:
> > 
> >   408663619fcf ("iommufd/selftest: Add domain_alloc_user() support in iommu mock")
> >   266ce58989ba ("iommufd/selftest: Test IOMMU_HWPT_ALLOC_DIRTY_TRACKING")
> >   7adf267d66d1 ("iommufd/selftest: Test IOMMU_HWPT_SET_DIRTY_TRACKING")
> >   a9af47e382a4 ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP")
> >   0795b305da89 ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP_NO_CLEAR flag")
> >   65fe32f7a447 ("iommufd/selftest: Add nested domain allocation for mock domain")
> > 
> > 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.
> 
> The resolution should have been as below (I think).

This was too horrible, I pushed a patch to reorganize the new iommufd side
code to more closely match how the domain_alloc_paging stuff is
supposed to work

Thanks,
Jason


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: manual merge of the iommufd tree with the iommu tree
  2023-10-30 18:26   ` Jason Gunthorpe
@ 2023-10-31  5:12     ` Stephen Rothwell
  2023-10-31 11:31       ` Jason Gunthorpe
  2023-11-02 23:53       ` Stephen Rothwell
  0 siblings, 2 replies; 23+ messages in thread
From: Stephen Rothwell @ 2023-10-31  5:12 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Joerg Roedel, Joao Martins, Joerg Roedel,
	Linux Kernel Mailing List, Linux Next Mailing List, Nicolin Chen,
	Yi Liu

[-- Attachment #1: Type: text/plain, Size: 6094 bytes --]

Hi all,

On Mon, 30 Oct 2023 15:26:21 -0300 Jason Gunthorpe <jgg@nvidia.com> wrote:
>
> On Fri, Oct 27, 2023 at 05:15:22PM +1100, Stephen Rothwell wrote:
> > 
> > On Fri, 27 Oct 2023 15:55:22 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:  
> > >
> > > Today's linux-next merge of the iommufd tree got a conflict in:
> > > 
> > >   drivers/iommu/iommufd/selftest.c
> > > 
> > > between commits:
> > > 
> > >   1c68cbc64fe6 ("iommu: Add IOMMU_DOMAIN_PLATFORM")
> > >   13fbceb1b8e9 ("iommufd: Convert to alloc_domain_paging()")
> > > 
> > > from the iommu tree and commits:
> > > 
> > >   408663619fcf ("iommufd/selftest: Add domain_alloc_user() support in iommu mock")
> > >   266ce58989ba ("iommufd/selftest: Test IOMMU_HWPT_ALLOC_DIRTY_TRACKING")
> > >   7adf267d66d1 ("iommufd/selftest: Test IOMMU_HWPT_SET_DIRTY_TRACKING")
> > >   a9af47e382a4 ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP")
> > >   0795b305da89 ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP_NO_CLEAR flag")
> > >   65fe32f7a447 ("iommufd/selftest: Add nested domain allocation for mock domain")
> > > 
> > > 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.  
> > 
> > The resolution should have been as below (I think).  
> 
> This was too horrible, I pushed a patch to reorganize the new iommufd side
> code to more closely match how the domain_alloc_paging stuff is
> supposed to work

I have used the conflict resolution below now.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/iommu/iommufd/selftest.c
index ee6079847091,d43a87737c1e..5d93434003d8
--- a/drivers/iommu/iommufd/selftest.c
+++ b/drivers/iommu/iommufd/selftest.c
@@@ -155,6 -240,81 +235,72 @@@ static struct iommu_domain *mock_domain
  	return &mock->domain;
  }
  
+ static struct iommu_domain *
+ __mock_domain_alloc_nested(struct mock_iommu_domain *mock_parent,
+ 			   const struct iommu_hwpt_selftest *user_cfg)
+ {
+ 	struct mock_iommu_domain_nested *mock_nested;
+ 	int i;
+ 
+ 	mock_nested = kzalloc(sizeof(*mock_nested), GFP_KERNEL);
+ 	if (!mock_nested)
+ 		return ERR_PTR(-ENOMEM);
+ 	mock_nested->parent = mock_parent;
+ 	mock_nested->domain.ops = &domain_nested_ops;
+ 	mock_nested->domain.type = IOMMU_DOMAIN_NESTED;
+ 	for (i = 0; i < MOCK_NESTED_DOMAIN_IOTLB_NUM; i++)
+ 		mock_nested->iotlb[i] = user_cfg->iotlb;
+ 	return &mock_nested->domain;
+ }
+ 
 -static struct iommu_domain *mock_domain_alloc(unsigned int iommu_domain_type)
 -{
 -	if (iommu_domain_type == IOMMU_DOMAIN_BLOCKED)
 -		return &mock_blocking_domain;
 -	if (iommu_domain_type == IOMMU_DOMAIN_UNMANAGED)
 -		return mock_domain_alloc_paging(NULL);
 -	return NULL;
 -}
 -
+ static struct iommu_domain *
+ mock_domain_alloc_user(struct device *dev, u32 flags,
+ 		       struct iommu_domain *parent,
+ 		       const struct iommu_user_data *user_data)
+ {
+ 	struct mock_iommu_domain *mock_parent;
+ 	struct iommu_hwpt_selftest user_cfg;
+ 	int rc;
+ 
+ 	/* must be mock_domain */
+ 	if (!parent) {
+ 		struct mock_dev *mdev = container_of(dev, struct mock_dev, dev);
+ 		bool has_dirty_flag = flags & IOMMU_HWPT_ALLOC_DIRTY_TRACKING;
+ 		bool no_dirty_ops = mdev->flags & MOCK_FLAGS_DEVICE_NO_DIRTY;
+ 		struct iommu_domain *domain;
+ 
+ 		if (flags & (~(IOMMU_HWPT_ALLOC_NEST_PARENT |
+ 			       IOMMU_HWPT_ALLOC_DIRTY_TRACKING)))
+ 			return ERR_PTR(-EOPNOTSUPP);
+ 		if (user_data || (has_dirty_flag && no_dirty_ops))
+ 			return ERR_PTR(-EOPNOTSUPP);
+ 		domain = mock_domain_alloc_paging(NULL);
+ 		if (!domain)
+ 			return ERR_PTR(-ENOMEM);
+ 		if (has_dirty_flag)
+ 			container_of(domain, struct mock_iommu_domain, domain)
+ 				->domain.dirty_ops = &dirty_ops;
+ 		return domain;
+ 	}
+ 
+ 	/* must be mock_domain_nested */
+ 	if (user_data->type != IOMMU_HWPT_DATA_SELFTEST || flags)
+ 		return ERR_PTR(-EOPNOTSUPP);
+ 	if (!parent || parent->ops != mock_ops.default_domain_ops)
+ 		return ERR_PTR(-EINVAL);
+ 
+ 	mock_parent = container_of(parent, struct mock_iommu_domain, domain);
+ 	if (!mock_parent)
+ 		return ERR_PTR(-EINVAL);
+ 
+ 	rc = iommu_copy_struct_from_user(&user_cfg, user_data,
+ 					 IOMMU_HWPT_DATA_SELFTEST, iotlb);
+ 	if (rc)
+ 		return ERR_PTR(rc);
+ 
+ 	return __mock_domain_alloc_nested(mock_parent, &user_cfg);
+ }
+ 
  static void mock_domain_free(struct iommu_domain *domain)
  {
  	struct mock_iommu_domain *mock =
@@@ -272,9 -432,28 +418,20 @@@ static phys_addr_t mock_domain_iova_to_
  
  static bool mock_domain_capable(struct device *dev, enum iommu_cap cap)
  {
- 	return cap == IOMMU_CAP_CACHE_COHERENCY;
+ 	struct mock_dev *mdev = container_of(dev, struct mock_dev, dev);
+ 
+ 	switch (cap) {
+ 	case IOMMU_CAP_CACHE_COHERENCY:
+ 		return true;
+ 	case IOMMU_CAP_DIRTY_TRACKING:
+ 		return !(mdev->flags & MOCK_FLAGS_DEVICE_NO_DIRTY);
+ 	default:
+ 		break;
+ 	}
+ 
+ 	return false;
  }
  
 -static void mock_domain_set_plaform_dma_ops(struct device *dev)
 -{
 -	/*
 -	 * mock doesn't setup default domains because we can't hook into the
 -	 * normal probe path
 -	 */
 -}
 -
  static struct iommu_device mock_iommu_device = {
  };
  
@@@ -293,8 -466,10 +450,9 @@@ static const struct iommu_ops mock_ops 
  	.owner = THIS_MODULE,
  	.pgsize_bitmap = MOCK_IO_PAGE_SIZE,
  	.hw_info = mock_domain_hw_info,
 -	.domain_alloc = mock_domain_alloc,
 +	.domain_alloc_paging = mock_domain_alloc_paging,
+ 	.domain_alloc_user = mock_domain_alloc_user,
  	.capable = mock_domain_capable,
 -	.set_platform_dma_ops = mock_domain_set_plaform_dma_ops,
  	.device_group = generic_device_group,
  	.probe_device = mock_probe_device,
  	.default_domain_ops =

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: manual merge of the iommufd tree with the iommu tree
  2023-10-31  5:12     ` Stephen Rothwell
@ 2023-10-31 11:31       ` Jason Gunthorpe
  2023-11-02 23:53       ` Stephen Rothwell
  1 sibling, 0 replies; 23+ messages in thread
From: Jason Gunthorpe @ 2023-10-31 11:31 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Joerg Roedel, Joao Martins, Joerg Roedel,
	Linux Kernel Mailing List, Linux Next Mailing List, Nicolin Chen,
	Yi Liu

On Tue, Oct 31, 2023 at 04:12:14PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> On Mon, 30 Oct 2023 15:26:21 -0300 Jason Gunthorpe <jgg@nvidia.com> wrote:
> >
> > On Fri, Oct 27, 2023 at 05:15:22PM +1100, Stephen Rothwell wrote:
> > > 
> > > On Fri, 27 Oct 2023 15:55:22 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:  
> > > >
> > > > Today's linux-next merge of the iommufd tree got a conflict in:
> > > > 
> > > >   drivers/iommu/iommufd/selftest.c
> > > > 
> > > > between commits:
> > > > 
> > > >   1c68cbc64fe6 ("iommu: Add IOMMU_DOMAIN_PLATFORM")
> > > >   13fbceb1b8e9 ("iommufd: Convert to alloc_domain_paging()")
> > > > 
> > > > from the iommu tree and commits:
> > > > 
> > > >   408663619fcf ("iommufd/selftest: Add domain_alloc_user() support in iommu mock")
> > > >   266ce58989ba ("iommufd/selftest: Test IOMMU_HWPT_ALLOC_DIRTY_TRACKING")
> > > >   7adf267d66d1 ("iommufd/selftest: Test IOMMU_HWPT_SET_DIRTY_TRACKING")
> > > >   a9af47e382a4 ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP")
> > > >   0795b305da89 ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP_NO_CLEAR flag")
> > > >   65fe32f7a447 ("iommufd/selftest: Add nested domain allocation for mock domain")
> > > > 
> > > > 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.  
> > > 
> > > The resolution should have been as below (I think).  
> > 
> > This was too horrible, I pushed a patch to reorganize the new iommufd side
> > code to more closely match how the domain_alloc_paging stuff is
> > supposed to work
> 
> I have used the conflict resolution below now.

Yep!

Thanks,
Jason


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: manual merge of the iommufd tree with the iommu tree
  2023-10-31  5:12     ` Stephen Rothwell
  2023-10-31 11:31       ` Jason Gunthorpe
@ 2023-11-02 23:53       ` Stephen Rothwell
  2023-11-03  0:33         ` Jason Gunthorpe
  1 sibling, 1 reply; 23+ messages in thread
From: Stephen Rothwell @ 2023-11-02 23:53 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Joerg Roedel, Joao Martins, Joerg Roedel,
	Linux Kernel Mailing List, Linux Next Mailing List, Nicolin Chen,
	Yi Liu

[-- Attachment #1: Type: text/plain, Size: 6636 bytes --]

Hi all,

On Tue, 31 Oct 2023 16:12:14 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> On Mon, 30 Oct 2023 15:26:21 -0300 Jason Gunthorpe <jgg@nvidia.com> wrote:
> >
> > On Fri, Oct 27, 2023 at 05:15:22PM +1100, Stephen Rothwell wrote:  
> > > 
> > > On Fri, 27 Oct 2023 15:55:22 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:    
> > > >
> > > > Today's linux-next merge of the iommufd tree got a conflict in:
> > > > 
> > > >   drivers/iommu/iommufd/selftest.c
> > > > 
> > > > between commits:
> > > > 
> > > >   1c68cbc64fe6 ("iommu: Add IOMMU_DOMAIN_PLATFORM")
> > > >   13fbceb1b8e9 ("iommufd: Convert to alloc_domain_paging()")
> > > > 
> > > > from the iommu tree and commits:
> > > > 
> > > >   408663619fcf ("iommufd/selftest: Add domain_alloc_user() support in iommu mock")
> > > >   266ce58989ba ("iommufd/selftest: Test IOMMU_HWPT_ALLOC_DIRTY_TRACKING")
> > > >   7adf267d66d1 ("iommufd/selftest: Test IOMMU_HWPT_SET_DIRTY_TRACKING")
> > > >   a9af47e382a4 ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP")
> > > >   0795b305da89 ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP_NO_CLEAR flag")
> > > >   65fe32f7a447 ("iommufd/selftest: Add nested domain allocation for mock domain")
> > > > 
> > > > 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.    
> > > 
> > > The resolution should have been as below (I think).    
> > 
> > This was too horrible, I pushed a patch to reorganize the new iommufd side
> > code to more closely match how the domain_alloc_paging stuff is
> > supposed to work  
> 
> I have used the conflict resolution below now.
> 
> -- 
> Cheers,
> Stephen Rothwell
> 
> diff --cc drivers/iommu/iommufd/selftest.c
> index ee6079847091,d43a87737c1e..5d93434003d8
> --- a/drivers/iommu/iommufd/selftest.c
> +++ b/drivers/iommu/iommufd/selftest.c
> @@@ -155,6 -240,81 +235,72 @@@ static struct iommu_domain *mock_domain
>   	return &mock->domain;
>   }
>   
> + static struct iommu_domain *
> + __mock_domain_alloc_nested(struct mock_iommu_domain *mock_parent,
> + 			   const struct iommu_hwpt_selftest *user_cfg)
> + {
> + 	struct mock_iommu_domain_nested *mock_nested;
> + 	int i;
> + 
> + 	mock_nested = kzalloc(sizeof(*mock_nested), GFP_KERNEL);
> + 	if (!mock_nested)
> + 		return ERR_PTR(-ENOMEM);
> + 	mock_nested->parent = mock_parent;
> + 	mock_nested->domain.ops = &domain_nested_ops;
> + 	mock_nested->domain.type = IOMMU_DOMAIN_NESTED;
> + 	for (i = 0; i < MOCK_NESTED_DOMAIN_IOTLB_NUM; i++)
> + 		mock_nested->iotlb[i] = user_cfg->iotlb;
> + 	return &mock_nested->domain;
> + }
> + 
>  -static struct iommu_domain *mock_domain_alloc(unsigned int iommu_domain_type)
>  -{
>  -	if (iommu_domain_type == IOMMU_DOMAIN_BLOCKED)
>  -		return &mock_blocking_domain;
>  -	if (iommu_domain_type == IOMMU_DOMAIN_UNMANAGED)
>  -		return mock_domain_alloc_paging(NULL);
>  -	return NULL;
>  -}
>  -
> + static struct iommu_domain *
> + mock_domain_alloc_user(struct device *dev, u32 flags,
> + 		       struct iommu_domain *parent,
> + 		       const struct iommu_user_data *user_data)
> + {
> + 	struct mock_iommu_domain *mock_parent;
> + 	struct iommu_hwpt_selftest user_cfg;
> + 	int rc;
> + 
> + 	/* must be mock_domain */
> + 	if (!parent) {
> + 		struct mock_dev *mdev = container_of(dev, struct mock_dev, dev);
> + 		bool has_dirty_flag = flags & IOMMU_HWPT_ALLOC_DIRTY_TRACKING;
> + 		bool no_dirty_ops = mdev->flags & MOCK_FLAGS_DEVICE_NO_DIRTY;
> + 		struct iommu_domain *domain;
> + 
> + 		if (flags & (~(IOMMU_HWPT_ALLOC_NEST_PARENT |
> + 			       IOMMU_HWPT_ALLOC_DIRTY_TRACKING)))
> + 			return ERR_PTR(-EOPNOTSUPP);
> + 		if (user_data || (has_dirty_flag && no_dirty_ops))
> + 			return ERR_PTR(-EOPNOTSUPP);
> + 		domain = mock_domain_alloc_paging(NULL);
> + 		if (!domain)
> + 			return ERR_PTR(-ENOMEM);
> + 		if (has_dirty_flag)
> + 			container_of(domain, struct mock_iommu_domain, domain)
> + 				->domain.dirty_ops = &dirty_ops;
> + 		return domain;
> + 	}
> + 
> + 	/* must be mock_domain_nested */
> + 	if (user_data->type != IOMMU_HWPT_DATA_SELFTEST || flags)
> + 		return ERR_PTR(-EOPNOTSUPP);
> + 	if (!parent || parent->ops != mock_ops.default_domain_ops)
> + 		return ERR_PTR(-EINVAL);
> + 
> + 	mock_parent = container_of(parent, struct mock_iommu_domain, domain);
> + 	if (!mock_parent)
> + 		return ERR_PTR(-EINVAL);
> + 
> + 	rc = iommu_copy_struct_from_user(&user_cfg, user_data,
> + 					 IOMMU_HWPT_DATA_SELFTEST, iotlb);
> + 	if (rc)
> + 		return ERR_PTR(rc);
> + 
> + 	return __mock_domain_alloc_nested(mock_parent, &user_cfg);
> + }
> + 
>   static void mock_domain_free(struct iommu_domain *domain)
>   {
>   	struct mock_iommu_domain *mock =
> @@@ -272,9 -432,28 +418,20 @@@ static phys_addr_t mock_domain_iova_to_
>   
>   static bool mock_domain_capable(struct device *dev, enum iommu_cap cap)
>   {
> - 	return cap == IOMMU_CAP_CACHE_COHERENCY;
> + 	struct mock_dev *mdev = container_of(dev, struct mock_dev, dev);
> + 
> + 	switch (cap) {
> + 	case IOMMU_CAP_CACHE_COHERENCY:
> + 		return true;
> + 	case IOMMU_CAP_DIRTY_TRACKING:
> + 		return !(mdev->flags & MOCK_FLAGS_DEVICE_NO_DIRTY);
> + 	default:
> + 		break;
> + 	}
> + 
> + 	return false;
>   }
>   
>  -static void mock_domain_set_plaform_dma_ops(struct device *dev)
>  -{
>  -	/*
>  -	 * mock doesn't setup default domains because we can't hook into the
>  -	 * normal probe path
>  -	 */
>  -}
>  -
>   static struct iommu_device mock_iommu_device = {
>   };
>   
> @@@ -293,8 -466,10 +450,9 @@@ static const struct iommu_ops mock_ops 
>   	.owner = THIS_MODULE,
>   	.pgsize_bitmap = MOCK_IO_PAGE_SIZE,
>   	.hw_info = mock_domain_hw_info,
>  -	.domain_alloc = mock_domain_alloc,
>  +	.domain_alloc_paging = mock_domain_alloc_paging,
> + 	.domain_alloc_user = mock_domain_alloc_user,
>   	.capable = mock_domain_capable,
>  -	.set_platform_dma_ops = mock_domain_set_plaform_dma_ops,
>   	.device_group = generic_device_group,
>   	.probe_device = mock_probe_device,
>   	.default_domain_ops =

This is now a conflict between the iommu tree and Linus' tree.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: manual merge of the iommufd tree with the iommu tree
  2023-11-02 23:53       ` Stephen Rothwell
@ 2023-11-03  0:33         ` Jason Gunthorpe
  0 siblings, 0 replies; 23+ messages in thread
From: Jason Gunthorpe @ 2023-11-03  0:33 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Joerg Roedel, Joao Martins, Joerg Roedel,
	Linux Kernel Mailing List, Linux Next Mailing List, Nicolin Chen,
	Yi Liu

On Fri, Nov 03, 2023 at 10:53:12AM +1100, Stephen Rothwell wrote:
> > I have used the conflict resolution below now.
> 
> This is now a conflict between the iommu tree and Linus' tree.

My PR has instructions for the resolution to both:

https://lore.kernel.org/linux-iommu/20231031131417.GA1815719@nvidia.com/

Thanks,
Jason 



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: manual merge of the iommufd tree with the iommu tree
  2023-10-25  4:44 Stephen Rothwell
  2023-10-25 12:17 ` Jason Gunthorpe
@ 2023-11-02 23:53 ` Stephen Rothwell
  1 sibling, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2023-11-02 23:53 UTC (permalink / raw)
  To: Jason Gunthorpe, Joerg Roedel
  Cc: Jason Gunthorpe, Joerg Roedel, Linux Kernel Mailing List,
	Linux Next Mailing List, Lu Baolu, Nicolin Chen, Yi Liu

[-- Attachment #1: Type: text/plain, Size: 4454 bytes --]

Hi all,

On Wed, 25 Oct 2023 15:44:20 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the iommufd tree got a conflict in:
> 
>   include/linux/iommu.h
> 
> between commits:
> 
>   1c68cbc64fe6 ("iommu: Add IOMMU_DOMAIN_PLATFORM")
>   4601cd2d7c4c ("iommu: Add ops->domain_alloc_paging()")
> 
> from the iommu tree and commits:
> 
>   1621aef1fbfe ("iommu: Add IOMMU_DOMAIN_NESTED")
>   909f4abd1097 ("iommu: Add new iommu op to create domains owned by userspace")
>   17dd7701a2e7 ("iommu: Pass in parent domain with user_data to domain_alloc_user op")
> 
> 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/iommu.h
> index b5b254e205c6,f347bf31761f..000000000000
> --- a/include/linux/iommu.h
> +++ b/include/linux/iommu.h
> @@@ -64,8 -66,10 +66,11 @@@ struct iommu_domain_geometry 
>   #define __IOMMU_DOMAIN_DMA_FQ	(1U << 3)  /* DMA-API uses flush queue    */
>   
>   #define __IOMMU_DOMAIN_SVA	(1U << 4)  /* Shared process address space */
>  +#define __IOMMU_DOMAIN_PLATFORM	(1U << 5)
>   
> + #define __IOMMU_DOMAIN_NESTED	(1U << 5)  /* User-managed address space nested
> + 					      on a stage-2 translation        */
> + 
>   #define IOMMU_DOMAIN_ALLOC_FLAGS ~__IOMMU_DOMAIN_DMA_FQ
>   /*
>    * This are the possible domain-types
> @@@ -94,7 -96,7 +99,8 @@@
>   				 __IOMMU_DOMAIN_DMA_API |	\
>   				 __IOMMU_DOMAIN_DMA_FQ)
>   #define IOMMU_DOMAIN_SVA	(__IOMMU_DOMAIN_SVA)
>  +#define IOMMU_DOMAIN_PLATFORM	(__IOMMU_DOMAIN_PLATFORM)
> + #define IOMMU_DOMAIN_NESTED	(__IOMMU_DOMAIN_NESTED)
>   
>   struct iommu_domain {
>   	unsigned type;
> @@@ -238,9 -327,19 +331,21 @@@ static inline int __iommu_copy_struct_f
>    *           op is allocated in the iommu driver and freed by the caller after
>    *           use. The information type is one of enum iommu_hw_info_type defined
>    *           in include/uapi/linux/iommufd.h.
> -  * @domain_alloc: allocate iommu domain
> +  * @domain_alloc: allocate and return an iommu domain if success. Otherwise
> +  *                NULL is returned. The domain is not fully initialized until
> +  *                the caller iommu_domain_alloc() returns.
>  + * @domain_alloc_paging: Allocate an iommu_domain that can be used for
>  + *                       UNMANAGED, DMA, and DMA_FQ domain types.
> +  * @domain_alloc_user: Allocate an iommu domain corresponding to the input
> +  *                     parameters as defined in include/uapi/linux/iommufd.h.
> +  *                     Unlike @domain_alloc, it is called only by IOMMUFD and
> +  *                     must fully initialize the new domain before return.
> +  *                     Upon success, if the @user_data is valid and the @parent
> +  *                     points to a kernel-managed domain, the new domain must be
> +  *                     IOMMU_DOMAIN_NESTED type; otherwise, the @parent must be
> +  *                     NULL while the @user_data can be optionally provided, the
> +  *                     new domain must support __IOMMU_DOMAIN_PAGING.
> +  *                     Upon failure, ERR_PTR must be returned.
>    * @probe_device: Add device to iommu driver handling
>    * @release_device: Remove device from iommu driver handling
>    * @probe_finalize: Do final setup work after the device is added to an IOMMU
> @@@ -275,7 -372,9 +380,10 @@@ struct iommu_ops 
>   
>   	/* Domain allocation and freeing by the iommu driver */
>   	struct iommu_domain *(*domain_alloc)(unsigned iommu_domain_type);
>  +	struct iommu_domain *(*domain_alloc_paging)(struct device *dev);
> + 	struct iommu_domain *(*domain_alloc_user)(
> + 		struct device *dev, u32 flags, struct iommu_domain *parent,
> + 		const struct iommu_user_data *user_data);
>   
>   	struct iommu_device *(*probe_device)(struct device *dev);
>   	void (*release_device)(struct device *dev);

This is now a conflict between the iommu tree and Linus' tree.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the iommufd tree with the iommu tree
@ 2023-10-26  3:27 Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2023-10-26  3:27 UTC (permalink / raw)
  To: Jason Gunthorpe, Joerg Roedel
  Cc: Jason Gunthorpe, Linux Kernel Mailing List,
	Linux Next Mailing List, Michael Shavit, Tina Zhang, Will Deacon

[-- Attachment #1: Type: text/plain, Size: 2892 bytes --]

Hi all,

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

  drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c

between commit:

  24503148c545 ("iommu/arm-smmu-v3: Refactor write_ctx_desc")

from the iommu tree and commit:

  a247f322787d ("iommu: Add mm_get_enqcmd_pasid() helper function")

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 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c
index 353248ab18e7,08fac84c1804..000000000000
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c
@@@ -264,10 -233,10 +264,10 @@@ static void arm_smmu_mm_release(struct 
  	 * DMA may still be running. Keep the cd valid to avoid C_BAD_CD events,
  	 * but disable translation.
  	 */
- 	arm_smmu_update_ctx_desc_devices(smmu_domain, mm->pasid, &quiet_cd);
 -	arm_smmu_write_ctx_desc(smmu_domain, mm_get_enqcmd_pasid(mm), &quiet_cd);
++	arm_smmu_update_ctx_desc_devices(smmu_domain, mm_get_enqcmd_pasid(mm), &quiet_cd);
  
  	arm_smmu_tlb_inv_asid(smmu_domain->smmu, smmu_mn->cd->asid);
- 	arm_smmu_atc_inv_domain(smmu_domain, mm->pasid, 0, 0);
+ 	arm_smmu_atc_inv_domain(smmu_domain, mm_get_enqcmd_pasid(mm), 0, 0);
  
  	smmu_mn->cleared = true;
  	mutex_unlock(&sva_lock);
@@@ -323,16 -290,7 +323,16 @@@ arm_smmu_mmu_notifier_get(struct arm_sm
  		goto err_free_cd;
  	}
  
 -	ret = arm_smmu_write_ctx_desc(smmu_domain, mm_get_enqcmd_pasid(mm), cd);
 +	spin_lock_irqsave(&smmu_domain->devices_lock, flags);
 +	list_for_each_entry(master, &smmu_domain->devices, domain_head) {
- 		ret = arm_smmu_write_ctx_desc(master, mm->pasid, cd);
++		ret = arm_smmu_write_ctx_desc(master, mm_get_enqcmd_pasid(mm), cd);
 +		if (ret) {
 +			list_for_each_entry_from_reverse(master, &smmu_domain->devices, domain_head)
- 				arm_smmu_write_ctx_desc(master, mm->pasid, NULL);
++				arm_smmu_write_ctx_desc(master, mm_get_enqcmd_pasid(mm), NULL);
 +			break;
 +		}
 +	}
 +	spin_unlock_irqrestore(&smmu_domain->devices_lock, flags);
  	if (ret)
  		goto err_put_notifier;
  
@@@ -357,8 -315,7 +357,8 @@@ static void arm_smmu_mmu_notifier_put(s
  		return;
  
  	list_del(&smmu_mn->list);
 -	arm_smmu_write_ctx_desc(smmu_domain, mm_get_enqcmd_pasid(mm), NULL);
 +
- 	arm_smmu_update_ctx_desc_devices(smmu_domain, mm->pasid, NULL);
++	arm_smmu_update_ctx_desc_devices(smmu_domain, mm_get_enqcmd_pasid(mm), NULL);
  
  	/*
  	 * If we went through clear(), we've already invalidated, and no

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: manual merge of the iommufd tree with the iommu tree
  2023-10-25 12:17     ` Jason Gunthorpe
@ 2023-10-25 12:25       ` Baolu Lu
  0 siblings, 0 replies; 23+ messages in thread
From: Baolu Lu @ 2023-10-25 12:25 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: baolu.lu, Stephen Rothwell, Yi Liu, Kevin Tian, Joerg Roedel,
	Jacob Pan, Jiapeng Chong, Joao Martins,
	Linux Kernel Mailing List, Linux Next Mailing List

On 2023/10/25 20:17, Jason Gunthorpe wrote:
> On Wed, Oct 25, 2023 at 08:16:16PM +0800, Baolu Lu wrote:
>> On 2023/10/25 20:12, Jason Gunthorpe wrote:
>>> On Wed, Oct 25, 2023 at 03:34:55PM +1100, Stephen Rothwell wrote:
>>>> Hi all,
>>>>
>>>> Today's linux-next merge of the iommufd tree got a conflict in:
>>>>
>>>>     drivers/iommu/intel/pasid.c
>>>>
>>>> between commit:
>>>>
>>>>     c61c255e114c ("iommu/vt-d: Remove unused function")
>>>>
>>>> from the iommu tree and commits:
>>>>
>>>>     f35f22cc760e ("iommu/vt-d: Access/Dirty bit support for SS domains")
>>>>     cbf8b441ea08 ("iommu/vt-d: Add helper to setup pasid nested translation")
>>>>
>>>> from the iommufd tree.
>>>>
>>>> I fixed it up (the latter added a use of the function removed by
>>>> the former, so I just used the latter) and can carry the fix as
>>>> necessary. This is now fixed as far as linux-next is concerned, but any
>>>> non trivial
>>> Intel folks, this is not nice 🙁 Why was the first commit done at all
>>> if the nesting series needs this?
>> It's my fault. My apologies for not realizing that the helper would
>> still be used by the nesting translation series. I will be more careful
>> in the future.
> Can you send a revert of c61c255e114c ASAP to Joerg please?

Sure!

Best regards,
baolu

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: manual merge of the iommufd tree with the iommu tree
  2023-10-25 12:16   ` Baolu Lu
@ 2023-10-25 12:17     ` Jason Gunthorpe
  2023-10-25 12:25       ` Baolu Lu
  0 siblings, 1 reply; 23+ messages in thread
From: Jason Gunthorpe @ 2023-10-25 12:17 UTC (permalink / raw)
  To: Baolu Lu
  Cc: Stephen Rothwell, Yi Liu, Kevin Tian, Joerg Roedel, Jacob Pan,
	Jiapeng Chong, Joao Martins, Linux Kernel Mailing List,
	Linux Next Mailing List

On Wed, Oct 25, 2023 at 08:16:16PM +0800, Baolu Lu wrote:
> On 2023/10/25 20:12, Jason Gunthorpe wrote:
> > On Wed, Oct 25, 2023 at 03:34:55PM +1100, Stephen Rothwell wrote:
> > > Hi all,
> > > 
> > > Today's linux-next merge of the iommufd tree got a conflict in:
> > > 
> > >    drivers/iommu/intel/pasid.c
> > > 
> > > between commit:
> > > 
> > >    c61c255e114c ("iommu/vt-d: Remove unused function")
> > > 
> > > from the iommu tree and commits:
> > > 
> > >    f35f22cc760e ("iommu/vt-d: Access/Dirty bit support for SS domains")
> > >    cbf8b441ea08 ("iommu/vt-d: Add helper to setup pasid nested translation")
> > > 
> > > from the iommufd tree.
> > > 
> > > I fixed it up (the latter added a use of the function removed by
> > > the former, so I just used the latter) and can carry the fix as
> > > necessary. This is now fixed as far as linux-next is concerned, but any
> > > non trivial
> > Intel folks, this is not nice 🙁 Why was the first commit done at all
> > if the nesting series needs this?
> 
> It's my fault. My apologies for not realizing that the helper would
> still be used by the nesting translation series. I will be more careful
> in the future.

Can you send a revert of c61c255e114c ASAP to Joerg please?

Jason

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: manual merge of the iommufd tree with the iommu tree
  2023-10-25  4:44 Stephen Rothwell
@ 2023-10-25 12:17 ` Jason Gunthorpe
  2023-11-02 23:53 ` Stephen Rothwell
  1 sibling, 0 replies; 23+ messages in thread
From: Jason Gunthorpe @ 2023-10-25 12:17 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Joerg Roedel, Joerg Roedel, Linux Kernel Mailing List,
	Linux Next Mailing List, Lu Baolu, Nicolin Chen, Yi Liu

On Wed, Oct 25, 2023 at 03:44:20PM +1100, Stephen Rothwell wrote:
> diff --cc include/linux/iommu.h
> index b5b254e205c6,f347bf31761f..000000000000
> --- a/include/linux/iommu.h
> +++ b/include/linux/iommu.h
> @@@ -64,8 -66,10 +66,11 @@@ struct iommu_domain_geometry 
>   #define __IOMMU_DOMAIN_DMA_FQ	(1U << 3)  /* DMA-API uses flush queue    */
>   
>   #define __IOMMU_DOMAIN_SVA	(1U << 4)  /* Shared process address space */
>  +#define __IOMMU_DOMAIN_PLATFORM	(1U << 5)
>   
> + #define __IOMMU_DOMAIN_NESTED	(1U << 5)  /* User-managed address space nested
> + 					      on a stage-2 translation        */

One of these should be 6

I'm going to change my tree so __IOMMU_DOMAIN_NESTED is 6

Otherwise looks OK thanks

Jason

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: manual merge of the iommufd tree with the iommu tree
  2023-10-25 12:12 ` Jason Gunthorpe
@ 2023-10-25 12:16   ` Baolu Lu
  2023-10-25 12:17     ` Jason Gunthorpe
  0 siblings, 1 reply; 23+ messages in thread
From: Baolu Lu @ 2023-10-25 12:16 UTC (permalink / raw)
  To: Jason Gunthorpe, Stephen Rothwell, Yi Liu, Kevin Tian
  Cc: baolu.lu, Joerg Roedel, Jacob Pan, Jiapeng Chong, Joao Martins,
	Linux Kernel Mailing List, Linux Next Mailing List

On 2023/10/25 20:12, Jason Gunthorpe wrote:
> On Wed, Oct 25, 2023 at 03:34:55PM +1100, Stephen Rothwell wrote:
>> Hi all,
>>
>> Today's linux-next merge of the iommufd tree got a conflict in:
>>
>>    drivers/iommu/intel/pasid.c
>>
>> between commit:
>>
>>    c61c255e114c ("iommu/vt-d: Remove unused function")
>>
>> from the iommu tree and commits:
>>
>>    f35f22cc760e ("iommu/vt-d: Access/Dirty bit support for SS domains")
>>    cbf8b441ea08 ("iommu/vt-d: Add helper to setup pasid nested translation")
>>
>> from the iommufd tree.
>>
>> I fixed it up (the latter added a use of the function removed by
>> the former, so I just used the latter) and can carry the fix as
>> necessary. This is now fixed as far as linux-next is concerned, but any
>> non trivial
> Intel folks, this is not nice 🙁 Why was the first commit done at all
> if the nesting series needs this?

It's my fault. My apologies for not realizing that the helper would
still be used by the nesting translation series. I will be more careful
in the future.

Best regards,
baolu

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: manual merge of the iommufd tree with the iommu tree
  2023-10-25  4:34 Stephen Rothwell
@ 2023-10-25 12:12 ` Jason Gunthorpe
  2023-10-25 12:16   ` Baolu Lu
  0 siblings, 1 reply; 23+ messages in thread
From: Jason Gunthorpe @ 2023-10-25 12:12 UTC (permalink / raw)
  To: Stephen Rothwell, Lu Baolu, Yi Liu, Kevin Tian
  Cc: Joerg Roedel, Jacob Pan, Jiapeng Chong, Joao Martins,
	Linux Kernel Mailing List, Linux Next Mailing List

On Wed, Oct 25, 2023 at 03:34:55PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the iommufd tree got a conflict in:
> 
>   drivers/iommu/intel/pasid.c
> 
> between commit:
> 
>   c61c255e114c ("iommu/vt-d: Remove unused function")
> 
> from the iommu tree and commits:
> 
>   f35f22cc760e ("iommu/vt-d: Access/Dirty bit support for SS domains")
>   cbf8b441ea08 ("iommu/vt-d: Add helper to setup pasid nested translation")
> 
> from the iommufd tree.
> 
> I fixed it up (the latter added a use of the function removed by
> the former, so I just used the latter) and can carry the fix as
> necessary. This is now fixed as far as linux-next is concerned, but any
> non trivial

Intel folks, this is not nice :( Why was the first commit done at all
if the nesting series needs this?

Thanks Stephen, it looks good
Jason


^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the iommufd tree with the iommu tree
@ 2023-10-25  4:44 Stephen Rothwell
  2023-10-25 12:17 ` Jason Gunthorpe
  2023-11-02 23:53 ` Stephen Rothwell
  0 siblings, 2 replies; 23+ messages in thread
From: Stephen Rothwell @ 2023-10-25  4:44 UTC (permalink / raw)
  To: Jason Gunthorpe, Joerg Roedel
  Cc: Jason Gunthorpe, Joerg Roedel, Linux Kernel Mailing List,
	Linux Next Mailing List, Lu Baolu, Nicolin Chen, Yi Liu

[-- Attachment #1: Type: text/plain, Size: 4094 bytes --]

Hi all,

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

  include/linux/iommu.h

between commits:

  1c68cbc64fe6 ("iommu: Add IOMMU_DOMAIN_PLATFORM")
  4601cd2d7c4c ("iommu: Add ops->domain_alloc_paging()")

from the iommu tree and commits:

  1621aef1fbfe ("iommu: Add IOMMU_DOMAIN_NESTED")
  909f4abd1097 ("iommu: Add new iommu op to create domains owned by userspace")
  17dd7701a2e7 ("iommu: Pass in parent domain with user_data to domain_alloc_user op")

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/iommu.h
index b5b254e205c6,f347bf31761f..000000000000
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@@ -64,8 -66,10 +66,11 @@@ struct iommu_domain_geometry 
  #define __IOMMU_DOMAIN_DMA_FQ	(1U << 3)  /* DMA-API uses flush queue    */
  
  #define __IOMMU_DOMAIN_SVA	(1U << 4)  /* Shared process address space */
 +#define __IOMMU_DOMAIN_PLATFORM	(1U << 5)
  
+ #define __IOMMU_DOMAIN_NESTED	(1U << 5)  /* User-managed address space nested
+ 					      on a stage-2 translation        */
+ 
  #define IOMMU_DOMAIN_ALLOC_FLAGS ~__IOMMU_DOMAIN_DMA_FQ
  /*
   * This are the possible domain-types
@@@ -94,7 -96,7 +99,8 @@@
  				 __IOMMU_DOMAIN_DMA_API |	\
  				 __IOMMU_DOMAIN_DMA_FQ)
  #define IOMMU_DOMAIN_SVA	(__IOMMU_DOMAIN_SVA)
 +#define IOMMU_DOMAIN_PLATFORM	(__IOMMU_DOMAIN_PLATFORM)
+ #define IOMMU_DOMAIN_NESTED	(__IOMMU_DOMAIN_NESTED)
  
  struct iommu_domain {
  	unsigned type;
@@@ -238,9 -327,19 +331,21 @@@ static inline int __iommu_copy_struct_f
   *           op is allocated in the iommu driver and freed by the caller after
   *           use. The information type is one of enum iommu_hw_info_type defined
   *           in include/uapi/linux/iommufd.h.
-  * @domain_alloc: allocate iommu domain
+  * @domain_alloc: allocate and return an iommu domain if success. Otherwise
+  *                NULL is returned. The domain is not fully initialized until
+  *                the caller iommu_domain_alloc() returns.
 + * @domain_alloc_paging: Allocate an iommu_domain that can be used for
 + *                       UNMANAGED, DMA, and DMA_FQ domain types.
+  * @domain_alloc_user: Allocate an iommu domain corresponding to the input
+  *                     parameters as defined in include/uapi/linux/iommufd.h.
+  *                     Unlike @domain_alloc, it is called only by IOMMUFD and
+  *                     must fully initialize the new domain before return.
+  *                     Upon success, if the @user_data is valid and the @parent
+  *                     points to a kernel-managed domain, the new domain must be
+  *                     IOMMU_DOMAIN_NESTED type; otherwise, the @parent must be
+  *                     NULL while the @user_data can be optionally provided, the
+  *                     new domain must support __IOMMU_DOMAIN_PAGING.
+  *                     Upon failure, ERR_PTR must be returned.
   * @probe_device: Add device to iommu driver handling
   * @release_device: Remove device from iommu driver handling
   * @probe_finalize: Do final setup work after the device is added to an IOMMU
@@@ -275,7 -372,9 +380,10 @@@ struct iommu_ops 
  
  	/* Domain allocation and freeing by the iommu driver */
  	struct iommu_domain *(*domain_alloc)(unsigned iommu_domain_type);
 +	struct iommu_domain *(*domain_alloc_paging)(struct device *dev);
+ 	struct iommu_domain *(*domain_alloc_user)(
+ 		struct device *dev, u32 flags, struct iommu_domain *parent,
+ 		const struct iommu_user_data *user_data);
  
  	struct iommu_device *(*probe_device)(struct device *dev);
  	void (*release_device)(struct device *dev);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the iommufd tree with the iommu tree
@ 2023-10-25  4:34 Stephen Rothwell
  2023-10-25 12:12 ` Jason Gunthorpe
  0 siblings, 1 reply; 23+ messages in thread
From: Stephen Rothwell @ 2023-10-25  4:34 UTC (permalink / raw)
  To: Jason Gunthorpe, Joerg Roedel
  Cc: Jacob Pan, Jason Gunthorpe, Jiapeng Chong, Joao Martins,
	Linux Kernel Mailing List, Linux Next Mailing List, Lu Baolu,
	Yi Liu

[-- Attachment #1: Type: text/plain, Size: 888 bytes --]

Hi all,

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

  drivers/iommu/intel/pasid.c

between commit:

  c61c255e114c ("iommu/vt-d: Remove unused function")

from the iommu tree and commits:

  f35f22cc760e ("iommu/vt-d: Access/Dirty bit support for SS domains")
  cbf8b441ea08 ("iommu/vt-d: Add helper to setup pasid nested translation")

from the iommufd tree.

I fixed it up (the latter added a use of the function removed by
the former, so I just used the latter) 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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the iommufd tree with the iommu tree
@ 2023-10-23  4:56 Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2023-10-23  4:56 UTC (permalink / raw)
  To: Jason Gunthorpe, Joerg Roedel
  Cc: Jason Gunthorpe, Jiapeng Chong, Joao Martins, Joerg Roedel,
	Linux Kernel Mailing List, Linux Next Mailing List, Lu Baolu

[-- Attachment #1: Type: text/plain, Size: 2206 bytes --]

Hi all,

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

  drivers/iommu/intel/pasid.c

between commit:

  c61c255e114c ("iommu/vt-d: Remove unused function")

from the iommu tree and commit:

  3c576c995219 ("iommu/intel: Access/Dirty bit support for SL domains")

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 drivers/iommu/intel/pasid.c
index 06ddb3c927f5,b9264b9174e8..000000000000
--- a/drivers/iommu/intel/pasid.c
+++ b/drivers/iommu/intel/pasid.c
@@@ -335,6 -340,45 +340,36 @@@ static inline void pasid_set_fault_enab
  	pasid_set_bits(&pe->val[0], 1 << 1, 0);
  }
  
+ /*
+  * Enable second level A/D bits by setting the SLADE (Second Level
+  * Access Dirty Enable) field (Bit 9) of a scalable mode PASID
+  * entry.
+  */
+ static inline void pasid_set_ssade(struct pasid_entry *pe)
+ {
+ 	pasid_set_bits(&pe->val[0], 1 << 9, 1 << 9);
+ }
+ 
+ /*
+  * Disable second level A/D bits by clearing the SLADE (Second Level
+  * Access Dirty Enable) field (Bit 9) of a scalable mode PASID
+  * entry.
+  */
+ static inline void pasid_clear_ssade(struct pasid_entry *pe)
+ {
+ 	pasid_set_bits(&pe->val[0], 1 << 9, 0);
+ }
+ 
+ /*
+  * Checks if second level A/D bits specifically the SLADE (Second Level
+  * Access Dirty Enable) field (Bit 9) of a scalable mode PASID
+  * entry is set.
+  */
+ static inline bool pasid_get_ssade(struct pasid_entry *pe)
+ {
+ 	return pasid_get_bits(&pe->val[0]) & (1 << 9);
+ }
+ 
 -/*
 - * Setup the WPE(Write Protect Enable) field (Bit 132) of a
 - * scalable mode PASID entry.
 - */
 -static inline void pasid_set_wpe(struct pasid_entry *pe)
 -{
 -	pasid_set_bits(&pe->val[2], 1 << 4, 1 << 4);
 -}
 -
  /*
   * Setup the P(Present) field (Bit 0) of a scalable mode PASID
   * entry.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: manual merge of the iommufd tree with the iommu tree
  2023-10-11  5:03 Stephen Rothwell
@ 2023-10-11 13:58 ` Jason Gunthorpe
  0 siblings, 0 replies; 23+ messages in thread
From: Jason Gunthorpe @ 2023-10-11 13:58 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Joerg Roedel, Joerg Roedel, Linux Kernel Mailing List,
	Linux Next Mailing List, Lu Baolu, Nicolin Chen, Yi Liu

On Wed, Oct 11, 2023 at 04:03:57PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the iommufd tree got a conflict in:
> 
>   include/linux/iommu.h
> 
> between commit:
> 
>   4601cd2d7c4c ("iommu: Add ops->domain_alloc_paging()")
> 
> from the iommu tree and commit:
> 
>   909f4abd1097 ("iommu: Add new iommu op to create domains owned by userspace")
> 
> 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.

Looks right, thanks

Jason
 



^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the iommufd tree with the iommu tree
@ 2023-10-11  5:03 Stephen Rothwell
  2023-10-11 13:58 ` Jason Gunthorpe
  0 siblings, 1 reply; 23+ messages in thread
From: Stephen Rothwell @ 2023-10-11  5:03 UTC (permalink / raw)
  To: Jason Gunthorpe, Joerg Roedel
  Cc: Jason Gunthorpe, Joerg Roedel, Linux Kernel Mailing List,
	Linux Next Mailing List, Lu Baolu, Nicolin Chen, Yi Liu

[-- Attachment #1: Type: text/plain, Size: 2650 bytes --]

Hi all,

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

  include/linux/iommu.h

between commit:

  4601cd2d7c4c ("iommu: Add ops->domain_alloc_paging()")

from the iommu tree and commit:

  909f4abd1097 ("iommu: Add new iommu op to create domains owned by userspace")

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/iommu.h
index 0c4d8ae985ac,3861d66b65c1..000000000000
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@@ -238,9 -234,15 +238,17 @@@ struct iommu_iotlb_gather 
   *           op is allocated in the iommu driver and freed by the caller after
   *           use. The information type is one of enum iommu_hw_info_type defined
   *           in include/uapi/linux/iommufd.h.
-  * @domain_alloc: allocate iommu domain
+  * @domain_alloc: allocate and return an iommu domain if success. Otherwise
+  *                NULL is returned. The domain is not fully initialized until
+  *                the caller iommu_domain_alloc() returns.
 + * @domain_alloc_paging: Allocate an iommu_domain that can be used for
 + *                       UNMANAGED, DMA, and DMA_FQ domain types.
+  * @domain_alloc_user: Allocate an iommu domain corresponding to the input
+  *                     parameters as defined in include/uapi/linux/iommufd.h.
+  *                     Unlike @domain_alloc, it is called only by IOMMUFD and
+  *                     must fully initialize the new domain before return.
+  *                     Upon success, a domain is returned. Upon failure,
+  *                     ERR_PTR must be returned.
   * @probe_device: Add device to iommu driver handling
   * @release_device: Remove device from iommu driver handling
   * @probe_finalize: Do final setup work after the device is added to an IOMMU
@@@ -275,7 -275,7 +283,8 @@@ struct iommu_ops 
  
  	/* Domain allocation and freeing by the iommu driver */
  	struct iommu_domain *(*domain_alloc)(unsigned iommu_domain_type);
 +	struct iommu_domain *(*domain_alloc_paging)(struct device *dev);
+ 	struct iommu_domain *(*domain_alloc_user)(struct device *dev, u32 flags);
  
  	struct iommu_device *(*probe_device)(struct device *dev);
  	void (*release_device)(struct device *dev);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the iommufd tree with the iommu tree
@ 2023-08-16  6:21 Stephen Rothwell
  0 siblings, 0 replies; 23+ messages in thread
From: Stephen Rothwell @ 2023-08-16  6:21 UTC (permalink / raw)
  To: Jason Gunthorpe, Joerg Roedel
  Cc: Jason Gunthorpe, Joerg Roedel, Linux Kernel Mailing List,
	Linux Next Mailing List, Yi Liu

[-- Attachment #1: Type: text/plain, Size: 1738 bytes --]

Hi all,

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

  include/linux/iommu.h

between commit:

  2b4de976b360 ("iommu: Pass in the iommu_device to probe for in bus_iommu_probe()")

from the iommu tree and commit:

  c64805327b7d ("iommu: Move dev_iommu_ops() to private header")

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/iommu.h
index 411ce9b998dc,f2d6a3989713..000000000000
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@@ -460,19 -459,7 +469,8 @@@ static inline void iommu_iotlb_gather_i
  	};
  }
  
- static inline const struct iommu_ops *dev_iommu_ops(struct device *dev)
- {
- 	/*
- 	 * Assume that valid ops must be installed if iommu_probe_device()
- 	 * has succeeded. The device ops are essentially for internal use
- 	 * within the IOMMU subsystem itself, so we should be able to trust
- 	 * ourselves not to misuse the helper.
- 	 */
- 	return dev->iommu->iommu_dev->ops;
- }
- 
 -extern int bus_iommu_probe(const struct bus_type *bus);
 +extern int bus_iommu_probe(const struct bus_type *bus,
 +			   struct iommu_device *iommu);
  extern bool iommu_present(const struct bus_type *bus);
  extern bool device_iommu_capable(struct device *dev, enum iommu_cap cap);
  extern bool iommu_group_has_isolated_msi(struct iommu_group *group);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: manual merge of the iommufd tree with the iommu tree
  2022-11-04 12:33 ` Jason Gunthorpe
@ 2022-11-04 19:21   ` Jason Gunthorpe
  0 siblings, 0 replies; 23+ messages in thread
From: Jason Gunthorpe @ 2022-11-04 19:21 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Joerg Roedel, Linux Kernel Mailing List, Linux Next Mailing List

On Fri, Nov 04, 2022 at 09:33:28AM -0300, Jason Gunthorpe wrote:
> On Fri, Nov 04, 2022 at 03:24:34PM +1100, Stephen Rothwell wrote:
> > Hi all,
> > 
> > Today's linux-next merge of the iommufd tree got conflicts in:
> > 
> >   drivers/iommu/iommu.c
> >   include/linux/iommu.h
> > 
> > between commits from the iommu and iommufd trees.
> > 
> > I don't have time to disentangle this, so I have just dropped the iommufd
> > tree for today.  Please coordinate.
> 
> Urk - this is caused by merging the Intel SVA cleanup series into the
> iommu tree
> 
> Most likely I'll have to take commit 69e61edebea0 ("Merge tag
> 'for-joerg' of
> git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd into core")
> from the iommu tree as a shared branch
> 
> Check again tomorrow please

It is sorted out now.

Jason

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: linux-next: manual merge of the iommufd tree with the iommu tree
  2022-11-04  4:24 Stephen Rothwell
@ 2022-11-04 12:33 ` Jason Gunthorpe
  2022-11-04 19:21   ` Jason Gunthorpe
  0 siblings, 1 reply; 23+ messages in thread
From: Jason Gunthorpe @ 2022-11-04 12:33 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Joerg Roedel, Linux Kernel Mailing List, Linux Next Mailing List

On Fri, Nov 04, 2022 at 03:24:34PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the iommufd tree got conflicts in:
> 
>   drivers/iommu/iommu.c
>   include/linux/iommu.h
> 
> between commits from the iommu and iommufd trees.
> 
> I don't have time to disentangle this, so I have just dropped the iommufd
> tree for today.  Please coordinate.

Urk - this is caused by merging the Intel SVA cleanup series into the
iommu tree

Most likely I'll have to take commit 69e61edebea0 ("Merge tag
'for-joerg' of
git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd into core")
from the iommu tree as a shared branch

Check again tomorrow please

Thanks,
Jason

^ permalink raw reply	[flat|nested] 23+ messages in thread

* linux-next: manual merge of the iommufd tree with the iommu tree
@ 2022-11-04  4:24 Stephen Rothwell
  2022-11-04 12:33 ` Jason Gunthorpe
  0 siblings, 1 reply; 23+ messages in thread
From: Stephen Rothwell @ 2022-11-04  4:24 UTC (permalink / raw)
  To: Jason Gunthorpe, Joerg Roedel
  Cc: Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 328 bytes --]

Hi all,

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

  drivers/iommu/iommu.c
  include/linux/iommu.h

between commits from the iommu and iommufd trees.

I don't have time to disentangle this, so I have just dropped the iommufd
tree for today.  Please coordinate.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2023-11-03  0:33 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-27  4:55 linux-next: manual merge of the iommufd tree with the iommu tree Stephen Rothwell
2023-10-27  6:15 ` Stephen Rothwell
2023-10-30 18:26   ` Jason Gunthorpe
2023-10-31  5:12     ` Stephen Rothwell
2023-10-31 11:31       ` Jason Gunthorpe
2023-11-02 23:53       ` Stephen Rothwell
2023-11-03  0:33         ` Jason Gunthorpe
  -- strict thread matches above, loose matches on Subject: below --
2023-10-26  3:27 Stephen Rothwell
2023-10-25  4:44 Stephen Rothwell
2023-10-25 12:17 ` Jason Gunthorpe
2023-11-02 23:53 ` Stephen Rothwell
2023-10-25  4:34 Stephen Rothwell
2023-10-25 12:12 ` Jason Gunthorpe
2023-10-25 12:16   ` Baolu Lu
2023-10-25 12:17     ` Jason Gunthorpe
2023-10-25 12:25       ` Baolu Lu
2023-10-23  4:56 Stephen Rothwell
2023-10-11  5:03 Stephen Rothwell
2023-10-11 13:58 ` Jason Gunthorpe
2023-08-16  6:21 Stephen Rothwell
2022-11-04  4:24 Stephen Rothwell
2022-11-04 12:33 ` Jason Gunthorpe
2022-11-04 19:21   ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).