From patchwork Wed Dec 18 13:40:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avihai Horon X-Patchwork-Id: 13913733 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 0C342E77188 for ; Wed, 18 Dec 2024 13:46:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNuND-0003TN-3a; Wed, 18 Dec 2024 08:45:59 -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 1tNuN7-00030G-0v for qemu-devel@nongnu.org; Wed, 18 Dec 2024 08:45:53 -0500 Received: from mail-mw2nam12on2050.outbound.protection.outlook.com ([40.107.244.50] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNuN4-0006lo-1a for qemu-devel@nongnu.org; Wed, 18 Dec 2024 08:45:52 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=P+BeNDCOoJXtPW19+V0VVGWVJGjC+KG6ODQWSI2KSWjMa+JNZBD0StsRxrsaOOCb2PqZv7lSU6nO7OJ8bVaSgx7ox/pCTXs1UO1SPe6E8I/u+k/eTUPzNXYGadsnUZdtbQI7/aZpI7CX5c3Ji8qkYa4Q4NaTppqYh9IJFP6LfvI1N53+389Wmb0EEcawJpFRj+EuFNnPT2RC1S60OXU8t4SwBS5FAK1t8E5ElURaPZbGJzka8F4sEt0bDvCt5Fn7E8VNODJhggBl4Ax68ne6dy1YuwqUOeu050kNxsoDFRVtDpXbJdik3tyaX84ackylkaR8e64jG2ImUvfJiAKwXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tXp4FRqE/o+QZ90l5bTNvD51XwHJsdB1erBnGPspoAk=; b=LiQ1DLqnhk/6NFZEhW62Y2MA2xDzAqBEJrBWWMiVYu23II2j5cT7+LXMnMhk4CfkSGK9woBfcnF+2kb/J0E0+3v8XtW+RcPdUdVIpIvWvu4uDLx9IqXfEyZIy6JyTkUHk/OQDzcVX4nEqt0yMWXZBFEZH9W03QXIoP/ALjh0qOxzkdBgLw4IKvJ97fwT72RSG13A5oFVCyqMr+HVwLtdImy9GMzs7jDgyQ0z08lAy6XCb3PQHgoEE5Nxy4PWmPruch1MRYXoXu6D5jAfLhVmiaw9Up/tyYHAJv+QFuZ+0HSlUyybKxGhp2hK4r4kugJxcMi0RO2D1iIEbGyCX77UxQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=nongnu.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tXp4FRqE/o+QZ90l5bTNvD51XwHJsdB1erBnGPspoAk=; b=Ch7XAcrWU8Xpeu2rpup+hJ8lY9Zzn0NNcblk0gP7i4d0gTTtolFyokT5zk4CC/opwqcHcCicRL0lxj3WvZF7F9gh8hoBZmCTGUzx7E65zR/16f63+PrkTYm9RZd+5xS/fHmwlf4BF+s8BtwaHoCa8JlQJ0CimA/9it+qd9OShN1WCYmLQpnMN8xrUn03IaTMo39AUEe6gnWlkCda7fuFFxPstQ1LPaSh6Rde7oQkzotidYxz62Xt71/VHgCieqGxUyJlrCEjvBJZKniqKnm/MIajGo8mceYneVybsuy6kk3mBqWBv7tvz1YF6UxnIXgg3o+Tnl24qmaIHwpXT/S7VQ== Received: from BYAPR04CA0008.namprd04.prod.outlook.com (2603:10b6:a03:40::21) by DS0PR12MB8561.namprd12.prod.outlook.com (2603:10b6:8:166::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Wed, 18 Dec 2024 13:40:43 +0000 Received: from SJ1PEPF0000231A.namprd03.prod.outlook.com (2603:10b6:a03:40:cafe::d0) by BYAPR04CA0008.outlook.office365.com (2603:10b6:a03:40::21) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8251.23 via Frontend Transport; Wed, 18 Dec 2024 13:40:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SJ1PEPF0000231A.mail.protection.outlook.com (10.167.242.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15 via Frontend Transport; Wed, 18 Dec 2024 13:40:43 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 18 Dec 2024 05:40:28 -0800 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 18 Dec 2024 05:40:27 -0800 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 18 Dec 2024 05:40:25 -0800 From: Avihai Horon To: CC: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , Peter Xu , Fabiano Rosas , Hyman Huang , Joao Martins , "Maor Gottlieb" , Avihai Horon Subject: [PATCH v2 1/7] vfio/container: Add dirty tracking started flag Date: Wed, 18 Dec 2024 15:40:16 +0200 Message-ID: <20241218134022.21264-2-avihaih@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20241218134022.21264-1-avihaih@nvidia.com> References: <20241218134022.21264-1-avihaih@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF0000231A:EE_|DS0PR12MB8561:EE_ X-MS-Office365-Filtering-Correlation-Id: f1cab929-18e6-43c3-3585-08dd1f6991eb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: 2hHdTI2vGYSTCBe7YkizsAPvgSME81eVA+qVUtXFstKf2/bYFfP7UBK6faezI31y+lVXueH8pqtHKdKYBYnQjONvTJoPQlIl9C7XtHIOLtYv+9loch4udM6V2mIbbOWtqDvImEt+HgyfKrqtwqNwhDkVRKxw4+rBE7UELQbmdq1Y5jcni9l661bARdSYgroAY87ezeC1Iqe0+p6M9Kae5qntUh2DhdWixCVCGYv4zwNDfVAdKyw68O6NGyXAqmDrAM29GV2CzHsC5jS6OKby2D4Fwsw96KDgBhwtbRWJOPYGMgLgEkBOqExSsfRenPwe0z0WQwg/dbg1df8NykL/2rnFfGK4XHyL1IbwShp0loQ1TLQ4NbhXJs4PFlfW8nxv20Hl+WyA4cnGP0G9XTd0p88Pmxm1fIaTAbbKyqj+IBAMpUpZMqao/ny2aZn1E/vr0RNDofk1R20IZv/QYnkkYNvrVsxOlirDYvLHlZNXu2Zbfh3Jk95n/WDR9QZtweWhpM6c+r1cG4Bunb5Y0rl00Rz5UwwtPfDJ/XeQB6ofHo9O94Hs+7EAmoNVZmq/VPeQaF3xUES9aN4n3WkhfMCuxjmnZxkOJt/SXyySDHuAkwT9ABBZrZ7WF7tWZm9npuPZzmV86VoSp8N3aEBipsjN3yZQpx1eVo5T1YyhgK7pkcygVJbU/OS19GGjRHayR88zc52RrgiGig4Sbe4t8RWZyXicHA2Y1FrezTVy6rfsOx8p17dHl0PMLoFW2gyQRt/A7hjoEyKuzw12JQ1nSksVr4OFSKYz+LM0iO71s87a8/IAXiPy3Q1GBwkjrFg8ZA9Ud6ig+lmZyv2IJgaJiOt4pF3vU95KL677m1OieSfao07cNs8PP5Oz8Wk+ATOGqfZD3/5vihpx3Xem2swCv3O9QLpDwQucxYp8i/xPChoop/EBHqpnUByUDaNwYs6LMZWzMw6aPMckpKVB2tqhq7qe4OJzAeh3wrk1q/s0HS5jaC9txDq6Vqf941YAu7XU6mifW9IN5zv9S/YcvFyt5495Txx+XH04cZrLcX9le9HPLaQ/l9bfTVLbTpXcH11CuOyD3hM7V2OFRfMBNhrXVZdGJ8bKu1tqG5AJfyGD+1XxJD2Zd6uaRvAaJQpXmJv1NJzW+AvIFD4AEYKpKOmLVT25Uef3hto3Pn7F6O0Z65+IYw6/cu114WBGvF/u/4QhRbwqy+gYt05NA9lWejlt0Xn6LzbWMKabqdVkFtawc2qddtvGg0hURqDGOrDiAKCK6Fiou4M1IL6KaHNaw9fL/IwHx95xBSYnG1UvzVP7KXwNrqrrFDQjzwMY6rgFPxwPRRXZNqgAZkJOHm0ljUreCzFxQSxHWa9nt+wYMg/1ZrWAmxCDitEtUYTYjVe2kR17SS9cicu9f1hp7Sql35r+MUL5Ze2whFnRJlTFazmbdoOjN/ke9KIpNZ+dgUyQ4u4gLIeI3QtC3ltmg0ombIaj7UHgAbGyqfVwKdamgxBR6rjx0HM= X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 13:40:43.6460 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f1cab929-18e6-43c3-3585-08dd1f6991eb X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF0000231A.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8561 Received-SPF: softfail client-ip=40.107.244.50; envelope-from=avihaih@nvidia.com; helo=NAM12-MW2-obe.outbound.protection.outlook.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 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=-1.116, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Add a flag to VFIOContainerBase that indicates whether dirty tracking has been started for the container or not. This will be used in the following patches to allow dirty page syncs only if dirty tracking has been started. Signed-off-by: Avihai Horon Reviewed-by: Joao Martins --- include/hw/vfio/vfio-container-base.h | 1 + hw/vfio/container-base.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/hw/vfio/vfio-container-base.h b/include/hw/vfio/vfio-container-base.h index 62a8b60d87..4cff9943ab 100644 --- a/include/hw/vfio/vfio-container-base.h +++ b/include/hw/vfio/vfio-container-base.h @@ -44,6 +44,7 @@ typedef struct VFIOContainerBase { unsigned long pgsizes; unsigned int dma_max_mappings; bool dirty_pages_supported; + bool dirty_pages_started; /* Protected by BQL */ QLIST_HEAD(, VFIOGuestIOMMU) giommu_list; QLIST_HEAD(, VFIORamDiscardListener) vrdl_list; QLIST_ENTRY(VFIOContainerBase) next; diff --git a/hw/vfio/container-base.c b/hw/vfio/container-base.c index 6f86c37d97..749a3fd29d 100644 --- a/hw/vfio/container-base.c +++ b/hw/vfio/container-base.c @@ -64,13 +64,23 @@ int vfio_container_set_dirty_page_tracking(VFIOContainerBase *bcontainer, bool start, Error **errp) { VFIOIOMMUClass *vioc = VFIO_IOMMU_GET_CLASS(bcontainer); + int ret; if (!bcontainer->dirty_pages_supported) { return 0; } g_assert(vioc->set_dirty_page_tracking); - return vioc->set_dirty_page_tracking(bcontainer, start, errp); + if (bcontainer->dirty_pages_started == start) { + return 0; + } + + ret = vioc->set_dirty_page_tracking(bcontainer, start, errp); + if (!ret) { + bcontainer->dirty_pages_started = start; + } + + return ret; } int vfio_container_query_dirty_bitmap(const VFIOContainerBase *bcontainer, From patchwork Wed Dec 18 13:40:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avihai Horon X-Patchwork-Id: 13913739 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id F0AC9E77187 for ; Wed, 18 Dec 2024 13:46:18 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNuN6-0002uO-6n; Wed, 18 Dec 2024 08:45:52 -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 1tNuN4-0002iU-Ii for qemu-devel@nongnu.org; Wed, 18 Dec 2024 08:45:50 -0500 Received: from mail-dm6nam10on2065.outbound.protection.outlook.com ([40.107.93.65] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNuN2-0006lj-8k for qemu-devel@nongnu.org; Wed, 18 Dec 2024 08:45:50 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pUg78tNw9qr2stUIJq6PubstnmGq9d1y4g7NYdiSgVWhWfCVuRpDew9EPOzBnSOfPMlAOxQ4XS3sNlh3Z1y9gjFRGVGG6RMnfweWii97sR8/kGdC6fCUKpeLRuK3Fg6q2/cbINB2qf1Whp+KgUWynKiFSIJ5kwZrifPoT/6dxqpE9N5pK0VEEB8Ie/wWJ2YtsVL9GcmiDbFy61I0M3ODsj1MVHzyMmGfSRnFdYukQCEdaAEi6paHvMwPJS3m0qn0SKmb+egCLAFqJLuHj852LpWbEv6yQUKljz9+DEPd/7+fMGpH9tahEEt9+3L/2hXOAGwd9K/OahExgc28eQb4QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Smv0sLtma52eJMuYfomE8BSkOIUNKfCuLJKL/tP8hJY=; b=E7LUlthsO3ZCfxlEv7bNQ8jb0WKBGvm78XU/X81PlZOdNbouK+4k9W5BDEsIK34Nf6ejS+XbF1EYhZ/vkFKuEMIBtEwHOnKoOU2Fp1dH+9u3lB6c68+leZsBxYqbSuUoVmsVkflhWcEjvTaHCDccXMNWkNFnri5KvIu5WCkftKOq+iv25nem994fLhGKfW/4ds5dZMuIxys+kMwkEFGAZY9GTqMwKalDiz3vSqPQs6BIDDdUu8bmDijKD44Y1JsiX3WgmTnBONAtfoFht7v+YCvpOM9iMjYChfaz69TYpSp/S18X7/sHgbnVN0OqzSPDVVbNxO16DqmhWKCgTDk4FQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=nongnu.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Smv0sLtma52eJMuYfomE8BSkOIUNKfCuLJKL/tP8hJY=; b=QNY0xi/oqDlk4VLPtAk4f/YFvNB8cvCxa3Rxqv1zRUmnn6rGb4em4aNr1JAXNCuqF/ic6c3Kxlka6ZFyeO1F87CI2o7P8Wu1AxWAj82yhv0+Ck7bfwzYJ1TyW6NXUIHVxNPYew7yl9ujG/4ihkxedBsjyCRfOQMWl/sWxmLXP+i9+KOpUVcZWfGq6tSl1G61GW8n7UYJBGMVQhSpKC8wfc49cUtjScK20rJLbLwR7wHTTKwdlNLi4+8Vorqb/eoD7T+36Ph5FogFSV+ePdh+eZi4P14VH3HgZvjwCdb1smVzg4pxbyvT+Q0weDbCbrXWheaifZ9jLgwcCrxUpD3Jzg== Received: from MW4PR04CA0036.namprd04.prod.outlook.com (2603:10b6:303:6a::11) by PH8PR12MB6986.namprd12.prod.outlook.com (2603:10b6:510:1bd::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.13; Wed, 18 Dec 2024 13:40:40 +0000 Received: from CO1PEPF000044EF.namprd05.prod.outlook.com (2603:10b6:303:6a:cafe::2e) by MW4PR04CA0036.outlook.office365.com (2603:10b6:303:6a::11) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8251.23 via Frontend Transport; Wed, 18 Dec 2024 13:40:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by CO1PEPF000044EF.mail.protection.outlook.com (10.167.241.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15 via Frontend Transport; Wed, 18 Dec 2024 13:40:39 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 18 Dec 2024 05:40:31 -0800 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 18 Dec 2024 05:40:30 -0800 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 18 Dec 2024 05:40:28 -0800 From: Avihai Horon To: CC: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , Peter Xu , Fabiano Rosas , Hyman Huang , Joao Martins , "Maor Gottlieb" , Avihai Horon Subject: [PATCH v2 2/7] vfio/migration: Refactor vfio_devices_all_dirty_tracking() logic Date: Wed, 18 Dec 2024 15:40:17 +0200 Message-ID: <20241218134022.21264-3-avihaih@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20241218134022.21264-1-avihaih@nvidia.com> References: <20241218134022.21264-1-avihaih@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044EF:EE_|PH8PR12MB6986:EE_ X-MS-Office365-Filtering-Correlation-Id: 9a56682b-9df9-4119-b94f-08dd1f698f39 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: x6UtdJpcF1OJUKECuNGNSJ4EDWbmBhsBtzSzGaervQJCMmyZ9pXHR+k6WeFYTtWbnvdQ9FnvlB4Acg+NJxqC0p3/rpOktTnshUdlL5oKjIKWG0jSqIHPwvSSc51vaeWtXgAvX3JA+xdjZzdc8NPds1GqcvR98N7LRAOaJo2gHlT/asFRxQ5ICtKBPAMbvtLhWCI7lE0FggOeVpIZ29lIpMScl0DUtAkH7S+t+NnXy2DaM8LhfQMcxocGpFHVS9lJVqDd4vh+SymEW5oqk35qcYInVRdQbVPF5wW/lhCHX4KdUaRXp6NeJBvVxIniw0GH2XQXS4O8YHQPGTEGkjQ61Us7/oKv+R1mTAdaiBmQCq3wXDCEYEC4XK1GY/ONBwLlWjpXMPg2BucyDnF/0lEf5Hqj4xdb+XcERlK6w8dFFcOc/5f+kyuh9hT1OHBdpaQPSL9NkD8FNF4Fs1e9o4BuD/kLjJ/O6DKT7fqVp/zHDt17XTpV/dSzOIvfuuOCM4wZvGx4pVuWjvGayprfpaA+sMiRorgyAWPkdK/iLEZB/N+f2rdyR+GHR+1sUFBxIHyLpeH9UGnEI/+GkO56l9BIq7pXiJtxHbgC5VQS4pz9Mu+4ZAhxXvSUHzxUtSPGacyGT6rPgjfYy1YptwHIcbj7tmPtHA9b6HSY2LV6cZNZRP3+HE8z/ySrqp4nXmPgwddPqvljCBiVMRaslfTPy1tyjBmbwuyj/ic3D5jlnJd6Pt9SGrBjipqE3x7vh86Er/+9EvG7f3J6H825kTMVHophtg+YfUQbF+zoiuP9ASP9Chxys4tQ64QGt/NeTnfwv6zuYnx8Fn4ZKpofHRfg7pFAPWHXmUsfqV7PZaOiyHcsn3nESM19i00aGJmh/xtTDtcM6DfmFRjYjDFTrYHD4z4NwWDnh9OYJEdJCXmUGlHz6P/gykXWJ2OXPPCS2wPSFjEMiCO6qVzNMpRxZTGSEqzpBu3tGbWBiaLga0vU8bx193M55d0xSmgzwDDGMzaMAweOeSF3LXOlTJJuNaVb41rYCMj5sZNBmUu9cEEQTmHQ/zIoQfhgdUDLxo1aewj7sWzR8KDdvmuo/cWFHbmAqgYIYIq6k3HzMxac4KvLBPsCG2GT9H6qna3Wjb3SipwwsrKyMSwdYUxHaWCR7mf+2UK1LNRKL8IVLKIKC4LYRRZvUO7oHU+XkBPlpDyr4QRts5uQa7JL/a2Czq0D2VbA4O4QajCoGvEjfhPNzEZjE8A0/vBLx3NCes1op41EB1EWophlqce6fkPfgg0PTssqCyaTHA+93Sbv47M82H1YGgMgB2jhbw6YdNxLuu+7Anx13uB+BbgUY27u1VPDyK8NaL2WbIaY1Nj7dvlh9WUD2Jbz8gc6mC+AALYojPuwlNqku+H2E+FzV0ZWUM+YVB+MN5QpPjmNR3Sp4gAGdT2w5qQBWMXly4vz0HbWDYh+kqZa09EgWI8l/pPSdwnVsdEZ0/hJaOlyuk7VKSDkVyAr/7TLa8Y= X-Forefront-Antispam-Report: CIP:216.228.118.232; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge1.nvidia.com; CAT:NONE; SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 13:40:39.0649 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9a56682b-9df9-4119-b94f-08dd1f698f39 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.232]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000044EF.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6986 Received-SPF: softfail client-ip=40.107.93.65; envelope-from=avihaih@nvidia.com; helo=NAM10-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 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=-1.116, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org During dirty page log sync, vfio_devices_all_dirty_tracking() is used to check if dirty tracking has been started in order to avoid errors. The current logic checks if migration is in ACTIVE or DEVICE states to ensure dirty tracking has been started. However, recently there has been an effort to simplify the migration status API and reduce it to a single migration_is_running() function. To accommodate this, refactor vfio_devices_all_dirty_tracking() logic so it won't use migration_is_active() and migration_is_device(). Instead, use internal VFIO dirty tracking flags. As a side effect, now that migration status is no longer used to detect dirty tracking status, VFIO log syncs are untied from migration. This will make calc-dirty-rate more accurate as now it will also include VFIO dirty pages. While at it, as VFIODevice->dirty_tracking is now used to detect dirty tracking status, add a comment that states how it's protected. Signed-off-by: Avihai Horon Reviewed-by: Joao Martins --- include/hw/vfio/vfio-common.h | 2 +- hw/vfio/common.c | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h index e0ce6ec3a9..6c999be398 100644 --- a/include/hw/vfio/vfio-common.h +++ b/include/hw/vfio/vfio-common.h @@ -143,7 +143,7 @@ typedef struct VFIODevice { OnOffAuto pre_copy_dirty_page_tracking; OnOffAuto device_dirty_page_tracking; bool dirty_pages_supported; - bool dirty_tracking; + bool dirty_tracking; /* Protected by BQL */ bool iommu_dirty_tracking; HostIOMMUDevice *hiod; int devid; diff --git a/hw/vfio/common.c b/hw/vfio/common.c index dcef44fe55..e032ce1b6f 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -170,11 +170,26 @@ bool vfio_device_state_is_precopy(VFIODevice *vbasedev) migration->device_state == VFIO_DEVICE_STATE_PRE_COPY_P2P; } +static bool vfio_devices_all_device_dirty_tracking_started( + const VFIOContainerBase *bcontainer) +{ + VFIODevice *vbasedev; + + QLIST_FOREACH(vbasedev, &bcontainer->device_list, container_next) { + if (!vbasedev->dirty_tracking) { + return false; + } + } + + return true; +} + static bool vfio_devices_all_dirty_tracking(VFIOContainerBase *bcontainer) { VFIODevice *vbasedev; - if (!migration_is_active() && !migration_is_device()) { + if (!(vfio_devices_all_device_dirty_tracking_started(bcontainer) || + bcontainer->dirty_pages_started)) { return false; } From patchwork Wed Dec 18 13:40:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avihai Horon X-Patchwork-Id: 13913712 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EF7D1E77187 for ; Wed, 18 Dec 2024 13:41:32 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNuIf-0006gS-NO; Wed, 18 Dec 2024 08:41:17 -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 1tNuIK-0006f4-Ql for qemu-devel@nongnu.org; Wed, 18 Dec 2024 08:40:56 -0500 Received: from mail-mw2nam10on20620.outbound.protection.outlook.com ([2a01:111:f403:2412::620] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNuII-0004hL-Jm for qemu-devel@nongnu.org; Wed, 18 Dec 2024 08:40:56 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=llewC75EW5R+nLAckMZEQUZdDzb4aQcsZEWjWyUz0Fp6qGry+Xp+hSKOz4ooeTHaZDBilt0CDHOXjTNBmACJgqGT9mZdgyxQOxx7Aodi4lR3ZTvyEIVX7ain1aIG1dcgu0UBJOfXxUzj/Q4SjV8Pk/jbEHZDQCs06Cn0VCl+OKjqUcdOlEqf+/YbFaduo2iz/BxKaaFJkqOOafnRa5nHCQoumd7kOFXTGBCHOVq6bFVX+ShHpDbN4Rz+XtRMkDgXwKFiQuyxKfYqdn5mM0i/8ZlCPw5NK+S3QuGwp3OYYgS0zKnfu/pV56u2z31eloq6YmhjDuhTPEsgjv74mPKXCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DM4jKH5VoSupnigqCKHmVNpJHCChrXTI3MHzfuesa5U=; b=qZnMc7MmawnhfGXZA/u9+BDYoi75wcAabUinxnC0yqtzKYZc68/cBJkK45JvKAZ/urCPHrqYUSJOPgk8DQSzUGbZJST2KL+5THh8m8slcHyRWJhELJSJAlo7unD/h7jCV8KuR31IInHmK1xL3O5UoL+aZPfuSs/gXQqHm9fNYYaExAumTmXEZMuClZy7WxGj2dkhCwbzu9CUaQ239EBsLUKDgtcksjXHr2E/fUkiiynodrJdwtyMDuKI3VDjZwijfSFJwsYRTCpE6Wf0+1yCyfwEXhTLPMEyfBfGQd71RDHZlbXnNfEW7IvtQtPUrf8Ht5qqncYe0sARLU0WhpQ45Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=nongnu.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DM4jKH5VoSupnigqCKHmVNpJHCChrXTI3MHzfuesa5U=; b=Lv/GQBwz2VHSB/Wnud877uFepyXMTrtGbnJlQBncad8r9HFeCafIhkxWEmfInVncTfZ3UVkMmQmExdJbyPIWsGPOd7bD7dJRAZ9xHs1yuFsEnJfssh+REurwTguseesYya+0hDwLG7CejvuZIb4GyYLSiPNCRwopjRrckuTnZb1gp+Shl4NFNG3fWG0POoaUNUPBxnE+Ylfjaz8hFBWNsnDC52TWxJRAQ5wsTKxgcqcapJ7hEgs4gXSqwfl8ZOYGBHnPbG1Sx2m/Mvx4w7snhq8sFxdDUBgkxSKcbgblDfXNBXcWpiO+p3iQkpmSHcXocQDq0UJuAYBS3l286AqlDA== Received: from MW2PR16CA0049.namprd16.prod.outlook.com (2603:10b6:907:1::26) by DM4PR12MB6133.namprd12.prod.outlook.com (2603:10b6:8:ae::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.20; Wed, 18 Dec 2024 13:40:46 +0000 Received: from SJ1PEPF0000231D.namprd03.prod.outlook.com (2603:10b6:907:1:cafe::3b) by MW2PR16CA0049.outlook.office365.com (2603:10b6:907:1::26) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8137.26 via Frontend Transport; Wed, 18 Dec 2024 13:40:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SJ1PEPF0000231D.mail.protection.outlook.com (10.167.242.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15 via Frontend Transport; Wed, 18 Dec 2024 13:40:46 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 18 Dec 2024 05:40:33 -0800 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 18 Dec 2024 05:40:33 -0800 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 18 Dec 2024 05:40:31 -0800 From: Avihai Horon To: CC: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , Peter Xu , Fabiano Rosas , Hyman Huang , Joao Martins , "Maor Gottlieb" , Avihai Horon Subject: [PATCH v2 3/7] vfio/migration: Refactor vfio_devices_all_running_and_mig_active() logic Date: Wed, 18 Dec 2024 15:40:18 +0200 Message-ID: <20241218134022.21264-4-avihaih@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20241218134022.21264-1-avihaih@nvidia.com> References: <20241218134022.21264-1-avihaih@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF0000231D:EE_|DM4PR12MB6133:EE_ X-MS-Office365-Filtering-Correlation-Id: 19b22a8c-8306-4d1c-6764-08dd1f69936c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: JsASmH90Ve2PAzPNNkzghpgDveruM59Txtbhc5GhvBMLR50C6foH7iZgyBKfhpu4VyHlStMjy59lxaJcOO2kVJhoOZfjYTFkb7yDqlUyIIly6nvmj+c+yO9w81CURcK2MoV1SjAKDF4+C93KpccBS+y1x8MmCNv/YaQX17pkam2UYTbPDq+P5xPOhGnj4622+/hZY4PYj4l1CphZ0oOlx3QGl+KdN//llsun1Fb2qak+rHuhOu5HtHgHMvocnSo+hjYziMI2EL5TYFWW7TEuokNCdneRV4WUxWjn7+4WV0zbgFQQYh3fXmBszBlCVCpY93Zd0efKarGkoqfA+FksJYz0MNb1XMJ/zgepaUbfDaUH2Z6vmNYP9EKP64oKBV6+JXN5/wdGvcUVqkFwkYV5oFSvD2aLOS1E6zC9Abm/3VGx8HDIiYBo8M8nID3+YzzMW5ciJu9+oa6t2LCtRqQRzPR0LPoeDkmQC0L9knXOl9NCHT/SXuT52N+zkSsyn+OYlKf/lAxJXP9WLuzQf7sAZr/lORZQqPeRD0yfeOxqh9J9MMkW+7f1FXOa6tsRHMyaXS0IyMxiAx3dE0BB4d6E0TtkEOQYRFXvmU0dbQr/WK51qkgP8Y5AtSiYTv8Yr/KLpakO8sB1HCDq+0je9qNO4BXZjqYZAMx2MTWuymoNMosUx9Bt9DxZH9BFAnT5XpDOvwFuEeMnoPM2UQErbm4qdCoABjLBaaYZ5aG4oEO+GxbXf18shZDA1CEMV7RD5rIveu13o6gGZo712MPEq78Wf68M0CfSfFBqce2r1w8Iv6SJ1b8wzaycBdvPix6ZVDGOvIwfXIBCCg5A+XvcNBjttFoKWpt6ihlvGNRuZnaW14MJMrNdV4xngjddECBWhOY1JoFVq70t7QuVUEfwRybB0E7rSRol5zPbbl6kUzz5ERwviWvZOv6Mw/KzW7vA85Mf4YZX2EXtGW9/7WHIPfv/AT5IvUb4cPFvgtXm4BnZ/+op8fzVyl2x6mJ9siaCPCi5BbW0cHE7siNez+VxtkhWJNeoQlNSNYZALrfoIYyYzmNvomu5gD8W6jx+lTOZ9uN4axR4J7d4TaPMup+eh51Qoua3n5wHwCCiuCsO48CpH0Ro/M1IZJF3CbF/q44cZ3LCuhTSnEyVtPHD/WTQ4beGeFavpoGgeUoaAcmSi7LPjbmhdRjMj/AELs2voQr8cLh9pv6Luxylt50ym+fAkmvOG8fpBWRyxdufOXvekiTEVBchcLDNl3AiuUso7e7/chYTWnxGKA1PtazIrIpEJuP0V0G5lF2ea9iuwa0Z9diYhsitjzRALbUXiiOH38XPvyJT1H5lW8bZa8qT0mjB6uupUGuks5spHwrjl99aQOtZNdgVx74iuhsl9r7N6TKWt1UE/Qgetp0gekirjnSgoeahmzTCzJ3LLwRMKWkY04zlLMETcH8cDAeD4Yfj3H+acl6R44/yGPDOFIU7MwFeDGIdp7NMIzNykrb6RnFtWG6QwAE= X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 13:40:46.1548 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 19b22a8c-8306-4d1c-6764-08dd1f69936c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF0000231D.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6133 Received-SPF: softfail client-ip=2a01:111:f403:2412::620; envelope-from=avihaih@nvidia.com; helo=NAM10-MW2-obe.outbound.protection.outlook.com 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, SPF_HELO_PASS=-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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org During DMA unmap with vIOMMU, vfio_devices_all_running_and_mig_active() is used to check whether a dirty page log sync of the unmapped pages is required. Such log sync is needed during migration pre-copy phase, and the current logic detects it by checking if migration is active and if the VFIO devices are running. However, recently there has been an effort to simplify the migration status API and reduce it to a single migration_is_running() function. To accommodate this, refactor vfio_devices_all_running_and_mig_active() logic so it won't use migration_is_active(). Do it by simply checking if dirty tracking has been started using internal VFIO flags. This should be equivalent to the previous logic as during migration dirty tracking is active and when the guest is stopped there shouldn't be DMA unmaps coming from it. As a side effect, now that migration status is no longer used, DMA unmap log syncs are untied from migration. This will make calc-dirty-rate more accurate as now it will also include VFIO dirty pages that were DMA unmapped. Also rename the function to properly reflect its new logic and extract common code from vfio_devices_all_dirty_tracking(). Signed-off-by: Avihai Horon Reviewed-by: Joao Martins --- include/hw/vfio/vfio-common.h | 4 ++-- hw/vfio/common.c | 40 +++++++---------------------------- hw/vfio/container.c | 2 +- 3 files changed, 11 insertions(+), 35 deletions(-) diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h index 6c999be398..d5f542beab 100644 --- a/include/hw/vfio/vfio-common.h +++ b/include/hw/vfio/vfio-common.h @@ -296,8 +296,8 @@ bool vfio_migration_realize(VFIODevice *vbasedev, Error **errp); void vfio_migration_exit(VFIODevice *vbasedev); int vfio_bitmap_alloc(VFIOBitmap *vbmap, hwaddr size); -bool -vfio_devices_all_running_and_mig_active(const VFIOContainerBase *bcontainer); +bool vfio_devices_all_dirty_tracking_started( + const VFIOContainerBase *bcontainer); bool vfio_devices_all_device_dirty_tracking(const VFIOContainerBase *bcontainer); int vfio_devices_query_dirty_bitmap(const VFIOContainerBase *bcontainer, diff --git a/hw/vfio/common.c b/hw/vfio/common.c index e032ce1b6f..2831f674ff 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -184,12 +184,18 @@ static bool vfio_devices_all_device_dirty_tracking_started( return true; } +bool vfio_devices_all_dirty_tracking_started( + const VFIOContainerBase *bcontainer) +{ + return vfio_devices_all_device_dirty_tracking_started(bcontainer) || + bcontainer->dirty_pages_started; +} + static bool vfio_devices_all_dirty_tracking(VFIOContainerBase *bcontainer) { VFIODevice *vbasedev; - if (!(vfio_devices_all_device_dirty_tracking_started(bcontainer) || - bcontainer->dirty_pages_started)) { + if (!vfio_devices_all_dirty_tracking_started(bcontainer)) { return false; } @@ -225,36 +231,6 @@ bool vfio_devices_all_device_dirty_tracking(const VFIOContainerBase *bcontainer) return true; } -/* - * Check if all VFIO devices are running and migration is active, which is - * essentially equivalent to the migration being in pre-copy phase. - */ -bool -vfio_devices_all_running_and_mig_active(const VFIOContainerBase *bcontainer) -{ - VFIODevice *vbasedev; - - if (!migration_is_active()) { - return false; - } - - QLIST_FOREACH(vbasedev, &bcontainer->device_list, container_next) { - VFIOMigration *migration = vbasedev->migration; - - if (!migration) { - return false; - } - - if (vfio_device_state_is_running(vbasedev) || - vfio_device_state_is_precopy(vbasedev)) { - continue; - } else { - return false; - } - } - return true; -} - static bool vfio_listener_skipped_section(MemoryRegionSection *section) { return (!memory_region_is_ram(section->mr) && diff --git a/hw/vfio/container.c b/hw/vfio/container.c index 9ccdb639ac..15deffe3e4 100644 --- a/hw/vfio/container.c +++ b/hw/vfio/container.c @@ -131,7 +131,7 @@ static int vfio_legacy_dma_unmap(const VFIOContainerBase *bcontainer, int ret; Error *local_err = NULL; - if (iotlb && vfio_devices_all_running_and_mig_active(bcontainer)) { + if (iotlb && vfio_devices_all_dirty_tracking_started(bcontainer)) { if (!vfio_devices_all_device_dirty_tracking(bcontainer) && bcontainer->dirty_pages_supported) { return vfio_dma_unmap_bitmap(container, iova, size, iotlb); From patchwork Wed Dec 18 13:40:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avihai Horon X-Patchwork-Id: 13913711 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id E85ABE77187 for ; Wed, 18 Dec 2024 13:41:11 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNuIL-0006fG-DF; Wed, 18 Dec 2024 08:40:57 -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 1tNuII-0006eq-V0 for qemu-devel@nongnu.org; Wed, 18 Dec 2024 08:40:54 -0500 Received: from mail-dm6nam10on2061a.outbound.protection.outlook.com ([2a01:111:f403:2413::61a] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNuIH-0004h7-0V for qemu-devel@nongnu.org; Wed, 18 Dec 2024 08:40:54 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Fx6MVl3PqAN+63qPisv2aK/yT6IVJtdczMWntaTiI+eblbh+aSBscyDGzqLBOzss+Y3C9682zREnqrLxXCTikJL4DPiB6zboLrddzsHLFMhgW5kjjcKjVw67UHeF6O0PqWO5ikWGjWGXr/dcCQpcmZbMkDwIKKH4YyH0Rz2e9JQpoWOGgyXAUO8+lR6/ndjvByAnZDjV6k7Ynz3TOJE34xUsILbbfoi4j4fsKC0z146AclZfC/jbfrAMOyQvE2FwQEtLlkmdOybr1EPkTVufHmac5vFZ9a9aWL2bJ/nUpNHXMtyB7ubU2DfJsTjNWqARpwD7ECCq5bX23acPOyIU6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XG7Kek0hDWz6Trc/DRDzAZ1rqHwRn1to69oRMngrhfI=; b=qLZeqY0o/xs2NMybVqXsveoIbexYJXCCURU+Vx/cTV+JSTfJq2ymbiCC0Sw6SV6/xi6Mv1vkPUAjo0zy7Crn8ltvL0Fc0ckACBAkwoEJf9EK1q3jf6TUYH2XP50Tx+0T295D5xV/tPaPOoQiAyL6ZR28P+jBg+G7/YN6tzLn20Am8l0Tx35a5oi1ptHfZfrsobzN8lUC4k1z2r5d+VFTx4zW2Iptb/NXEU3UXboh77/Uv51lfNTnM/zdbbw0l0O2vp7wTOurRsS9p4TLrQv0AzsShoXe4s/v/znFNqDaovQY/GvKC/FPein1k/b2/zHsFrjR46VE6jNdjsPpjmunNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=nongnu.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XG7Kek0hDWz6Trc/DRDzAZ1rqHwRn1to69oRMngrhfI=; b=qOwbeTVzU6bHZxUNqlDh5Ya6yAb0AUYFzxeXb/PVNTNM6CEmDbRyNKwPEEFRBJZhTfmClgXI6OqjajqGIyHYqF//E3Ul+WD85fyZXMMNYwePnplGcdoSNYhVD5101e/pgY6yQTMkUs8/wUENLvzWk4px5/kMkFT9gDAFC0HZ6DS9cPWb3lUY9C+X8upHpqQmbwJYgzj9s/KQZ+bu0Eh7VD74PP3zs6RTDndxE4EGfX9frQLqlYS+nUH4pUc9l8lynm/7q3I4Kn6bQjS3jv+oS0KIhdXhydo30pWRijDr0N58dZ02KibhuXZN+zXwNoeTpEhUYKpgbE1AzUypFJL2bw== Received: from MW4P220CA0026.NAMP220.PROD.OUTLOOK.COM (2603:10b6:303:115::31) by CH3PR12MB7617.namprd12.prod.outlook.com (2603:10b6:610:140::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.13; Wed, 18 Dec 2024 13:40:48 +0000 Received: from CO1PEPF000044F0.namprd05.prod.outlook.com (2603:10b6:303:115:cafe::24) by MW4P220CA0026.outlook.office365.com (2603:10b6:303:115::31) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8251.22 via Frontend Transport; Wed, 18 Dec 2024 13:40:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by CO1PEPF000044F0.mail.protection.outlook.com (10.167.241.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15 via Frontend Transport; Wed, 18 Dec 2024 13:40:46 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 18 Dec 2024 05:40:36 -0800 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 18 Dec 2024 05:40:35 -0800 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 18 Dec 2024 05:40:33 -0800 From: Avihai Horon To: CC: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , Peter Xu , Fabiano Rosas , Hyman Huang , Joao Martins , "Maor Gottlieb" , Avihai Horon Subject: [PATCH v2 4/7] vfio/migration: Rename vfio_devices_all_dirty_tracking() Date: Wed, 18 Dec 2024 15:40:19 +0200 Message-ID: <20241218134022.21264-5-avihaih@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20241218134022.21264-1-avihaih@nvidia.com> References: <20241218134022.21264-1-avihaih@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044F0:EE_|CH3PR12MB7617:EE_ X-MS-Office365-Filtering-Correlation-Id: bb0c6421-cc91-4288-f80a-08dd1f6993b3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: sfnh9acgJVmvkRsl0hKHhVHKidPmAc4uJB5rc8+jaSnD9mJWTU6Jk/7Zt+gUFzmELBtagr2lVyhyVTIqPbeAKP3rJIM8+iY23DmCGG5GKJCoZ+S0xzv0zbYhWRqNdsfYAHec/97yrFMyKjT5SvC5GUxlhJ5l1VU+UDh2gI53cFpd/6FyIlQkwZ5m8P2a+8uk4gA9GDEO0/IiqTnALPXBCyLXyBE0xe14K07Zglv4/jfL/k+/URFwUeKu0pGRPw4P367FvmkEcmp/bDk/fCJvD+YOCzcU3Lcq7dkmVncMESXZN2m28UXGSK4sXxiqXbE3fGLcFgf0kyJMN99kSEw5EvMgAmO72Vxq8yT/1JAKESPDKUrGy5XWBqEmdC1YxRUa3ciX00InMChy2+WeMzjDywloYRqhSg2e5yj7l657yPgp3HGqtzKf4ld0AghMkGP5ts8mDbgT6lXJl4W3VRhdSpb+3TnQx4A0HyjrGlFL3DNRDfK8ocjlYgbqsUTUP5GZ29vA0fU8ngXiBijtScHokF4dr0qaokl+AbK+MNCBdiuL2wQYC5YrTS8GJigX5miAnWhKiVxkO7/nUWpPzXtTMWJnJysEV94alO7b7GPQHI8YIC5zBvrJ4ZR8zs5T/1IC5xLl0+pTNIHxlWPULvpnHzJMpgdzQejPT9DDGCGfheX7UoBxNShYi54ZVMRCkARfjVqUydfnW3EqxSx//sMsgLWSC/LqKKxI2cmYQuYg8RTHcOHZjRxHfRjUjCUbKExD7pQthXJDdCKojgwUecm81v4EeXvlZs9jOzciLJ6+HyDfGUY8HPFPL0wL08SXE8aDsEsrjeRNW9Pxi795mtD6ArfQJAgjLoflNhBwhCpGVLFSKA3bV4RRn7rnJZltkt9MyG8wx2gbgO6idqb40n27Jad8t+DhwFG3mPpaB/SBvm/wZ8t/xbgN3xZ5EnN+T1zM83m78+zwMNe1lqUH11ZshTtaGEaRRJgGOkepmLGtxwWs4WCC+2alUxFf8oxIRhH3S7Rc7hbLuJDwC4n0rGH+WtG3YGo+h1mB6tqIa9eRW2yfKk+cMj1hCHQolfl4Tc1ceD+O9HBQowMMomlqFp4NT1lyJfRF2Df2zN1pw/wEY4oc+3AQ15F3qlM3ecLIpDRINPMwbTmLuCckz1lwFWTgt+IwhJWMHQlWKD9DRYLaHkp59jEUH1BZwaXaks+Jk44XtUmoDJIqha/y/Y1BRGKwl19WdyDZumrdomC0zywU/iWUG5P4JEy6a8ZC9bNs/nMQMlDIfd/ayr1A6Y73lpv65x0biYkP/f0RjaCE8bJS/sCetePb+mq4yv8lzF5h9YiOxwyCY/oeiMGk22xAN06VVyFT+nZRIP8DbHw5GqrgqAnB3wC+ztbCX02SKmC6rXNbMdlsNrVOpunENIzwRdnCpMJM+CKllmMKkzPAlgkWV8gllCkP5FEnewtyWvC6S1+Mr3BWLvNPd7bsnm4QoUIdSjLA2WBXAq8i8n6pjbHGVyA= X-Forefront-Antispam-Report: CIP:216.228.118.232; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge1.nvidia.com; CAT:NONE; SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 13:40:46.5613 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bb0c6421-cc91-4288-f80a-08dd1f6993b3 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.232]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000044F0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7617 Received-SPF: softfail client-ip=2a01:111:f403:2413::61a; envelope-from=avihaih@nvidia.com; helo=NAM10-DM6-obe.outbound.protection.outlook.com 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, SPF_HELO_PASS=-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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org vfio_devices_all_dirty_tracking() is used to check if dirty page log sync is needed. However, besides checking the dirty page tracking status, it also checks the pre_copy_dirty_page_tracking flag. Rename it to vfio_devices_log_sync_needed() which reflects its purpose more accurately and makes the code clearer as there are already several helpers with similar names. Signed-off-by: Avihai Horon Reviewed-by: Joao Martins --- hw/vfio/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 2831f674ff..d113d8f4f5 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -191,7 +191,7 @@ bool vfio_devices_all_dirty_tracking_started( bcontainer->dirty_pages_started; } -static bool vfio_devices_all_dirty_tracking(VFIOContainerBase *bcontainer) +static bool vfio_log_sync_needed(const VFIOContainerBase *bcontainer) { VFIODevice *vbasedev; @@ -1364,7 +1364,7 @@ static void vfio_listener_log_sync(MemoryListener *listener, return; } - if (vfio_devices_all_dirty_tracking(bcontainer)) { + if (vfio_log_sync_needed(bcontainer)) { ret = vfio_sync_dirty_bitmap(bcontainer, section, &local_err); if (ret) { error_report_err(local_err); From patchwork Wed Dec 18 13:40:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avihai Horon X-Patchwork-Id: 13913715 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 96975E77188 for ; Wed, 18 Dec 2024 13:42:13 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNuIi-0006kI-By; Wed, 18 Dec 2024 08:41:20 -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 1tNuIP-0006ft-HB for qemu-devel@nongnu.org; Wed, 18 Dec 2024 08:41:06 -0500 Received: from mail-mw2nam10on20618.outbound.protection.outlook.com ([2a01:111:f403:2412::618] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNuIM-0004hY-2H for qemu-devel@nongnu.org; Wed, 18 Dec 2024 08:41:00 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hrO10TpxpuolDXjcwncjqCOfMNNKY79g4pTF49wccp0EjPPwFhb+Q3eAgsLrd/gN+lYWh2UPshSZq7ke2MNwf4ZwNPVkIif6beMsFbY2Xvql3fSRVL/ClRTFFQ406Whi+d6qD6YlHr+J7eBHcPGXOwyv6otvxVEUkIC2dD/M3XBzBjgW2JPEZmy5RS4F2fGdWSwUKzdo5uOSzn+klD7A+Iyaz6I6cXrnkIjDQOO3YH4oIhvjS9XHbqAp9s7lIjWtpcBzzwMn/AmjSLj4mpn7u6waVi5NGqsh3LcSWT65zWLrS0Vxzn4vbmxDRAe/yBctjkF0m02leeZYDKqyljsPGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zAiYKusLrHRrTGVfSy7Cu/HoWxHxS4ZmbTJ9sDkoWtc=; b=ywIi9/3e/IoMYwrQNafquLyiVaDa4eqSDakGyyP004BwgOYv6lg8CqvZS36MmdK6wQfDMbwXUFFVaoTdbzDHee39pj/kRS/Y/qc0jAkic1j96ngPW3mH73LPQNB9G5oX8X1v/eSCvWKdiENZuMlO+8wLUzhsn2c6Xwz+uoB7nEStn9VYlK+9p/2H4orke/aT2zhLiqDYKSH5jzZdDaqD5AwAfwKZIi02Xqsc1CQbO+wwsO3H88rKUM4N6l3QRc6Czl5GjceXhwEQGumskhmBt03eOeQeigAoDY4l8UEvW7uUy6tZGMpcl0wozGG6lTZa6PD7GpByvYdBHu7eu3YbBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=nongnu.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zAiYKusLrHRrTGVfSy7Cu/HoWxHxS4ZmbTJ9sDkoWtc=; b=ex1NHX4ZDAuyNvb0VM731HcqT9OczsposHO2Ve9L1nzw2BYJ+BfuN0kEAn7uEt7gO/jKEnMLlP1xdh/bbSa+93xMZiov3bZSJpSh18AVPBZpMq86xKOisw4xZX2eY4DLPu6qtuyYPi0AZhYCkXtQ6qaN1XMOpmcbfEuwW7lQtsYZyfQg3Em8nBusUlyp4rMt/xt2/cnt/jjI6lV6GNtPy9Afca4sJioCb/8IBoyi0kB2Q3JVA2QTn2pq4CFdafBzhxNbA0ohy5D2C9D+s+n6hqjnSfEI1vuIibf8NjeshpoxSVQDW+oXyn9VjRCG4FVYRQPRWuioQLVvaedyvu4ckg== Received: from MW4PR03CA0227.namprd03.prod.outlook.com (2603:10b6:303:b9::22) by SA1PR12MB8161.namprd12.prod.outlook.com (2603:10b6:806:330::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.22; Wed, 18 Dec 2024 13:40:51 +0000 Received: from SJ1PEPF0000231E.namprd03.prod.outlook.com (2603:10b6:303:b9:cafe::3c) by MW4PR03CA0227.outlook.office365.com (2603:10b6:303:b9::22) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8251.21 via Frontend Transport; Wed, 18 Dec 2024 13:40:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SJ1PEPF0000231E.mail.protection.outlook.com (10.167.242.230) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15 via Frontend Transport; Wed, 18 Dec 2024 13:40:50 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 18 Dec 2024 05:40:38 -0800 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 18 Dec 2024 05:40:38 -0800 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 18 Dec 2024 05:40:36 -0800 From: Avihai Horon To: CC: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , Peter Xu , Fabiano Rosas , Hyman Huang , Joao Martins , "Maor Gottlieb" , Avihai Horon Subject: [PATCH v2 5/7] system/dirtylimit: Don't use migration_is_active() Date: Wed, 18 Dec 2024 15:40:20 +0200 Message-ID: <20241218134022.21264-6-avihaih@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20241218134022.21264-1-avihaih@nvidia.com> References: <20241218134022.21264-1-avihaih@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF0000231E:EE_|SA1PR12MB8161:EE_ X-MS-Office365-Filtering-Correlation-Id: 9242228a-b4be-4ecf-9e11-08dd1f699628 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|376014|36860700013; X-Microsoft-Antispam-Message-Info: 7o6Qqp+xm9sEHmb1Xm14QpKeRtiVkleY4jHHH3eJ/hr2difiOB1mfxo/ogFiI24wL9ow9vxBUyrIr3+BZhfAbVKveBCr864i0p8b3DMgs0A8YsxM3GcQvRBf9Cp9BrzmxVvSmcF3S5BPSSsoZ3r6WPEOoaeUQWirclkYagC+g7dHa+q+kqXVMPuyy006+ukU7QA771hih7OrCGobgBU8hyv3laeBbIQQ1qSirk9HLksA96cjgWqEo6Uliv3Ta9vA6lcTyulw0RzM3lSZFAXTLyA/yTejNRq9x/BQfLPMp9cubFclfE3WUQroCKrZIV/Gh57GVL6D9FU6kRFTklPVggBQdRvcKlADJDxdoqiAylVTD8aKKNUGP6qq8D4r9l5FJZbmOxxiiEVr5BSh9pg0D7Fgn6ixyqxlGywjiTW6poXScDIXaWlnkV1uIBLC+q2QpjHXIm0X7GMWRS3WdtvUFZVt4rmEezG1qIcn+O6ip751/onA9KGf+OV4DH9Ndsu0XSGTCg7SH540skPx981+zA8q+aWYWpd452ITZz6IRdXdbTmnrle7Wqg2kn/jWJ1QIudKdw8zw9ZyxunjduPlXRFU3sEpva33TpRiKdymPpNhlAq8puw2wn/ze1KIEmkygZuKb3blsfm0i3+uOV709bINRBV6zpikpI/Zy9eGq1bbL7lyAu3bGQ3VstxqkzMFrKoAAjFPwXGQGb6cEP8rudLT0pBCMqmevmnlvGxYKMgn2b3Rge2NnpTadrBE1fJGh6Oc6B6ZVI4/n+MfNA2+FWK6LFiXoiDB/sUrdyEGoIaYbJtWB0d+T5pgRA17cxDCI+x22DUpHhXvowL3WIH7rw4EIUV2LgDST0ioqbhM/MOpCBK304YkRWQex9H3bjP1Wy+zQu7tDUGaa+yMLRQFLT36wr6aCQuHwOuyrjixIbYiRDrB39tDXl9AM+RAQ8aGUVZvpagfYgMLZ9QlSq2+tLj/UqHq3r8b5BetYftGKbxi92ZR4zJKd5uhB1+EQXN/OryUyTf32VfMcI0hRnrjtpnUpldUHOKNQWOq6zCThU26pDYOVnJVR5eXS4dg8pxioN2JmW35/lvO6l5Gex2XO/l6c1rlLKW5jd/6Ugwt6K6Ezi6Z8aljF4Iu1Ayco2IZoc3Yl+Gq2DWVIE1bNjkTlJbfPIjehIi2/1q1SBEOZIslQ7yRbvxmzM//GML01NxbZJDuzApAC8/2h0omPmJu1mk2VE34AoKxvbBd+FClkvGyZk95gL+itjb0rEV6RfsNSkgg59GqnIWT/xUzRQPYzQXF76Rvp98h4ubp5MpetPznojgi0Y4VhRa3//0868jiCeampekfDvAGvn7HUgEu90UU5RM9qy6tFQbGfV045MFrCim2F2oijFBsDk2vF2v478/HqLjQLNNN+fOp6MGx6+SDJUIKbEtRmRFyI0qtEVbpt/dteSNd0wjxMMvDt3WENVr5MSbcRPdVA8TCgxF6sA== X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230040)(82310400026)(1800799024)(376014)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 13:40:50.7593 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9242228a-b4be-4ecf-9e11-08dd1f699628 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF0000231E.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8161 Received-SPF: softfail client-ip=2a01:111:f403:2412::618; envelope-from=avihaih@nvidia.com; helo=NAM10-MW2-obe.outbound.protection.outlook.com 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, SPF_HELO_PASS=-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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org vcpu_dirty_rate_stat_collect() uses migration_is_active() to detect whether migration is running or not, in order to get the correct dirty rate period value. However, recently there has been an effort to simplify the migration status API and reduce it to a single migration_is_running() function. To accommodate this, and since the same functionality can be achieved with migration_is_running(), use it instead of migration_is_active(). Signed-off-by: Avihai Horon Reviewed-by: Hyman Huang --- system/dirtylimit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/system/dirtylimit.c b/system/dirtylimit.c index ab20da34bb..d7a855c603 100644 --- a/system/dirtylimit.c +++ b/system/dirtylimit.c @@ -80,8 +80,7 @@ static void vcpu_dirty_rate_stat_collect(void) int i = 0; int64_t period = DIRTYLIMIT_CALC_TIME_MS; - if (migrate_dirty_limit() && - migration_is_active()) { + if (migrate_dirty_limit() && migration_is_running()) { period = migrate_vcpu_dirty_limit_period(); } From patchwork Wed Dec 18 13:40:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Avihai Horon X-Patchwork-Id: 13913714 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 01AEEE77187 for ; Wed, 18 Dec 2024 13:42:12 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNuIi-0006lH-VZ; Wed, 18 Dec 2024 08:41:21 -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 1tNuIY-0006go-7X for qemu-devel@nongnu.org; Wed, 18 Dec 2024 08:41:17 -0500 Received: from mail-bn8nam04on2061d.outbound.protection.outlook.com ([2a01:111:f403:2408::61d] helo=NAM04-BN8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNuIP-0004hm-Ca for qemu-devel@nongnu.org; Wed, 18 Dec 2024 08:41:04 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tA5RiB+TNw7zk0iK3Vgw3+XKWh4OCrrwnV2FkKHffUI1EOTdixZagcRy1QVQ9e2uj20DNQ5gCZlrgWQj0M+Qp4JGOt/NWYssouOmlkGlcVfaxLMOKHdy3MzSB0ZPPk61RytL3XP4W/5dj2juyudiTZarXPZ9MiXF8ppdNA9tvcOmxgIaFN/hQ+LlJA5d3cXMn6ZxFjgyeOm3bMOIXKsZAy6rk0A8f55nt3UQJ5seK9/xnRHYGyUymCe+IRr6hAxCNXhgXfzOKRqXAbjTxwV7jzvT4VhaMArJhLxReCaYqlocsu8xUeX/+zl5zBHY9HtpKANE13S5RsNsntJwsqSNjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XqleAvJ9PRXc6uJCv6Tr1N9BPEJC167mxaoejccZf30=; b=XvAiEILUCoCknWEkLOQkW5qONr6iEWi5iTsYP3l2kU/wJymfdiT4M5kJZ9mku4kKaOszF82fkKovAnd22C07urVDMP2WRERRMf8SevCWGOB+dakWKco0owTthxL/LGx8p4fwUjzSs/nHVoAfYwo9cisUmOc5NqGNlr22zX7J8Co+qcv3gXoOaZ5SWvyW/e55VuuuH3/iLRftvQnpOZ3K1wkQIMElFt5yaQo8FpfQ9TRygAOoJbHDxQqRQeYwJPe8hQ8RpgifyTsT6DAOpNbHZGwqGf9+4sgU4c0kEq0nIu3mmR3mCFjecUBWzm7gIvKbFdooagOc2on5qegfTx1/7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=nongnu.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XqleAvJ9PRXc6uJCv6Tr1N9BPEJC167mxaoejccZf30=; b=Xox8DWsaE9jixeESjOMIvZ7LsQLbgMCxOLI1JUGMzqtYc7rVAaKNO8TNKvsUJSUPVPDF6sXoisD7X//LD/TS4XbJ+/p+lJ7VgBRreRMEZzMyK22dO3PlSBhlPkRMhXo6zgRNJqwL+lr+sF+BiUysEBTZJKAJaZCK/X9TWv/hCnff1uEajblbyLfR3R/Q/iNQ3DooaiMjqRiLUhqFOgbzfoB41ijxNvjnNc76OlMtgUpw9hPSLUY68388aykkFQtYq1ysVogWp2G7C/bny/hyebxNio2BsVIXT8HODOldQPgJ9RB2KMB5zmNhxbJT2K9XVOKqnO6xq0l7nshQI+hicA== Received: from MW4PR03CA0235.namprd03.prod.outlook.com (2603:10b6:303:b9::30) by LV8PR12MB9110.namprd12.prod.outlook.com (2603:10b6:408:18b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.13; Wed, 18 Dec 2024 13:40:54 +0000 Received: from SJ1PEPF0000231E.namprd03.prod.outlook.com (2603:10b6:303:b9:cafe::2d) by MW4PR03CA0235.outlook.office365.com (2603:10b6:303:b9::30) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8251.22 via Frontend Transport; Wed, 18 Dec 2024 13:40:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SJ1PEPF0000231E.mail.protection.outlook.com (10.167.242.230) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15 via Frontend Transport; Wed, 18 Dec 2024 13:40:54 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 18 Dec 2024 05:40:41 -0800 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 18 Dec 2024 05:40:41 -0800 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 18 Dec 2024 05:40:39 -0800 From: Avihai Horon To: CC: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , Peter Xu , Fabiano Rosas , Hyman Huang , Joao Martins , "Maor Gottlieb" , Avihai Horon Subject: [PATCH v2 6/7] migration: Drop migration_is_device() Date: Wed, 18 Dec 2024 15:40:21 +0200 Message-ID: <20241218134022.21264-7-avihaih@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20241218134022.21264-1-avihaih@nvidia.com> References: <20241218134022.21264-1-avihaih@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF0000231E:EE_|LV8PR12MB9110:EE_ X-MS-Office365-Filtering-Correlation-Id: 116cc3a5-aeb7-4ca3-fac5-08dd1f69984c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?utf-8?q?3Xk3irc7uOA+fciP1tXyBebjallKgU9?= =?utf-8?q?Zkl6hkez2nE0yX7TljLmDBiweNcrZBn0hEb+inFOfLouXt0aIFTDfAYAqhEkL6CZu?= =?utf-8?q?jEm64eiRZdsxxpqIuars5F5p4mRVaEisTNf7daD3MKFM1Ff61No0k6BFZnkBorMUd?= =?utf-8?q?eJFgtLoirAzne50bxctVeoTwGSQwxoB7aDyH0DMk3stwgZ58+ype9ntp9hwd3XOjZ?= =?utf-8?q?UhPUqs4bjFtpWdLit3Ede+mIw4D2h0+ilP4hMFiWNFLzmpWDHRFE9ripNvRtVnzew?= =?utf-8?q?Z9bh+fxWq7d+aUAqnmpSuPgVFwkJnjMMeiCagV+5qkPKX/PoLtxT/JvxDHUHu3nit?= =?utf-8?q?T74RESrjJXx73PlARiFB9CJeT09XN8AeteAbnLoNQL6GG435oDu6Nyz9kIdpwi6Uh?= =?utf-8?q?IkqnntJZNfFVUKcmELUWqDaPz095wgxIMQmKttOLSIgTWU9XANZqxvHp493mR9dGQ?= =?utf-8?q?OfRshlZ1sf297otGiw1RnsoKYrD3o4Tpr5TdEGY4xd2/gZeY2juU2wP0OvDKrRJpf?= =?utf-8?q?qnCK+z93Et2/Im+/YVuoWPb0jp6VVa0i9EW8Laxws1ZlCFL9ZywfDrPh1TF5WqjAA?= =?utf-8?q?9nomZHh9t+IjUvup3stCKttMMW5RXSaOXi9lCxNZCdFV6nBSGyjxnyq5q1ZIe1nwv?= =?utf-8?q?7Qag9OB0iXfeQr6b0kPCaEODf8aTPQsO2Nwd663yS7WRVL4jlgTmiyq6z1uzt5fBL?= =?utf-8?q?OV02HptF0JXTShBZJDrurraQ1F+5pJdZlaB3556FWPL22Yd9FnpWhxdcbiHDl06hx?= =?utf-8?q?td4PhtGMuwxndzToe5rCn3oAafla1gFsf025D/aPjHiq1wjN2saHO/UI9Fm5wG5BQ?= =?utf-8?q?FWN/8nw/+OtNdfmZZqZ2/Q3HMYW7o2QDrroIf6SJq2WPezUIgpYmeJivEe5iakSca?= =?utf-8?q?ZFMuO7F3m23jGVKDCjeuaJNEv35HBEyGTtWnk9MUM20oDHuFkfl2fUvMOeJi0AB3i?= =?utf-8?q?Z+nOGEGOdEheKcplQGyz5N9eXTlzbYXP+EqlVyzDfiZRKLx8Ns5nmjPsHn1sHLA8G?= =?utf-8?q?ECLkvGYSdkgpZSi4pmwnU591IKqLsMNOowF2gbuOow6ypV462jXxocRUUIVUHtfw2?= =?utf-8?q?x+v240DHZeKyCCX5G5WFlFPny8YNLy8tytpFq1gDYSpGU3zxl/a77eQLKpKyrd8XU?= =?utf-8?q?TzbnXkkywBMowq9hz1VUUMI6N2mfk2NugNiSFLD42GEaptpJ4fUWNQ3GcJTAkzqvz?= =?utf-8?q?snIJfrg7eDs84hBqP71Xx1LUwVU35D24Er1l8bcGpgGWzlEgkQfgzRUJlDFPnX7ri?= =?utf-8?q?lFyKCw2sBdStNr8VmGKtxC8gXbbi4RIj1tj81OpW+jZrfLt52g6JxrBlC1qleNPOf?= =?utf-8?q?H5Y5gnU6eZIHJUV/sPQmXPMfGhTs9gZlmovv8tgKJWtY+4aehd4CbZEaeB8DGoe+i?= =?utf-8?q?H6Hs2VrHw8y38Yv5lRxYxiah4BMHVueX29GSVLVxbBnrFyJGi+FyoM=3D?= X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230040)(82310400026)(1800799024)(376014)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 13:40:54.3376 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 116cc3a5-aeb7-4ca3-fac5-08dd1f69984c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF0000231E.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9110 Received-SPF: softfail client-ip=2a01:111:f403:2408::61d; envelope-from=avihaih@nvidia.com; helo=NAM04-BN8-obe.outbound.protection.outlook.com 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, SPF_HELO_PASS=-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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org After being removed from VFIO, migration_is_device() no longer has any users. Drop it. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater Acked-by: Peter Xu --- include/migration/misc.h | 1 - migration/migration.c | 7 ------- 2 files changed, 8 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index 804eb23c06..ad1e25826a 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -54,7 +54,6 @@ void migration_object_init(void); void migration_shutdown(void); bool migration_is_active(void); -bool migration_is_device(void); bool migration_is_running(void); bool migration_thread_is_self(void); diff --git a/migration/migration.c b/migration/migration.c index 8c5bd0a75c..18ca60af4f 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1645,13 +1645,6 @@ bool migration_is_active(void) s->state == MIGRATION_STATUS_POSTCOPY_ACTIVE); } -bool migration_is_device(void) -{ - MigrationState *s = current_migration; - - return s->state == MIGRATION_STATUS_DEVICE; -} - bool migration_thread_is_self(void) { MigrationState *s = current_migration; From patchwork Wed Dec 18 13:40:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Avihai Horon X-Patchwork-Id: 13913713 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B95B8E77187 for ; Wed, 18 Dec 2024 13:41:49 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNuIk-0006ly-Gv; Wed, 18 Dec 2024 08:41: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 1tNuIY-0006gp-7W for qemu-devel@nongnu.org; Wed, 18 Dec 2024 08:41:17 -0500 Received: from mail-bn7nam10on20624.outbound.protection.outlook.com ([2a01:111:f403:2009::624] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNuIP-0004hu-BP for qemu-devel@nongnu.org; Wed, 18 Dec 2024 08:41:04 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=m6vLya7UBJ2MuU61Dqvkc47pd1o5ZqQloLrCZQ0h6WQpENxJpIFnDu4DSbEgcVVrEqHrbJVRmLRvlf2Aa6F/nN58BHGm+t2v1A2ejF3zCdDhaVKcaP3uU1PaNEN76RNpKylWFMQbateGqiUJOQGjNkegyklcl02plNcnuG8Iq/LKys+/cnsantMzFomT/j8xP59aj+YFRiY1vLAUAq8X3VRKznU0SlMMXdqtf4WAbRRJWAOSVBxo4kc8gnRQmQweLM81+OpSdHTxrBJbzw0R1E0cm7lIsdWi8UsDYiGUFCPhAjdaoUFQs5MYx4vUygOSF611hXYEn8AvsGTlH38PAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DmdvqL8OCXMc7eJg3MzqQn6K8IKkUcFUi8NZhsh36Sk=; b=h2grFGuDWaizSim/v80xiQpA7EiaCvKttY+2AgykrT0z6wYYe7Ug8b48uusSdXjayiHAZ2EY7Dvf/qvvF9jp/HC5yZqm6VJzJvW0mvmRFHukW4A35MkxGAqhoKlYA4KJu2h/VKzUW/TRbCugTMdavnSh3tABr6+VbUou9u7ZOycRyiLD+WEJyOyOqlGr7mGWHD7PT+b9T6l0i85gp6XVJunJxhfJW72KkXs/1OOmDpPOh9jJgs3mDxbrOd2sxq1NIw6T5QhOZqoKiH4RY7NFg/aP09lu/IPfe+nk+H791PrzAr27nHO8upuYDWc4Azdw5x2qJEedlu75I9wUVi3TfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=nongnu.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DmdvqL8OCXMc7eJg3MzqQn6K8IKkUcFUi8NZhsh36Sk=; b=pZLyEAQrnPgC0d0/QaUrEhXvceMb/5HOtAiMXqVhgl/XJ3X05/neh+39UnsUUMM9u6ArZnygh47wPxCz9BvrexDQ1PbwvsgOw7CN0n2zpOWwcEuXKve/L1fJEEmBLLfcQGu7EH+GA2Ly8OBhyiJ42nzVw9+uU+QYNQ48q4QARQNQwrY2q/B9xb3yTpVqJyk707jwpGOcELZn6Jdt9psrVGfgsVHIg1u9ubXhGztzUPv3uRbajQBNlBhCox2YmXxUJjtc6snxLhGBJxuCyFsKNPDktko0Hj4YdNmOBUVicWkrVRhQ5vV2avENsaqNXGiF+nKU9wGmlzqTLi6D5zUFHA== Received: from MW4PR04CA0040.namprd04.prod.outlook.com (2603:10b6:303:6a::15) by CH3PR12MB8726.namprd12.prod.outlook.com (2603:10b6:610:17b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.14; Wed, 18 Dec 2024 13:40:55 +0000 Received: from CO1PEPF000044EF.namprd05.prod.outlook.com (2603:10b6:303:6a:cafe::ef) by MW4PR04CA0040.outlook.office365.com (2603:10b6:303:6a::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8251.22 via Frontend Transport; Wed, 18 Dec 2024 13:40:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by CO1PEPF000044EF.mail.protection.outlook.com (10.167.241.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15 via Frontend Transport; Wed, 18 Dec 2024 13:40:55 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 18 Dec 2024 05:40:44 -0800 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 18 Dec 2024 05:40:43 -0800 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 18 Dec 2024 05:40:41 -0800 From: Avihai Horon To: CC: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , Peter Xu , Fabiano Rosas , Hyman Huang , Joao Martins , "Maor Gottlieb" , Avihai Horon Subject: [PATCH v2 7/7] migration: Unexport migration_is_active() Date: Wed, 18 Dec 2024 15:40:22 +0200 Message-ID: <20241218134022.21264-8-avihaih@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20241218134022.21264-1-avihaih@nvidia.com> References: <20241218134022.21264-1-avihaih@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044EF:EE_|CH3PR12MB8726:EE_ X-MS-Office365-Filtering-Correlation-Id: f94c94ba-1e2e-42f7-f298-08dd1f699918 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?q?0llSKvVed1n9I8wjwrwzBxkckqUbICW?= =?utf-8?q?gQRR9uiZzQQwg5sSNsvZpJ+vs5GoZloLqRhR95/CPKEmoAT95YJd5oUf/Nfj0FT7p?= =?utf-8?q?zw1Wq8vXT/L/6q8sCJt7X02XCpFAKBJegTnPQcImYzhbmfLLWmy9b77shXR26Bu6S?= =?utf-8?q?kN9Nwfsnf2p72JWlwpVVLtnN2lWxhidfRN4FL7HfdJLc+IQa6Curemn5DzaUggJT9?= =?utf-8?q?jkO9BJSh4ao6KFUvXrRZzdQAKlYZ7SeJOP+HBOdCDpViN51rj+d6MMCR2IcwkJv2f?= =?utf-8?q?mUcj8D18S5EplfUSkLXQNBU1XBcnQXDsvxQpQEVKVCPzC25af23EVIFqhJ3fdjvJP?= =?utf-8?q?Lisv78rzeuGC8hWEtig5fm5uL+CFKMFexkE6/fL9aODuKJe4sxzpGud8aY1iK8s8H?= =?utf-8?q?woEydmNPz05fc5GhXoNaaBO2k+IijQINlsfCZqjY2Kgs/ms30sOWg7NxiOnqNLsLf?= =?utf-8?q?Z6iN1aKyKIAirJFLmKDMxhEstDahCu97jAAN+MN/ZSCpf84qn0UnEqyGU1ENwkAZf?= =?utf-8?q?on687vD8YQCn9I7e5ixp6l8iRJPc3UDf9y5Y+kIjgzMTPPoGJx30PEr/tOmteoBjc?= =?utf-8?q?6CBlElRheOiHVZR8b8y/Mg5f967T20x65FJ7YALLTWXu3Jwcvi4VCnSqulka3TAye?= =?utf-8?q?Vj74v/nKcdysEA5+6CvWvaCU1wJ5L0Ep+mscnsKxegrKm+X6DvTwI3fglfZy+2wSA?= =?utf-8?q?2+T+fTDeMSDYt5n9D2z9qHEV3F1fGZQw0ltig/JuBVFNWP2v8kLV+ofDZfZPSCHQ7?= =?utf-8?q?rbk3SZ6Brb+eR3Y/Z5xn9ODl5jqsOkYReYFi3tcU6QtCnIldyk+RpCV4x9vkVAeAf?= =?utf-8?q?Lvco6DxXP95Oyl04dtmEyUA056eOokrT+aYbFLkwoXPzlLhDfuvzXLpVpHq//b+nJ?= =?utf-8?q?CCT49G37BM90W4y+MeEmNMpO7ThUpfx3RHDHA+8KSCUCh1vEVbili9SYITxMHn+jS?= =?utf-8?q?80mFRWe9gayo41HHobiY29uSWEyv+QG1owtZMYPmAvPgTl/y6jvFbzBw+YP7Lcsw8?= =?utf-8?q?9DsCeGWVPTbnNDE+xrn64KvLhNsFntG1NLiPMBatC5uf/zxUNh8acA9nAiBGrc0Eg?= =?utf-8?q?T6TxakkksmMhmoDZDBA4Gvvud9PRzhYIlIaf8arg90geJxXRHs4pUCviEY68Emlyt?= =?utf-8?q?Mp2cppYpHFunaWhMz1OMhhx0XXXrmZS+wZ8gvZcD5yhDqUxFG/JnV92ei6QbbPvAN?= =?utf-8?q?r9CkKJzM3mb9WmVNxCbEOmGaUXtizMLonAPbB5ANL7UD8QrfOXZeSaMfqi+O7ee+W?= =?utf-8?q?lspvfjkgXkcXVcV+94iEm+ysyxdT8RUO/RNN4TiiEhxkKByi/MbkA6KV0Im8QVEn/?= =?utf-8?q?PZ+kt4wgLaZ1JA8NyRPx9PsRpdlvD/uqfwkePoHhGWLoqr2Q12eMZBY1XtCyQsJx+?= =?utf-8?q?+X8L/yTzUPHqKGK1Frp60m6K1zQrwNHvogYvcXc+fFKXnylH4LSTXw=3D?= X-Forefront-Antispam-Report: CIP:216.228.118.232; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge1.nvidia.com; CAT:NONE; SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 13:40:55.6273 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f94c94ba-1e2e-42f7-f298-08dd1f699918 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.232]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000044EF.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8726 Received-SPF: softfail client-ip=2a01:111:f403:2009::624; envelope-from=avihaih@nvidia.com; helo=NAM10-BN7-obe.outbound.protection.outlook.com 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, SPF_HELO_PASS=-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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org After being removed from VFIO and dirty limit, migration_is_active() no longer has any users outside the migration subsystem, and in fact, it's only used in migration.c. Unexport it and also relocate it so it can be made static. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater Acked-by: Peter Xu --- include/migration/misc.h | 1 - migration/migration.c | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index ad1e25826a..c0e23fdac9 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -53,7 +53,6 @@ void dump_vmstate_json_to_file(FILE *out_fp); void migration_object_init(void); void migration_shutdown(void); -bool migration_is_active(void); bool migration_is_running(void); bool migration_thread_is_self(void); diff --git a/migration/migration.c b/migration/migration.c index 18ca60af4f..5bb0633e37 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1139,6 +1139,14 @@ bool migration_is_running(void) } } +static bool migration_is_active(void) +{ + MigrationState *s = current_migration; + + return (s->state == MIGRATION_STATUS_ACTIVE || + s->state == MIGRATION_STATUS_POSTCOPY_ACTIVE); +} + static bool migrate_show_downtime(MigrationState *s) { return (s->state == MIGRATION_STATUS_COMPLETED) || migration_in_postcopy(); @@ -1637,14 +1645,6 @@ bool migration_in_bg_snapshot(void) return migrate_background_snapshot() && migration_is_running(); } -bool migration_is_active(void) -{ - MigrationState *s = current_migration; - - return (s->state == MIGRATION_STATUS_ACTIVE || - s->state == MIGRATION_STATUS_POSTCOPY_ACTIVE); -} - bool migration_thread_is_self(void) { MigrationState *s = current_migration;