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=-6.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 49746C433DF for ; Wed, 20 May 2020 10:42:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0EE782075F for ; Wed, 20 May 2020 10:42:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="P7hUF+ZZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726560AbgETKma (ORCPT ); Wed, 20 May 2020 06:42:30 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:29112 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726224AbgETKm3 (ORCPT ); Wed, 20 May 2020 06:42:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589971348; 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=nWScQxGnuCxPTRKRuxipi99sMG+Yz5m1VAv7OprXKT0=; b=P7hUF+ZZdeqdNFvWuKVlhBe4ri5U34zUY8nC2NIo5CvkHAYk7FPZ4UsKVccYXRCNKOeBHt LMYbtPS+naUDO7J7beDo9iTMUuzYv+Ti0g8mW8bn6p3HEd/GVE372lJDnIiU2yJDLsazHI m4qvMc9zge/Ihejg89Gb4MVmwlLukY4= 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-334-3mnn2BlhP42Db2pWcYmIUQ-1; Wed, 20 May 2020 06:42:23 -0400 X-MC-Unique: 3mnn2BlhP42Db2pWcYmIUQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D583F18FE861; Wed, 20 May 2020 10:42:20 +0000 (UTC) Received: from gondolin (ovpn-113-5.ams2.redhat.com [10.36.113.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F8532E05D; Wed, 20 May 2020 10:42:03 +0000 (UTC) Date: Wed, 20 May 2020 12:42:00 +0200 From: Cornelia Huck To: Kirti Wankhede Cc: , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH Kernel v22 7/8] vfio iommu: Add migration capability to report supported features Message-ID: <20200520124200.0b4f3562.cohuck@redhat.com> In-Reply-To: <1589781397-28368-8-git-send-email-kwankhede@nvidia.com> References: <1589781397-28368-1-git-send-email-kwankhede@nvidia.com> <1589781397-28368-8-git-send-email-kwankhede@nvidia.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Mon, 18 May 2020 11:26:36 +0530 Kirti Wankhede wrote: > Added migration capability in IOMMU info chain. > User application should check IOMMU info chain for migration capability > to use dirty page tracking feature provided by kernel module. > User application must check page sizes supported and maximum dirty > bitmap size returned by this capability structure for ioctls used to get > dirty bitmap. > > Signed-off-by: Kirti Wankhede > --- > drivers/vfio/vfio_iommu_type1.c | 23 ++++++++++++++++++++++- > include/uapi/linux/vfio.h | 22 ++++++++++++++++++++++ > 2 files changed, 44 insertions(+), 1 deletion(-) (...) > diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h > index a1dd2150971e..aa8aa9dcf02a 100644 > --- a/include/uapi/linux/vfio.h > +++ b/include/uapi/linux/vfio.h > @@ -1013,6 +1013,28 @@ struct vfio_iommu_type1_info_cap_iova_range { > struct vfio_iova_range iova_ranges[]; > }; > > +/* > + * The migration capability allows to report supported features for migration. > + * > + * The structures below define version 1 of this capability. > + * > + * The existence of this capability indicates IOMMU kernel driver supports s/indicates/indicates that/ > + * dirty page tracking. > + * > + * pgsize_bitmap: Kernel driver returns supported page sizes bitmap for dirty > + * page tracking. "bitmap of supported page sizes for dirty page tracking" ? > + * max_dirty_bitmap_size: Kernel driver returns maximum supported dirty bitmap > + * size in bytes to be used by user application for ioctls to get dirty bitmap. "maximum supported dirty bitmap size in bytes that can be used by user applications when getting the dirty bitmap" ? > + */ > +#define VFIO_IOMMU_TYPE1_INFO_CAP_MIGRATION 1 > + > +struct vfio_iommu_type1_info_cap_migration { > + struct vfio_info_cap_header header; > + __u32 flags; > + __u64 pgsize_bitmap; > + __u64 max_dirty_bitmap_size; /* in bytes */ > +}; > + > #define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12) > > /** Reviewed-by: Cornelia Huck 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=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 C5765C433E0 for ; Wed, 20 May 2020 10:43:12 +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 888592075F for ; Wed, 20 May 2020 10:43:12 +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="gqPqk8ZC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 888592075F 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]:60374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbMBr-0007ko-Qn for qemu-devel@archiver.kernel.org; Wed, 20 May 2020 06:43:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbMB9-00076v-Qt for qemu-devel@nongnu.org; Wed, 20 May 2020 06:42:27 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:60112 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jbMB8-00032w-W9 for qemu-devel@nongnu.org; Wed, 20 May 2020 06:42:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589971346; 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=nWScQxGnuCxPTRKRuxipi99sMG+Yz5m1VAv7OprXKT0=; b=gqPqk8ZCurr/u+WjZgJ9HfkG5o+Xd1W+sR/Eos6FH5EUYNcSuhIy/41Ae8GsSJoa3GhD7B J7h3NZ5mKJC3wR2OqNaloPxJv0m2arApPA/7uE+1FCfs7vq3HSEfhupsV915GDDYygY4Z5 4XoG351hKlYzp+yfFTUvOjFFAB0zwL8= 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-334-3mnn2BlhP42Db2pWcYmIUQ-1; Wed, 20 May 2020 06:42:23 -0400 X-MC-Unique: 3mnn2BlhP42Db2pWcYmIUQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D583F18FE861; Wed, 20 May 2020 10:42:20 +0000 (UTC) Received: from gondolin (ovpn-113-5.ams2.redhat.com [10.36.113.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F8532E05D; Wed, 20 May 2020 10:42:03 +0000 (UTC) Date: Wed, 20 May 2020 12:42:00 +0200 From: Cornelia Huck To: Kirti Wankhede Subject: Re: [PATCH Kernel v22 7/8] vfio iommu: Add migration capability to report supported features Message-ID: <20200520124200.0b4f3562.cohuck@redhat.com> In-Reply-To: <1589781397-28368-8-git-send-email-kwankhede@nvidia.com> References: <1589781397-28368-1-git-send-email-kwankhede@nvidia.com> <1589781397-28368-8-git-send-email-kwankhede@nvidia.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Received-SPF: pass client-ip=205.139.110.61; envelope-from=cohuck@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/20 02:22:41 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, 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_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: kevin.tian@intel.com, yi.l.liu@intel.com, cjia@nvidia.com, kvm@vger.kernel.org, eskultet@redhat.com, ziye.yang@intel.com, qemu-devel@nongnu.org, Zhengxiao.zx@Alibaba-inc.com, shuangtai.tst@alibaba-inc.com, dgilbert@redhat.com, zhi.a.wang@intel.com, mlevitsk@redhat.com, pasic@linux.ibm.com, aik@ozlabs.ru, alex.williamson@redhat.com, eauger@redhat.com, felipe@nutanix.com, jonathan.davies@nutanix.com, yan.y.zhao@intel.com, changpeng.liu@intel.com, Ken.Xue@amd.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Mon, 18 May 2020 11:26:36 +0530 Kirti Wankhede wrote: > Added migration capability in IOMMU info chain. > User application should check IOMMU info chain for migration capability > to use dirty page tracking feature provided by kernel module. > User application must check page sizes supported and maximum dirty > bitmap size returned by this capability structure for ioctls used to get > dirty bitmap. > > Signed-off-by: Kirti Wankhede > --- > drivers/vfio/vfio_iommu_type1.c | 23 ++++++++++++++++++++++- > include/uapi/linux/vfio.h | 22 ++++++++++++++++++++++ > 2 files changed, 44 insertions(+), 1 deletion(-) (...) > diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h > index a1dd2150971e..aa8aa9dcf02a 100644 > --- a/include/uapi/linux/vfio.h > +++ b/include/uapi/linux/vfio.h > @@ -1013,6 +1013,28 @@ struct vfio_iommu_type1_info_cap_iova_range { > struct vfio_iova_range iova_ranges[]; > }; > > +/* > + * The migration capability allows to report supported features for migration. > + * > + * The structures below define version 1 of this capability. > + * > + * The existence of this capability indicates IOMMU kernel driver supports s/indicates/indicates that/ > + * dirty page tracking. > + * > + * pgsize_bitmap: Kernel driver returns supported page sizes bitmap for dirty > + * page tracking. "bitmap of supported page sizes for dirty page tracking" ? > + * max_dirty_bitmap_size: Kernel driver returns maximum supported dirty bitmap > + * size in bytes to be used by user application for ioctls to get dirty bitmap. "maximum supported dirty bitmap size in bytes that can be used by user applications when getting the dirty bitmap" ? > + */ > +#define VFIO_IOMMU_TYPE1_INFO_CAP_MIGRATION 1 > + > +struct vfio_iommu_type1_info_cap_migration { > + struct vfio_info_cap_header header; > + __u32 flags; > + __u64 pgsize_bitmap; > + __u64 max_dirty_bitmap_size; /* in bytes */ > +}; > + > #define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12) > > /** Reviewed-by: Cornelia Huck