lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1475009318-2617-4-git-send-email-eric.auger@redhat.com>
Date:   Tue, 27 Sep 2016 20:48:30 +0000
From:   Eric Auger <eric.auger@...hat.com>
To:     eric.auger@...hat.com, eric.auger.pro@...il.com,
        christoffer.dall@...aro.org, marc.zyngier@....com,
        robin.murphy@....com, alex.williamson@...hat.com,
        will.deacon@....com, joro@...tes.org, tglx@...utronix.de,
        jason@...edaemon.net, linux-arm-kernel@...ts.infradead.org
Cc:     kvm@...r.kernel.org, drjones@...hat.com,
        linux-kernel@...r.kernel.org, Bharat.Bhushan@...escale.com,
        pranav.sawargaonkar@...il.com, p.fedin@...sung.com,
        iommu@...ts.linux-foundation.org, Jean-Philippe.Brucker@....com,
        yehuday@...vell.com, Manish.Jaggi@...iumnetworks.com
Subject: [RFC 03/11] iommu: Introduce IOMMU_DOMAIN_MIXED

We introduce a new IOMMU domain type, dubbed IOMMU_DOMAIN_MIXED.
It is bound to be used as a replacement of IOMMU_DOMAIN_UNMANAGED
when the IOMMU translates MSI addresses. Such domain hosts
"unmanaged" reserved IOVA ranges chosen by the iommu-api user,
dished out as part of alloc_iova. Rest if available for internal
iova needs such as MSI frame IOVA allocation.

Signed-off-by: Eric Auger <eric.auger@...hat.com>
---
 include/linux/iommu.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 5c2673a..44fe213 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -62,6 +62,9 @@ struct iommu_domain_msi_geometry {
 #define __IOMMU_DOMAIN_DMA_API	(1U << 1)  /* Domain for use in DMA-API
 					      implementation              */
 #define __IOMMU_DOMAIN_PT	(1U << 2)  /* Domain is identity mapped   */
+#define __IOMMU_DOMAIN_MIXED	(1U << 3)  /* Domain mixing unmanaged and
+					    * managed IOVAS
+					    */
 
 /*
  * This are the possible domain-types
@@ -71,6 +74,9 @@ struct iommu_domain_msi_geometry {
  *	IOMMU_DOMAIN_IDENTITY	- DMA addresses are system physical addresses
  *	IOMMU_DOMAIN_UNMANAGED	- DMA mappings managed by IOMMU-API user, used
  *				  for VMs
+ *	IOMMU_DOMAIN_MIXED	- Most DMA mappings are managed by IOMMU-API
+ *				  users and holes are left available for
+				  internal use such as MSI frame IOVA allocation
  *	IOMMU_DOMAIN_DMA	- Internally used for DMA-API implementations.
  *				  This flag allows IOMMU drivers to implement
  *				  certain optimizations for these domains
@@ -80,6 +86,9 @@ struct iommu_domain_msi_geometry {
 #define IOMMU_DOMAIN_UNMANAGED	(__IOMMU_DOMAIN_PAGING)
 #define IOMMU_DOMAIN_DMA	(__IOMMU_DOMAIN_PAGING |	\
 				 __IOMMU_DOMAIN_DMA_API)
+#define IOMMU_DOMAIN_MIXED	(__IOMMU_DOMAIN_MIXED |		\
+				 __IOMMU_DOMAIN_PAGING |	\
+				 __IOMMU_DOMAIN_DMA_API)
 
 struct iommu_domain {
 	unsigned type;
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ