From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anup Patel via iommu Subject: [PATCH v2 1/2] vfio: Allow No-IOMMU mode without checking iommu_present() Date: Thu, 20 Jul 2017 10:02:33 +0530 Message-ID: <1500525154-5200-2-git-send-email-anup.patel@broadcom.com> References: <1500525154-5200-1-git-send-email-anup.patel@broadcom.com> Reply-To: Anup Patel Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1500525154-5200-1-git-send-email-anup.patel-dY08KVG/lbpWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Will Deacon , Robin Murphy , Joerg Roedel , Baptiste Reynal , Alex Williamson Cc: kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Scott Branden , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: iommu@lists.linux-foundation.org Not allowing No-IOMMU mode for devices already having iommu_ops on their bus is very conservative. We now have IOMMU (such as ARM SMMU) which can bypass transcations when IOMMU is not configured for a given device. In addition, it is not necessary to have all devices on bus to be upstream to an IOMMU on that bus. Due above reasons, having iommu_present() check for VFIO No-IOMMU mode is not appropriate. Signed-off-by: Anup Patel --- drivers/vfio/vfio.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index 330d505..9d90de7 100644 --- a/drivers/vfio/vfio.c +++ b/drivers/vfio/vfio.c @@ -124,11 +124,10 @@ struct iommu_group *vfio_iommu_group_get(struct device *dev) #ifdef CONFIG_VFIO_NOIOMMU /* * With noiommu enabled, an IOMMU group will be created for a device - * that doesn't already have one and doesn't have an iommu_ops on their - * bus. We set iommudata simply to be able to identify these groups - * as special use and for reclamation later. + * that doesn't already have one. We set iommudata simply to be able + * to identify these groups as special use and for reclamation later. */ - if (group || !noiommu || iommu_present(dev->bus)) + if (group || !noiommu) return group; group = iommu_group_alloc(); -- 2.7.4