[PATCH 6/8] iommu/dart: Move the blocked domain support to a global static

Jason Gunthorpe jgg at nvidia.com
Wed Sep 27 05:59:25 PDT 2023


On Tue, Sep 26, 2023 at 09:05:08PM +0200, Janne Grunau wrote:
> > +static int apple_dart_attach_dev_blocked(struct iommu_domain *domain,
> > +					 struct device *dev)
> > +{
> > +	struct apple_dart_master_cfg *cfg = dev_iommu_priv_get(dev);
> > +	struct apple_dart_stream_map *stream_map;
> > +	int i;
> > +
> > +	if (cfg->stream_maps[0].dart->force_bypass)
> > +		return -EINVAL;
> 
> unrelated to this change as this keeps the current behavior but I think
> force_bypass should not override IOMMU_DOMAIN_BLOCKED.

That would be great, dart is the only driver that can fail blocked..

> It is set if the CPU page size is smaller than dart's page
> size. Obviously dart can't translate in that situation but it should
> be still possible to block it completely.

Wonderful, actually it probably shouldn't even support allocating a
paging domain if it can't support PAGE_SIZE mappings?

> How do we manage this? I can write a patch either to the current state
> or based on this series.

Let me just add a patch to this series to remove that test with your
explanation, that will avoid patch ordering troubles.

Thanks,
Jason



More information about the linux-arm-kernel mailing list