2023-01-27 03:13:39

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: manual merge of the iommu tree with Linus' tree

Hi all,

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

drivers/vfio/vfio_iommu_type1.c

between commit:

895c0747f726 ("vfio/type1: Respect IOMMU reserved regions in vfio_test_domain_fgsp()")

from Linus' tree and commit:

1369459b2e21 ("iommu: Add a gfp parameter to iommu_map()")

from the iommu 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/vfio/vfio_iommu_type1.c
index 2209372f236d,e14f86a8ef52..000000000000
--- a/drivers/vfio/vfio_iommu_type1.c
+++ b/drivers/vfio/vfio_iommu_type1.c
@@@ -1867,22 -1866,15 +1868,22 @@@ static void vfio_test_domain_fgsp(struc
if (!pages)
return;

- ret = iommu_map(domain->domain, 0, page_to_phys(pages), PAGE_SIZE * 2,
- IOMMU_READ | IOMMU_WRITE | IOMMU_CACHE, GFP_KERNEL);
- if (!ret) {
- size_t unmapped = iommu_unmap(domain->domain, 0, PAGE_SIZE);
+ list_for_each_entry(region, regions, list) {
+ start = ALIGN(region->start, PAGE_SIZE * 2);
+ if (start >= region->end || (region->end - start < PAGE_SIZE * 2))
+ continue;

- if (unmapped == PAGE_SIZE)
- iommu_unmap(domain->domain, PAGE_SIZE, PAGE_SIZE);
- else
- domain->fgsp = true;
+ ret = iommu_map(domain->domain, start, page_to_phys(pages), PAGE_SIZE * 2,
- IOMMU_READ | IOMMU_WRITE | IOMMU_CACHE);
++ IOMMU_READ | IOMMU_WRITE | IOMMU_CACHE, GFP_KERNEL);
+ if (!ret) {
+ size_t unmapped = iommu_unmap(domain->domain, start, PAGE_SIZE);
+
+ if (unmapped == PAGE_SIZE)
+ iommu_unmap(domain->domain, start + PAGE_SIZE, PAGE_SIZE);
+ else
+ domain->fgsp = true;
+ }
+ break;
}

__free_pages(pages, order);


Attachments:
(No filename) (488.00 B)
OpenPGP digital signature

2023-01-30 08:50:07

by Joerg Roedel

[permalink] [raw]
Subject: Re: linux-next: manual merge of the iommu tree with Linus' tree

Thanks for the report, Stephen.

Alex,

On Fri, Jan 27, 2023 at 02:13:30PM +1100, Stephen Rothwell wrote:
> Hi all,
>
> Today's linux-next merge of the iommu tree got a conflict in:
>
> drivers/vfio/vfio_iommu_type1.c
>
> between commit:
>
> 895c0747f726 ("vfio/type1: Respect IOMMU reserved regions in vfio_test_domain_fgsp()")
>
> from Linus' tree and commit:
>
> 1369459b2e21 ("iommu: Add a gfp parameter to iommu_map()")
>
> from the iommu tree.

In case you want to fix this up in your tree, the patch-set causing this
is in a separate branch in the IOMMU tree which you can merge into your
tree:

git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git iommu-memory-accounting

Regards,

--
J?rg R?del
[email protected]

SUSE Software Solutions Germany GmbH
Frankenstra?e 146
90461 N?rnberg
Germany

(HRB 36809, AG N?rnberg)
Gesch?ftsf?hrer: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman


2023-01-30 17:56:38

by Alex Williamson

[permalink] [raw]
Subject: Re: linux-next: manual merge of the iommu tree with Linus' tree

On Mon, 30 Jan 2023 09:49:16 +0100
Joerg Roedel <[email protected]> wrote:

> Thanks for the report, Stephen.
>
> Alex,
>
> On Fri, Jan 27, 2023 at 02:13:30PM +1100, Stephen Rothwell wrote:
> > Hi all,
> >
> > Today's linux-next merge of the iommu tree got a conflict in:
> >
> > drivers/vfio/vfio_iommu_type1.c
> >
> > between commit:
> >
> > 895c0747f726 ("vfio/type1: Respect IOMMU reserved regions in vfio_test_domain_fgsp()")
> >
> > from Linus' tree and commit:
> >
> > 1369459b2e21 ("iommu: Add a gfp parameter to iommu_map()")
> >
> > from the iommu tree.
>
> In case you want to fix this up in your tree, the patch-set causing this
> is in a separate branch in the IOMMU tree which you can merge into your
> tree:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git iommu-memory-accounting

Hi Joerg,

The conflict is with mainline, not my next branch. The commit above
went in as a fix for v6.2. Thanks,

Alex


2023-01-30 18:00:21

by Jason Gunthorpe

[permalink] [raw]
Subject: Re: linux-next: manual merge of the iommu tree with Linus' tree

On Mon, Jan 30, 2023 at 10:55:49AM -0700, Alex Williamson wrote:
> On Mon, 30 Jan 2023 09:49:16 +0100
> Joerg Roedel <[email protected]> wrote:
>
> > Thanks for the report, Stephen.
> >
> > Alex,
> >
> > On Fri, Jan 27, 2023 at 02:13:30PM +1100, Stephen Rothwell wrote:
> > > Hi all,
> > >
> > > Today's linux-next merge of the iommu tree got a conflict in:
> > >
> > > drivers/vfio/vfio_iommu_type1.c
> > >
> > > between commit:
> > >
> > > 895c0747f726 ("vfio/type1: Respect IOMMU reserved regions in vfio_test_domain_fgsp()")
> > >
> > > from Linus' tree and commit:
> > >
> > > 1369459b2e21 ("iommu: Add a gfp parameter to iommu_map()")
> > >
> > > from the iommu tree.
> >
> > In case you want to fix this up in your tree, the patch-set causing this
> > is in a separate branch in the IOMMU tree which you can merge into your
> > tree:
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git iommu-memory-accounting
>
> Hi Joerg,
>
> The conflict is with mainline, not my next branch. The commit above
> went in as a fix for v6.2. Thanks,

I usually sort out conflicts against the rc series when I send a PR, I
pulled Joerg's branch so I can deal with these conflicts, they are
trivial enough

There will be another -rc conflict from rdma as well:

https://lore.kernel.org/r/[email protected]

Jason