From nobody Wed Nov 27 13:02:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1699531423; cv=none; d=zohomail.com; s=zohoarc; b=Y9u8Fuine7uWuoJUeuhJrpJXnLbwy96hmk2g6v/sJP1Ygc85piM5IQBRt98cSGLWB2T1AzZbk4I6jEVjQpg+kR3Ky+1IHEKqsjGz876z/ZM+lSjhaPdECZ0SCOJ7LF6D6Xz/+EgxPbvM4FDxYlDMPo7AWfafutUaCHxNlJpknuE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699531423; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ftgiZ8JXHLQrC291IqiaPqijgOVsQoiT+CraxY4PGM4=; b=QhcG0PczpIV5VBJuEwQc2iPW/LToVuXeN7gwyd5XPuXrZbfDG3YxJQcG5q0OUUy7Y5aydxY/A4KFq5ZMv9sS1Chbd3RHdMsNeF8uVjZFY6C3hSapofw37UySdkvu4jqZQed5yee1Fukxk1/VlXldNC9zPf8MKieT6WkqaQyvXMs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1699531423684470.3038529176624; Thu, 9 Nov 2023 04:03:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r13is-0001qr-7H; Thu, 09 Nov 2023 07:01:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r13io-0001qZ-DS for qemu-devel@nongnu.org; Thu, 09 Nov 2023 07:01:18 -0500 Received: from mgamail.intel.com ([192.55.52.136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r13il-0001a4-O7 for qemu-devel@nongnu.org; Thu, 09 Nov 2023 07:01:18 -0500 Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2023 04:01:11 -0800 Received: from duan-server-s2600bt.bj.intel.com ([10.240.192.147]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2023 04:01:08 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699531275; x=1731067275; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5ejhTNqCwupSTAJs1yfEG2tXWeKhQlFW3fCS+eeO2Bc=; b=FhGfju0VjXn/r1thLtinGoW+RlITmnfzTBgovnNCcxKKIH9gpKAZyBSv GK3yrwFSqrKnAM+9YVQ+w1n5yLrFMgPLjgC6l+dzTRptLTjwJdmsctwgp CDZ4PapEsDXIlJkxpjhMkFnBG5TRLFX+KcAGJSimJdkJvWsyAG6IoY3Bf ulqlPeoT0jxz89+/4TxL0sWi6Na6fRlSyT921oTWcjn1XKIR/fCso7b1/ KFS9SYNwA3coAJ2XtALmjs0FTVKXsNCcCinQp4j7oHIhw/ZXw6zl2SwFv Stl6E266GMYeBOO1M2xBbTTCUHZzavXi8MzifyFfOIsEwl8MErCxcjNRI Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10888"; a="369305243" X-IronPort-AV: E=Sophos;i="6.03,289,1694761200"; d="scan'208";a="369305243" X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,289,1694761200"; d="scan'208";a="11515509" From: Zhenzhong Duan To: qemu-devel@nongnu.org Cc: alex.williamson@redhat.com, clg@redhat.com, jgg@nvidia.com, nicolinc@nvidia.com, joao.m.martins@oracle.com, eric.auger@redhat.com, peterx@redhat.com, jasowang@redhat.com, kevin.tian@intel.com, yi.l.liu@intel.com, yi.y.sun@intel.com, chao.p.peng@intel.com, Zhenzhong Duan Subject: [PATCH v5 04/20] vfio/iommufd: Relax assert check for iommufd backend Date: Thu, 9 Nov 2023 19:45:13 +0800 Message-Id: <20231109114529.1904193-5-zhenzhong.duan@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231109114529.1904193-1-zhenzhong.duan@intel.com> References: <20231109114529.1904193-1-zhenzhong.duan@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=192.55.52.136; envelope-from=zhenzhong.duan@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1699531424765100001 Currently iommufd doesn't support dirty page sync yet, but it will not block us doing live migration if VFIO migration is force enabled. So in this case we allow set_dirty_page_tracking to be NULL. Note we don't need same change for query_dirty_bitmap because when dirty page sync isn't supported, query_dirty_bitmap will never be called. Suggested-by: C=C3=A9dric Le Goater Signed-off-by: Zhenzhong Duan Reviewed-by: C=C3=A9dric Le Goater --- hw/vfio/container-base.c | 4 ++++ hw/vfio/container.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/vfio/container-base.c b/hw/vfio/container-base.c index 71f7274973..eee2dcfe76 100644 --- a/hw/vfio/container-base.c +++ b/hw/vfio/container-base.c @@ -55,6 +55,10 @@ void vfio_container_del_section_window(VFIOContainerBase= *bcontainer, int vfio_container_set_dirty_page_tracking(VFIOContainerBase *bcontainer, bool start) { + if (!bcontainer->dirty_pages_supported) { + return 0; + } + g_assert(bcontainer->ops->set_dirty_page_tracking); return bcontainer->ops->set_dirty_page_tracking(bcontainer, start); } diff --git a/hw/vfio/container.c b/hw/vfio/container.c index 6bacf38222..ed2d721b2b 100644 --- a/hw/vfio/container.c +++ b/hw/vfio/container.c @@ -216,10 +216,6 @@ static int vfio_legacy_set_dirty_page_tracking(VFIOCon= tainerBase *bcontainer, .argsz =3D sizeof(dirty), }; =20 - if (!bcontainer->dirty_pages_supported) { - return 0; - } - if (start) { dirty.flags =3D VFIO_IOMMU_DIRTY_PAGES_FLAG_START; } else { --=20 2.34.1