stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iommu/vt-d: Fix misplaced domain_attached assignment
@ 2025-07-23 12:04 Ban ZuoXiang
  2025-07-23 12:11 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Ban ZuoXiang @ 2025-07-23 12:04 UTC (permalink / raw)
  To: stable; +Cc: iommu, baolu.lu, gregkh, linux-kernel, Ban ZuoXiang

Commit fb5873b779dd ("iommu/vt-d: Restore context entry setup order
for aliased devices") was incorrectly backported: the domain_attached
assignment was mistakenly placed in device_set_dirty_tracking()
instead of original identity_domain_attach_dev().

Fix this by moving the assignment to the correct function as in the
original commit.

Fixes: fb5873b779dd ("iommu/vt-d: Restore context entry setup order for aliased devices")
Closes: https://lore.kernel.org/linux-iommu/721D44AF820A4FEB+722679cb-2226-4287-8835-9251ad69a1ac@bbaa.fun/
Cc: stable@vger.kernel.org
Reported-by: Ban ZuoXiang <bbaa@bbaa.fun>
Signed-off-by: Ban ZuoXiang <bbaa@bbaa.fun>
---
 drivers/iommu/intel/iommu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index 56e9f125cda9..af4e6c1e55db 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -4414,9 +4414,6 @@ static int device_set_dirty_tracking(struct list_head *devices, bool enable)
 			break;
 	}
 
-	if (!ret)
-		info->domain_attached = true;
-
 	return ret;
 }
 
@@ -4600,6 +4597,9 @@ static int identity_domain_attach_dev(struct iommu_domain *domain, struct device
 		ret = device_setup_pass_through(dev);
 	}
 
+	if (!ret)
+		info->domain_attached = true;
+
 	return ret;
 }
 
-- 
2.50.1


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

* Re: [PATCH] iommu/vt-d: Fix misplaced domain_attached assignment
  2025-07-23 12:04 [PATCH] iommu/vt-d: Fix misplaced domain_attached assignment Ban ZuoXiang
@ 2025-07-23 12:11 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2025-07-23 12:11 UTC (permalink / raw)
  To: Ban ZuoXiang; +Cc: stable, iommu, baolu.lu, linux-kernel

On Wed, Jul 23, 2025 at 08:04:23PM +0800, Ban ZuoXiang wrote:
> Commit fb5873b779dd ("iommu/vt-d: Restore context entry setup order
> for aliased devices") was incorrectly backported: the domain_attached
> assignment was mistakenly placed in device_set_dirty_tracking()
> instead of original identity_domain_attach_dev().
> 
> Fix this by moving the assignment to the correct function as in the
> original commit.
> 
> Fixes: fb5873b779dd ("iommu/vt-d: Restore context entry setup order for aliased devices")
> Closes: https://lore.kernel.org/linux-iommu/721D44AF820A4FEB+722679cb-2226-4287-8835-9251ad69a1ac@bbaa.fun/
> Cc: stable@vger.kernel.org
> Reported-by: Ban ZuoXiang <bbaa@bbaa.fun>
> Signed-off-by: Ban ZuoXiang <bbaa@bbaa.fun>
> ---
>  drivers/iommu/intel/iommu.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Now queued up, thanks!

greg k-h

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

end of thread, other threads:[~2025-07-23 12:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-23 12:04 [PATCH] iommu/vt-d: Fix misplaced domain_attached assignment Ban ZuoXiang
2025-07-23 12:11 ` Greg KH

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