From patchwork Fri Jan 22 06:34:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 8087791 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6E4C39FCD9 for ; Fri, 22 Jan 2016 06:37:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A613520429 for ; Fri, 22 Jan 2016 06:37:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BB19320434 for ; Fri, 22 Jan 2016 06:37:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751309AbcAVGgS (ORCPT ); Fri, 22 Jan 2016 01:36:18 -0500 Received: from e23smtp01.au.ibm.com ([202.81.31.143]:41028 "EHLO e23smtp01.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751273AbcAVGgQ (ORCPT ); Fri, 22 Jan 2016 01:36:16 -0500 Received: from localhost by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 22 Jan 2016 16:36:00 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp01.au.ibm.com (202.81.31.207) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 22 Jan 2016 16:35:58 +1000 X-IBM-Helo: d23dlp01.au.ibm.com X-IBM-MailFrom: aik@ozlabs.ru X-IBM-RcptTo: kvm@vger.kernel.org;linux-kernel@vger.kernel.org Received: from d23relay06.au.ibm.com (d23relay06.au.ibm.com [9.185.63.219]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id DE8A82CE802D; Fri, 22 Jan 2016 17:35:57 +1100 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u0M6ZZan48431240; Fri, 22 Jan 2016 17:35:47 +1100 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u0M6ZK4f027192; Fri, 22 Jan 2016 17:35:21 +1100 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u0M6ZKnN026310; Fri, 22 Jan 2016 17:35:20 +1100 Received: from bran.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) by ozlabs.au.ibm.com (Postfix) with ESMTP id 6722DA01E2; Fri, 22 Jan 2016 17:34:56 +1100 (AEDT) Received: from vpl2.ozlabs.ibm.com (vpl2.ozlabs.ibm.com [10.61.141.27]) by bran.ozlabs.ibm.com (Postfix) with ESMTP id 508DCE3937; Fri, 22 Jan 2016 17:34:56 +1100 (AEDT) From: Alexey Kardashevskiy To: linuxppc-dev@lists.ozlabs.org Cc: Alexey Kardashevskiy , Alex Williamson , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH kernel] vfio: Only check for bus IOMMU when NOIOMMU is selected Date: Fri, 22 Jan 2016 17:34:54 +1100 Message-Id: <1453444494-46900-1-git-send-email-aik@ozlabs.ru> X-Mailer: git-send-email 2.5.0.rc3 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16012206-1618-0000-0000-0000038A9166 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Recent change 03a76b60 "vfio: Include No-IOMMU mode" disabled VFIO on systems which do not implement iommu_ops for the PCI bus even though there is an VFIO IOMMU driver for it such as SPAPR TCE driver for PPC64/powernv platform. This moves iommu_present() call under #ifdef CONFIG_VFIO_NOIOMMU as it is done in the rest of the file to re-enable VFIO on powernv. Signed-off-by: Alexey Kardashevskiy --- drivers/vfio/vfio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index 82f25cc..3f8060e 100644 --- a/drivers/vfio/vfio.c +++ b/drivers/vfio/vfio.c @@ -343,7 +343,6 @@ static struct vfio_group *vfio_create_group(struct iommu_group *iommu_group, atomic_set(&group->opened, 0); group->iommu_group = iommu_group; group->noiommu = !iommu_present; - group->nb.notifier_call = vfio_iommu_group_notifier; /* @@ -767,7 +766,11 @@ int vfio_add_group_dev(struct device *dev, group = vfio_group_get_from_iommu(iommu_group); if (!group) { +#ifdef CONFIG_VFIO_NOIOMMU group = vfio_create_group(iommu_group, iommu_present(dev->bus)); +#else + group = vfio_create_group(iommu_group, true); +#endif if (IS_ERR(group)) { iommu_group_put(iommu_group); return PTR_ERR(group);