From: Lu Baolu <baolu.lu@linux.intel.com> To: David Woodhouse <dwmw2@infradead.org>, Joerg Roedel <joro@8bytes.org> Cc: ashok.raj@intel.com, jacob.jun.pan@intel.com, kevin.tian@intel.com, jamessewart@arista.com, tmurphy@arista.com, dima@arista.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Lu Baolu <baolu.lu@linux.intel.com> Subject: [PATCH v3 0/8] iommu/vt-d: Delegate DMA domain to generic iommu Date: Mon, 29 Apr 2019 10:09:17 +0800 [thread overview] Message-ID: <20190429020925.18136-1-baolu.lu@linux.intel.com> (raw) Hi, This patchset delegates the iommu DMA domain management to the generic iommu layer. It avoids the use of find_or_alloc_domain whose domain assignment is inconsistent with the iommu grouping as determined by pci_device_group. The major change is to permit domains of type IOMMU_DOMAIN_DMA and IOMMU_DOMAIN_IDENTITY to be allocated via the iommu_ops api. This allows the default_domain of an iommu group to be set in iommu.c. This domain will be attached to every device that is brought up with an iommu group, and the devices reserved regions will be mapped using regions returned by get_resv_regions. The default domain implementation defines a default domain type and a domain of the default domain type will be allocated and attached to devices which belong to a same group. Unfortunately, this doesn't work for some quirky devices which is known to only work with a specific domain type. PATCH 1/8 adds an iommu ops which allows the IOMMU driver to return whether a device requires a specific domain type, otherwise the staic defined type will be applied. Other changes are limited within the Intel IOMMU driver. They mainly allow the driver to adapt to allocating domains, attaching domains, applying and direct mapping reserved memory regions, deferred domain attachment, and so on, via the iommu_ops api's. This patchset was initiated by James Sewart. The v1 and v2 were posted here [1] [2] for discussion. Lu Baolu took over the work for testing and bug fixing with permission from James Sewart. Reference: [1] https://lkml.org/lkml/2019/3/4/644 [2] https://lkml.org/lkml/2019/3/14/299 Best regards, Lu Baolu Change log: v2->v3: - Add supported default domain type callback. - Make the iommu map() callback work even the domain is not attached. - Add domain deferred attach when iommu is pre-enabled in kdump kernel. v1->v2: - https://lkml.org/lkml/2019/3/14/299 - Refactored ISA direct mappings to be returned by iommu_get_resv_regions. - Integrated patch by Lu to defer turning on DMAR until iommu.c has mapped reserved regions. - Integrated patches by Lu to remove more unused code in cleanup. v1: -Original post https://lkml.org/lkml/2019/3/4/644 James Sewart (4): iommu/vt-d: Implement apply_resv_region iommu ops entry iommu/vt-d: Expose ISA direct mapping region via iommu_get_resv_regions iommu/vt-d: Allow DMA domains to be allocated by iommu ops iommu/vt-d: Remove lazy allocation of domains Lu Baolu (4): iommu: Add ops entry for supported default domain type iommu/vt-d: Enable DMA remapping after rmrr mapped iommu/vt-d: Implement def_domain_type iommu ops entry iommu/vt-d: Implement is_attach_deferred iommu ops entry drivers/iommu/intel-iommu.c | 630 +++++++++++------------------------- drivers/iommu/iommu.c | 13 +- include/linux/iommu.h | 11 + 3 files changed, 210 insertions(+), 444 deletions(-) -- 2.17.1
WARNING: multiple messages have this Message-ID (diff)
From: Lu Baolu <baolu.lu@linux.intel.com> To: David Woodhouse <dwmw2@infradead.org>, Joerg Roedel <joro@8bytes.org> Cc: kevin.tian@intel.com, ashok.raj@intel.com, dima@arista.com, tmurphy@arista.com, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, jacob.jun.pan@intel.com Subject: [PATCH v3 0/8] iommu/vt-d: Delegate DMA domain to generic iommu Date: Mon, 29 Apr 2019 10:09:17 +0800 [thread overview] Message-ID: <20190429020925.18136-1-baolu.lu@linux.intel.com> (raw) Message-ID: <20190429020917.9yWX9VU5-7RACe183IXBakBOiHdHkC56A81wx5NRsHA@z> (raw) Hi, This patchset delegates the iommu DMA domain management to the generic iommu layer. It avoids the use of find_or_alloc_domain whose domain assignment is inconsistent with the iommu grouping as determined by pci_device_group. The major change is to permit domains of type IOMMU_DOMAIN_DMA and IOMMU_DOMAIN_IDENTITY to be allocated via the iommu_ops api. This allows the default_domain of an iommu group to be set in iommu.c. This domain will be attached to every device that is brought up with an iommu group, and the devices reserved regions will be mapped using regions returned by get_resv_regions. The default domain implementation defines a default domain type and a domain of the default domain type will be allocated and attached to devices which belong to a same group. Unfortunately, this doesn't work for some quirky devices which is known to only work with a specific domain type. PATCH 1/8 adds an iommu ops which allows the IOMMU driver to return whether a device requires a specific domain type, otherwise the staic defined type will be applied. Other changes are limited within the Intel IOMMU driver. They mainly allow the driver to adapt to allocating domains, attaching domains, applying and direct mapping reserved memory regions, deferred domain attachment, and so on, via the iommu_ops api's. This patchset was initiated by James Sewart. The v1 and v2 were posted here [1] [2] for discussion. Lu Baolu took over the work for testing and bug fixing with permission from James Sewart. Reference: [1] https://lkml.org/lkml/2019/3/4/644 [2] https://lkml.org/lkml/2019/3/14/299 Best regards, Lu Baolu Change log: v2->v3: - Add supported default domain type callback. - Make the iommu map() callback work even the domain is not attached. - Add domain deferred attach when iommu is pre-enabled in kdump kernel. v1->v2: - https://lkml.org/lkml/2019/3/14/299 - Refactored ISA direct mappings to be returned by iommu_get_resv_regions. - Integrated patch by Lu to defer turning on DMAR until iommu.c has mapped reserved regions. - Integrated patches by Lu to remove more unused code in cleanup. v1: -Original post https://lkml.org/lkml/2019/3/4/644 James Sewart (4): iommu/vt-d: Implement apply_resv_region iommu ops entry iommu/vt-d: Expose ISA direct mapping region via iommu_get_resv_regions iommu/vt-d: Allow DMA domains to be allocated by iommu ops iommu/vt-d: Remove lazy allocation of domains Lu Baolu (4): iommu: Add ops entry for supported default domain type iommu/vt-d: Enable DMA remapping after rmrr mapped iommu/vt-d: Implement def_domain_type iommu ops entry iommu/vt-d: Implement is_attach_deferred iommu ops entry drivers/iommu/intel-iommu.c | 630 +++++++++++------------------------- drivers/iommu/iommu.c | 13 +- include/linux/iommu.h | 11 + 3 files changed, 210 insertions(+), 444 deletions(-) -- 2.17.1 _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
next reply other threads:[~2019-04-29 2:09 UTC|newest] Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-04-29 2:09 Lu Baolu [this message] 2019-04-29 2:09 ` [PATCH v3 0/8] iommu/vt-d: Delegate DMA domain to generic iommu Lu Baolu 2019-04-29 2:09 ` [PATCH v3 1/8] iommu: Add ops entry for supported default domain type Lu Baolu 2019-04-29 2:09 ` Lu Baolu 2019-05-06 15:32 ` Tom Murphy via iommu 2019-05-07 10:28 ` Robin Murphy 2019-05-09 2:30 ` Lu Baolu 2019-05-09 16:11 ` Robin Murphy 2019-05-10 5:29 ` Lu Baolu 2019-05-09 2:22 ` Lu Baolu 2019-04-29 2:09 ` [PATCH v3 2/8] iommu/vt-d: Implement apply_resv_region iommu ops entry Lu Baolu 2019-04-29 2:09 ` Lu Baolu 2019-04-29 2:09 ` [PATCH v3 3/8] iommu/vt-d: Expose ISA direct mapping region via iommu_get_resv_regions Lu Baolu 2019-04-29 2:09 ` Lu Baolu 2019-04-29 2:09 ` [PATCH v3 4/8] iommu/vt-d: Enable DMA remapping after rmrr mapped Lu Baolu 2019-04-29 2:09 ` Lu Baolu 2019-04-29 2:09 ` [PATCH v3 5/8] iommu/vt-d: Implement def_domain_type iommu ops entry Lu Baolu 2019-04-29 2:09 ` Lu Baolu 2019-04-29 20:03 ` Christoph Hellwig 2019-04-29 20:03 ` Christoph Hellwig 2019-04-30 2:11 ` Lu Baolu 2019-04-30 2:11 ` Lu Baolu 2019-05-06 15:25 ` Tom Murphy via iommu 2019-05-09 4:31 ` Lu Baolu 2019-04-29 2:09 ` [PATCH v3 6/8] iommu/vt-d: Allow DMA domains to be allocated by iommu ops Lu Baolu 2019-04-29 2:09 ` Lu Baolu 2019-04-29 2:09 ` [PATCH v3 7/8] iommu/vt-d: Remove lazy allocation of domains Lu Baolu 2019-04-29 2:09 ` Lu Baolu 2019-04-29 2:09 ` [PATCH v3 8/8] iommu/vt-d: Implement is_attach_deferred iommu ops entry Lu Baolu 2019-04-29 2:09 ` Lu Baolu
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190429020925.18136-1-baolu.lu@linux.intel.com \ --to=baolu.lu@linux.intel.com \ --cc=ashok.raj@intel.com \ --cc=dima@arista.com \ --cc=dwmw2@infradead.org \ --cc=iommu@lists.linux-foundation.org \ --cc=jacob.jun.pan@intel.com \ --cc=jamessewart@arista.com \ --cc=joro@8bytes.org \ --cc=kevin.tian@intel.com \ --cc=linux-kernel@vger.kernel.org \ --cc=tmurphy@arista.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).