From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjXfv-000674-1O for qemu-devel@nongnu.org; Mon, 03 Jun 2013 12:32:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UjXft-0006sG-E4 for qemu-devel@nongnu.org; Mon, 03 Jun 2013 12:32:02 -0400 Received: from nodalink.pck.nerim.net ([62.212.105.220]:60846 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjXft-0006ng-2u for qemu-devel@nongnu.org; Mon, 03 Jun 2013 12:32:01 -0400 Date: Mon, 3 Jun 2013 18:33:05 +0200 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20130603163305.GC4094@irqsave.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] VFIO and scheduled SR-IOV cards List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: iommu@lists.linux-foundation.org, qemu-devel@nongnu.org, alex.williamson@redhat.com Hello, I plan to write a PF driver for an SR-IOV card and make the VFs work with= QEMU's VFIO passthrough so I am asking the following design question before tryi= ng to write and push code. After SR-IOV being enabled on this hardware only one VF function can be a= ctive at a given time. The PF host kernel driver is acting as a scheduler. It switch every few milliseconds which VF is the current active function = while disabling the others VFs. One consequence of how the hardware works is that the MMR regions of the switched off VFs must be unmapped and their io access should block until = the VF is switched on again. Each IOMMU map/unmap should be done in less than 100ns. As the kernel iommu module is being called by the VFIO driver the PF driv= er cannot interface with it. Currently the only interface of the VFIO code is for the userland QEMU pr= ocess and I fear that notifying QEMU that it should do the unmap/block would ta= ke more than 100ns. Also blocking the IO access in QEMU under the BQL would freeze QEMU. Do you have and idea on how to write this required map and block/unmap fe= ature ? Best regards Beno=EEt Canet