Re: [PATCH v11 0/3] Enhance IOMMU default DMA mode build options

From: John Garry
Date: Thu Jun 10 2021 - 12:31:38 EST


On 09/06/2021 09:15, Joerg Roedel wrote:
On Tue, Jun 08, 2021 at 09:18:25PM +0800, John Garry wrote:
Zhen Lei (3):
iommu: Enhance IOMMU default DMA mode build options
iommu/vt-d: Add support for IOMMU default DMA mode build options
iommu/amd: Add support for IOMMU default DMA mode build options
So I like the idea, but can we go a step further and get (mostly) rid of
the driver-specific setup code for lazy/non-lazy mode? This can happen
in the dma-iommu code and the drivers only need to keep the support for
their legacy command line options.

The AMD driver just maintains a flag and a print for the strict mode setting.

The Intel driver still maintains some lazy vs strict config, depending on the platform:
- DMAR caching mode set means that we enforce strict mode globally
- workaround for ironlake gpu means that we enforce strict mode globally

So there isn't much driver-specific setup remaining, and I can't see the intel stuff being moved into dma-iommu.c or asbtracted (for that).

We could prob replace the driver-specific logs with new logs in iommu.c, and do away with maintaining the proprietary driver strict mode flags. That's if we're ok with replacing the driver-specific logs, though.

Thanks,
John