From patchwork Mon Dec 16 09:46:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avihai Horon X-Patchwork-Id: 13909462 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 4869FE77180 for ; Mon, 16 Dec 2024 09:52:18 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tN7lu-0006bW-7z; Mon, 16 Dec 2024 04:52:14 -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 1tN7ls-0006bJ-Pw for qemu-devel@nongnu.org; Mon, 16 Dec 2024 04:52:12 -0500 Received: from mail-sn1nam02on2084.outbound.protection.outlook.com ([40.107.96.84] helo=NAM02-SN1-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 1tN7lr-0004t9-0f for qemu-devel@nongnu.org; Mon, 16 Dec 2024 04:52:12 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IjrMs42in3gO25UkVjAyIPqXGriLPVoe0okBA1gwXyF5n6RCwdIQ7PDv904/4ApGHJMK10O0MrZWnGIYjcWol2ZRLvsmx4gYIkH0k65uedXB5fL8S7NoQYAGlgK87i4C/+dyK+xPqmkUWC0h8xMc5pvIW1vAmxaw6OJq2hzFHq3zdEMW1IwcMvvVH05i2kYZ+Eql6A2Y5TxMwyE7RfzLglyFLnHU4M3mrtzE3sLwM8XvOZCZ3qSwhI5bgeBUwNJD0v0yM9JZuvB4RLAYK+/636APHlUVicNQT5NyORliUXuYwV776MQ2AxTj1tpGlKCdc6wtujC8XBkpIlOK78OpCA== 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=2F/vA4U5vm+OvnHBse+FyTyoWwUteRMZnak7fl4ig8U=; b=G+5yIVZItO3u6UZCUy3OF9rBaYYz8YrT7rtvIyQsPogn77d2ZLWSKzs2gx+6zljeM47D3oysmTL03FqoGaVACoNRwd9jxTks9JAbOwZ5B90zv/CTPRkQ2x60oahMw6dl6uX82dRcdiCB+qgDgrE/5o4aaCDG5I3PZu5i0mChKhK+iQwsabGbTpeKFJeT5nfNxPrKmQoKt3kdEOGdY8QMG77wcuq3SNJNfRe3tDyDnIFwLp2y8ncTUxzGpw/G+FEamAE+fRxptP68Po2UUNRicEOkvrBb/P9MqF4HzhSuMKPDf5zB5poqjkJW+HUBqMFYFeayYGfDaoQJdxjZzwbTPw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=2F/vA4U5vm+OvnHBse+FyTyoWwUteRMZnak7fl4ig8U=; b=L6j4ynJ1NnSCJutJ3uZRGcUESK0brjege8KrWlLawosGRx06v48lbYmTJ0Lcx586qabHKbzHuXr9t3vwKxuJMz0S77CdIMHCUwv3BW4Sjk72qgrkyM7XvSZPwO+Grq7lGB+qXzF8qJo4zV8YNEJdKOPLlTkXq/wIjTYCgv4/9Poe5xzMLaee86b4Lco4jSU0aKqsLJkKIgz00QPoi7zEcUFR0xLb77rn8CblvCftu6JpVc/2OJnDNBDsWVxjQvnJlZCgF3PLJzYra3ZeULhvu6UgZfijtmgItlYpONyD5Rk9InzWaUirT0LFgQQ3zbca7amNeIapjdQeRa6SDAqohA== Received: from SJ0PR13CA0123.namprd13.prod.outlook.com (2603:10b6:a03:2c6::8) by SJ1PR12MB6196.namprd12.prod.outlook.com (2603:10b6:a03:456::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Mon, 16 Dec 2024 09:47:03 +0000 Received: from SJ1PEPF000023DA.namprd21.prod.outlook.com (2603:10b6:a03:2c6:cafe::19) by SJ0PR13CA0123.outlook.office365.com (2603:10b6:a03:2c6::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8251.20 via Frontend Transport; Mon, 16 Dec 2024 09:47:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SJ1PEPF000023DA.mail.protection.outlook.com (10.167.244.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.0 via Frontend Transport; Mon, 16 Dec 2024 09:47:03 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 16 Dec 2024 01:46:44 -0800 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 16 Dec 2024 01:46:43 -0800 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 16 Dec 2024 01:46: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 , Maor Gottlieb , Avihai Horon Subject: [PATCH 1/9] vfio/container: Add dirty tracking started flag Date: Mon, 16 Dec 2024 11:46:30 +0200 Message-ID: <20241216094638.26406-2-avihaih@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20241216094638.26406-1-avihaih@nvidia.com> References: <20241216094638.26406-1-avihaih@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF000023DA:EE_|SJ1PR12MB6196:EE_ X-MS-Office365-Filtering-Correlation-Id: b9343ac2-9b5a-4743-6c70-08dd1db6988d 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: UuFyjwtHqtr0zGRvrOeKOKnqSeVZ1zsiWeoeepOBlLAGPYUygsTJddr37XflMNiGk8dcVYFMrEiJEDyd4o9WYXZ4aFays7MWaF6O2h8iXx3M8vjOuYs9i5qiHgEljO1saPl1/ovVG1cdsxluc33lWYI7+WztLBWO5opqCEK1EClm7XnJXuXPqOJ0NMas+b4NO2GcZl2zJ0Edzc5D5xev63NQEMj64FWIkg15+Pl8kU9/Uco2P/R0AEQob6W4q5OOgO0oav1MMixaHj8tr4j+G9K+EuF5DTqGLNocHM8R6AVHak6PkAp4yCG133miup157b/n7WndLo4Uj1oSfvbhOvvDYYlNldnmfR0QhU9AHPc+LTWaUs4d0UQVFFc8ivNS1IMaEr51dYb6C2G7dxurVakJN3UdRf0+xS4eAkuQO/dzQywvHJzPAC6O+cNvp0igCH0xXa0z6lbZ8k6VHQFbL1od9IE834O7qBeeYZHBk9ff/TcREYkZt7ErHJ2ypIXVbhR3mmmqx+PPXm9IEP0ChuI0ZMUoRREdC13UFB1w5MTm3d23xvMOyiSTp+UoliVz3DgiIzaYbA7dbW/xTmdvpgB3bZo1lbwRSrCTATb18JgTu/ZHplSkymxQDPHr3s3bVjMLYUls3EFCTSEKC+tfXGbMg7qb8aPvcnc2p1K2syOPS5cw+tY+W0Rzgoc2EKRPz4OWD+P6NIZdjzjZJ8NGBBCPYN3lZNtk8UDYbKw36HKeeBkkMIiJqgfrTtB/+LzI4mob9VVDcFHzZT+FJCMehWKhfEoi4qfJeDm6CSY36oF0xQNCcDJy+8oZj/kmX4YB9gLppfd0AGyFWwj8IIdhic+7PqDWAliUgA5INFyOkoAzGBvVd287p5kTZwFBWkHcHBfIqJpcvt7lvVmoldMMuZ+AC6A7MDOIIZt9Wplo7U7Sh0qYoTYq2AJ8L6uXQd3ZcocW4/weYZIEEz9emrLWbgnXejifG3jIAg1O1HG+zSTLSm0CBI97VgBqmKkzrqaTvxFapRMgxqVTM7U4xCQwTXn295vbCNsW0pZSXEFcH3OucllqI/O1TiGkRCKd+wqXHa4Rz7sy58P7RPfEVPnYi5b84FkrpFWzmoQZ5Vim9Op2o0cOWViDKBUkwAGdDF/ExoJGbi/+vn6zK3FZ6h5mVcW8oOl6+Nt/diyvMst8SKRIx3V9kII0NB8VE/PncGQ3UIxqOMJ0yryhglAikjQTRBTUW2zRZV5M2aDjost4txXBuknbgQ57tC4dwMUxmJpdDAm6kEC7VBPWMJXdsCQQgBqQV41QuDPLTCgsBpion1K+jE5evBppJfE0thnZqwOYv3PtIuzAamS9q+sllf4MEI07u8LGQfIy1f6/CQzD2kEQ+/nEf7U6Ny24w3xpYIjmHy1A9L1KGbMMY7i5oX5MHaQ6An05yxV3UY/SfMOtpBlcMrj5onHkxWw6HzesCM8+qzIJkpRqjGSkUTejdv3IjGTZ84OCx8iK2BAddlcW3PY= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2024 09:47:03.5886 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b9343ac2-9b5a-4743-6c70-08dd1db6988d X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF000023DA.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6196 Received-SPF: softfail client-ip=40.107.96.84; envelope-from=avihaih@nvidia.com; helo=NAM02-SN1-obe.outbound.protection.outlook.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 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.168, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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 | 8 +++++++- 2 files changed, 8 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..48fc75cd62 100644 --- a/hw/vfio/container-base.c +++ b/hw/vfio/container-base.c @@ -64,13 +64,19 @@ 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); + 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 Mon Dec 16 09:46:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avihai Horon X-Patchwork-Id: 13909454 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 AD421E77180 for ; Mon, 16 Dec 2024 09:47:53 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tN7h5-0000Wl-RW; Mon, 16 Dec 2024 04:47:15 -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 1tN7h4-0000Wa-2X for qemu-devel@nongnu.org; Mon, 16 Dec 2024 04:47:14 -0500 Received: from mail-dm6nam12on2060f.outbound.protection.outlook.com ([2a01:111:f403:2417::60f] helo=NAM12-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 1tN7h2-0004ML-84 for qemu-devel@nongnu.org; Mon, 16 Dec 2024 04:47:13 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QfO1MhysJz8rH1nvxMAaNVG1SkmdcXFqoGr7K3rWxyH05PVL2fvZiRL5j8cvOQTfmp4jMD2wM08hfuwXmEnRn7Yw6N/Pyn7a/p5d9kvMRQhw9g/74FFduBnxHtIMdR8pG07YYyCcLYl/Cs7wbm17wxt+O2SERDP3xhtRgiL3R406EUfoRn0YYVpuwzMAoqimZ0MwFP7NZclO4D/aFBF2H94GBikZikrQS/wnYgiLEgtz4iPXiFIN14fjitmsC/Z8Jv37US87P1mDJTpjGWhZREpSKrt7gZGIAZVPqWhRGZHTsMlMQSeb0JSKiFna6fk3mUiU1wkeZj7KVz4n5QhOSQ== 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=lM9gghSegxOSpyH8vflVWUT1rpjWXEgZQ/Gkym8vnKU=; b=sY71Jgm1iYn/UzvBwVMLuVaEtXy+8X4Cwh63o3m5lmHPdOHhtRv8nPqeYb6XvZ6E6VpAx7KwVZKVe6weK+msxW9QjdfbFZZt9wwKH8XbRDExysRQ+j1MRB1+nQ7HjRanoA5+7q7J3rqg7f7YPbO7d5HQZvgQ+Tb1RkF8WwkRmFrqmRXwSLIsY6FjESIN1h3gxYMSZ++YlURj0CqMZEHmNeuOUTVvaLH9tlHqBszpzPD+dZ0aQpcdsjj6byE4cHf6t+0RQARMYRNAp0O35/71USTDgqsvVFOWvxBzAF14SWyq6h2tSVQ/sgkStt5LQJOh6NX+xeLqwnv7QdxxfjX1ag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=lM9gghSegxOSpyH8vflVWUT1rpjWXEgZQ/Gkym8vnKU=; b=X8EtIdamTTeAj/IiJQ3ZUuVOOdo/ch/LhhB//MD0TM3Gew29Tywxd6dXcToRsG15hP8yGr7nA/1i7h/5GbNIUI6BmSjPaWMe2CO/AD+Pq8Q2kjsl522QiYCw/dblnSLjL+mSZMUFdTOpGoHLOAaAx//PQ/Q/M1aPUJBslZMiQtpY3kFmg1ItwAhjmn3Rg8pumduH71DRSnYMBZTsvn9u/pZ9PV5wF1fmn+TGsd9VIHk7RHiP7zzsGXhvQ9w/3yGjc3ARqerhtJ3/QcBxGO96/EQ72jz/+Wp2ff9+xsybih/821KvUpDf+6wBZUQV9pdY2e3NegO8tHb8xwUREc4QcQ== Received: from SJ0PR05CA0155.namprd05.prod.outlook.com (2603:10b6:a03:339::10) by SA1PR12MB6971.namprd12.prod.outlook.com (2603:10b6:806:24e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.19; Mon, 16 Dec 2024 09:47:07 +0000 Received: from SJ1PEPF000023D9.namprd21.prod.outlook.com (2603:10b6:a03:339:cafe::67) by SJ0PR05CA0155.outlook.office365.com (2603:10b6:a03:339::10) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8251.21 via Frontend Transport; Mon, 16 Dec 2024 09:47:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SJ1PEPF000023D9.mail.protection.outlook.com (10.167.244.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.0 via Frontend Transport; Mon, 16 Dec 2024 09:47:06 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 16 Dec 2024 01:46:46 -0800 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 16 Dec 2024 01:46:46 -0800 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 16 Dec 2024 01:46:44 -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 , Maor Gottlieb , Avihai Horon Subject: [PATCH 2/9] vfio/migration: Refactor vfio_devices_all_dirty_tracking() logic Date: Mon, 16 Dec 2024 11:46:31 +0200 Message-ID: <20241216094638.26406-3-avihaih@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20241216094638.26406-1-avihaih@nvidia.com> References: <20241216094638.26406-1-avihaih@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF000023D9:EE_|SA1PR12MB6971:EE_ X-MS-Office365-Filtering-Correlation-Id: 53db2bba-874c-4011-46f3-08dd1db69a35 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|376014|1800799024; X-Microsoft-Antispam-Message-Info: oH8l98/LCIUEtSF/ia0EI+IMWPgLU1ngA6EVMqjTPhe2dTxlkNIZFDijsfRm4mlWl5sJIswCIpS3gXm1KAfhLGnyZLgX7yCAzm72pfCftInj60ATa6sjov10YcDantUSj4bKUPmt4Hk5x4DnCeFfEAd9RWVULUXEJ14wi/2YlSaUWp+cYbaBBllpsEGatE9tUtCh5WiXuV7kfg0eX/cWNT87YZZ2ptkKcYq9/ujpkvp2GC4O9qU293Uvdvw0wTdsiyNrpXHEge743JmkNVhUnd0AUDZAGsOWe7NPQZhdyOfMFYhkGQIgWMuCOFncUTnBlx4sA57gF2SVy6TmSQT0JukguWThOVF9gCmYV2/36p4wJ797mh4UtgfP945l0qszfTN1bOdh1+32366HDVnoZ6zT4WDav1+H/ClU5YGS6z2FkdhFi9z7OXJ9AKilBOIyeQ+tLohVgMi8jMh2ErNXOGGo5p9D7+iugN2VQ5LL8Fep9hLeZRa73bRQ1oDTYx7AMhvHP79NamMO/efIiPZrHZk9cvMUK6l9Flu4zWgGpkJx5hhQIuWZG+3Wf3QFFXbKhjyo+N6/qqdISQHqp46wiK+WLQ1yR3DjgT6r6AK8aCDKTTviA8+5o3BRXN9KmcMrE6w9i0mNdjLIiGQzIKlRvr08vGpmKqf3yNj2YgAEOZVQwtKv7sCvrZpkD8OTU4sJx7FalQKxtPXzbDnKOEWFvZhU8MBZ7RXsfyPOuzoG7bdsFLzP2MOmC3BYrx3OXnR7C7hINLwutrxEiNp6cYFkC9sar7hr9KEkzx09DsEkBlybYAkrDKMPZMr3gIb3ZVFPdFdhpk+9rSlN7d1+CnWyR5pUToCh7Po8yGl/YTonnKlkf6GzwquodZpc4R1FlgduRtOLXhHk9y5U1pz+UjrRMMgbE/kkf90Tk/02Clwq0ok6UEiz/T/H3hLXYNP5nIU+wZW+xkK8x3kIroXl9Axa52r2QJM2bcJwS6JzdlrJ9G47zuXikXDTd2GU+2MYsoEVe6dTa3J30B8GBCxKhBe4eByi3M7u6ZF+yGRXutq13RY2bQiDdMpThoBxhlqLJaYwlNjnEo9D+GePJmfE1imOhP2ktGyNVbT7ptg9PQr+jc5VdQP4ZeaeN7OJYd1HjWWfDt4VTCC2GSzqBRfL5FmZRYqkqtzED/viQbqfydmEY8Xrim/40oX10GaYRbL8bbm8bDlGfzh4QwAECHHaCt1rAukfiKJ1M1J7tk7qHpqVKMOwdCSdPlmvrsgpfdB1d8VKc1HyIcwZLby05GYyjD6EILrFNKY/bBCbnKQO85RwKWcI/Am+AE7zTiPFvIcp0lqMMgE0qEbjOsa+h7/fqXnSoPZr2is/R8tiinFWfvrXfUMKW2TcivrdLGYA9QybO3rOXRi5x5uq6HmQ3YtOZlDiLQPP55HUSmcx6jkuIRsRNDWgrNaitRaVSwiyBzM24W2FTKdwEXc472tEo6vxCbZQEkVx/A8BhE8Z/BpEMhx+Y0I= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(36860700013)(82310400026)(376014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2024 09:47:06.3508 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 53db2bba-874c-4011-46f3-08dd1db69a35 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF000023D9.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6971 Received-SPF: softfail client-ip=2a01:111:f403:2417::60f; envelope-from=avihaih@nvidia.com; helo=NAM12-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 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. Signed-off-by: Avihai Horon Signed-off-by: Joao Martins --- hw/vfio/common.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index dcef44fe55..a99796403e 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -170,11 +170,30 @@ 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 (!migration_is_running()) { + return false; + } + + if (!(vfio_devices_all_device_dirty_tracking_started(bcontainer) || + bcontainer->dirty_pages_started)) { return false; } From patchwork Mon Dec 16 09:46:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avihai Horon X-Patchwork-Id: 13909455 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 1EFD4E77180 for ; Mon, 16 Dec 2024 09:48:06 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tN7h8-0000XM-Qw; Mon, 16 Dec 2024 04:47:18 -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 1tN7h6-0000X4-Ka for qemu-devel@nongnu.org; Mon, 16 Dec 2024 04:47:17 -0500 Received: from mail-co1nam11on2062a.outbound.protection.outlook.com ([2a01:111:f403:2416::62a] helo=NAM11-CO1-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 1tN7h4-0004MQ-P5 for qemu-devel@nongnu.org; Mon, 16 Dec 2024 04:47:16 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WzQlo9uqNT8I7HELFuIX5w556muQrtDTdz9WROWAkibNUPnsUCZKx9xoLnv2Mu2pf3PBKreRfPvBLU2h6IdxtCEK+b6gpp7DiBgVHbATxL3tubLWGkwL43N4XTIodZ3d2+Zv4fTspv3W36ffMr1HEvkd4+aaTgb30pxGaQh8A4GlW10ZIY2R3RSLWM5innXizXBlf8bQiuCR/HtRyR4johmAG+3NHCIAr36AFmxburqaugx1bfztxwt9dzo4qrf7AVoeMd3yjiAP6P383ju2eCZB1r+Ju4t716pt5SNel3Yk0efCfN6Lm++XsYcojXHsC2yJNYePJYytGEbQnoNmiw== 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=QLHrEJluMTpfJiGRKKnzy/R6+v/rtPavVRfMOXmStSw=; b=UANZa13XTzHU6TeTNXcsLC05DN8CeAmcdHRqFwASuddNvl5YHBAUapW0R9sJSKDrugkFAU+VdYPCni5xE4uyBM31NYHePiW+q9+CU/hshRKzRmftspYqWpucF8a+EVcqwfNj57gYFBhUSEpHwzuvnQeuaxWBoIZsbuUnF/q04FNlWQbslk7QU5HxwBYZrUynXO3iXMvMzaWjgmAiz4nvjwQR7EXAyDWklbqmNODZkdIf6EOtBqwyugVevc53lSO37cjMXGDr9+EToKjx5SA9LfeVb5X0kIzx0fQfjAKi21qsEyGYXbG3Xif6R2Y4inCUyABp/zs8/2I7Tf6SrLqcAA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=QLHrEJluMTpfJiGRKKnzy/R6+v/rtPavVRfMOXmStSw=; b=m4+bLaE10CHkVb2fL1sGRH6CQK+FdT5hwbUsPU/ecM8SVZHk29hQE6+slpLg8/WHbBtpBtyWKxXs9JfqP2tLGi8FNQeBqOFojTDSoCVpSzBNj1BZoF0mCL91jOK/JFd3xwo6tLlZfuBozw9R9C2cxmxmK37FL5G2+k0cgGHzS4AiexhpYKrx8pNdYoCtP97kuRPp8BqtsFuR9ZgeyUp//v85GEnJeaa+pBd/2jZBVpkLiUHPYkTyHu9OpKGtm3mplq3C8OPVJouyqtfKN3M5vJ510VZbfXCq0LdVyQLtZk+gZV0+y88oxg5ty9ARdORL62BAiXpaMi/SrjLU7wg4/w== Received: from MW4PR04CA0350.namprd04.prod.outlook.com (2603:10b6:303:8a::25) by SA3PR12MB9225.namprd12.prod.outlook.com (2603:10b6:806:39e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Mon, 16 Dec 2024 09:47:09 +0000 Received: from CO1PEPF000066EC.namprd05.prod.outlook.com (2603:10b6:303:8a:cafe::9) by MW4PR04CA0350.outlook.office365.com (2603:10b6:303:8a::25) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8251.21 via Frontend Transport; Mon, 16 Dec 2024 09:47:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1PEPF000066EC.mail.protection.outlook.com (10.167.249.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15 via Frontend Transport; Mon, 16 Dec 2024 09:47:08 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 16 Dec 2024 01:46:49 -0800 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 16 Dec 2024 01:46:49 -0800 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 16 Dec 2024 01:46:47 -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 , Maor Gottlieb , Avihai Horon Subject: [PATCH 3/9] vfio/migration: Refactor vfio_devices_all_running_and_mig_active() logic Date: Mon, 16 Dec 2024 11:46:32 +0200 Message-ID: <20241216094638.26406-4-avihaih@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20241216094638.26406-1-avihaih@nvidia.com> References: <20241216094638.26406-1-avihaih@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000066EC:EE_|SA3PR12MB9225:EE_ X-MS-Office365-Filtering-Correlation-Id: 2e3498ba-6b66-48b7-08bc-08dd1db69b51 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: bTbFtHQsANSoL7QSFyoOAxY7BJG3DQ4s+QVqu/pEIc3gpFokruBj+kpNg4FkSJ5/dBSmwadbi6kGPl/kwEOoHU957+U2xiVROcRo7fJG+gRxPOCpbD6zxVjyoxmxfuMtOPt3eYfxF0QVC1dkcsmKKLuBr28NOR0ZCX81XSpkie2Rss7gnIyUfxIA0qwAvIbRjB73eHGD2Sz51sloVdBpHt93Usnv/tOa+ZF6V6cdJ+3Uo0qxP68j0lRGk7snLDjL5yrPqkOS8g6/JfsM7bitweA60Os6f9Qi5Q7h/rxq3dQLayfyPmdHHG0RzMJyPIN+ZpPX8JorWG50y4250hHjPdshcTgQYiPrlHqRh0kmQcDtFmDF2rOevhBWNjFnz14prsd5Cw3/9f1SX8rM/YKpxFw6jnIn27ctFQN04FdDhnJZFtyU2PGPe6I/ByQproRqpT8sGln2aslIeFWEKo29DJ3N/tQMeEGtpN5CkC0gzDFJ8zGnBbRgTViOThpLmuMs4Fo3TtG0G6RecSBsnMTaEF6CSJrEDtttD2F7W297AswNoNtSrR+gdfRV1mNAqvAF8MHfwjFjC9/zypQRAkCBEMhZOuTpJuFSL7ixvYSZO3ZC0+1EYuc/ltQz4EjAUouGLDcNKJub0nOR4NutrjAkkvXrIH1HCE9L6/fkHVoxJD2pSacA0mqSclveW0PBBJqpDEKO/iWLBBGofxE33+ptyzZi4yMceq60a8niZbjdK4PZvzc/2JZBdDMCpqvCUVlPnQv+pjEj+MgIu896U83K4+0SXZ313xOEf1+jsMpOI2KPUnVhSX+gNhgKD0uKK9ikPslsUmVUvqzafrU1w7V2unZd3Xl3007JA0OKNGvy8ob4TsSkWp80I5vZ2U6fH+FaqWfOiVckcqRGA5hfGhIvfx/7BKsaoFlPONNbWtCSxPfXCebLh2XqL+2pKNS6GkhY8lP3AyagI9ywhyrhOExMmXfheQiae4X/6Cfloss7DDL/aRQ/ibkIH9Ykau/b8AtfQ+x1MFiFCLqwzmUE4RK1ZM+hqpz4ucGKYusB1eO9/iYVeS9c2K4P9zbsU+mjJyEUMFKvlXAU4/C0HcLeb4/hgD2OrihiIE80DFKUjbo3T9HVyp5rLZZNCuiMOYqsiIoOhgJeJ3LGZLJqU+Zd0Sqzgiry98uPk7HL8zcfdjsFpYQxBXSGB3/avu1tPN3SMaNRWdV5o5t8QfF90XKLYDbSmUt5GVazWKoeZWaCgQEeBOn01lmra6ApmYi5032rcGLrxkiJi+CJth6/La4KTuQ9GYmRzfKilNEt3sFCXBW7/iZ1/Sgj67aSavaPDtiRM31FbbdZCrLdabbGHWQ4N8lmBx9qQfhezj/1Jy/RYwTfN0kWwZ9JkyAcfaL2PG57uVUezzkWh/0QF7b73L2kiPs/hWa42j3PZmB+Y0CWS35a2i2+IjZn9gYRZ4emK6Y+erAcWmYZwMbn7Xw/0CkkJ+nFTmcdazeb4toEJOQ9on1SSZc= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(82310400026)(1800799024)(376014)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2024 09:47:08.2573 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2e3498ba-6b66-48b7-08bc-08dd1db69b51 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000066EC.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB9225 Received-SPF: softfail client-ip=2a01:111:f403:2416::62a; envelope-from=avihaih@nvidia.com; helo=NAM11-CO1-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 modifying the logic to check if migration is running and dirty tracking has been started. This should be equivalent to the previous logic because when the guest is stopped there shouldn't be DMA unmaps coming from it. Also rename the function properly. Signed-off-by: Avihai Horon Reviewed-by: Joao Martins --- include/hw/vfio/vfio-common.h | 3 +-- hw/vfio/common.c | 28 ++++------------------------ hw/vfio/container.c | 2 +- 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h index e0ce6ec3a9..c23ca34871 100644 --- a/include/hw/vfio/vfio-common.h +++ b/include/hw/vfio/vfio-common.h @@ -296,8 +296,7 @@ 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_dma_unmap_dirty_sync_needed(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 a99796403e..81fba81a6f 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -229,34 +229,14 @@ 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) +bool vfio_dma_unmap_dirty_sync_needed(const VFIOContainerBase *bcontainer) { - VFIODevice *vbasedev; - - if (!migration_is_active()) { + if (!migration_is_running()) { 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; + return vfio_devices_all_device_dirty_tracking_started(bcontainer) || + bcontainer->dirty_pages_started; } static bool vfio_listener_skipped_section(MemoryRegionSection *section) diff --git a/hw/vfio/container.c b/hw/vfio/container.c index 9ccdb639ac..8107873534 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_dma_unmap_dirty_sync_needed(bcontainer)) { if (!vfio_devices_all_device_dirty_tracking(bcontainer) && bcontainer->dirty_pages_supported) { return vfio_dma_unmap_bitmap(container, iova, size, iotlb); From patchwork Mon Dec 16 09:46:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avihai Horon X-Patchwork-Id: 13909458 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 1087BE77180 for ; Mon, 16 Dec 2024 09:48:50 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tN7hA-0000Xm-Ol; Mon, 16 Dec 2024 04:47: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 1tN7h6-0000Wt-ER for qemu-devel@nongnu.org; Mon, 16 Dec 2024 04:47:16 -0500 Received: from mail-bn8nam04on20611.outbound.protection.outlook.com ([2a01:111:f403:2408::611] 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 1tN7h4-0004MT-KC for qemu-devel@nongnu.org; Mon, 16 Dec 2024 04:47:16 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dohC4UcC9U9IG5q5BbKZyGl2XvspqQHJvh/fhkVqaa5nT7gRY12WDwT+iIzzCTyZ7OyjqcDTVxEUnASzU4Dwt0H8iQMBtxrQi+qAnbnjympQyqU1VHywb4A8O3MTmrzSvVw6LHDmHLxwgQdvTfXcr91OdY/F6iN3/m+REJFqi0qG2qxsuyuGGNIMvQx68O7A700ohq/qvmd9bzO5ZaN97YZrqadokUNsJPBgZ2z66uy6MYDBsGEPJcwJLz9ZPo3I+6vbTJrbJuA+qNDrvvSKwOdS3N07hRj8WXue9Rfo/cOmCTUdHGWRWnC6zToV59sx6Ymh3y5/7Ss/KbnBIXOGKA== 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=fb4/3P7mjpTmCiwwS3JIXOxIVE8h13YyunD8pbbeAp4=; b=eUGonhODcS5KONFJqviXfAhGZAk0Sk5D5HqjJq4JhPFIQJqzCMLrmnJKT7BnZFKvI4HioPcGRfFnpJtxy6OihxU73OlaaLe9bMcSlEGcl2pPV7Y7fKgA12kTQuFORrYV3t5ShQQ0afliY/JoDZQQInHinhxwNT0u5KIINFMNRVWhp0rQsWb7cCXLBFAnZVVKQuk5NH09YcUKDZBMkdNQgEm2pjqDE41aNINFPlC/FWbY39b14XLrzHiRc3n9up58aMBtsCxe8BicvxdmxQX8K+TEF+zBn1lE/NL61uJYw3T4yYhh8KUcBtQMpY8XfD+i2cpMNUqgbiuwPDCEv9B/+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=fb4/3P7mjpTmCiwwS3JIXOxIVE8h13YyunD8pbbeAp4=; b=NrE5hXVq6uQUzcafWTkmLU4nKfbc0fKuIUvLRiAXeFgcCEMEyVxiudjDU5M1Vn2lDG6jNDdiuK6JtRRdo6G/LGpnQ5SUTsIGtm9L+Rs/vnpa0q2G2h0ZALeqsLKwxv3B9ba7n9pgFf6fIC13bx/K29nwwA5hFilqDIEIc6S/U4BWQ9DFE9RsTkL7FhW1aDQqoja3a7oAtK5dPwFMb9MOCB7O54dNyyRuhnapyxYUfE4FIfw0Cv5/wFPL2zQoVRJDrlS2PJQ33BuluvNov9nIgK1iplKP+CsqN6cvU/NMxV+/R9TMO1UelTwNyHngyMboyJ5XP+EXT4M5G2vDTbBC5g== Received: from BY3PR03CA0022.namprd03.prod.outlook.com (2603:10b6:a03:39a::27) by MN2PR12MB4456.namprd12.prod.outlook.com (2603:10b6:208:266::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.18; Mon, 16 Dec 2024 09:47:10 +0000 Received: from CO1PEPF000066E6.namprd05.prod.outlook.com (2603:10b6:a03:39a:cafe::3b) by BY3PR03CA0022.outlook.office365.com (2603:10b6:a03:39a::27) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8251.20 via Frontend Transport; Mon, 16 Dec 2024 09:47:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1PEPF000066E6.mail.protection.outlook.com (10.167.249.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15 via Frontend Transport; Mon, 16 Dec 2024 09:47:09 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 16 Dec 2024 01:46:52 -0800 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 16 Dec 2024 01:46:52 -0800 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 16 Dec 2024 01:46:49 -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 , Maor Gottlieb , Avihai Horon Subject: [PATCH 4/9] vfio/migration: Add vfio_devices_all_dirty_tracking_started() helper Date: Mon, 16 Dec 2024 11:46:33 +0200 Message-ID: <20241216094638.26406-5-avihaih@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20241216094638.26406-1-avihaih@nvidia.com> References: <20241216094638.26406-1-avihaih@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000066E6:EE_|MN2PR12MB4456:EE_ X-MS-Office365-Filtering-Correlation-Id: 3c98c874-72c1-406b-5b8a-08dd1db69c46 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: xQGGwWscxdUeDDfhvdQG2JUNDNA0lmoBGQm6LbgHnra9/NUzK/2AsnUjJeok+skC87ODFk5bLr2thWdSfnjxegSCbrnMM9eGM1XeUnvTGXkuYe1E8xVyWXTq7SE6jFt1aXvGYkJt45th0v1GKTiXFtJPt3t7YMYsqKTVdCr8dLJJLPgXLZ7XQU/cMUpzLRz/+z+aVNz7vQd5QdI0qSVPmNalunH7nrMjFBLasXqZmSPX8CeWUjtkt5xXb7BdhCyfe6vgeP5x7cPyn28+D+vBH+hNejiiEZ636whfjt/CvaZ7OlMiPWL3HtjdmB67+xb4LMM6xZomAnjMWfx4MqpO4MEyM2N0eUDY8ZvlgpWFq8ZJseDLZ3TJhKucNXMB6l3BE2cG2v2OvxEyJs15I9X/RASd3/xr+LQVAq5GIgftJAh3QguVW8Zqx24te+fBrdI5tKp4eozIueV91LSf7wtTBQG+rUBBIyzuF3zGt9wn1WjU9mkcJi6+SI4gawrjV/byL9gHw0mizt9nUTajDM3wIPF3fDZQWus+CcG8IhM0NqU++WV4VPCC45e6vbogVxCR8kzlHnfmLIeX6PrkmX86ySCcsIC8S9TPjLDt/RK2OkXBo/ixOTItnZT57snppeVRvLC93lunIu64wlBy8IcHoPyWsg9W32Y3eV0JByEWWDERSCwJC+axHIquQo6UO5T9nzC04usCyynWH3OBdyoHF6cpxfY1Z4fqScCDiDgt0ZmYrFiuTnnbmx0DDGaU2a66Em2kf0722eFEeWc2Rb9oap7nRsi1FlikmYzishbWyFI8dBp9zlYOLLPp80hgFnZFCcHTLNjZZ3dDWnUfybPyTvDx13kyK3o3Lbw14oetZ02PDDDZgjsw927U4ryWps6cYVCIXt+GrCWQQhX+QINeh8zyHxq9OrLD4huWuBsAMcQL432imx6rrOBFOxPzd9axtkH0TL7wxEfN9Viq8Ww4tfc0JKepttPVTHRKBryFGhKbvjr1ixdZ28TTSZOc23+htaFZk7BxDnuNpq6q39BbCtwnbzzNJTr89/oWDEvI75Vf+voLtz1hgCVIFPJYuGHH04rOPE6NuVYwbgNC/+drqbeDszkrVcksy4nIA/H/V/j8jdGB2/ILIWgL9OHxm6zWL8URdTx5rLo1NpL/0dgvC0wzWviFmT132CPsBPfr/o66vsfiVCbzS5Un6Pn3Kq6q1ERqaJJUxZ3ofQ66Lr1eeBmalO+zvVsBmIOP5mcJ7hZ1lhHKCkuzofEu27HR3du7xWKh+h2Om2iOY77zpxjHcduA651Soesoa2CUdDDGl0s0ZBu5XBzikmJfTyYaZkzVhNQPIDI8kM4dN9DMcpuvkOR/Harz1NWXwJPX/3CuiTJyInL5+x87biGbALJ2ruTijbu2lPE3hhvGuIm7oKJUxlgBgHFaSPF2N132AplG8/4sUmae5qy7zlENL7vYCQH+eMfS/T8ia+ir8nwO1kodHzCjOBNB+vH/mxeExxT16MI= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(82310400026)(1800799024)(376014)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2024 09:47:09.8494 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3c98c874-72c1-406b-5b8a-08dd1db69c46 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000066E6.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4456 Received-SPF: softfail client-ip=2a01:111:f403:2408::611; 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 vfio_devices_all_dirty_tracking() and vfio_dma_unmap_dirty_sync_needed() share the same code that checks if dirty page tracking has been started. Extract it to a common helper vfio_devices_all_dirty_tracking_started(). Signed-off-by: Avihai Horon Reviewed-by: Joao Martins --- hw/vfio/common.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 81fba81a6f..45783982c9 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -184,16 +184,22 @@ static bool vfio_devices_all_device_dirty_tracking_started( return true; } +static bool +vfio_devices_all_dirty_tracking_started(const VFIOContainerBase *bcontainer) +{ + if (!migration_is_running()) { + return false; + } + + 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 (!migration_is_running()) { - return false; - } - - if (!(vfio_devices_all_device_dirty_tracking_started(bcontainer) || - bcontainer->dirty_pages_started)) { + if (!vfio_devices_all_dirty_tracking_started(bcontainer)) { return false; } @@ -231,12 +237,7 @@ bool vfio_devices_all_device_dirty_tracking(const VFIOContainerBase *bcontainer) bool vfio_dma_unmap_dirty_sync_needed(const VFIOContainerBase *bcontainer) { - if (!migration_is_running()) { - return false; - } - - return vfio_devices_all_device_dirty_tracking_started(bcontainer) || - bcontainer->dirty_pages_started; + return vfio_devices_all_dirty_tracking_started(bcontainer); } static bool vfio_listener_skipped_section(MemoryRegionSection *section) From patchwork Mon Dec 16 09:46:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avihai Horon X-Patchwork-Id: 13909461 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 96C5AE77180 for ; Mon, 16 Dec 2024 09:49:06 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tN7hE-0000YE-R3; Mon, 16 Dec 2024 04:47:24 -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 1tN7hA-0000Xo-Bj for qemu-devel@nongnu.org; Mon, 16 Dec 2024 04:47:20 -0500 Received: from mail-dm6nam04on20630.outbound.protection.outlook.com ([2a01:111:f403:2409::630] helo=NAM04-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 1tN7h8-0004Mt-JX for qemu-devel@nongnu.org; Mon, 16 Dec 2024 04:47:20 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=H+0xmMEtpknwhR/RweUc8EEmFGeQiJuT6ARg5jXHpjayykuFVe/3wiZFZH1zMYQMyFiSqf4eh6k6jl3F6h8uCLqwVaQFvWreG0jxNMAfDD/I8LZ5N1KZUjMAwG/vOSDALNG5BXzKYdf2gPYTld8FbejMfmC4oKs+MZup83o1td9tVTD3+4RJ8PvobIcdkq6G4OR7a5YBg1wRZOA9Z4IrdPqIxmreBrfx55QYQgEqNnfOM7AOUkOQSBM51n6C6OnzpzuNP6Wd8464LIOqTddJvKjEp1GZsGnMJmtq04Psi6RRUw5JhSr0fuLBmD2oxqTBXoFKO+JUEK+D/Cb4vUCJLg== 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=6gkGDnKDmRM2MU+wMZK0oDong1qMUIksKsF56IspXZc=; b=YfzPm6bF7rHLO8P0Ua6rA9m0Keil3rXCbJoVVWjl7ZgJtU5xJKGa5HvpdYgDJAqXgq9zkCGAqyxzCvAZ3CuSfHS26iumzFqFwgqEgq30Kt4vJo1I9Qi2SSgGJkfhveL4UOGqMl6mMwjULT4vIIlVipYTc2mQOrXoNZRw/F+8jHPd4ewmAyaVcrz30Tr7X1M/aa7kSQQsDczPn3rihEO2vJKXQVvysSHmnitkqZFPbCq7/lOxijU9CBjhT7gj2MQwwaXRjr5NzLBxJh+Ax+Ma3AdCY9l7tFhcd8YlVEIUm0QQ/Q7wZelxVvLiIc58DMlzKsd0ZzG/3ZRZ4bXvhXWMgg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=6gkGDnKDmRM2MU+wMZK0oDong1qMUIksKsF56IspXZc=; b=TdgTOkMiYRHslYAA4DGtujVodPk/npLj4wrr9pcyK5xyT7Ao3dDpv4DsdxBRs7xBklsJxtIZBfNWA+9+AVqcz1t+c6GvY4wNr3S/00wmZN5WzkrL9ar5KLZ/lbKv408i22SEVPSh5tZFjX//c9AItGaPSEFRpkiFZ/fIuIL0dhvSBlkk5YwsJ1wBnz7lntbe7Zcyayn7MkzxBFO2VOy4ogk9VvfCeO9n5m9Fwk79B2AWAd9w1pnlx0BXdLDLWf+Qi+9R/QWFA4PmnzbkUyd4eBJTrGgXI4AzX0WnKb1UKvMwvqIFjiQJUrba8r4M+lXYR8B5ouI0SQ1sy8VrY+ct6A== Received: from SJ0PR13CA0105.namprd13.prod.outlook.com (2603:10b6:a03:2c5::20) by CH3PR12MB7690.namprd12.prod.outlook.com (2603:10b6:610:14e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.20; Mon, 16 Dec 2024 09:47:14 +0000 Received: from SJ1PEPF000023D3.namprd21.prod.outlook.com (2603:10b6:a03:2c5:cafe::a7) by SJ0PR13CA0105.outlook.office365.com (2603:10b6:a03:2c5::20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8251.20 via Frontend Transport; Mon, 16 Dec 2024 09:47:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SJ1PEPF000023D3.mail.protection.outlook.com (10.167.244.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.0 via Frontend Transport; Mon, 16 Dec 2024 09:47:13 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 16 Dec 2024 01:46:55 -0800 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 16 Dec 2024 01:46:54 -0800 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 16 Dec 2024 01:46:52 -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 , Maor Gottlieb , Avihai Horon Subject: [PATCH 5/9] vfio/migration: Drop vfio_dma_unmap_dirty_sync_needed() Date: Mon, 16 Dec 2024 11:46:34 +0200 Message-ID: <20241216094638.26406-6-avihaih@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20241216094638.26406-1-avihaih@nvidia.com> References: <20241216094638.26406-1-avihaih@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF000023D3:EE_|CH3PR12MB7690:EE_ X-MS-Office365-Filtering-Correlation-Id: 2485c62d-962f-47ea-0dac-08dd1db69e4e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: GJNo0J3186EZtT47kU1u1kXqsvwER1LuL9Sqv2fTgQKJLdKc3Y5Gzmqye1KA3WCy6iL85lEzoir46NdSJzlfK9wwQV2nq8mgYc3AxyMeF6noOgWrNfaKItAeA4jH5Qd+Pr82mrZoz2UOeGm9lCSx5FUqXKTrxK+0k+pN1+7K2E8I4NAJV3RApnc0qLD4PH/A1lWYSX0QVlu6m+FoGTN945fNNmOfOOoBEPymJZnOcS0AF7CYDhEK4SEuXbJKQI0+vWKlK58edA1WO0aNIV/XsQahKX1v3U2uWB2PbM2IoJi2XioPu/hHW08Co3+ySbGEK8oqq0W8BG07Hmo85cODJDFaxYebPN6c1HCieOdieE6zRZuQJ1YM0E/AOKRDtWJI0SRFOh8p7B1y2lZW8k/0GxUfkcctIqIz+EWVpX4a6ef/hSmy1EEDHUxDD3nMxxMxF0d24kWstTuhoMDyHcIyn+6dOot8T6DzFqhDxnYPZdea2jxrBg99vYAanfsXzQPNl3mquq9ocg484W16j5KbCoyI4L9Q7MIRw8q59qmcaGMmvZQ7TG9bvq4xsjTC17f8P8Lysuo16QCzdmRjZKHBNo4r3Cwmzw1ATPBYt30LIRcK/LudR2/BUxeVzCsDxs3JcTT+ysV3ma8Do5M9heKfYjb+aEuYpn65gGBZDNewev2XYlKRTPUpkm8RPL6RQBeR0fPHM/XuOGxTEqnEVO5LLVRypmbunDF6YE6H66p77T3tKPjP83LadsfNTOE5tn3ZzGCIMBjexw965kM4rf1NTll4ee2kTl9+uTblriGiAxJh4ETBGHyyqNRqyAb1J8jts9R2FeCUWdaYVuIAAWTcCCodanWo1OfzrmVaRQlDQd855cvyjrLO4Ec26rJIwEQ8HqVFpA12GQAuuzDk7dgdPGtC1U2VyLsEedaY6R9vLYirxjEDaZwwimmUwKqmV+R/Smlk5s196A5v39wToa/iPT5S/8komm8O7dwGK519cw0zKdxC6NEY1JnI72x2igo+T5862uraCE3euUwDLQTU8nz06EHUo3algK8BBsIgM0vrpcDwm8/AC1BcrAp4p3TnAIqFitMRNnmXgjX/fg1IeT/NMAhc+Pvyv4CiDWY0xyUi8F52rxbj5zRaPyMdx8YzE+ovRY4x0gOTcKgCSqOWI54S6sj7cDNSgPoKgyCV0K3qRCzCFj29PGUf24FwVWFwdlpe/Rc/YeGDWMQ+jzJ8IWELOEuKAZvUEuD7oiqSN0B+4CdZ078dWCCI4U/RISTvqTC8ykXPiZqM054SO0PBVG1hgwwCWhoPZ518TxCPHkpgfIb0WXZF9GxVhK9yzYg0ClIl4QKjLAR03zDtABjlmxVmFYUNh8ffC/DJEngEFGsZHaZ7XVafdJHW7s3Qpr8V3brY9FkQUZ3iS7E+E3Kqi9Px9JbUjOr/li+RrLRY76rOiuY50Sdf4L/BfLrvNBe0CXucRevzRv9aKhOiEex+bDIjKyQegN1Loy3i+4dh6wY= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2024 09:47:13.3022 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2485c62d-962f-47ea-0dac-08dd1db69e4e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF000023D3.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7690 Received-SPF: softfail client-ip=2a01:111:f403:2409::630; envelope-from=avihaih@nvidia.com; helo=NAM04-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 There is no need for vfio_dma_unmap_dirty_sync_needed(), as it simply calls vfio_devices_all_dirty_tracking_started(). Drop vfio_dma_unmap_dirty_sync_needed(), export vfio_devices_all_dirty_tracking_started() and use it instead. Signed-off-by: Avihai Horon --- include/hw/vfio/vfio-common.h | 3 ++- hw/vfio/common.c | 9 ++------- hw/vfio/container.c | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h index c23ca34871..c5aa606890 100644 --- a/include/hw/vfio/vfio-common.h +++ b/include/hw/vfio/vfio-common.h @@ -296,7 +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_dma_unmap_dirty_sync_needed(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 45783982c9..6e4654218a 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -184,8 +184,8 @@ static bool vfio_devices_all_device_dirty_tracking_started( return true; } -static bool -vfio_devices_all_dirty_tracking_started(const VFIOContainerBase *bcontainer) +bool vfio_devices_all_dirty_tracking_started( + const VFIOContainerBase *bcontainer) { if (!migration_is_running()) { return false; @@ -235,11 +235,6 @@ bool vfio_devices_all_device_dirty_tracking(const VFIOContainerBase *bcontainer) return true; } -bool vfio_dma_unmap_dirty_sync_needed(const VFIOContainerBase *bcontainer) -{ - return vfio_devices_all_dirty_tracking_started(bcontainer); -} - 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 8107873534..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_dma_unmap_dirty_sync_needed(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 Mon Dec 16 09:46:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avihai Horon X-Patchwork-Id: 13909459 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 093DAE77180 for ; Mon, 16 Dec 2024 09:48:56 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tN7hN-0000Zm-6Y; Mon, 16 Dec 2024 04:47:34 -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 1tN7hJ-0000ZW-7G for qemu-devel@nongnu.org; Mon, 16 Dec 2024 04:47:29 -0500 Received: from mail-bn8nam11on2062c.outbound.protection.outlook.com ([2a01:111:f403:2414::62c] helo=NAM11-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 1tN7hH-0004Nd-Ha for qemu-devel@nongnu.org; Mon, 16 Dec 2024 04:47:28 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UKX7yRzpBj5c/FhLysFgzUvfSIF2X/pupvrSPmuKPptHHf0jQZt5sZeVFJlNoVR/1whQl9O7naBFEghtk8QRLS5ByKftunJZ1bj4ht8fL3lqhsiDqjucRfEYiCsvi9izHOV6BcLYXBOMTUu1Gp4gMg2n5d7Tg3BqBzBXDqOXEOfYefy8hHmBWllmqU7p7pRgRXU1ePj1rJM+Ay0RSha7PQXwpHZDh73QXa5RqWmy+/FOMjDvQ5hEZ31N1rmAnc1x3ZQ4Y6u9UnE2qYrgTyxhpF0byAgD8hZUflz79exirhLL4WzmvqbioJ6tnC+QlkUrMNj1/Oy2r/qDfuk+Z0zoRQ== 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=r1jFyooOR9bbc8ADSfxULEp0uavRGZn1SNL0Xp74KJ4=; b=gS98Vu7FbQM7uMJ0CGuxS6Ca+Cm+CIVdsLi5FqA+8G+o/0KYYTd8XJTr9E63ARjQa2OLaRkNxg8ZQJiP3QTHn7OXvsQgqFOgl0LCXu8isPVWMxS3940i1ozVsP21aMdqIkV2TpPbkfMtFtcSIk/6Hv/AD3K5SIEwFLsBylVYIoriivz9lzOyOTEtJDSNSpFGWSLElZ5VCn5X8CL3+aQOYhfIkmq34zgOc/zjNR0+O08go1+I4cFzFtW34Z42+h4UXGgco02B0uYsPEi1JICH5CzRfQK8yFnXW/co3y/Z13j8EXWIJamz2k9N6tKwMJ1Tiux22TVgU7XHYCx+gP9e9A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=r1jFyooOR9bbc8ADSfxULEp0uavRGZn1SNL0Xp74KJ4=; b=RHW3kyXE0rHdUr9WYuf13DjzW9B+7LT0eflN+719jda/XER8uz8iN8+TsBa9qK5qe+260hiu05KPU/mWZnfsI1ym4aPmdPXo8G/oS7tHMpHxediRS3vga0K4LUMMh2dtbVoNKt1CybyaHS3rjddUDy3QKCkkvbA3xGG8NTvrv2sZPjvzvBEN8uo/qMlfigeJKmPoJYw8Zf1KGxByZLAA3ER4xWTE3D9cFatn/V7/qfAyewMiA7cJNRWPKq4PHk1PimqQ7GNIpHhQTEzBhX/COSeEYSyAY11e1ttDu9Zc86hTwyUzo2aJ/JwuIH1rRi1Iv9zucI02Nos7mWV32CB6jg== Received: from MW4PR04CA0346.namprd04.prod.outlook.com (2603:10b6:303:8a::21) by SJ2PR12MB8832.namprd12.prod.outlook.com (2603:10b6:a03:4d0::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.16; Mon, 16 Dec 2024 09:47:14 +0000 Received: from CO1PEPF000066EC.namprd05.prod.outlook.com (2603:10b6:303:8a:cafe::4) by MW4PR04CA0346.outlook.office365.com (2603:10b6:303:8a::21) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8251.20 via Frontend Transport; Mon, 16 Dec 2024 09:47:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1PEPF000066EC.mail.protection.outlook.com (10.167.249.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15 via Frontend Transport; Mon, 16 Dec 2024 09:47:13 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 16 Dec 2024 01:46:57 -0800 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 16 Dec 2024 01:46:57 -0800 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 16 Dec 2024 01:46:55 -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 , Maor Gottlieb , Avihai Horon Subject: [PATCH 6/9] vfio/migration: Rename vfio_devices_all_dirty_tracking() Date: Mon, 16 Dec 2024 11:46:35 +0200 Message-ID: <20241216094638.26406-7-avihaih@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20241216094638.26406-1-avihaih@nvidia.com> References: <20241216094638.26406-1-avihaih@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000066EC:EE_|SJ2PR12MB8832:EE_ X-MS-Office365-Filtering-Correlation-Id: d3f4634e-289c-484b-7f20-08dd1db69e93 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: bNQVjwrq6rFgpuW7EKlyxAFLi82kgUT6vWO20EPvWND2ZbbNPQBMEd63m17smKCFYBZ9a70FxWfnRbSPS67ofcUO07PEcKRDonjyAr2Ox6Q2NrCR4E2JyPyw+1CgM4okmc3iHO6EpKWpGDTmLvYSx3ja2MR1FzUp7rBDifN9WOJSBAKGTnAdidzJq7TXdgvXqG5v9CV6VflQpqViYYut+HBBXdk7n2XrF7EswjNZAXltkW64FdMBde7oYB1QigvFLXJWIuQdIe5Brcvh4J9PSj/T0/XTvjh9q/ZB17GwvrZFwwqTQepH16zD/idRyJo+iQBxJZR80xPwFKQMp7vf+bUo5qXr633SvXl+QJp608kMRIkCkw5Ol6eQsySBg/zsUsrG4fUDeGkUnQpKpf24J0+DzTMyedevNbGLsAVayNzPV/XPem8sHRDkawrJ5Uh6o2dhEbs+wTTmChkr7lgkGFnMxm0NnTUGch0174PDD5FbVMZBQdvbPAQGcNfLXDTa4ikuPp/Wqw2Lr5eCm0uSVlL+t05JspnttId8AF7DcrBCJQN9HUc+77pFYp7U6RCyv8pjJD6k5u0EK5ki7AGaUAkVDD7IM6zc7kfAxId1LIEJev7HLl706JQaVsFATte3JHpvXEZd3vDY6k14MBQtWRkeBJjoEcfQoJG1LJOoPtFg85qQ7P73wvpZttDkl0RJKMll7cU4AVpmG60EZ5MwbYJOWrRnsnwsD2+fPbBlhiZMQS0deKNLirHe5xjKTbn54vFhw/A5cuiwx09qHNBnp6uQqB6cEKENGZiOdUcDzD2YjkLVndF3RxebWOe1bWiPLkU/3cr/WXbjD3poaS9ELM87YGAgal6qfUZ6KugsMtUH0DrLjmqFDH9L3vc9nHQdvZNr/qvEA/hE12/KoIt/bKOeptvlnthcO8ojI8xqyEyrepaP0ehDXToTVWQCzfp0tXP0sZMv8ryjywltwqDK/IWVFPosz7dAmiSG50ZudqHsNGZdlFxUM3y0UmLTzxMoP4QfzGn2P07EGRgPF0Cyle6A3QjKien7VEQ95KPxhtdYAtB5RzvfDna0zRt40eaOOFEb5OnbRQo7SpisSfjSO4sxEI9+VGRklixVOPmiBApqkNFjeEhGWqanE95U160AUEWm2GdpkO+LmeWChvVmCAi5YEscyh7TpeotT4O0HJojCigweou0DnKCVr1GZ2W4/HPJR0eZGLwa4ZyS0MFjaT2QiX0MMV9MbNBGCA1U9tgncidghmeS96XHt6+9LEjIxxwzTNvEpONpL8lSfX7tTkHzoYyTN+WlySGAaEBCTNPpvdod8a3juLKw8kjgTfDZEbur0ciVIS+rG08CLuA7Tg4yeaZmvD+3F7IJR0dIelvQmNri1107LI3vNN6NP03XbQS8Qfukfha+Nro9+zVYtFN/fEfsj/OwRs/2ZbqtJNXtygaY/C24wq55tZK8yr4QxB6RzjuaH+6pv57tRkN4YAjAy5ZtlUT27nWg0F1vZdw= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(82310400026)(1800799024)(376014)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2024 09:47:13.7260 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d3f4634e-289c-484b-7f20-08dd1db69e93 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000066EC.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8832 Received-SPF: softfail client-ip=2a01:111:f403:2414::62c; envelope-from=avihaih@nvidia.com; helo=NAM11-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 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 6e4654218a..dd8c5c52b5 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -195,7 +195,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; @@ -1368,7 +1368,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 Mon Dec 16 09:46:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avihai Horon X-Patchwork-Id: 13909457 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 28523E77180 for ; Mon, 16 Dec 2024 09:48:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tN7hH-0000Ys-Kt; Mon, 16 Dec 2024 04:47:28 -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 1tN7hD-0000YD-78 for qemu-devel@nongnu.org; Mon, 16 Dec 2024 04:47:24 -0500 Received: from mail-sn1nam02on20601.outbound.protection.outlook.com ([2a01:111:f403:2406::601] helo=NAM02-SN1-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 1tN7hB-0004N0-Ef for qemu-devel@nongnu.org; Mon, 16 Dec 2024 04:47:22 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PIrNqutdH+TV/K42SBX1kQ50u3QBJy8qgqybAYRca1qj+L91hHrQP4nHQIo3m6jA/z1kl0NMk3MjzYmc3OMJn+EfYowXryuWRgOgfx/H10UAODVX0GeZCuqEnrbwZZKNseVJB7mUL34vGGm69TKmGmGgjtvNrpeQ4vjba6dlG9NmLZVbNP46qMCNZ4vm3EA+4MTHl0J+o+d2X0VZZFdZLv54retFGU0TGEyTkHclZflnkFxv3nhNBd1pO+k4mWj+M+ERMvT3Lu11TwIdnG2KxliHTl+fegNQFw66QoJGB5uX4vARcnsvwEnwDlkST1Wqzr9Ga+LbYG32H9Mp7WNLyw== 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=MWdGjvrkmvfvPRcfztRz61P7WEzbPU3q68+0ZLxjMTo=; b=Pmn70lIyN+2k9Knr3zTIcjF/ovN7Df449cfa+h6C8Lqsyr5jeFjKjIw6CsEvGGYptrPUPFLaQWfmrzHOFtWRbTLdQ+MWikS0kkJfxebaywNBvij7tyD4WKqtWYBu8f/q4SpkoLB/rNzyE/O/SF/vT+RbQsFjnYqruioRAmHjqQ8xQBxVa95f/heFZBwoPaHokXr8p5RZcz76c4DWJJDQuK5fe/XI8jzdljGu8KeRtgyVr2XSBylOerSBFYKJKiwZlo+pN1St/7oQgkn7T6uQNZOzJgiNJiBUE4WyFYUWDXZbtB2OLEQYtSJ1AVdfRYxN66QBOZijdo4at+9gPXLHRA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=MWdGjvrkmvfvPRcfztRz61P7WEzbPU3q68+0ZLxjMTo=; b=ONm0kA4dlesKvdgp1guvg63OxUQ59s6CYbBHHJG7Nv0OeVaVAcYjrseNt/nHi6+5bQ04omn51bkVXiuUHUdULFqDANFjMraumWHfaJRB5FSBFt9dvS7OuiYiOfJobbZdMUM60Jgnka+ECxtG/mK4D4/CbmvWe+zTF32GiJDwfoWGefowLNW23sgtaHBrO5W69JKSekSThvfiPuf/FeSTh3BZ3FzZkxJJirmFB+kRnVlXRFZZOXwhgNBepDgO2Ua/MlOXxiFRqvBd09kBhKNL7vR7JqStsnjYWpJctljMBREgMx12/UdRddZLIv3zaFP2cOdf4UgO0Z6TkK0QFjdbCA== Received: from MW4PR04CA0136.namprd04.prod.outlook.com (2603:10b6:303:84::21) by DS7PR12MB8083.namprd12.prod.outlook.com (2603:10b6:8:e4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.27; Mon, 16 Dec 2024 09:47:16 +0000 Received: from CO1PEPF000066ED.namprd05.prod.outlook.com (2603:10b6:303:84:cafe::99) by MW4PR04CA0136.outlook.office365.com (2603:10b6:303:84::21) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8251.20 via Frontend Transport; Mon, 16 Dec 2024 09:47:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1PEPF000066ED.mail.protection.outlook.com (10.167.249.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15 via Frontend Transport; Mon, 16 Dec 2024 09:47:15 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 16 Dec 2024 01:47:00 -0800 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 16 Dec 2024 01:47:00 -0800 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 16 Dec 2024 01:46:57 -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 , Maor Gottlieb , Avihai Horon Subject: [PATCH 7/9] system/dirtylimit: Don't use migration_is_active() Date: Mon, 16 Dec 2024 11:46:36 +0200 Message-ID: <20241216094638.26406-8-avihaih@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20241216094638.26406-1-avihaih@nvidia.com> References: <20241216094638.26406-1-avihaih@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000066ED:EE_|DS7PR12MB8083:EE_ X-MS-Office365-Filtering-Correlation-Id: 39a2fe56-fcb8-49a9-f428-08dd1db69fd0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: HtE6EZnGqovQpBtAUcZ5H6cFdl964k39CB4a4KgFvE2d0+TP9BBUHr8j1BRt3e7I8pTz7rHErW5OTjw4aQoiqtxtbGdQgX/Nxq0pWxDaiD6+mQZu1zMjJlmkkAAt0sTkmN6wesQWQrAm+01Oiw8RM+cgtS9G9X2F2fjZQPOKOE/l/lLtQ7b/m6jrdpsRqnMPDM37UmcqSmYISv9rpLHD15Y4xMiiS31bH90tnS4/RqTWf3V3JCinqB8QfC428b08HhnTvPBCPeUpyX1SoLRKdaczKaAXV+OqrVMWxY+9x5BTPKFhFVrHbOTX5JjJcl6Tj6mC3BygLFzTQ5qTn2T24hi5aKgREuTGRmSn19ls5KsE88d1FrVvx24/972X/orb8LIz3OG5dOBhUC6bTjROBR99EN6b8qtsMBXNFxguIGGKxbSs0JTo8OBkAg+cAXr0oqhHnEoEaZpIxlmro29y2KfiMU2cD0OMNp5h18XVwGvFMjZarJ2eQJY63U/GeA1yEWTTN/Mb5UkcrSr7u/z9nuRtJhWDKLsOF8mfA0Sk+G9+qC3WcWfPswARjfantQ1d1VL3p9UXay3+/aE48rkPYljw/QTgo097MhgIaEwdzJ1aYrW48O2fuGkT3+ImKDIjmBCoRa3GZKFevlPzxcjLclqp09E9VePItQL0g5h1f6E7VcE4Meh8G35hMN09K1ILFzovD3ZgSZy806nnU2GjkqPTHdQmSaWD+PJp/F5yS/4yrO9E7mNjmgTRQrz6s+mxXgPCZJzv5fGBGLuAhaQtZsMoHbr1dqcZudn6bVaJtdIepdcojej7ADAI/hR5lxLHTveCyDNvvH2Dj1mGarU0dvpQQJgqoxCw0VbnJlg/IKI0ViBK5p6JyvRt8aOnZEbL1r03UgVnETMJhCNG883GFlC/YBNkbcesJd/uXF41825ihcdT2BmCcz3U9F8mD+/jU5V+GJ5mcWI5h6TqCcmTwqKBbUGcTH4+5SHLK3wu/AhTPkaJEG6VTVB2wNDSnxT6LyceHRjEtjcuW+IljI5jzDI7pvDtneu3xylUahYIKYubZsSBN9PBosdWy0QpCvEBCUu/OI+LOAO36FI9NODg4OtXpQ1v8TKP9EmevkzCB9PPc68ct2AIEez7r0YotxgZUItrWOQ/V7UWnMlFQ+Nl34iS8Y3KALDelGfzKC6MQDlfw/CLeeol55NU/8N8SosiELiMsRfXC/L8rm87pVjfVX8EYUVmNkJxtpoleruO2ZBp3iEOLPEDByvtseuU4sOHq2nuUztN2i6XyFBmtu48glZPoyEQba8uYl3i4eXpfOFA9N054VVlkSVnOWwgU+WSiG+4ihd9fcYzVKkSSlRuJysLofL6YrBNdgsC8xxTD79K2+QauVunbIf7qjSgvyIG/w92tB2YYdJ3Ovs5oVRoWfRSYIzBkn/NJo5iVyPMDkzs4b1tKQvXAvIvnSGlVMYHEB35P2Nht3ihbI+NqHfHmA== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2024 09:47:15.8065 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 39a2fe56-fcb8-49a9-f428-08dd1db69fd0 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000066ED.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB8083 Received-SPF: softfail client-ip=2a01:111:f403:2406::601; envelope-from=avihaih@nvidia.com; helo=NAM02-SN1-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 Mon Dec 16 09:46:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Avihai Horon X-Patchwork-Id: 13909456 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 70706E77180 for ; Mon, 16 Dec 2024 09:48:31 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tN7hH-0000Yw-LL; Mon, 16 Dec 2024 04:47:28 -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 1tN7hE-0000YU-T6 for qemu-devel@nongnu.org; Mon, 16 Dec 2024 04:47:24 -0500 Received: from mail-co1nam11on20629.outbound.protection.outlook.com ([2a01:111:f403:2416::629] helo=NAM11-CO1-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 1tN7hC-0004NF-V3 for qemu-devel@nongnu.org; Mon, 16 Dec 2024 04:47:24 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ivfd2fAFwc4dfSxbL5f3PwL2aNvsjQOqWk1keBRDGzkzB5ag3rBM79xTQOygfQrM+y0/Pt3ahiQsY+AI1H4emy1REJvj0NxwqZHKa3q2yRFiQSYdJ2lnkr6iKxVBDDxYHFfZ0jX7ouO908GcFB5o14BD2WyImQ21DTeTHBI8K3JI7aPIm+zYq6ZhNP4gL2r8/VJggRrruGgiyytVIufWjwg38hVmyY3PORMOESD0soL+F0BzSWSTXNpDT6+DwcaCwwdsTubuc+cIzdn+Z2ppAYpmWwOuFT76XcCO//KkrQrOqqcJJVnXKHszIsApdvd+ZYlFPw5c5QSigJqPQBJOXg== 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=Udz9oOp9ZgWZpNWRItnobgAby/BEQqsyHVBKxOJL+SU=; b=YrODSGRsbUmhNSEswxedo/EcJdhAUnLmIKW0Rz9Keaqt/SA0Rn4xP5wtlXWzLhNFXpxQTshXEK9z+Kv/eLYhGk9M/UY6FxPQQ9HDFcwtmT1vXgXoR6zrnR71Sa/Erh3L/IXMaNxEkskjYUqIGHtH+FFYK8kD1ANBZjmy9PpA9homfBtOyBGWnfFXXXjsKP0AJO7Po7rVLSKIGQI5/VvpxqKZa6PnUbvxx++hZEXWGwATYBuD/pkSzDKqdVclXRCxqLxYIGzVOnSPVScB6n9iUshMClCyr/L72JKtI9BIY2j9yFXxcJCfpv+je6XScjnxQMVuWzs1mN/GEXHdSu+yGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=Udz9oOp9ZgWZpNWRItnobgAby/BEQqsyHVBKxOJL+SU=; b=jbgoxzOILB2GT8n3kw9091zbD8b2Q1sNS30+sm/g1jj580MmIwITkbCM76gqAN1ONPt52E1k6J+YVq5pChsAYxY47THjSMZZB5q5Lnum+/goALRQsU/vIcHoVbam0Ue9/iJhyaO7j41wbV2rxJHrBg0Y5VpzHR56/KgBTIj7ezVy4sLPJ09iwV6OcsGuAmYxMBsgy/ju1MDSzJwSusi3pSRUN6kNDevC9IvRCOKrz73C6U3K8FPt+SfO0cpWqCfxWSjc2NwABjKrFuYQ6A741RZn5O79LjqMn8akGRW0gTWa5qiScwL+vEm6URi3z1RvOlXaMJ0lJ3yI+3DN62vj2A== Received: from MW4PR04CA0145.namprd04.prod.outlook.com (2603:10b6:303:84::30) by DS0PR12MB6391.namprd12.prod.outlook.com (2603:10b6:8:cd::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.20; Mon, 16 Dec 2024 09:47:18 +0000 Received: from CO1PEPF000066ED.namprd05.prod.outlook.com (2603:10b6:303:84:cafe::8d) by MW4PR04CA0145.outlook.office365.com (2603:10b6:303:84::30) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8251.18 via Frontend Transport; Mon, 16 Dec 2024 09:47:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1PEPF000066ED.mail.protection.outlook.com (10.167.249.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15 via Frontend Transport; Mon, 16 Dec 2024 09:47:18 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 16 Dec 2024 01:47:03 -0800 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 16 Dec 2024 01:47:02 -0800 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 16 Dec 2024 01:47:00 -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 , Maor Gottlieb , Avihai Horon Subject: [PATCH 8/9] migration: Drop migration_is_device() Date: Mon, 16 Dec 2024 11:46:37 +0200 Message-ID: <20241216094638.26406-9-avihaih@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20241216094638.26406-1-avihaih@nvidia.com> References: <20241216094638.26406-1-avihaih@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000066ED:EE_|DS0PR12MB6391:EE_ X-MS-Office365-Filtering-Correlation-Id: 0f0d02bc-ba1d-4a42-1e8b-08dd1db6a140 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|82310400026|376014; X-Microsoft-Antispam-Message-Info: tgaNjVuCOfBQ3Npqn3H7sjgPtGusjZ/uP+nkvIfn9ZuDuPR49dTqscmhyYBZQ9Fn5zbDeDbSVwQdnSQC5AUWfPpu0y/1w2D1PqV2KuBsNto9OnI++M3Z27jUV5et5a8HVHLiM+xV1pIFeTidwlsg/qdd/I+L1rNmaoGF+vReN7XN9wKRhxNwhZbI2TGixi/V8waXKUFr9ofmm02e3vPYZEVY34rZdjLnCu2ZXQmLAHoPnH2OqHv1YJuQrhUVbg7R1ENsmtpw8Hc1Vb4pPj9WBcLYXZg42yAjxNyb0PNJWO+u4wcwik64gfIWWcjW1PpfP80ovnNq/DBL1KxfOSXZKP+y+/hqFMZ329SzmvdJbHl83kaHs7TohavWqGp3RJCZuL/x4VKUcXtdSkB3JX3u8FqSxRImwFentHqf6EfCq7NrI71AV29HN4tCLm6ee8T6mPPpACcfY6DSjpbuOie6PV5Oz1cEdtIH9UkfJlFJ1I6YDeXqKUmD9Lrkwv1JLBBoYTmnWzx4ix9WaKNFb6YTw9a5ABvPXKsLEqJCtLj8HwqEY3ui/TdrkUE8P4V5AUpegguuESPkjUf8EWfWgLS/gIq4qNJoONYJ+c4Ilr8FNKHjmc5xlYSNmh/36sQYRBe0Z3apj1U2ter7wlFz2TkpPk8mYiRjJF5Dl9Y1nmTmCxcM7hhS3JFO3RxL8PgXJw//PO2NItIvRKjuqYdeJblj+Mb1lfhkXzONqMaPSxqvQ1GkgJYrhUtqjFbRFcyRf4IHYFBo4I6rNujKUNwoUcIyoTJefv1A5Sf/Mn+0ZO/tQ9oWYt57PeMroFmDywHxUxAiPrqEzRrBAfn1IHcydr+MeVR+rXcbFv6Q8A3kV+167PHKz2fZOFVoD6hNxb8nbH2zGOgEM77QLakh1jEiDbqUWg3VmSDZDTmCqCh7bSOGZudEV/egrpHP04s+KOHEBrh81x+V9oKRfYtK4WwoCcDwFJv4OqzSt8982bvMiJq+2ifUUzqny6oQXgHKKAtCFyuGzWed5ezFTqyDekCjJcGzLsccLHZakOGgpb48qcwPQpiDhA873m/7fqPXxEmGNBKIysClnpmSfxUv5uYrosgVEQ5/ohSJw57945QKrt4eqbmByvnO/8Aq1c7l6UW3AX3Pe40YDkoVkWVdtLe808MRCuaDC53mWk6CnRr38sK67Y2w8/vU3egFesqtAUnJazWfZ2BTx5L7WPouDhLyqGhNbknw6GJt7ltfpEwhp+x0sI/tlE8fLJkeF7PEObMNC3gjQ9x213OlYpah0LoLRnikVDzfyiM6Lx2TLAZlgyOqJtPb/lAK/9o8IML2Ol6EayJHcyHPRuwyyC+i2v1+QY9JU9OU59cJYnAiNMBNpV88kUfjYqFFyZ4/b4LCwFvaNa/3EoFm8Y0Qux4sRgheKb9Hb0zXLHQJJLl1uaiGRjG+L5ypsqBgvwH/ZIJSpv0Y4SWYV4lB+gmR/oGmi5d7w55ujWN9JEHn6qteArYEnv5GIjk= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(36860700013)(1800799024)(82310400026)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2024 09:47:18.2128 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0f0d02bc-ba1d-4a42-1e8b-08dd1db6a140 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000066ED.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6391 Received-SPF: softfail client-ip=2a01:111:f403:2416::629; envelope-from=avihaih@nvidia.com; helo=NAM11-CO1-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 Mon Dec 16 09:46:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Avihai Horon X-Patchwork-Id: 13909460 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 EBBD8E77180 for ; Mon, 16 Dec 2024 09:49:01 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tN7hZ-0000b5-RX; Mon, 16 Dec 2024 04:47:45 -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 1tN7hK-0000Zi-9v for qemu-devel@nongnu.org; Mon, 16 Dec 2024 04:47:32 -0500 Received: from mail-dm6nam10on2062a.outbound.protection.outlook.com ([2a01:111:f403:2413::62a] 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 1tN7hI-0004Ne-Lo for qemu-devel@nongnu.org; Mon, 16 Dec 2024 04:47:30 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sgF4KyiF69wc5bNn173/WPgG0YF+QIkN4oGBEh9Hr+gOti88/g2iqvT0IQyxccAYBiRJaDQjYD+cQoLyIVRexIrpOC1zCTIifWfE3XoGTx9YJ/RaUwflek/PBkHjR4FtewITI6CJTdZZr3c3yifkV2WDjcOOGOyKKuFCRrOc6IJuWCrqc9S+g0vX3ZgQ1XOMaMPw6+oZZPMBKrP+dGVW64SIdCh1UhS6XO/u3YtQfLimzMz5Fgyd472D1w1XapVywEvhZdNgbH8kZlBwMM7nsKYJ6mMdT3m8IeB+YCW0Py21RBPDTvyPKOhQ29sBJN15ApJnBuhtZjjOCvKPd8/G9g== 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=nnIjopGlH0fjDwtHzVL9gDoP6tGKjDrcWAK8kQQHzxs=; b=wlzqRlMHMLXd56cG0MY7JwDkcxr8G75Ap6v487VgPhU2fCeKyCMH+1KUqpbCvj2pdhau9AjhRJWnj1x7rb8/6fPggDDm9+Q4FieN63Evfpbtuh89jVHQsKOczW1B6my3AlM60F7+sZhwbsfZ30aYGZIa6Y/1JST0D8uoqW5UjCT9zddF+TIWy6ybI7iXAiy2e8zH8LJFzrvWq6PwCnI/Qlg79GomByyeWCdb4+2BKFcbLoOIgXgrqBKo5IwyE7bFy6IRRdgdOhf7uW0mdT/U3vIOvmuMZMJwXWx21xL+4jPMjzvIpNq26DOage156clbXG1U4ptiDZZ8AMtqqQdPVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=nnIjopGlH0fjDwtHzVL9gDoP6tGKjDrcWAK8kQQHzxs=; b=lYQKGz3i+d2QLTJtoFDelWhoncGu2a3jyfdY70AGwOVnaQO0CwBr9wheK6Py9BE1vAlw1/1S3Pbb7eOWocazV8aN8CGkIyzXgxNbghbAeOA2zBiVGI6QoO1nsi5a19DaF6fjvEQOqwcHJlxH3Ov6CKiGQaNW2aaazOyWAmjBLD9baUc+h1xgXv6p2SDL2WshLGQybLhY4Dn3uiHKcJANmwUeNKUGA09rcHHihX0tx+WmTO/Zd2Swy2JLRHwEv8X4enJR1lVg4pyFGAiP/7E2uIrVXEwJ9gxuYOPu+UEqEY9OgS7a8V+F33RVnnWR4Ljis+p/xN6KQBmDHF/QNrHUFg== Received: from MW4PR04CA0130.namprd04.prod.outlook.com (2603:10b6:303:84::15) by IA1PR12MB6092.namprd12.prod.outlook.com (2603:10b6:208:3ec::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.21; Mon, 16 Dec 2024 09:47:23 +0000 Received: from CO1PEPF000066ED.namprd05.prod.outlook.com (2603:10b6:303:84:cafe::4e) by MW4PR04CA0130.outlook.office365.com (2603:10b6:303:84::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8251.17 via Frontend Transport; Mon, 16 Dec 2024 09:47:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1PEPF000066ED.mail.protection.outlook.com (10.167.249.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15 via Frontend Transport; Mon, 16 Dec 2024 09:47:22 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 16 Dec 2024 01:47:05 -0800 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 16 Dec 2024 01:47:05 -0800 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 16 Dec 2024 01:47:03 -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 , Maor Gottlieb , Avihai Horon Subject: [PATCH 9/9] migration: Unexport migration_is_active() Date: Mon, 16 Dec 2024 11:46:38 +0200 Message-ID: <20241216094638.26406-10-avihaih@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20241216094638.26406-1-avihaih@nvidia.com> References: <20241216094638.26406-1-avihaih@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000066ED:EE_|IA1PR12MB6092:EE_ X-MS-Office365-Filtering-Correlation-Id: 58d22442-db2b-4288-ee19-08dd1db6a3b7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|1800799024|376014; X-Microsoft-Antispam-Message-Info: 9KOcT3KddHPctdHSk6kpcaoxMnVAqA7DYEcV7w8t9fgaZQzG3PUYpyYQKbHUnEqcfEjjTYUwbExyoKLHUW7Rhf1/9OZjQdrJcAMmtCJUWXjNgwAl5AvrWPoqywStGlRF3h1nZ0bERSGK+gdDY0OcXLcvJ1Uapn3H8t7vkVh2sObhH4x6+OSYP2byHjf+7Zxc1XkLkBTyK8uCR4YKZrJo7xlbOoJjoPbzmjhGoeEtV4i7Y8oBFppiSmY50JzpBX9Gto1EqiI+7hP2zbhICRXvYsc1ATLFn6Ofp3WMDznJv1F21HlaFKa3Jtn2D8UNO8u9+DsztcI558L3VfuUP5e0wc0TybQ2uukKHQ8/rSHsa7Te8zBWo1RkGnKVGhITQI1wkT93w0O2uTAENX2zSdTpqfWVrl8wd0RP8iunGA6fQEWu44/2FlkwOnRCr+L9N0WoB7TpKJgVRwR6OM3X5brokYyJMWm4CitNHoOUg3WxEON90vk3kFwM5eu11z5PxFYFAQkdU8/WpDpQWG63OdKCDcKAaF4/+3fPXmdU2/3olNqRBbO3pVF8/52Zmz8dJSW5yXKBtbaHpV2q3zQWZ/8UB2lNM6kK5HcGkpywps9moT3hq7xT5cWUOjhjAxwT+OD4dI9A0FlUcAfu21N6VZ39nDkmUGGdh5C2GMfTdHRO23UTxvgFS+agtNEgSX52s6WooJBHsAHRRp8UnCgsSNeOYOAUOSuquB/jI325xX6dNjA3HhBvGmcfNjZW1stDE2NbHMOGFa14zK4SWAgWNHYCoI4E2Pki8ztba1E18i9y20p7/atLxgiqdzW7NEDDL4vnxsJomfrwME4qA3366NywTtgTWDASl0EiafjbIGSuVdKCRSP3hRipFLtkkJJMZs62QPa6Uz9KJgIkMIrnl9RR3vM7d0R44uiZZA2anDPR5H5sLvXOpAvAiJ3QfhraqUeMJOS51VCWnPH31GQUFyiyEGSDD18WQc+LkAawJwmHUsfebOg8Iz+L6/SpM1+2xnfPRDgwY72e/wVi7XX70/rCbhOQhvXRl/QDSlsnjYWYIyZQAWQ2ouFcThfvxghvCUtc0NxoGBUal5vFnf2rYX74RERTBH6Ae+QmmDs/ytHpWZurEuy8kDB6GHAJrB0qOlBe/MqyscQ8xnGPxefXaoctXovgHeaGR33NwPbpPHN04c/t5cNxRJQppP55SO4Qr+uK4DgGZROEW3ZkP3KqVDyaN77BIuxQO7DDnrVmSonYMxDSNIGN8fiJls7KuigE+z0bPpIjLGBro6ZdUb5/N72a+uDuMJ4EpyOVv1SbmO3DW68eMEzw9idsNQLAjRZjdx74DjG7p5r3B0Md7uUsQPuIPMmqz2ND3jv/Sfqo7SPZ8OR8UVgvsI88pI3QlseVopaVdVWpa8k3Fgvc3NZ/nh9mZWlT/Kin8Hq/vebjtE4VXbrscYfu9fSceqeB+wFvejuOzRL3w365yq1rLrrXbs+BJAxBkbdW6bR84TGYyKs9PHc= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(82310400026)(36860700013)(1800799024)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2024 09:47:22.3534 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 58d22442-db2b-4288-ee19-08dd1db6a3b7 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000066ED.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6092 Received-SPF: softfail client-ip=2a01:111:f403:2413::62a; 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 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;