Re: [PATCH v5 0/5] iommu: Support mappings/reservations in reserved-memory regions

2022-05-15 Thread Janne Grunau
Hej, I'm working on the display controller for Apple silicon SoCs and will add some comments with support for it in mind. added as...@lists.linux.dev to CC for the Apple silicon related aspects On 2022-05-12 21:00:47 +0200, Thierry Reding wrote: > > this is another attempt at solving the probl

Re: [PATCH v5 1/5] dt-bindings: reserved-memory: Document iommu-addresses

2022-05-15 Thread Janne Grunau
On 2022-05-12 21:00:48 +0200, Thierry Reding wrote: > From: Thierry Reding > > This adds the "iommu-addresses" property to reserved-memory nodes, which > allow describing the interaction of memory regions with IOMMUs. Two use- > cases are supported: > > 1. Static mappings can be described by p

Re: [PATCH v5 2/5] iommu: Implement of_iommu_get_resv_regions()

2022-05-15 Thread Janne Grunau
On 2022-05-12 21:00:49 +0200, Thierry Reding wrote: > From: Thierry Reding > > This is an implementation that IOMMU drivers can use to obtain reserved > memory regions from a device tree node. It uses the reserved-memory DT > bindings to find the regions associated with a given device. If these >

[PATCH 0/5] iommu: Make blocking domain static for group

2022-05-15 Thread Lu Baolu
Hi folks, This is a follow-up series after several discussions on blocking domain. The latest discussion could be found here. https://lore.kernel.org/linux-iommu/20220510140238.gd49...@nvidia.com/ This makes blocking domain static by: - Each IOMMU driver is required to report domain ops for the

[PATCH 1/5] iommu: Rename attach_dev to set_dev in domain ops

2022-05-15 Thread Lu Baolu
The detach callback of the iommu domain ops is not used in some IOMMU drivers. The detach_dev actually means setting a default domain or a blocking domain to the device. As attach_dev actually acts as setting domain for a device, this renames attach_dev to set_dev to reflect the actual usage. Sugg

[PATCH 3/5] iommu: Make blocking domain static for iommu group

2022-05-15 Thread Lu Baolu
This makes the blocking_domain static for an iommu group. It's allocated when the first device joins the group and freed after the last device leaves. Essentially the blocking domain is a dummy domain used to remove the domain from IOMMU's device context. Unfortunately, some IOMMU devices don't pro

[PATCH 2/5] iommu: Add blocking_domain_ops field in iommu_ops

2022-05-15 Thread Lu Baolu
Each IOMMU driver must provide a blocking domain ops. If the hardware supports detaching domain from device, setting blocking domain equals detaching the existing domain from the deivce. Otherwise, an UNMANAGED domain without any mapping will be used instead. Signed-off-by: Lu Baolu --- include/

[PATCH 4/5] iommu: Use blocking domain for empty domain attaching

2022-05-15 Thread Lu Baolu
If a NULL domain is about to set to a device, let's set the blocking domain instead. Signed-off-by: Lu Baolu --- drivers/iommu/iommu.c | 35 +++ 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index dcbc

[PATCH 5/5] iommu: Remove .detach_dev from iommu domain ops

2022-05-15 Thread Lu Baolu
The .detach_dev callback is not used anymore. Reomve it to avoid dead code. Signed-off-by: Lu Baolu --- include/linux/iommu.h | 2 -- include/trace/events/iommu.h| 7 --- drivers/iommu/amd/iommu.c | 1 - drivers/iommu/apple-dart.c | 1

Re: [PATCH v6 03/12] iommu: Add attach/detach_dev_pasid domain ops

2022-05-15 Thread Baolu Lu
On 2022/5/12 19:51, Jason Gunthorpe wrote: On Thu, May 12, 2022 at 08:00:59AM +0100, Jean-Philippe Brucker wrote: It is not "missing" it is just renamed to blocking_domain->ops->set_dev_pasid() The implementation of that function would be identical to detach_dev_pasid. attach(dev, pasid,

Re: [PATCH 0/7] iommu/vt-d: Make intel-iommu.h private

2022-05-15 Thread Christoph Hellwig
On Sat, May 14, 2022 at 09:43:15AM +0800, Lu Baolu wrote: > Hi folks, > > The include/linux/intel-iommu.h should be private to the Intel IOMMU > driver. Other drivers or components should interact with the IOMMU > drivers through the kAPIs provided by the iommu core. > > This series cleanups all

Re: [PATCH] vfio: Remove VFIO_TYPE1_NESTING_IOMMU

2022-05-15 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig we really should not keep dead code like this around. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu