public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb•auug.org.au>
To: Thomas Gleixner <tglx@linutronix•de>,
	Ingo Molnar <mingo@redhat•com>, "H. Peter Anvin" <hpa@zytor•com>,
	Peter Zijlstra <peterz@infradead•org>,
	Joerg Roedel <joro@8bytes•org>
Cc: Dave Hansen <dave.hansen@linux•intel.com>,
	Joerg Roedel <jroedel@suse•de>,
	"Kirill A. Shutemov" <kirill.shutemov@linux•intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger•kernel.org>,
	Linux Next Mailing List <linux-next@vger•kernel.org>,
	Lu Baolu <baolu.lu@linux•intel.com>
Subject: linux-next: manual merge of the tip tree with the iommu tree
Date: Mon, 14 Nov 2022 15:10:54 +1100	[thread overview]
Message-ID: <20221114151054.18a48fd9@canb.auug.org.au> (raw)

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

Hi all,

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

  drivers/iommu/iommu-sva-lib.c

between commit:

  757636ed2607 ("iommu: Rename iommu-sva-lib.{c,h}")

from the iommu tree and commits:

  e79114b17b81 ("iommu/sva: Replace pasid_valid() helper with mm_valid_pasid()")
  53e220bbaa51 ("x86/mm/iommu/sva: Make LAM and SVA mutually exclusive")

from the tip tree.

The file was renamed in the former, so I deleted it and applied the
following merge resolution patch.

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.

From: Stephen Rothwell <sfr@canb•auug.org.au>
Date: Mon, 14 Nov 2022 12:36:45 +1100
Subject: [PATCH] fix up for "iommu: Rename iommu-sva-lib.{c,h}"

Signed-off-by: Stephen Rothwell <sfr@canb•auug.org.au>
---
 drivers/iommu/iommu-sva.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/iommu-sva.c b/drivers/iommu/iommu-sva.c
index 24bf9b2b58aa..af05dd9f2a6f 100644
--- a/drivers/iommu/iommu-sva.c
+++ b/drivers/iommu/iommu-sva.c
@@ -2,6 +2,8 @@
 /*
  * Helpers for IOMMU drivers implementing SVA
  */
+#include <linux/mm.h>
+#include <linux/mmu_context.h>
 #include <linux/mutex.h>
 #include <linux/sched/mm.h>
 #include <linux/iommu.h>
@@ -32,21 +34,31 @@ int iommu_sva_alloc_pasid(struct mm_struct *mm, ioasid_t min, ioasid_t max)
 	    min == 0 || max < min)
 		return -EINVAL;
 
+	/* Serialize against address tagging enabling */
+	if (mmap_write_lock_killable(mm))
+		return -EINTR;
+
+	if (!arch_pgtable_dma_compat(mm)) {
+		mmap_write_unlock(mm);
+		return -EBUSY;
+	}
+
 	mutex_lock(&iommu_sva_lock);
 	/* Is a PASID already associated with this mm? */
-	if (pasid_valid(mm->pasid)) {
+	if (mm_valid_pasid(mm)) {
 		if (mm->pasid < min || mm->pasid >= max)
 			ret = -EOVERFLOW;
 		goto out;
 	}
 
 	pasid = ioasid_alloc(&iommu_sva_pasid, min, max, mm);
-	if (!pasid_valid(pasid))
+	if (pasid == INVALID_IOASID)
 		ret = -ENOMEM;
 	else
 		mm_pasid_set(mm, pasid);
 out:
 	mutex_unlock(&iommu_sva_lock);
+	mmap_write_unlock(mm);
 	return ret;
 }
 EXPORT_SYMBOL_GPL(iommu_sva_alloc_pasid);
-- 
2.35.1

-- 
Cheers,
Stephen Rothwell

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

             reply	other threads:[~2022-11-14  4:11 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-14  4:10 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-04-03  4:36 linux-next: manual merge of the tip tree with the iommu tree Stephen Rothwell
2023-04-03  5:11 ` Stephen Rothwell
2022-03-07  1:50 Stephen Rothwell
2021-10-21  1:35 Stephen Rothwell
2021-10-21 15:29 ` Borislav Petkov
2021-11-02  2:57 ` Stephen Rothwell
2020-10-02  5:22 Stephen Rothwell
2020-10-13  3:38 ` Stephen Rothwell
2017-08-22  3:50 Stephen Rothwell
2017-08-22  5:57 ` Baoquan He
2017-08-22  7:49   ` Stephen Rothwell
2017-08-22  8:01     ` Baoquan He
2017-08-22  8:43       ` Stephen Rothwell
2017-08-22  8:50         ` Baoquan He
2017-08-22  8:11     ` Baoquan He
2017-08-23 14:15 ` Tom Lendacky
2017-09-04  5:45 ` Stephen Rothwell
2015-06-17  3:22 Michael Ellerman
2015-06-17  9:57 ` Joerg Roedel
2015-06-17 21:15   ` Michael Ellerman
2015-06-09  6:57 Stephen Rothwell
2015-06-09  6:57 Stephen Rothwell
     [not found] <20150605085030.17051140293@ozlabs.org>
2015-06-05  8:57 ` Joerg Roedel
2011-09-27  5:03 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221114151054.18a48fd9@canb.auug.org.au \
    --to=sfr@canb$(echo .)auug.org.au \
    --cc=baolu.lu@linux$(echo .)intel.com \
    --cc=dave.hansen@linux$(echo .)intel.com \
    --cc=hpa@zytor$(echo .)com \
    --cc=joro@8bytes$(echo .)org \
    --cc=jroedel@suse$(echo .)de \
    --cc=kirill.shutemov@linux$(echo .)intel.com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=mingo@redhat$(echo .)com \
    --cc=peterz@infradead$(echo .)org \
    --cc=tglx@linutronix$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox