From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39675) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9yZk-000264-QX for qemu-devel@nongnu.org; Mon, 06 Jun 2016 13:44:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9yZg-00033L-NW for qemu-devel@nongnu.org; Mon, 06 Jun 2016 13:44:31 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:2771) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9yZg-00033G-FE for qemu-devel@nongnu.org; Mon, 06 Jun 2016 13:44:28 -0400 Date: Mon, 6 Jun 2016 10:44:25 -0700 From: Neo Jia Message-ID: <20160606174425.GA8903@nvidia.com> References: <1464119897-10844-1-git-send-email-kwankhede@nvidia.com> <1464119897-10844-2-git-send-email-kwankhede@nvidia.com> <20160603165746.3df39542@oc7835276234> <799479b0-44d5-061f-185a-43df0dba2fb3@nvidia.com> <20160606140148.31ec05f9@oc7835276234> <20160606062742.GA31747@nvidia.com> <20160606162911.7021a02c@oc7835276234> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20160606162911.7021a02c@oc7835276234> Subject: Re: [Qemu-devel] [RFC PATCH v4 1/3] Mediated device Core driver List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dong Jia Cc: Kirti Wankhede , alex.williamson@redhat.com, pbonzini@redhat.com, kraxel@redhat.com, qemu-devel@nongnu.org, kvm@vger.kernel.org, kevin.tian@intel.com, shuai.ruan@intel.com, jike.song@intel.com, zhiyuan.lv@intel.com On Mon, Jun 06, 2016 at 04:29:11PM +0800, Dong Jia wrote: > On Sun, 5 Jun 2016 23:27:42 -0700 > Neo Jia wrote: > > 2. VFIO_DEVICE_CCW_CMD_REQUEST > This intends to handle an intercepted channel I/O instruction. It > basically need to do the following thing: May I ask how and when QEMU knows that he needs to issue such VFIO ioctl at first place? Thanks, Neo > a. Copy the raw data of the CCW program (a group of chained CCWs) from > user into kernel space buffers. > b. Do CCW program translation based on the raw data to get a > real-device runnable CCW program. We'd pin pages for those CCWs > which have memory space pointers for their offload, and update the > CCW program with the pinned results (phys). > c. Issue the translated CCW program to a real-device to perform the > I/O operation, and wait for the I/O result interrupt. > d. Once we got the I/O result, copy the result back to user, and > unpin the pages. > > Step c could only be done by the physical device driver, since it's it > that the int_handler belongs to. > Step b and d should be done by the physical device driver. Or we'd > pin/unpin pages in the mediated device driver? > > That's why I asked for the new callback. >