Path: csiph.com!news.freedyn.net!aioe.org!bofh.it!news.nic.it!robomod From: Alexey Kardashevskiy Newsgroups: linux.kernel Subject: Re: [PATCH kernel] vfio: Only check for bus IOMMU when NOIOMMU is selected Date: Fri, 22 Jan 2016 07:50:01 +0100 Message-ID: References: Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ozlabs-ru.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=UuKq8dbLYVfolkcEU6jITWbtrJId54s0B+mNmHbMDXs=; b=jmUh5RTjclfaY3tbEToY+WfZIeCQgsnCoWS/dpRJEe7eGFJk7ZGA+c0q5bKHl2rBu6 yWvoVT73VgX5EbVagpEXjXI3nL87tpnwW5lX2lQN8PXYx4RWd+egeoXSx6I/iyAPu5+m 2jLydiO+lplauEpwrrblJa8pOYA/7xizO176jQkpULsSd+TdwlQO1dxhNkxVl2Q2VeSG O2R152m0HBU/dh0Xul0IWmEOr2ld60vahD4gVHgHCpPz2wNDt7lbQ7drAklj7XXeq1YV eLqJoLPaEVQ+S/4gTEgSrYpoohjMN9fWtODD7lVo+TCD7zN2Gm7MRWQY40zErAcwOZ// OE7g== X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=UuKq8dbLYVfolkcEU6jITWbtrJId54s0B+mNmHbMDXs=; b=Cby6AlM49Yqg3RjEcwDrsw1xNR52pYAWAqot3YwIVjXsikALXQA8DyKt/078P6QHbN X+Np3YFliC1MLArrHd78E8WHJf7J1c1vvegvXV72LnGuoeVIdQqbJ1or2DCU1lPU7PlO BgqpvcF6Kjjrq68Nifxl3MvgFo8YtH9nA9E4FrQn3ep8WrRbLnAdY85ZK3GT4P5asr1f nvT8U59OTGMPOaKfQ85WW97mQ0TMVLFpz0GnyyEeIW1HKYoYly9ygjYHz1dy3GHT4RD3 QBKqMdIapbA4WW9d9BNhbiGlYUIlNq1MU1kSDiFu+ngNm6sjm9c0up0UbiYKburQ2/H1 YuSQ== X-Gm-Message-State: AG10YORTWJSGv1V8zxKstcPTJNYm+UC5ybNaaX+tzc4O7O4iHxdDzaVgsW+31NHYXJ5cFQ== X-Received: by 10.98.31.8 with SMTP id f8mr2056541pff.71.1453445313150; Thu, 21 Jan 2016 22:48:33 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r; format=flowed Content-Transfer-Encoding: 7bit Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 48 Organization: linux.* mail to news gateway X-Original-Cc: Alex Williamson , kvm@vger.kernel.org, linux-kernel@vger.kernel.org X-Original-Date: Fri, 22 Jan 2016 17:48:28 +1100 X-Original-Message-ID: <56A1D0BC.6030405@ozlabs.ru> X-Original-References: <1453444494-46900-1-git-send-email-aik@ozlabs.ru> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1314777 On 01/22/2016 05:34 PM, Alexey Kardashevskiy wrote: > 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; > - Agrh. Unrelated change, repost? > 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); > -- Alexey