From: Baptiste Reynal <b.reynal-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
kvmarm-FPEHb7Xf0XXUo1n7N8X6UoWGPAHP3yOg@public.gmane.org
Cc: "open list:VFIO DRIVER"
<kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
eric.auger-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
"open list:ABI/API"
<linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
open list <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Antonios Motakis
<a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>,
tech-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org
Subject: [PATCH v5 2/4] vfio: introduce the VFIO_DMA_MAP_FLAG_NOEXEC flag
Date: Wed, 4 Mar 2015 17:07:52 +0100 [thread overview]
Message-ID: <1425485274-5709-3-git-send-email-b.reynal@virtualopensystems.com> (raw)
In-Reply-To: <1425485274-5709-1-git-send-email-b.reynal-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>
From: Antonios Motakis <a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>
We introduce the VFIO_DMA_MAP_FLAG_NOEXEC flag to the VFIO dma map call,
and expose its availability via the capability VFIO_DMA_NOEXEC_IOMMU.
This way the user can control whether the XN flag will be set on the
requested mappings. The IOMMU_NOEXEC flag needs to be available for all
the IOMMUs of the container used.
Signed-off-by: Antonios Motakis <a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>
Signed-off-by: Baptiste Reynal <b.reynal-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>
---
include/uapi/linux/vfio.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
index 5fb3d46..30801a7 100644
--- a/include/uapi/linux/vfio.h
+++ b/include/uapi/linux/vfio.h
@@ -31,6 +31,7 @@ enum vfio_iommu_cap {
(ex. PCIe NoSnoop stripping) */
VFIO_EEH = 5, /* Check if EEH is supported */
VFIO_TYPE1_NESTING_IOMMU = 6, /* Two-stage IOMMU, implies v2 */
+ VFIO_DMA_NOEXEC_IOMMU = 7,
};
@@ -397,12 +398,17 @@ struct vfio_iommu_type1_info {
*
* Map process virtual addresses to IO virtual addresses using the
* provided struct vfio_dma_map. Caller sets argsz. READ &/ WRITE required.
+ *
+ * To use the VFIO_DMA_MAP_FLAG_NOEXEC flag, the container must support the
+ * VFIO_DMA_NOEXEC_IOMMU capability. If mappings are created using this flag,
+ * any groups subsequently added to the container must support this capability.
*/
struct vfio_iommu_type1_dma_map {
__u32 argsz;
__u32 flags;
#define VFIO_DMA_MAP_FLAG_READ (1 << 0) /* readable from device */
#define VFIO_DMA_MAP_FLAG_WRITE (1 << 1) /* writable from device */
+#define VFIO_DMA_MAP_FLAG_NOEXEC (1 << 2) /* not executable from device */
__u64 vaddr; /* Process virtual address */
__u64 iova; /* IO virtual address */
__u64 size; /* Size of mapping (bytes) */
--
2.3.1
next prev parent reply other threads:[~2015-03-04 16:07 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-04 16:07 [PATCH v5 0/4] vfio: type1: support for ARM SMMUS with VFIO_IOMMU_TYPE1 Baptiste Reynal
2015-03-04 16:07 ` [PATCH v5 1/4] vfio: implement iommu driver capabilities with an enum Baptiste Reynal
2015-03-04 16:07 ` [PATCH v5 3/4] vfio: type1: replace vfio_domains_have_iommu_cache with generic function Baptiste Reynal
[not found] ` <1425485274-5709-1-git-send-email-b.reynal-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>
2015-03-04 16:07 ` Baptiste Reynal [this message]
2015-03-04 16:07 ` [PATCH v5 4/4] vfio: type1: implement the VFIO_DMA_MAP_FLAG_NOEXEC flag Baptiste Reynal
2015-03-04 17:45 ` [PATCH v5 0/4] vfio: type1: support for ARM SMMUS with VFIO_IOMMU_TYPE1 Alex Williamson
2015-03-05 10:16 ` Baptiste Reynal
[not found] ` <1425491104.5200.268.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-03-05 17:34 ` Eric Auger
[not found] ` <54F893C3.6020006-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-03-05 17:54 ` Alex Williamson
[not found] ` <1425578066.5200.331.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-03-05 18:09 ` Will Deacon
2015-03-05 21:11 ` Alex Williamson
[not found] ` <1425589915.5200.336.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-03-06 9:04 ` Eric Auger
[not found] ` <54F96D96.8040207-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-03-06 10:41 ` Will Deacon
[not found] ` <20150306104148.GC22377-5wv7dgnIgG8@public.gmane.org>
2015-03-06 11:27 ` Baptiste Reynal
[not found] ` <CAN9JPjHWcXuzkByJY1gnbvi28nZX8RBbZXDA2t-VeK6v8OrSRg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-06 12:41 ` Eric Auger
2015-03-06 13:17 ` Eric Auger
[not found] ` <54F9A8EE.9020008-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-03-06 13:44 ` Baptiste Reynal
2015-03-06 14:46 ` Alex Williamson
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=1425485274-5709-3-git-send-email-b.reynal@virtualopensystems.com \
--to=b.reynal-lrhrjnjw1ufhk3s98ze1ajgjjy/sre9j@public.gmane.org \
--cc=a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org \
--cc=eric.auger-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=kvmarm-FPEHb7Xf0XXUo1n7N8X6UoWGPAHP3yOg@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=tech-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org \
/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: link
Be 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