2014-06-05 17:04:19

by Antonios Motakis

[permalink] [raw]
Subject: [RFC PATCH v6 02/20] iommu: add capability IOMMU_CAP_NOEXEC

Some IOMMUs accept an IOMMU_NOEXEC protection flag in addition to
IOMMU_READ and IOMMU_WRITE. Expose this as an IOMMU capability.

Signed-off-by: Antonios Motakis <[email protected]>
---
include/linux/iommu.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index fc464d2..7e152fb 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -57,8 +57,9 @@ struct iommu_domain {
struct iommu_domain_geometry geometry;
};

-#define IOMMU_CAP_CACHE_COHERENCY 0x1
-#define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */
+#define IOMMU_CAP_CACHE_COHERENCY (1 << 0)
+#define IOMMU_CAP_INTR_REMAP (1 << 1) /* isolates device intrs */
+#define IOMMU_CAP_NOEXEC (1 << 2) /* IOMMU_NOEXEC flag */

/*
* Following constraints are specifc to FSL_PAMUV1:
--
1.8.3.2


2014-06-05 20:04:16

by Alex Williamson

[permalink] [raw]
Subject: Re: [RFC PATCH v6 02/20] iommu: add capability IOMMU_CAP_NOEXEC

On Thu, 2014-06-05 at 19:03 +0200, Antonios Motakis wrote:
> Some IOMMUs accept an IOMMU_NOEXEC protection flag in addition to
> IOMMU_READ and IOMMU_WRITE. Expose this as an IOMMU capability.
>
> Signed-off-by: Antonios Motakis <[email protected]>
> ---
> include/linux/iommu.h | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/iommu.h b/include/linux/iommu.h
> index fc464d2..7e152fb 100644
> --- a/include/linux/iommu.h
> +++ b/include/linux/iommu.h
> @@ -57,8 +57,9 @@ struct iommu_domain {
> struct iommu_domain_geometry geometry;
> };
>
> -#define IOMMU_CAP_CACHE_COHERENCY 0x1
> -#define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */
> +#define IOMMU_CAP_CACHE_COHERENCY (1 << 0)
> +#define IOMMU_CAP_INTR_REMAP (1 << 1) /* isolates device intrs */
> +#define IOMMU_CAP_NOEXEC (1 << 2) /* IOMMU_NOEXEC flag */
>
> /*
> * Following constraints are specifc to FSL_PAMUV1:

Hmm, was this really intended to be a bitmap? Why? Thanks,

Alex