Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1554358

[PATCH v7 06/19] iommu: Only map direct mapped regions

From Eric Auger <eric.auger@redhat.com>
Newsgroups linux.kernel
Subject [PATCH v7 06/19] iommu: Only map direct mapped regions
Date 2017-01-09 15:00 +0100
Message-ID <sXIEq-4UO-19@gated-at.bofh.it> (permalink)
References <sXIuJ-4Rr-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


As we introduced new reserved region types which do not require
mapping, let's make sure we only map direct mapped regions.

Signed-off-by: Eric Auger <eric.auger@redhat.com>

---

v3 -> v4:
- use region's type and reword commit message and title
---
 drivers/iommu/iommu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 927878d..41c1906 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -343,6 +343,9 @@ static int iommu_group_create_direct_mappings(struct iommu_group *group,
 		start = ALIGN(entry->start, pg_size);
 		end   = ALIGN(entry->start + entry->length, pg_size);
 
+		if (entry->type != IOMMU_RESV_DIRECT)
+			continue;
+
 		for (addr = start; addr < end; addr += pg_size) {
 			phys_addr_t phys_addr;
 
-- 
1.9.1

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v7 00/19] KVM PCIe/MSI passthrough on ARM/ARM64 and IOVA reserved regions Eric Auger <eric.auger@redhat.com> - 2017-01-09 14:50 +0100
  [PATCH v7 09/19] iommu/vt-d: Implement reserved region get/put callbacks Eric Auger <eric.auger@redhat.com> - 2017-01-09 15:00 +0100
  [PATCH v7 06/19] iommu: Only map direct mapped regions Eric Auger <eric.auger@redhat.com> - 2017-01-09 15:00 +0100
  [PATCH v7 02/19] iommu/dma: Allow MSI-only cookies Eric Auger <eric.auger@redhat.com> - 2017-01-09 15:00 +0100
  [PATCH v7 05/19] iommu: iommu_alloc_resv_region Eric Auger <eric.auger@redhat.com> - 2017-01-09 15:00 +0100
  Re: [PATCH v7 00/19] KVM PCIe/MSI passthrough on ARM/ARM64 and IOVA  reserved regions Joerg Roedel <joro@8bytes.org> - 2017-01-10 15:20 +0100
    Re: [PATCH v7 00/19] KVM PCIe/MSI passthrough on ARM/ARM64 and IOVA  reserved regions Will Deacon <will.deacon@arm.com> - 2017-01-10 15:20 +0100
    Re: [PATCH v7 00/19] KVM PCIe/MSI passthrough on ARM/ARM64 and IOVA  reserved regions Auger Eric <eric.auger@redhat.com> - 2017-01-10 17:00 +0100

csiph-web