linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the iommu tree with Linus' tree
@ 2023-01-27  3:13 Stephen Rothwell
  2023-01-30  8:49 ` Joerg Roedel
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Rothwell @ 2023-01-27  3:13 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: Alex Williamson, Jason Gunthorpe, Jason Gunthorpe, Joerg Roedel,
	Linux Kernel Mailing List, Linux Next Mailing List,
	Niklas Schnelle

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

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);

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

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

end of thread, other threads:[~2023-01-30 18:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-27  3:13 linux-next: manual merge of the iommu tree with Linus' tree Stephen Rothwell
2023-01-30  8:49 ` Joerg Roedel
2023-01-30 17:55   ` Alex Williamson
2023-01-30 18:00     ` 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).