From patchwork Sun Oct 20 13:01:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Avihai Horon X-Patchwork-Id: 13843064 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 D623AD3C935 for ; Sun, 20 Oct 2024 13:02:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t2VZ1-0002VE-3k; Sun, 20 Oct 2024 09:01:43 -0400 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 1t2VYu-0002Ua-2E for qemu-devel@nongnu.org; Sun, 20 Oct 2024 09:01:36 -0400 Received: from mail-dm6nam10on20607.outbound.protection.outlook.com ([2a01:111:f403:2413::607] 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 1t2VYq-0005zz-LZ for qemu-devel@nongnu.org; Sun, 20 Oct 2024 09:01:35 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NhOLHsJcPH+L3dyyH3OIHvVXxhEBrb3aW8Hq7i/fdY9r3y3fiB/GLXwu2PU2ZD7lnYLJ1V6/o9iTftlZS2LcXsoVSMPsDyNlQfGsPsz0zwPMSONI46pMCFD/fbMrjfdi5O3wRdwHyCU49n4EdgwCToduUL5Gc85xk8jcQZ/GL7xrH4Ptz+HRiN8dHs/4Lw1kwD5NV9MEBya8dJtoNMPJ4CFWnpzwZsbKp3LMZ5QAN60sP0+L9CSYet9LbGqSif+nVbNJaE7B1vH1a/OlMHv1bJ8oI8mEQJjzPUDEfH62PzEfmuxWZFNWe2cNCmWYkutKPAs//GSy9SSicjBXhujZtQ== 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=RgDgzuV/ynKTSoloqrpuFHVI+42kYg9sJUadBdSsNHw=; b=jvUqdrgMnE1UoH6ogj5msUrUGx7UExNEm/j6d/GglWwdLeJQ7NVD/g41illItL+Kq8SEeIfqd/RO1nOWcIsXwo/km1CRCjZSaC6JdXrMUpBA83AqLl9RQZRf3J0aY2yygGiCe6LK7vHOoUPBZzycUoyufP2g65XYCzfD1fiClt7/qWyoPKY5WNpf2wA3GruBOByojjJjUxFGl7Hl7i/PXvn/IW1N5Cs0f7YCFjhFqy2Y/zrlH6gCo668pChNiDSoUpglq99Z8nTni9iPL5mW35CSi9mP85hrQfFItWgEe0SU2g69NgcWDcyCiegq1lDVJecpWYJ0s66wtTfI96axOA== 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=RgDgzuV/ynKTSoloqrpuFHVI+42kYg9sJUadBdSsNHw=; b=j2p+8ZrquUSUpzB1kAivaOY2NhUrp9yF/RKRVo7iqrrv+xRqEtzhFq5pioydXpxrBZsochxSISnS+r6pV2iO20Y2C7TpnYsjIM+mTeR28aeG8O9OnEM/0BeZT4AmmceY2rJtYx1DPxwJ1ymIuSEDwa1SeJtKipD6beHpMliG7vRVZFU9o9N1dVCIh3uarCftLrZ/uUZZtfwO2v6zEPCndZMUv/dtrwou5kIRzy2W4R4BcgDZjxEMsXv6m6hY6M953wefhLm/HBOGToNiRUUFauhQBBDBw8PkqXBVh8Wl2xGx1xP9Yuk0kV7QaFyNmQma8RXsuNwBh6ZHCjtK3dOX5Q== Received: from BN9PR03CA0398.namprd03.prod.outlook.com (2603:10b6:408:111::13) by SJ0PR12MB6784.namprd12.prod.outlook.com (2603:10b6:a03:44f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.27; Sun, 20 Oct 2024 13:01:27 +0000 Received: from BN2PEPF000044A8.namprd04.prod.outlook.com (2603:10b6:408:111:cafe::b2) by BN9PR03CA0398.outlook.office365.com (2603:10b6:408:111::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28 via Frontend Transport; Sun, 20 Oct 2024 13:01:26 +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 BN2PEPF000044A8.mail.protection.outlook.com (10.167.243.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Sun, 20 Oct 2024 13:01:25 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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; Sun, 20 Oct 2024 06:01:14 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 20 Oct 2024 06:01:13 -0700 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Sun, 20 Oct 2024 06:01:12 -0700 From: Avihai Horon To: CC: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , Peter Xu , Fabiano Rosas , Avihai Horon Subject: [PATCH 1/3] vfio/migration: Report only stop-copy size in vfio_state_pending_exact() Date: Sun, 20 Oct 2024 16:01:06 +0300 Message-ID: <20241020130108.27148-2-avihaih@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20241020130108.27148-1-avihaih@nvidia.com> References: <20241020130108.27148-1-avihaih@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000044A8:EE_|SJ0PR12MB6784:EE_ X-MS-Office365-Filtering-Correlation-Id: fc432649-b82a-4be9-5e46-08dcf1074e2e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|36860700013|376014; X-Microsoft-Antispam-Message-Info: hQ3a224Y90yXFvLSWayR/89jI/vb9xKWvt0EStVqHlpdmwx49USf1dKzmXUo1Zf+Y8pUi+h/I8U3gzpwY4ZvMigtYPzeDLL/UHYiXi/ILQZZnu8YvdOSvvPEe6NwEDcRaQplzlwRsdnsU42LjaDrfqLcTlWJwWvxtcvHK7bf0LzNFQTt1DSnr+ph9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L7ydxgoJ7v7Gij+XHKyTo6YS0uTV5wC+24iYIaA9oTc10QAjYue0lFBlYn0zIhno7XBGi+ULyphlrpbp6HuoULDOdPrBKNGIagSsq3fP4H340ZEfvA5LXDwcDjIxZgafGmIoWLEAmaxjphE0BBXZyJKEUBEjLDLY37dB3Gpw== 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)(36860700013)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2024 13:01:25.6463 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc432649-b82a-4be9-5e46-08dcf1074e2e 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: BN2PEPF000044A8.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6784 Received-SPF: softfail client-ip=2a01:111:f403:2413::607; envelope-from=avihaih@nvidia.com; helo=NAM10-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.527, 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_state_pending_exact() is used to update migration core how much device data is left for the device migration. Currently, the sum of pre-copy and stop-copy sizes of the VFIO device are reported. The pre-copy size is obtained via the VFIO_MIG_GET_PRECOPY_INFO ioctl, which returns the amount of device data available to be transferred while the device is in the PRE_COPY states. The stop-copy size is obtained via the VFIO_DEVICE_FEATURE_MIG_DATA_SIZE ioctl, which returns the total amount of device data left to be transferred in order to complete the device migration. According to the above, current implementation is wrong -- it reports extra overlapping data because pre-copy size is already contained in stop-copy size. Fix it by reporting only stop-copy size. Fixes: eda7362af959 ("vfio/migration: Add VFIO migration pre-copy support") Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- hw/vfio/migration.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 17199b73ae..992dc3b102 100644 --- a/hw/vfio/migration.c +++ b/hw/vfio/migration.c @@ -576,9 +576,6 @@ static void vfio_state_pending_exact(void *opaque, uint64_t *must_precopy, if (vfio_device_state_is_precopy(vbasedev)) { vfio_query_precopy_size(migration); - - *must_precopy += - migration->precopy_init_size + migration->precopy_dirty_size; } trace_vfio_state_pending_exact(vbasedev->name, *must_precopy, *can_postcopy, From patchwork Sun Oct 20 13:01:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avihai Horon X-Patchwork-Id: 13843063 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 D2605D3C930 for ; Sun, 20 Oct 2024 13:02:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t2VZ1-0002VF-4W; Sun, 20 Oct 2024 09:01:43 -0400 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 1t2VYv-0002Ul-W3 for qemu-devel@nongnu.org; Sun, 20 Oct 2024 09:01:40 -0400 Received: from mail-bn8nam12on20617.outbound.protection.outlook.com ([2a01:111:f403:2418::617] helo=NAM12-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 1t2VYt-00060M-C2 for qemu-devel@nongnu.org; Sun, 20 Oct 2024 09:01:37 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jyJUkzK2zyNhLy33GyVrAunhljvc8dWzyDU+B6BZrtIwGeWFZpSaq7XkxKoCQWejf2EK/uLELNlQndw8p0HQwDp6NWlYeX3zBVvuu/xDbePr0RGTBBMKZwvP/3BAxM/QLm/+SOgAORrPdc8qQ2CQn2y7W0xhQxmcUFlmL8ucBtiJZ4hI/Zfv4hTr3w95pIhkj0kN51UHT6BblD+rOcGzmn/CD0w96olGQ9a9tv/fIWH6t/eVPYUpejiIBNKh24G+T2FCmLFTUYei3L6GbrP3qPrGx+qRs70/3O8oDxoAkwqCRhn6FwFOfVdDunTUMozZgnP5sv2pBM/Qpg3n62YqnQ== 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=/Vpr2+RIpJhd1qrK09AxWT+0B7xyAWckQEeipR5LSu4=; b=YbCPQyn+AC5O9oX8+KUM1/2Jd+igvxoC+41ph4j3x8zNH8Lso2bHBoSTeyXTzMdP0EHnbJRnDrJjfAx4ix+QFP3nT2i2T+khTMcj3FUyU9zoz3NJ5T+8GdnNDi4g57poUfuRmisuLH+0KM91fAay0Lvucw230prOThkKW0q4YZhgq0xkef6mhfpnCRG+yFfDAaPNOGNwnZAsaPp7MpmS9IAbYHmW19pjv2Wdmx8J7gebuOhNgK0Uy11qz6OG6jll0oHL11psU5OhEIWXvu388xLZCU/rTnHCXUPnqWSYxzplzNE+W2qpzEYkSxvblmzQc4gdsPgJN12Lb9jBjyM1jA== 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=/Vpr2+RIpJhd1qrK09AxWT+0B7xyAWckQEeipR5LSu4=; b=jiZ3H3HVf0oWVnL1cT2YhGbQheDYP+VtpKMgnXbxRybc/S4PEHViWXzAaCxKKBeMN+nsmQgZi0P45jz+ak6SBLrJZN207aAwBJpec+ZTMOoTiX59j9wamPiz8WSbg5Do9eT2rQnpvu6Kd7c1mov5R+Pzdn/1BCKtX8BnVBPEqaKmhhitue7h8E+ujVxpubYJgJX9JU16i6HA9qlwhN58fFezs3RsXBEFRs33aLcEvCIrp+p5fBTVKwl2N2aQrxZw5q8p0Y9hnPB0yzu7mRbvnCS342CSQAauh8Q3kr5S47rqWlI6AcW7ccSOhM9ogT7RjeFPDWJshc5k5QeN+1AZYQ== Received: from BN9PR03CA0419.namprd03.prod.outlook.com (2603:10b6:408:111::34) by SN7PR12MB6672.namprd12.prod.outlook.com (2603:10b6:806:26c::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.20; Sun, 20 Oct 2024 13:01:28 +0000 Received: from BN2PEPF000044A8.namprd04.prod.outlook.com (2603:10b6:408:111:cafe::93) by BN9PR03CA0419.outlook.office365.com (2603:10b6:408:111::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.26 via Frontend Transport; Sun, 20 Oct 2024 13:01:27 +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 BN2PEPF000044A8.mail.protection.outlook.com (10.167.243.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Sun, 20 Oct 2024 13:01:27 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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; Sun, 20 Oct 2024 06:01:16 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 20 Oct 2024 06:01:15 -0700 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Sun, 20 Oct 2024 06:01:14 -0700 From: Avihai Horon To: CC: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , Peter Xu , Fabiano Rosas , Avihai Horon Subject: [PATCH 2/3] vfio/migration: Refactor vfio_vmstate_change/_prepare() error reporting Date: Sun, 20 Oct 2024 16:01:07 +0300 Message-ID: <20241020130108.27148-3-avihaih@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20241020130108.27148-1-avihaih@nvidia.com> References: <20241020130108.27148-1-avihaih@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000044A8:EE_|SN7PR12MB6672:EE_ X-MS-Office365-Filtering-Correlation-Id: aaee65a4-6fa3-4cb3-6436-08dcf1074f58 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: XepxD/NcfEeZ7416D9AezMpdCeDbzAhQ9EzUm36M13s4lsdptqGNfaNZo5+lzsk9sA6+zYH8IL9UbdfidYGUg9B4Ujyh/KJNASz0P31V6mYNUpSxNxusYsyOBxUZGX8bge0rJZ1YUgkuNx1kMNL/4xCGsbbtXY3YKEpC8pxKSFPXeZOXy1eK5D+neb+Erkzn+QVZ3dNKg+TYo8U22U6zp5qP+d/+zw43NSDxhlPctAQDSXojEK7/kJ1Vj3O29jN9s8ncL9MqGAsGzKUNLFr1mjVhJjp5U/DyLQkUAK/E94aRE0GsVp+me7/Pt1CnfQ9FWyJkrb5dxWdXPS+aA2kBQIn0SFyp6Cchn78XSOeHrYynuZK6JvIYnxschouhVyxt0CRQRMd7AMMIETJuJ8l8FJJQ7SWAeynl3s8MrMtKgbFsvTjq3sorR1IEsrlj29RJq/IeacLgIocLJs8XL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FS:(13230040)(376014)(82310400026)(1800799024)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2024 13:01:27.6150 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aaee65a4-6fa3-4cb3-6436-08dcf1074f58 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: BN2PEPF000044A8.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6672 Received-SPF: softfail client-ip=2a01:111:f403:2418::617; envelope-from=avihaih@nvidia.com; helo=NAM12-BN8-obe.outbound.protection.outlook.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.527, 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 When the VM is shut down vfio_vmstate_change/_prepare() are called to transition the VFIO device state to STOP. They are called after migration_shutdown() and thus, by this time, the migration object is already freed (more specifically, MigrationState->qemu_file_lock is already destroyed). In this case, if there is an error in vfio_vmstate_change/_prepare(), it calls migration_file_set_error() which tries to lock the already destroyed MigrationState->qemu_file_lock, leading to the following assert: qemu-system-x86_64: ../util/qemu-thread-posix.c:92: qemu_mutex_lock_impl: Assertion `mutex->initialized' failed. Fix this by not setting migration file error in the shut down flow. Fixes: 20c64c8a51a4 ("migration: migration_file_set_error") Signed-off-by: Avihai Horon --- hw/vfio/migration.c | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 992dc3b102..1c44b036ea 100644 --- a/hw/vfio/migration.c +++ b/hw/vfio/migration.c @@ -783,6 +783,25 @@ static const SaveVMHandlers savevm_vfio_handlers = { /* ---------------------------------------------------------------------- */ +static void vfio_vmstate_change_error_report(int ret, Error *err, + RunState state) +{ + if (state == RUN_STATE_SHUTDOWN) { + /* + * If VM is being shut down, migration object might have already been + * freed, so just report the error. + */ + error_report_err(err); + return; + } + + /* + * Migration should be aborted in this case, but vm_state_notify() + * currently does not support reporting failures. + */ + migration_file_set_error(ret, err); +} + static void vfio_vmstate_change_prepare(void *opaque, bool running, RunState state) { @@ -798,11 +817,7 @@ static void vfio_vmstate_change_prepare(void *opaque, bool running, ret = vfio_migration_set_state_or_reset(vbasedev, new_state, &local_err); if (ret) { - /* - * Migration should be aborted in this case, but vm_state_notify() - * currently does not support reporting failures. - */ - migration_file_set_error(ret, local_err); + vfio_vmstate_change_error_report(ret, local_err, state); } trace_vfio_vmstate_change_prepare(vbasedev->name, running, @@ -829,11 +844,7 @@ static void vfio_vmstate_change(void *opaque, bool running, RunState state) ret = vfio_migration_set_state_or_reset(vbasedev, new_state, &local_err); if (ret) { - /* - * Migration should be aborted in this case, but vm_state_notify() - * currently does not support reporting failures. - */ - migration_file_set_error(ret, local_err); + vfio_vmstate_change_error_report(ret, local_err, state); } trace_vfio_vmstate_change(vbasedev->name, running, RunState_str(state), From patchwork Sun Oct 20 13:01:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Avihai Horon X-Patchwork-Id: 13843062 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 CEE7BD3C92A for ; Sun, 20 Oct 2024 13:02:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t2VZ3-0002W2-VP; Sun, 20 Oct 2024 09:01:46 -0400 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 1t2VYy-0002Us-8l for qemu-devel@nongnu.org; Sun, 20 Oct 2024 09:01:40 -0400 Received: from mail-mw2nam04on2062d.outbound.protection.outlook.com ([2a01:111:f403:240a::62d] helo=NAM04-MW2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2VYv-00060g-Ul for qemu-devel@nongnu.org; Sun, 20 Oct 2024 09:01:40 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HX2aGp76SrnAyo7U8KIDi8/1v0lIe6PGQX8z3jkZyWGabieC2myhcKZZprdFhPTDGHpW1JBklhCYIWbQLvFzabuPpy8HCYJoOCGbyKTGddL08KXn5hXiYzxKB7cPTTPW73mo+MEfW1WVgi/DLk7IYjTdLZUw0tWX7nFPiev+47wMudhsrC1WqQtPL4Dz/7G1kS7MZcUR8Yc6ecdZfUXKc9NjlmrA41my0I6rcTixIhdo64se83H3tz92m/KAEiO3iViWFht8FQE6JnUU6mIfBN1yQMQr9t87dK+V1ZcaGUmFux9nQ6aiQq/pFeT2hYk8ERQu/blyEgklfOs2WYWp7g== 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=OXGLve0Y1+n51c7Ice9d331PIxvUbAPEnvpjOHMKuhQ=; b=XimuF9j4o+NNInFHqkdC28+DmGbxwF/CfvRnR+OYtbZBhEHyLA9ruPOUHkRdAgHiFP9/jEDTwbRCdfmaj96b0lW6eF/H6QqxaMDgpduYkensJgziKZvKXbSAWt5GWBmTd+vKHiNZEixgzCr1onErOQEAQ9cjXEkJ3LgjfumkICvCpg0xEdMhrc/Gx++5Fs3BT8KHgE8QBEro0wPS0K4FzV4TfBJ8QJc0oSfF3J0EMwlIMrSMBWI36hf7jowWv9PmMPl6xROWg2cB4jwxqrRJJTN3cnGZAGh0LjtMwXF49/Kp1j+cEd33ndBXfo3X9Di9QPcNxjGspdyIU5NVBb3Lkw== 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=OXGLve0Y1+n51c7Ice9d331PIxvUbAPEnvpjOHMKuhQ=; b=VHoc5AgP60VybcjKokKTBjfS3CsGwBDS3dOw6ao83DUuXqqLzyIgWPkRfrFE5vPQc8vrQshn8RqHSC+Z3xWfW21CqJ/mYMhl9g87laFZZJ2zO++BrRi9IrmqEjLM+YeCDgyPMnJ9pR6/neVRPvoP3FVouaQ5mquZJ0tOdBs9GYTP4ZfVvXJbCu4K9Oau5G5d0ZHGSaGLBnN1QM1AhzStjviigDPzVkL16ieoPXcpESJ9MPhmIHzbuKUJEtfV51R1zMeKx2KHCkxly4SMoEQejYE94g/dv4WHweZt+Or+u2qtM0ilYv7PxL9Iz8yd1Xhw4juoZ2GdpU+fpSO365gxdw== Received: from BLAPR03CA0037.namprd03.prod.outlook.com (2603:10b6:208:32d::12) by MW4PR12MB5644.namprd12.prod.outlook.com (2603:10b6:303:189::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.17; Sun, 20 Oct 2024 13:01:30 +0000 Received: from BL02EPF0001A0F9.namprd03.prod.outlook.com (2603:10b6:208:32d:cafe::22) by BLAPR03CA0037.outlook.office365.com (2603:10b6:208:32d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28 via Frontend Transport; Sun, 20 Oct 2024 13:01:30 +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 BL02EPF0001A0F9.mail.protection.outlook.com (10.167.242.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Sun, 20 Oct 2024 13:01:29 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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; Sun, 20 Oct 2024 06:01:18 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 20 Oct 2024 06:01:18 -0700 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Sun, 20 Oct 2024 06:01:16 -0700 From: Avihai Horon To: CC: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , Peter Xu , Fabiano Rosas , Avihai Horon Subject: [PATCH 3/3] vfio/migration: Change trace formats from hex to decimal Date: Sun, 20 Oct 2024 16:01:08 +0300 Message-ID: <20241020130108.27148-4-avihaih@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20241020130108.27148-1-avihaih@nvidia.com> References: <20241020130108.27148-1-avihaih@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A0F9:EE_|MW4PR12MB5644:EE_ X-MS-Office365-Filtering-Correlation-Id: 2fefc4a7-8525-4592-2ade-08dcf10750ba X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|82310400026|376014; X-Microsoft-Antispam-Message-Info: 5vxHPHa4fOQOx2eODZf1Nhispwy1A4u2k+HgcWhNAuT1CpnT/uAOhKy9cIvpq6yDOI/PZ5YOxpZNFMd9Eo+UfYCanpekeQdGMU2RlV0fN7WV46C0pfoDZOdAikWYd77zV/Fz/WpcFWuX6dH7GM0xb2CDfld5XUGZxfCxeAwcfq4f4PwAA7TTo5IbTTCAMvOfgpBw6tPvd34g++OBpF4rLhOjevMh3+tmN4Kc9cIZ+lYyF+F8OhAt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EXHX//811ReNiFa8s93xT3B5wBFZhWnBkFWVuVkO8UzUGQ11NwhwY14r0E8N4usMUIJU5XYg/yWCyUSZfvTqvwrefOPpSecyzon8KzbFi2XblsASqQ== 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)(1800799024)(36860700013)(82310400026)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2024 13:01:29.9179 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2fefc4a7-8525-4592-2ade-08dcf10750ba 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: BL02EPF0001A0F9.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB5644 Received-SPF: softfail client-ip=2a01:111:f403:240a::62d; envelope-from=avihaih@nvidia.com; helo=NAM04-MW2-obe.outbound.protection.outlook.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.527, 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 Data sizes in VFIO migration trace events are printed in hex format while in migration core trace events they are printed in decimal format. This inconsistency makes it less readable when using both trace event types. Hence, change the data sizes print format to decimal in VFIO migration trace events. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater --- hw/vfio/trace-events | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/vfio/trace-events b/hw/vfio/trace-events index c475c273fd..29789e8d27 100644 --- a/hw/vfio/trace-events +++ b/hw/vfio/trace-events @@ -151,7 +151,7 @@ vfio_display_edid_write_error(void) "" vfio_load_cleanup(const char *name) " (%s)" vfio_load_device_config_state(const char *name) " (%s)" vfio_load_state(const char *name, uint64_t data) " (%s) data 0x%"PRIx64 -vfio_load_state_device_data(const char *name, uint64_t data_size, int ret) " (%s) size 0x%"PRIx64" ret %d" +vfio_load_state_device_data(const char *name, uint64_t data_size, int ret) " (%s) size %"PRIu64" ret %d" vfio_migration_realize(const char *name) " (%s)" vfio_migration_set_device_state(const char *name, const char *state) " (%s) state %s" vfio_migration_set_state(const char *name, const char *new_state, const char *recover_state) " (%s) new state %s, recover state %s" @@ -160,10 +160,10 @@ vfio_save_block(const char *name, int data_size) " (%s) data_size %d" vfio_save_cleanup(const char *name) " (%s)" vfio_save_complete_precopy(const char *name, int ret) " (%s) ret %d" vfio_save_device_config_state(const char *name) " (%s)" -vfio_save_iterate(const char *name, uint64_t precopy_init_size, uint64_t precopy_dirty_size) " (%s) precopy initial size 0x%"PRIx64" precopy dirty size 0x%"PRIx64 -vfio_save_setup(const char *name, uint64_t data_buffer_size) " (%s) data buffer size 0x%"PRIx64 -vfio_state_pending_estimate(const char *name, uint64_t precopy, uint64_t postcopy, uint64_t precopy_init_size, uint64_t precopy_dirty_size) " (%s) precopy 0x%"PRIx64" postcopy 0x%"PRIx64" precopy initial size 0x%"PRIx64" precopy dirty size 0x%"PRIx64 -vfio_state_pending_exact(const char *name, uint64_t precopy, uint64_t postcopy, uint64_t stopcopy_size, uint64_t precopy_init_size, uint64_t precopy_dirty_size) " (%s) precopy 0x%"PRIx64" postcopy 0x%"PRIx64" stopcopy size 0x%"PRIx64" precopy initial size 0x%"PRIx64" precopy dirty size 0x%"PRIx64 +vfio_save_iterate(const char *name, uint64_t precopy_init_size, uint64_t precopy_dirty_size) " (%s) precopy initial size %"PRIu64" precopy dirty size %"PRIu64 +vfio_save_setup(const char *name, uint64_t data_buffer_size) " (%s) data buffer size %"PRIu64 +vfio_state_pending_estimate(const char *name, uint64_t precopy, uint64_t postcopy, uint64_t precopy_init_size, uint64_t precopy_dirty_size) " (%s) precopy %"PRIu64" postcopy %"PRIu64" precopy initial size %"PRIu64" precopy dirty size %"PRIu64 +vfio_state_pending_exact(const char *name, uint64_t precopy, uint64_t postcopy, uint64_t stopcopy_size, uint64_t precopy_init_size, uint64_t precopy_dirty_size) " (%s) precopy %"PRIu64" postcopy %"PRIu64" stopcopy size %"PRIu64" precopy initial size %"PRIu64" precopy dirty size %"PRIu64 vfio_vmstate_change(const char *name, int running, const char *reason, const char *dev_state) " (%s) running %d reason %s device state %s" vfio_vmstate_change_prepare(const char *name, int running, const char *reason, const char *dev_state) " (%s) running %d reason %s device state %s"