From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E230C4727C for ; Tue, 29 Sep 2020 20:06:49 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7E7212076A for ; Tue, 29 Sep 2020 20:06:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TyQH5xj+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E7212076A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:34046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kNLtf-0000FD-FE for qemu-devel@archiver.kernel.org; Tue, 29 Sep 2020 16:06:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kNLgB-0002h4-Ee for qemu-devel@nongnu.org; Tue, 29 Sep 2020 15:52:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:39962) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kNLg9-0008GV-AV for qemu-devel@nongnu.org; Tue, 29 Sep 2020 15:52:50 -0400 Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601409167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gMdwuCpOh/nwgsUZha8J6mJLEGqGIPS0qTYJXjMijtQ=; b=TyQH5xj+KdSN0ekPx5WNWXZp1zjiJf05cGudFnsd30zF/cOXfNBth+YX72r+2Pp24lpFDZ tAJ0RbQ6lN24uMOn3qQjL+qsMxzt4eyE1E5Z8LpH4B3EaBXdlzhFBwg6ImNxNQRM1GSiqZ lReiYOoyOM4m6umG7VKwgKZ2RpQhN+s= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-538-USZBNIvZPDuob-6Qjivajg-1; Tue, 29 Sep 2020 15:52:41 -0400 X-MC-Unique: USZBNIvZPDuob-6Qjivajg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EE2491882FC7; Tue, 29 Sep 2020 19:52:38 +0000 (UTC) Received: from x1.home (ovpn-112-71.phx2.redhat.com [10.3.112.71]) by smtp.corp.redhat.com (Postfix) with ESMTP id DACB760C13; Tue, 29 Sep 2020 19:52:30 +0000 (UTC) Date: Tue, 29 Sep 2020 13:52:30 -0600 From: Alex Williamson To: Stefan Hajnoczi Subject: Re: [PATCH Kernel v24 0/8] Add UAPIs to support migration for VFIO devices Message-ID: <20200929135230.6cfb24aa@x1.home> In-Reply-To: <20200929082702.GA181243@stefanha-x1.localdomain> References: <1590697854-21364-1-git-send-email-kwankhede@nvidia.com> <20200929082702.GA181243@stefanha-x1.localdomain> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Received-SPF: pass client-ip=63.128.21.124; envelope-from=alex.williamson@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/28 22:47:55 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.687, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cjia@nvidia.com, kvm@vger.kernel.org, aik@ozlabs.ru, Zhengxiao.zx@alibaba-inc.com, shuangtai.tst@alibaba-inc.com, qemu-devel@nongnu.org, Kirti Wankhede , eauger@redhat.com, yi.l.liu@intel.com, eskultet@redhat.com, ziye.yang@intel.com, mlevitsk@redhat.com, pasic@linux.ibm.com, felipe@nutanix.com, Ken.Xue@amd.com, kevin.tian@intel.com, yan.y.zhao@intel.com, dgilbert@redhat.com, changpeng.liu@intel.com, cohuck@redhat.com, zhi.a.wang@intel.com, jonathan.davies@nutanix.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Tue, 29 Sep 2020 09:27:02 +0100 Stefan Hajnoczi wrote: > On Fri, May 29, 2020 at 02:00:46AM +0530, Kirti Wankhede wrote: > > * IOCTL VFIO_IOMMU_DIRTY_PAGES to get dirty pages bitmap with > > respect to IOMMU container rather than per device. All pages pinned by > > vendor driver through vfio_pin_pages external API has to be marked as > > dirty during migration. When IOMMU capable device is present in the > > container and all pages are pinned and mapped, then all pages are marked > > dirty. > > From what I can tell only the iommu participates in dirty page tracking. > This places the responsibility for dirty page tracking on IOMMUs. My > understanding is that support for dirty page tracking is currently not > available in IOMMUs. > > Can a PCI device implement its own DMA dirty log and let an mdev driver > implement the dirty page tracking using this mechanism? That way we > don't need to treat all pinned pages as dirty all the time. Look at the last patch in this series, there we define a mechanism whereby the act of a vendor driver pinning pages both marks those pages dirty and indicates a mode in the vfio type1 container where the scope of dirty pages is limited to those pages pinned by the driver. The vfio_dma_rw() interface does the same. We could clearly implement a more lightweight interface for this as well, one without pinning or memory access, but there are no proposed users for such an interface currently. Thanks, Alex