From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f178.google.com (mail-pf0-f178.google.com [209.85.192.178]) by dpdk.org (Postfix) with ESMTP id 4AE0F8DA7 for ; Mon, 25 Jan 2016 01:20:31 +0100 (CET) Received: by mail-pf0-f178.google.com with SMTP id n128so72311123pfn.3 for ; Sun, 24 Jan 2016 16:20:31 -0800 (PST) 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=L29CGEduluyLNte53zAS1zvuL8rPEJl+BJCgidwgEm0=; b=EyfquvrLjUqcb/Yac08znl9ueTkNKY1FGkDpEZOKBXNNNqdx7J1uHDG2uQxSlYj3pQ QPQBcf64vl8LFxWhOSg6r3jDfT9C1O54NPg+NHSYX6hgmW428WS0MyjCfZepWdjOIutj YTYUsfkjVFNDIij9vreE62h4EtsyPd5JmuN1qpAmnA/IL5qsxhFLEjW5IZRs3hPbyso3 yi4rJ3uYRbaRHKakCOChUpTtl6idBuG7UK4FWuBMtyBoH9hiLwQNZTni4ZZl6Eneh2Bw PsW+nkNokKy/JpqyZ1yFsz8uqV24DQOx8zZZIA4w2Vqu4fhTyi15z5ztKahTVZfEMbS3 +MSw== 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=L29CGEduluyLNte53zAS1zvuL8rPEJl+BJCgidwgEm0=; b=Ml1vLCQeU8QzCy8qTHUW+mZYtQ8C9i8+3R+1vRwJtCqp3pVgNNA69Fw5L9yVYjYr3+ QeouhIj2NZwnU9BgGd8cUXf1bp5REYX0gjhOHnZmoAW0Cp0jlXkvopR+cu3D5bRJGEYU rVQYZ9byj41RJXbdCtIOEAL7uAUutpxdhBYCUOFVho7pyyAZVbS2IQ6t9DViC6028cOm vzaBj6wRV9mdvvTFxJXKdpndDnsKbcHjQMsWJw5Bv+IDSm0dVoy8BDtMb2NMTB+AN9mF eNc9oeisJ1HelHqK8QWSETI3qXgmMhp7dEtbRz1GDzXwqfYuH1U7ZMoWz/vnui1/r71F 7JGQ== X-Gm-Message-State: AG10YORDhosSHuXWcfRJDeqKoXeivTIELzxXxOkHioh7RtBYaVBnrnjcKgdkfkMez3xHjw== X-Received: by 10.98.19.130 with SMTP id 2mr21790430pft.31.1453681230648; Sun, 24 Jan 2016 16:20:30 -0800 (PST) Received: from aik.ozlabs.ibm.com ([122.99.82.10]) by smtp.googlemail.com with ESMTPSA id u69sm23891762pfa.61.2016.01.24.16.20.27 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 24 Jan 2016 16:20:29 -0800 (PST) To: Alex Williamson References: <20160122172159.5655.55830.stgit@gimli.home> 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 X-Mailman-Approved-At: Mon, 25 Jan 2016 16:12:50 +0100 Cc: dev@dpdk.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [dpdk-dev] [PATCH] vfio/noiommu: Don't use iommu_present() to track fake groups X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 00:20:31 -0000 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