From nobody Mon Nov 25 12:31:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nvidia.com); dmarc=pass(p=reject dis=none) header.from=nvidia.com ARC-Seal: i=2; a=rsa-sha256; t=1715779403; cv=pass; d=zohomail.com; s=zohoarc; b=a3rV/EyJMp82xt6AH0oDFoD2QGKczBoge+XKTOHgD9zaXvsKhta+7kuErCEogKqt9SPrtugU8CPNidlqRWTCO+6KudBmHVHUSMwt6nuu6J06sZn4B2GzDGaIfk2hGlOmvMtlT6V7Hnt+KUyByRkUyueV/BJq0b8hs7WgWfLlgJU= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715779403; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SmWO0AxSzPSaSe9bmaQhyDXGyhc+LqakSOpDXCeOnD8=; b=CyGWwIxvfee5S/xUE/MnHK0WexHwwraNRbZV4Gk/CnS+ASGH+rEuw2AnaYdzKhTGyy7SfXBJNBDFyxNcRTFFmU3mNwaDXjpENUWVisvNwHbrcA3MuKrUImIB/PekEv92ff+3ny7Cb+Cp2mVacblZqSCRGctafTGglJrfeRmtCws= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nvidia.com); dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1715779403759496.4649459665145; Wed, 15 May 2024 06:23:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7EaS-0001KT-4w; Wed, 15 May 2024 09:22:28 -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 1s7EaP-0001KA-2B for qemu-devel@nongnu.org; Wed, 15 May 2024 09:22:26 -0400 Received: from mail-bn8nam12on20600.outbound.protection.outlook.com ([2a01:111:f403:2418::600] 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 1s7EaJ-0007Gf-HB for qemu-devel@nongnu.org; Wed, 15 May 2024 09:22:24 -0400 Received: from BL0PR02CA0074.namprd02.prod.outlook.com (2603:10b6:208:51::15) by SN7PR12MB7787.namprd12.prod.outlook.com (2603:10b6:806:347::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.55; Wed, 15 May 2024 13:22:14 +0000 Received: from MN1PEPF0000F0E5.namprd04.prod.outlook.com (2603:10b6:208:51:cafe::95) by BL0PR02CA0074.outlook.office365.com (2603:10b6:208:51::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.55 via Frontend Transport; Wed, 15 May 2024 13:22:14 +0000 Received: from mail.nvidia.com (216.228.118.232) by MN1PEPF0000F0E5.mail.protection.outlook.com (10.167.242.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.21 via Frontend Transport; Wed, 15 May 2024 13:22:14 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 15 May 2024 06:21:45 -0700 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 15 May 2024 06:21:44 -0700 Received: from vdi.nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 15 May 2024 06:21:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MgvBCfs3Re7EbQ6ie+YlXs1oje4xofncRYNGfGSRv30cKzflEpeCiRzRYOXRrEI07RV9k2Nlsft8lO28Ra9FiPMZaybnlsadFVNzUWHEsiVXdPYTOvg6x9MGFg+bo5uAPkgsM5glNB0kv8vLxF5d379/ojL49RhlRkI/sHPJxA784/3Bs8pScsJHDTRlhQev4rLZlwtx+aUB8dzU1uE/MxmDEwpcRBAEspzZkU0Dx78XedrHEd3BqC7Q77MuUHvgJ0EbQWDDiEbpvWMrAwK5FKJi+O8HHCnyvnHO/F5Wm/Yn/zqWi2LL1sYDDjlVBNFHdTUZkmWMmgUShiuUIKtOmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=SmWO0AxSzPSaSe9bmaQhyDXGyhc+LqakSOpDXCeOnD8=; b=NpMPH3CttKPpE4zlsiQKLGRL5pLr8pXTq9dS8rxGW/Jwz9DVP7fuh+yXb+43lWF4ufICFGK/iSoRMESTGSmwnn6AWx+AZC5U5dlaL6Df/LumTfdM7YGK0bDcDysR0c0yzof2u2TgtrsoNEQ6ppXD/TxAmQtmWsG5v6Smw/fjxRYskQiIe0oGKXNqwERWpBIzBQLGlQLns/QoI2NfxVOgpH57TCR4PhSLM2rK1kxqvxh1p3+LYFY5/mRdFvDEmL0I+IIzk8hB3TAwEweAyWADq/E9Dxg2/Y0q++EJOTXHoqS8HM8bRnYvaoqdhVuunRNdMG7NEEcEtZuvKevagAGvXw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=nongnu.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SmWO0AxSzPSaSe9bmaQhyDXGyhc+LqakSOpDXCeOnD8=; b=l17m4B6VnNs83rse4fwXp+ExAWt0SFNooZ6vbRcPSndMWIYmiGnOry55i35tSgQheqSDP2EmtN2i2WwzLIww0oUcRhiulxQLL2BJ349V/Svnm2PWjKyiSYZvrOCv04C3dSncO9cWgeyHAaTJ+IySn2ejy4f7c9hb3l+6j8YYYIG4h2M27pF9Ze3J7/cGfBRaIGvD8riG1++7UInEJ/UoQ6CzKDkBAPVA/9LcB1IhvceOQRiT1Ewf00TXv7YN1ZJDbcSsXyqNHyUZAPz4sgo59WSTtDc13XqWbLXXRQ77MO5X/0d7jydSZkbKvPqVzWDr2Bzd0GqrlhmokInW8PhwNw== X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C From: Avihai Horon To: CC: Alex Williamson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Markus Armbruster , Michael Roth , Eric Blake , Peter Xu , Fabiano Rosas , Joao Martins , Maor Gottlieb , Avihai Horon Subject: [PATCH v3 1/4] qapi/vfio: Add VFIO migration QAPI event Date: Wed, 15 May 2024 16:21:35 +0300 Message-ID: <20240515132138.4560-2-avihaih@nvidia.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20240515132138.4560-1-avihaih@nvidia.com> References: <20240515132138.4560-1-avihaih@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000F0E5:EE_|SN7PR12MB7787:EE_ X-MS-Office365-Filtering-Correlation-Id: 47a930e1-ec12-4ce1-e717-08dc74e2090e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|36860700004|376005|82310400017|1800799015; X-Microsoft-Antispam-Message-Info: =?utf-8?B?ZjREczI0cUlyWEloLzFRd2w2MFRrSmxuZkxzS0FJeTh2d3NUNG9tQUFUSzQz?= =?utf-8?B?UjRkMUl6VkwwVTJYRDdWQlNTbUZDV1hGZi9QVHdXcG95NUxHbjAwcFFrWDJq?= =?utf-8?B?ZWRwTVN1Tktnb1QwdTR3NitySkFLWGNiMmJXL1BkRzJKVi8zMmh1STd5S083?= =?utf-8?B?ek5UMFRLeXJWZG4xc3phdTYyNk14OVBDWWJEKzNYSHZNeFZta25GRENIZ1hn?= =?utf-8?B?RW5Jc1p0d0NRYThZekxUVzNKRWxCK1BaWVB6M2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U2hQRWpqMnRlNG83ZGtHNU9RcFArd3M0UWpjRHBK?= =?utf-8?B?OEdtbEhHd09RKzVjbnpnelJxeTZrYWI3cGJObitBYUNZK1JxbGtmQWhzN3E0?= =?utf-8?B?UjFQL1FqdXpGQUQ0bHFiWFhURFNoM0JhYzQ3VzdBYUt3T09wZjRQYmQremFW?= =?utf-8?B?M0ZKb3RHaGZtM2piRFBRMkpTTFRVaWtEMTBEbERBdzk1dlp6N2FVUXRGdDdZ?= =?utf-8?B?V0tOMFkwRnJCNWR6WURGTVpxR3kyUFJkalhXbzkyR0JBUDFhQ1YxcWJ4eVlH?= =?utf-8?B?ZDNNckhtWTdxQlZZMXVoK1Z1QklGamRvT04yb2dGVkdSRUZCeEdqUG1sOVNV?= =?utf-8?B?d2lNempxU2hPUis1T1pveUgrRDVIdW5aR2lGMC8rbUJVa2ZDVGlUbzZjM2pO?= =?utf-8?B?dDZEaEplVjI2Z21IelBkQ3JkMWJmSE5YcXh6MlExSm5WWGF4dU56WS9mNGhJ?= =?utf-8?B?bHU3OTR4TGYrTjFQbHNZZzNKSUgzQUZXL240K3Q1MVkwZXlBekRjR2JqdHFt?= =?utf-8?B?eFJMTUVCa3ZBaENkRVU2anR1ejUwemdRK3FPNmFJQzZCVHRVM2F3RHVhWEM4?= =?utf-8?B?OHQzb25MeVozSWhWbEhpRU5wa2pka0dtY3MxNFliZ3NieTEzTktsbUpSWVB0?= =?utf-8?B?aVZ4dXd6WWNOYkgwSFpZWDBkSERFS0hkUnkvcmowayt4VDdnTCtFVElJdllY?= =?utf-8?Q?IXoLBh4wPf1bW?= X-Forefront-Antispam-Report: CIP:216.228.118.232; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge1.nvidia.com; CAT:NONE; SFS:(13230031)(36860700004)(376005)(82310400017)(1800799015); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2024 13:22:14.1295 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 47a930e1-ec12-4ce1-e717-08dc74e2090e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.232]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000F0E5.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7787 Received-SPF: softfail client-ip=2a01:111:f403:2418::600; envelope-from=avihaih@nvidia.com; helo=NAM12-BN8-obe.outbound.protection.outlook.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.935, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @Nvidia.com) X-ZM-MESSAGEID: 1715779404681100009 Add a new QAPI event for VFIO migration. This event will be emitted when a VFIO device changes its migration state, for example, during migration or when stopping/starting the guest. This event can be used by management applications to get updates on the current state of the VFIO device for their own purposes. Note that this new event is introduced since VFIO devices have a unique set of migration states which cannot be described as accurately by other existing events such as run state or migration status. Signed-off-by: Avihai Horon Reviewed-by: C=C3=A9dric Le Goater --- MAINTAINERS | 1 + qapi/qapi-schema.json | 1 + qapi/vfio.json | 67 +++++++++++++++++++++++++++++++++++++++++++ qapi/meson.build | 1 + 4 files changed, 70 insertions(+) create mode 100644 qapi/vfio.json diff --git a/MAINTAINERS b/MAINTAINERS index 1b79767d61..448dc951c5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2164,6 +2164,7 @@ F: hw/vfio/* F: include/hw/vfio/ F: docs/igd-assign.txt F: docs/devel/migration/vfio.rst +F: qapi/vfio.json =20 vfio-ccw M: Eric Farman diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json index 5e33da7228..b1581988e4 100644 --- a/qapi/qapi-schema.json +++ b/qapi/qapi-schema.json @@ -78,5 +78,6 @@ { 'include': 'pci.json' } { 'include': 'stats.json' } { 'include': 'virtio.json' } +{ 'include': 'vfio.json' } { 'include': 'cryptodev.json' } { 'include': 'cxl.json' } diff --git a/qapi/vfio.json b/qapi/vfio.json new file mode 100644 index 0000000000..a0e5013188 --- /dev/null +++ b/qapi/vfio.json @@ -0,0 +1,67 @@ +# -*- Mode: Python -*- +# vim: filetype=3Dpython +# + +## +# =3D VFIO devices +## + +## +# @VfioMigrationState: +# +# An enumeration of the VFIO device migration states. +# +# @stop: The device is stopped. +# +# @running: The device is running. +# +# @stop-copy: The device is stopped and its internal state is available +# for reading. +# +# @resuming: The device is stopped and its internal state is available +# for writing. +# +# @running-p2p: The device is running in the P2P quiescent state. +# +# @pre-copy: The device is running, tracking its internal state and its +# internal state is available for reading. +# +# @pre-copy-p2p: The device is running in the P2P quiescent state, +# tracking its internal state and its internal state is available +# for reading. +# +# Since: 9.1 +## +{ 'enum': 'VfioMigrationState', + 'data': [ 'stop', 'running', 'stop-copy', 'resuming', 'running-p2p', + 'pre-copy', 'pre-copy-p2p' ], + 'prefix': 'QAPI_VFIO_MIGRATION_STATE' } + +## +# @VFIO_MIGRATION: +# +# This event is emitted when a VFIO device migration state is changed. +# +# @device-id: The device's id, if it has one. +# +# @qom-path: The device's QOM path. +# +# @device-state: The new changed device migration state. +# +# Since: 9.1 +# +# Example: +# +# <- { "timestamp": { "seconds": 1713771323, "microseconds": 212268 }, +# "event": "VFIO_MIGRATION", +# "data": { +# "device-id": "vfio_dev1", +# "qom-path": "/machine/peripheral/vfio_dev1", +# "device-state": "stop" } } +## +{ 'event': 'VFIO_MIGRATION', + 'data': { + 'device-id': 'str', + 'qom-path': 'str', + 'device-state': 'VfioMigrationState' + } } diff --git a/qapi/meson.build b/qapi/meson.build index c92af6e063..e7bc54e5d0 100644 --- a/qapi/meson.build +++ b/qapi/meson.build @@ -52,6 +52,7 @@ qapi_all_modules =3D [ 'stats', 'trace', 'transaction', + 'vfio', 'virtio', 'yank', ] --=20 2.26.3