From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id CCFB4958F for ; Wed, 27 Jan 2016 14:21:52 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 27 Jan 2016 05:21:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,354,1449561600"; d="scan'208";a="890221246" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by fmsmga001.fm.intel.com with ESMTP; 27 Jan 2016 05:21:51 -0800 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.100]) by IRSMSX102.ger.corp.intel.com ([169.254.2.97]) with mapi id 14.03.0248.002; Wed, 27 Jan 2016 13:21:50 +0000 From: "Burakov, Anatoly" To: Alexey Kardashevskiy , Alex Williamson , Santosh Shukla Thread-Topic: [PATCH] vfio/noiommu: Don't use iommu_present() to track fake groups Thread-Index: AQHRVTmoAa3SinyjFEuKw1Y9YY5BX58LYeoAgAP+dRA= Date: Wed, 27 Jan 2016 13:21:49 +0000 Message-ID: References: <20160122172159.5655.55830.stgit@gimli.home> <56A56A48.9090405@ozlabs.ru> In-Reply-To: <56A56A48.9090405@ozlabs.ru> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.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: Wed, 27 Jan 2016 13:21:53 -0000 Hi Alex, > 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 >=20 >=20 >=20 > Reviewed-by: Alexey Kardashevskiy > Tested-by: Alexey Kardashevskiy Tested bringing the NIC's up, encountered no issues. Curious if it also wor= ks for Santosh (CC'd) as he's one of the intended users of the No-IOMMU fun= ctionality, but otherwise seems to work. Thanks, Anatoly