From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753986AbcAYAUf (ORCPT ); Sun, 24 Jan 2016 19:20:35 -0500 Received: from mail-pf0-f169.google.com ([209.85.192.169]:34897 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752194AbcAYAUb (ORCPT ); Sun, 24 Jan 2016 19:20:31 -0500 Subject: Re: [PATCH] vfio/noiommu: Don't use iommu_present() to track fake groups To: Alex Williamson References: <20160122172159.5655.55830.stgit@gimli.home> Cc: anatoly.burakov@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, ferruh.yigit@intel.com, dev@dpdk.org From: Alexey Kardashevskiy Message-ID: <56A56A48.9090405@ozlabs.ru> Date: Mon, 25 Jan 2016 11:20:24 +1100 User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160122172159.5655.55830.stgit@gimli.home> Content-Type: text/plain; charset=koi8-r; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/23/2016 04:23 AM, Alex Williamson wrote: > Using iommu_present() to determine whether an IOMMU group is real or > fake has some problems. First, apparently Power systems don't > register an IOMMU on the device bus, so the groups and containers get > marked as noiommu and then won't bind to their actual IOMMU driver. > Second, I expect we'll run into the same issue as we try to support > vGPUs through vfio, since they're likely to emulate this behavior of > creating an IOMMU group on a virtual device and then providing a vfio > IOMMU backend tailored to the sort of isolation they provide, which > won't necessarily be fully compatible with the IOMMU API. > > The solution here is to use the existing iommudata interface to IOMMU > groups, which allows us to easily identify the fake groups we've > created for noiommu purposes. The iommudata we set is purely > arbitrary since we're only comparing the address, so we use the > address of the noiommu switch itself. > > Reported-by: Alexey Kardashevskiy > Fixes: 03a76b60f8ba ("vfio: Include No-IOMMU mode") > Signed-off-by: Alex Williamson Reviewed-by: Alexey Kardashevskiy Tested-by: Alexey Kardashevskiy Thanks! -- Alexey