All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/arm: smmuv1: remove iommu group when deassign a device
@ 2022-04-27 16:15 Rahul Singh
  2022-04-27 17:42 ` Julien Grall
  0 siblings, 1 reply; 14+ messages in thread
From: Rahul Singh @ 2022-04-27 16:15 UTC (permalink / raw)
  To: xen-devel
  Cc: bertrand.marquis, rahul.singh, Stefano Stabellini, Julien Grall,
	Volodymyr Babchuk

When a device is deassigned from the domain it is required to remove the
iommu group.

If we don't remove the group, the next time when we assign
a device, SME and S2CR will not be setup correctly for the device
because of that SMMU fault will be observed.

Signed-off-by: Rahul Singh <rahul.singh@arm.com>
---
 xen/drivers/passthrough/arm/smmu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index 5cacb2dd99..9a31c332d0 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -1690,6 +1690,8 @@ static void arm_smmu_detach_dev(struct iommu_domain *domain, struct device *dev)
 	if (cfg)
 		arm_smmu_master_free_smes(cfg);
 
+	iommu_group_put(dev_iommu_group(dev));
+	dev_iommu_group(dev) = NULL;
 }
 
 #if 0 /*
-- 
2.25.1



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

end of thread, other threads:[~2022-07-27 13:27 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-27 16:15 [PATCH] xen/arm: smmuv1: remove iommu group when deassign a device Rahul Singh
2022-04-27 17:42 ` Julien Grall
2022-04-29 14:33   ` Rahul Singh
2022-05-03 15:44     ` Julien Grall
2022-06-16  7:48       ` Mykyta Poturai
2022-06-16 10:55         ` Rahul Singh
2022-06-17 11:15           ` Mykyta Poturai
2022-06-20  9:38             ` Rahul Singh
2022-06-21  9:38               ` Mykyta Poturai
2022-06-21 13:51                 ` Rahul Singh
2022-06-28 17:23                   ` Mykyta Poturai
2022-07-21 15:53                     ` Rahul Singh
2022-07-26 17:35                       ` Julien Grall
2022-07-27 13:27                         ` Rahul Singh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.