From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0j7W-0005yw-UU for qemu-devel@nongnu.org; Sun, 22 Nov 2015 23:52:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0j7T-0002z2-Mn for qemu-devel@nongnu.org; Sun, 22 Nov 2015 23:52:54 -0500 Received: from mga14.intel.com ([192.55.52.115]:27165) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0j7T-0002yi-DK for qemu-devel@nongnu.org; Sun, 22 Nov 2015 23:52:51 -0500 Message-ID: <56529B7E.6050904@intel.com> Date: Mon, 23 Nov 2015 12:52:14 +0800 From: Jike Song MIME-Version: 1.0 References: <53D215D3.50608@intel.com> <547FCAAD.2060406@intel.com> <54AF967B.3060503@intel.com> <5527CEC4.9080700@intel.com> <559B3E38.1080707@intel.com> <562F4311.9@intel.com> <1447870341.4697.92.camel@redhat.com> <564D78D0.80904@intel.com> <1447948366.4697.119.camel@redhat.com> <564E8C51.6070706@intel.com> <1447993371.4697.257.camel@redhat.com> <564EB4F2.9080605@intel.com> <1448037640.4697.266.camel@redhat.com> In-Reply-To: <1448037640.4697.266.camel@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Intel-gfx] [Announcement] 2015-Q3 release of XenGT - a Mediated Graphics Passthrough Solution from Intel List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: "igvt-g@ml01.01.org" , "Tian, Kevin" , "Li, Susie" , "Lv, Zhiyuan" , Stefano Stabellini , "White, Michael L" , "Dong, Eddie" , "intel-gfx@lists.freedesktop.org" , "Reddy, Raghuveer" , "Cowperthwaite, David J" , qemu-devel , "linux-kernel@vger.kernel.org" , Gerd Hoffmann , Paolo Bonzini , "Zhu, Libo" , "xen-devel@lists.xen.org" , "Wang, Hongbo" , "Zhou, Chao" On 11/21/2015 12:40 AM, Alex Williamson wrote: >> >> Thanks for confirmation. For QEMU/KVM, I totally agree your point; However, >> if we take XenGT to consider, it will be a bit more complex: with Xen >> hypervisor and Dom0 kernel running in different level, it's not a straight- >> forward way for QEMU to do something like mapping a portion of MMIO BAR >> via VFIO in Dom0 kernel, instead of calling hypercalls directly. > > This would need to be part of the support added for Xen. To directly > map a device MMIO space to the VM, VFIO provides an mmap, QEMU registers > that mmap with KVM, or Xen. It's all just MemoryRegions in QEMU. > Perhaps it's even already supported by Xen. > AFAICT, things are different here for Xen. To establish mappings between Dom0 pfns and DomU gfn, one will have to call Xen hypercalls. In the scene above, either QEMU calls the hypercall directly, or it asks the VFIO in dom0 kernel to do it. I'm not saying that VFIO is not applicable for XenGT. I just want to say that given the VFIO based kernel/QEMU split model, additional effort is needed for XenGT. >> I don't know if there is a better way to handle this. But I do agree that >> channels between kernel and Qemu via VFIO is a good idea, even though we >> may have to split KVMGT/XenGT in Qemu a bit. We are currently working on >> moving all of PCI CFG emulation from kernel to Qemu, hopefully we can >> release it by end of this year and work with you guys to adjust it for >> the agreed method. > > Well, moving PCI config space emulation from kernel to QEMU is exactly > the wrong direction to take for this proposal. Config space access to > the vGPU would occur through the VFIO API. So if you already have > config space emulation in the kernel, that's already one less piece of > work for a VFIO model, it just needs to be "wired up" through the VFIO > API. Thanks, If I understand correctly, the idea of moving PCI CFG to QEMU is actually very similar to your VFIO design: a) VM access a CFG regsiter b) KVM hands over the access to QEMU c) QEMU may emulate it, and when necessary, ioctl into kernel(i915/vgt) > > Alex > > -- Thanks, Jike