From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41470) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYDrq-0001eb-0P for qemu-devel@nongnu.org; Thu, 10 Apr 2014 08:14:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYDri-0005NI-Cv for qemu-devel@nongnu.org; Thu, 10 Apr 2014 08:14:05 -0400 Message-ID: <53468B04.8040200@suse.de> Date: Thu, 10 Apr 2014 14:13:56 +0200 From: Alexander Graf MIME-Version: 1.0 References: <1394603550-11556-1-git-send-email-aik@ozlabs.ru> <1394603550-11556-9-git-send-email-aik@ozlabs.ru> <533D5159.7040103@suse.com> <53422489.4060206@ozlabs.ru> In-Reply-To: <53422489.4060206@ozlabs.ru> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v5 08/11] spapr-iommu: add SPAPR VFIO IOMMU device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy , Alexander Graf , Alex Williamson Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org On 07.04.14 06:07, Alexey Kardashevskiy wrote: > On 04/03/2014 11:17 PM, Alexander Graf wrote: >> On 12.03.14 06:52, Alexey Kardashevskiy wrote: >>> This adds SPAPR VFIO IOMMU device in order to support DMA operations >>> for VFIO devices. >> Sorry if this has been mentioned before, but why exactly do you need a >> separate IOMMU for VFIO? Couldn't the existing IOMMU backend drive things? > Well... Since I started VFIO on SPAPR, the emulated and VFIO IOMMU became > almost the same thing and I'll rework that too before I post things again. > > However one difference still remains - IOMMU for emulated PCI and VIO keeps > a TCE table (allocated in QEMU or mmap'ed from the host kernel) and VFIO > IOMMU works with the table which is allocated and owned by the host kernel. > > Since TCE tables are used only by devices, the IOMMU translation callback > is never called by VFIO devices and that's ok and I checked - it works. > > So I either need a property in the IOMMU device to tell it is TCE table and > MemoryRegionIOMMUOps::translate() are required. Or a new IOMMU device > class. What to choose? We need to handle in-kernel TCE tables with the emulated device IOMMU as well, so I'd > Oh. btw. There is H_GET_TCE now which I have to implement for VFIO :( This > will never ever end. ... which means you get H_GET_TCE for free as well ;). Alex