From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b19Kp-0007vz-Vr for qemu-devel@nongnu.org; Fri, 13 May 2016 05:24:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b19Kl-0006WS-SN for qemu-devel@nongnu.org; Fri, 13 May 2016 05:24:39 -0400 Received: from mga11.intel.com ([192.55.52.93]:59286) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b19Kl-0006Vz-MP for qemu-devel@nongnu.org; Fri, 13 May 2016 05:24:35 -0400 Message-ID: <57359D20.6020305@intel.com> Date: Fri, 13 May 2016 17:23:44 +0800 From: Jike Song MIME-Version: 1.0 References: <5732F823.3090409@intel.com> <20160511160628.690876f9@t450s.home> <20160512194924.GA24334@nvidia.com> <573572AD.2010407@intel.com> <20160513064357.GB30970@nvidia.com> <57358293.7060408@intel.com> <20160513074206.GC5749@nvidia.com> <20160513083107.GC6162@nvidia.com> In-Reply-To: <20160513083107.GC6162@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v3 3/3] VFIO Type1 IOMMU change: to support with iommu and without iommu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Neo Jia Cc: "Tian, Kevin" , Jike Song , Alex Williamson , Kirti Wankhede , "pbonzini@redhat.com" , "kraxel@redhat.com" , "qemu-devel@nongnu.org" , "kvm@vger.kernel.org" , "Ruan, Shuai" , "Lv, Zhiyuan" On 05/13/2016 04:31 PM, Neo Jia wrote: > On Fri, May 13, 2016 at 07:45:14AM +0000, Tian, Kevin wrote: >> >> We use page tracking framework, which is newly added to KVM recently, >> to mark RAM pages as read-only so write accesses are intercepted to >> device model. > > Yes, I am aware of that patchset from Guangrong. So far the interface are all > requiring struct *kvm, copied from https://lkml.org/lkml/2015/11/30/644 > > - kvm_page_track_add_page(): add the page to the tracking pool after > that later specified access on that page will be tracked > > - kvm_page_track_remove_page(): remove the page from the tracking pool, > the specified access on the page is not tracked after the last user is > gone > > void kvm_page_track_add_page(struct kvm *kvm, gfn_t gfn, > enum kvm_page_track_mode mode); > void kvm_page_track_remove_page(struct kvm *kvm, gfn_t gfn, > enum kvm_page_track_mode mode); > > Really curious how you are going to have access to the struct kvm *kvm, or you > are relying on the userfaultfd to track the write faults only as part of the > QEMU userfault thread? > Hi Neo, For the vGPU used as a device for KVM guest, there will be interfaces wrapped or implemented in KVM layer, as a rival thing diverted from the interfaces for Xen. That is where the KVM related code supposed to be. -- Thanks, Jike