From nobody Sun Dec 22 09:00:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; arc=fail (BodyHash is different from the expected one); dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1733963147327802.1261396831701; Wed, 11 Dec 2024 16:25:47 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 51FF6136C; Wed, 11 Dec 2024 19:25:46 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 6D6CF1289; Wed, 11 Dec 2024 19:25:01 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 2AF5A12FF; Wed, 11 Dec 2024 19:24:57 -0500 (EST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2075.outbound.protection.outlook.com [40.107.100.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 7727A1270 for ; Wed, 11 Dec 2024 19:24:43 -0500 (EST) Received: from SN7PR12MB6838.namprd12.prod.outlook.com (2603:10b6:806:266::18) by MN0PR12MB6103.namprd12.prod.outlook.com (2603:10b6:208:3c9::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.16; Thu, 12 Dec 2024 00:24:40 +0000 Received: from SN7PR12MB6838.namprd12.prod.outlook.com ([fe80::529d:478:bc5d:b400]) by SN7PR12MB6838.namprd12.prod.outlook.com ([fe80::529d:478:bc5d:b400%6]) with mapi id 15.20.8251.008; Thu, 12 Dec 2024 00:24:40 +0000 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, FORGED_SPF_HELO,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.4 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DWIGwr+cWnlWXa89eRC5iilX4gbDAZwSnH/7EMXwr8y776GqV97JL1BduAvHVM4VyqgWgLWM/uqqPl30U2R2esqUyIetMpDLH+3eeNAr+/kHoTAo/qoxm1S51VSHmR5XUuvrIUJ4wjdCnBpMl/sY+9L1R+E6TYzp2PWAdqa8gCNVn8SmWGhnx+TPoVGo2izGHjuZJyNh0Ux8iROSDG9R8eUKz1wWMuKHd5maDUEjVuSExrgDPmNyOs58wYSSrp4v10H0HdyaIjfiNXSOHw14HAdRwqULVaamVe4WDQehkirFxXW3A2Dc3RYAkRRutcVeb98MhW+sVUqZVP/2mqUpEQ== 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=eZ6XtH4eY35sSVQwcHC8vFgqUWzZLfYedDgOYCE8HZ0=; b=iRPnv2nBzmQkPqLgzoHheLJ8qVvtfEVqwGifIFroG62EFqotZvoyWj58WisyxReGZna0cyAhxYAC+Llk9DcVamwEO5nJF++XSJ8t3z6OcZXyM0SRpsNG+fxchLQmbuLY8njkXivxwz30HFQq7ZCLlnOUsArXP4vujTVDNwQ00qHK4YEOzpQclH5Rc4GLp6jH1bV3nC7s+Xy8D9sAQ9SjKMFW37MOk/xJHis+mr+AR2G7JnAi4fxzGUXd+pdQdYvnwtMB8krjPl9/iMS0+JmT0H2suaukUE/h3ImMkz1k5quofCYWUfwu0Ey2KYWhSB3Zy8MAxIHe2o9lJYVASY0hqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none 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=eZ6XtH4eY35sSVQwcHC8vFgqUWzZLfYedDgOYCE8HZ0=; b=Tjxf+KCNfLReonJyDXAYSyVYxhzwrVbpTC6Jc+q1opdrKaqIuyZ+V5mFSQxq7jpKmmN8Fhb21Y0PQiZsXb55Q3xk/q2J9ItiODRmyGisgHAQLqeuHIH5kbZqFM70xmZFodEGkEjovQayz68BC0UUUU3D7dxMB1bXADoOj9dJpkqgD6IG5yP4c9RrTHGNi+RjoWYx4JP74zmySpXLLRbDl9BFLZTme3qEPULQA9RBfuQRi+fD6n9qo7t2kBZfETaT5hQUGiLGvFT9BcG5egY/CACspc0kR2ItVkijrobBgZoLHJvGCiVXzSZUDQpJa9jN273ATpOrOLrSB2rasJCntg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; To: devel@lists.libvirt.org Subject: [RFC PATCH 1/5] conf: Add a nestedSmmuv3 IOMMU model Date: Wed, 11 Dec 2024 16:24:19 -0800 Message-Id: <20241212002423.1050892-2-nathanc@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241212002423.1050892-1-nathanc@nvidia.com> References: <20241212002423.1050892-1-nathanc@nvidia.com> X-ClientProxiedBy: SJ0PR05CA0208.namprd05.prod.outlook.com (2603:10b6:a03:330::33) To SN7PR12MB6838.namprd12.prod.outlook.com (2603:10b6:806:266::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR12MB6838:EE_|MN0PR12MB6103:EE_ X-MS-Office365-Filtering-Correlation-Id: 092cf2b1-994b-419a-75aa-08dd1a435e73 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?pD4OUHagfdv9TuXcVTwyr5qKodwjRevtCB2EU5w0Ynxf72pduPlOwIPzHpNp?= =?us-ascii?Q?ClWjET6wpLFcAv6oGlE+4iTJdGgF5rQcivGJVb8TW6GCZnPCIU2mb95mEM3p?= =?us-ascii?Q?L+wV1vSlXEsJInmdmsQy3+nbO3S7thEQSmPOlDPOFw5rS3NzLv1dgwuPhdWj?= =?us-ascii?Q?M7WzLYzaMMLYLKHC/zzpTKu/C/24Q1ix+VcZDRY6Tcz/d8HqQ/yK5EuCvCTN?= =?us-ascii?Q?vCucaeMIz6US2z/YGMkfnO9JxOeq5tPTGYuB69xRQmXXhDEl6/+lfGr3xgVI?= =?us-ascii?Q?YYHPs7Wv8IHwHzYmv5+toicWsBuFRq6P9V8TXUtVQhQwqAiWaQrfvKkuQfgV?= =?us-ascii?Q?XtPRigi2mlq0QDjwQPTFbPmVek4OeaADD2fjlxtPFL4qiNQx960hbcIFXarx?= =?us-ascii?Q?VE0yFydZh03Ccriia4iAcEYr90Nw+1WEsBBJxeLC5GY6lYQqnERpqZUv6BnP?= =?us-ascii?Q?miMHaB2H12kMdEfuwAoK1Jfp8HPeLNDh/VEVfOFiyBCK9P0MUhRaqD6FyUmZ?= =?us-ascii?Q?cGofshoKWH8OgZXwth4RQM/cBNYotL/W9kh11EUu9LnO7PSz8yTZzpoOJT2g?= =?us-ascii?Q?Rh854LNAR2EW7ZwNs0pc6NaCIk4OrzN5/srrIwwbQUYFcUV131kV90KqGEqZ?= =?us-ascii?Q?8gEGRdQ2/SdQuLdYMeb8DJCXsDStgyQ/LM0e24kysg28iZTRwFFEm9H1KHyz?= =?us-ascii?Q?Su/4DVnCeRmWURePCeksdWg8Siv5XE3WsZlGSrrgO0jdcTOV44MZVkNDhiOq?= =?us-ascii?Q?C+E13wQbUcKn2b5OgHpTRB/SVoOqBamAsDy7fBeOykQ8NOL8EzSFyxuc4zyb?= =?us-ascii?Q?dBo/RkaxvV8/twnU9saD2s1ukTjRn9F5EbN8LbaojDcIc7MyV4mcLMnmu0D6?= =?us-ascii?Q?F/1UzlBMBnpZb4x1S6JSve5SIySZ/vH8t43eawHkN9h9CBWqKF4H4JbXu+3V?= =?us-ascii?Q?PhJl/jc2/6+oa7pv/9hdOQY1PI6wfGD8fNIafz+7NIMqhcrkeuBhCjmCWQrX?= =?us-ascii?Q?dxtyzzfEYxSmdyGG/9NlcX98uZeAnuNZyIk7BSnRxLkUWUZvROXj0d7cniMj?= =?us-ascii?Q?oN5bSQ3wrIYT1iN6SeUsINs4hvTYJF0f/dK4DxlmPdDxhMRBSW/BD/PDp0L9?= =?us-ascii?Q?qYX/Y0fhrMzkDIrCpd56m6/1JL9x15oK3sjMK37Z6WREcxjLnI+ZZB+pzU/K?= =?us-ascii?Q?MrN/kHsNFKynYLxOL6i1JrlcgkCN4lIUDUSkMu77IONMVHSLPJbJwZKZ4Zf0?= =?us-ascii?Q?/14QcKbkgP2GxRX6cVHH9KGJD3/m0ifFSr9IkUSycRzXvDVNOnRg3q2XOUgL?= =?us-ascii?Q?dY9dFdC+0eNIpzh7/CsbjpoO+peDt5lm1w0a3MxnHJgKng=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN7PR12MB6838.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?JvneOjohy1JjYc/lCcb1qC+x9jc+8F+W6Fj/hmJ4aea1HBIV4xPfiVbkv5Ng?= =?us-ascii?Q?yHrc+oqHS2DCyzhaKFCn39+8I4TglzzC8hwZJumrUgpE1s8koh5/W7wo6itf?= =?us-ascii?Q?iJMOTh4np3TDwOwbRxhFjlGSw0qVIjuXzwVd5OcIzLAyd0FlRZw4OIoMiVu+?= =?us-ascii?Q?JBtpyjQsMu24w7jZlnuWxYkzYm6Ju7BDFlrb0rS8yqZcPQ/RXFzD5iWfFh0L?= =?us-ascii?Q?ladTsexfNci/tKZWiAHqFwnUuuz8H3H8v+gB6FT0sPUNERLRhBS8/awU2NA4?= =?us-ascii?Q?daOmEoxmxzxkSgg9PyAH4Eumzmhp2UeLvyESAqJ8xc/3WMctc53QQPP84o0A?= =?us-ascii?Q?Kss8OrT3t0eD0cqKkREL5z/1BLL5R3XCKYo8B6VZFXHKf5YmGBbaq9v3du1Q?= =?us-ascii?Q?b9KuvqXXfWZbQ6xBNW/6yNq3LOjm8Unp7BpQHY/Ei3sU39vWu4FS0tPx+ici?= =?us-ascii?Q?GoU4DNxH1tkBe7eRPbRarX9tbjS03j1ClXA/79bamt+jBB73RBnsG8AqSfdq?= =?us-ascii?Q?l4E64BgUgOD8Rg1d7Ij5t8ETylaiPz6dyJgtBNO/Qm2YPRo/EB23GE4G2ojf?= =?us-ascii?Q?kcVguyr1n8URIhMIHmDucRgm42Sty27Vg/22N4v6jweKBCIdDpQ0RJs6EdDz?= =?us-ascii?Q?WQeULNJQTydT2iO+U09roK5uMfsgLHt8MtkDS0mXOlaqFXyb0rR45D8qAVPe?= =?us-ascii?Q?d9I1l7OHlr5XnOCSUt0vv0QSI7D+aYU/TDQroLgVIrOFxChMVRzLXlG1JmTA?= =?us-ascii?Q?WqqyWLN3SxoMfUUv3cqdEQ/4xdCyuvVsQ2es4Af0D/IO0bDn0eUPejUPjTlH?= =?us-ascii?Q?U2jzVCH2lJX/gC6K2NsaDhewaDRb1pVm1DXl7GCYulytpbzquTOoNZPAcNSm?= =?us-ascii?Q?VFVK+soQUqMb0ZJoCikuQg2wHtAMk+YO6oSKerRvGwYlULrKraJ6hcPemSs3?= =?us-ascii?Q?Vg4+cb/pnnT1jVlKevJVvfsBsdAHDzyhqJFGCFBAdam1k/y8MQxO1A/T+7ts?= =?us-ascii?Q?SyH0a0IG+BxlJVhSjIdieb4bHTfQZ3fs8j+5ODQH5rgdbGzBO7k04fUZCIh+?= =?us-ascii?Q?/u2xCqXK55FJ9oIeDjHbV9LmwaRveUFU37wOIoSt8QTx+UUy9fdICFTn8TdM?= =?us-ascii?Q?Nix/gHyGbDHULcBt8x/QNNnICrf6Qz6W2y4NPHKkFep4SCcU6OgNoLoHRqi5?= =?us-ascii?Q?Wf3AGS86tbsqbbfEI/pWXTRumEkLkuwZJ81Mmzhma7aXwoZFLbfedzugPpJt?= =?us-ascii?Q?TKWezJBP11xQmP7f3pLa2m1zdQMilwGx8TwGytqXsdLEANN4s7GgTY6hWomR?= =?us-ascii?Q?h7thfe/3lPKz60B6pZlT9DEShqOc0JrJ2BN+aDnfrj8RdcEUwQg2Nx1UnHCW?= =?us-ascii?Q?ot9qrFLn6tz2EfnImVYIiWwqz6sTiHqolY5bkUHyqowgGiPlhDV39ronZckT?= =?us-ascii?Q?Qqk0j2bMEq94Dc3accP1kkgUXYLG3sfLFKHsKVudqEftlhsv6W2dptUGmbUS?= =?us-ascii?Q?4u8I7IDXMBWzVeEOUiALmgcD7DXEKqLe6cQkNaXTrCsWCy2KoewMcStAdY0f?= =?us-ascii?Q?ZWMMxgJ6rgMVROL93BAalVxbYUMk4DP3+jA1SnWC?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 092cf2b1-994b-419a-75aa-08dd1a435e73 X-MS-Exchange-CrossTenant-AuthSource: SN7PR12MB6838.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2024 00:24:40.7147 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 60womefQRdKBT9yQ0szVk58DfOo2vdheRvSa/k+vDLQgSUtZaWEJIQw8tdhI3xOzvPF2I2lT92cGXSJd9oBvnQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6103 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: OT2RXQLFAHGSQQ6EBOT775PAIUJYUIXI X-Message-ID-Hash: OT2RXQLFAHGSQQ6EBOT775PAIUJYUIXI X-MailFrom: nathanc@nvidia.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Nicolin Chen , Shameerali Kolothum Thodi , Nathan Chen X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Nathan Chen via Devel Reply-To: Nathan Chen X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1733963147801116600 Content-Type: text/plain; charset="utf-8" Add support for specifying "nestedSmmuv3" as the IOMMU model. In the follow= ing commits, when the "nestedSmmuv3" IOMMU model is parsed from the VM definiti= on, PXB controllers and "nestedSmmuv3" devices will be auto-added to the VM definition and VFIO devices will be routed to PXB controllers based on their association with host SMMU nodes. The auto-added "nestedSmmuv3" devices will each be attached to a PXB controller so that VFIO devices with unique host SMMU node associations are attached to unique PXB controllers. Signed-off-by: Nathan Chen --- docs/formatdomain.rst | 5 +++-- src/conf/domain_conf.c | 1 + src/conf/domain_conf.h | 1 + src/conf/domain_validate.c | 2 ++ src/conf/schemas/domaincommon.rng | 1 + src/qemu/qemu_command.c | 6 +++++- src/qemu/qemu_domain_address.c | 2 ++ src/qemu/qemu_validate.c | 15 +++++++++++++++ 8 files changed, 30 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 60bee8bd4f..63bb565991 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -8729,8 +8729,9 @@ Example: ... =20 ``model`` - Supported values are ``intel`` (for Q35 guests) ``smmuv3`` - (:since:`since 5.5.0`, for ARM virt guests), and ``virtio`` + Supported values are ``intel`` (for Q35 guests), ``smmuv3`` + (:since:`since 5.5.0`, for ARM virt guests), ``nestedSmmuv3`` + (for ARM virt guests), and ``virtio`` (:since:`since 8.3.0`, for Q35 and ARM virt guests). =20 ``driver`` diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 4ad8289b89..c1092551e0 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1349,6 +1349,7 @@ VIR_ENUM_IMPL(virDomainIOMMUModel, "intel", "smmuv3", "virtio", + "nestedSmmuv3", ); =20 VIR_ENUM_IMPL(virDomainVsockModel, diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index a187ab4083..f8ab1b7d2f 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2944,6 +2944,7 @@ typedef enum { VIR_DOMAIN_IOMMU_MODEL_INTEL, VIR_DOMAIN_IOMMU_MODEL_SMMUV3, VIR_DOMAIN_IOMMU_MODEL_VIRTIO, + VIR_DOMAIN_IOMMU_MODEL_NESTED_SMMUV3, =20 VIR_DOMAIN_IOMMU_MODEL_LAST } virDomainIOMMUModel; diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 1034bb57f5..c8b7b701bf 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -3001,6 +3001,7 @@ virDomainIOMMUDefValidate(const virDomainIOMMUDef *io= mmu) { switch (iommu->model) { case VIR_DOMAIN_IOMMU_MODEL_SMMUV3: + case VIR_DOMAIN_IOMMU_MODEL_NESTED_SMMUV3: case VIR_DOMAIN_IOMMU_MODEL_VIRTIO: if (iommu->intremap !=3D VIR_TRISTATE_SWITCH_ABSENT || iommu->caching_mode !=3D VIR_TRISTATE_SWITCH_ABSENT || @@ -3022,6 +3023,7 @@ virDomainIOMMUDefValidate(const virDomainIOMMUDef *io= mmu) =20 switch (iommu->model) { case VIR_DOMAIN_IOMMU_MODEL_SMMUV3: + case VIR_DOMAIN_IOMMU_MODEL_NESTED_SMMUV3: case VIR_DOMAIN_IOMMU_MODEL_INTEL: if (iommu->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { virReportError(VIR_ERR_XML_ERROR, diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index b3fdbf7ffb..de6a1e5c7e 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -6144,6 +6144,7 @@ intel smmuv3 virtio + nestedSmmuv3 diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index dcb9c4934e..6629addace 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6063,6 +6063,9 @@ qemuBuildIOMMUCommandLine(virCommand *cmd, /* There is no -device for SMMUv3, so nothing to be done here */ return 0; =20 + case VIR_DOMAIN_IOMMU_MODEL_NESTED_SMMUV3: + return 0; + case VIR_DOMAIN_IOMMU_MODEL_LAST: default: virReportEnumRangeError(virDomainIOMMUModel, iommu->model); @@ -6885,7 +6888,8 @@ qemuBuildMachineCommandLine(virCommand *cmd, case VIR_DOMAIN_IOMMU_MODEL_VIRTIO: /* These IOMMUs are formatted in qemuBuildIOMMUCommandLine */ break; - + case VIR_DOMAIN_IOMMU_MODEL_NESTED_SMMUV3: + break; case VIR_DOMAIN_IOMMU_MODEL_LAST: default: virReportEnumRangeError(virDomainIOMMUModel, def->iommu->model= ); diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 970ae3949d..51f4bbd6eb 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -943,6 +943,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDevic= eDef *dev, =20 case VIR_DOMAIN_IOMMU_MODEL_INTEL: case VIR_DOMAIN_IOMMU_MODEL_SMMUV3: + case VIR_DOMAIN_IOMMU_MODEL_NESTED_SMMUV3: case VIR_DOMAIN_IOMMU_MODEL_LAST: /* These are not PCI devices */ return 0; @@ -2367,6 +2368,7 @@ qemuDomainAssignDevicePCISlots(virDomainDef *def, =20 case VIR_DOMAIN_IOMMU_MODEL_INTEL: case VIR_DOMAIN_IOMMU_MODEL_SMMUV3: + case VIR_DOMAIN_IOMMU_MODEL_NESTED_SMMUV3: case VIR_DOMAIN_IOMMU_MODEL_LAST: /* These are not PCI devices */ break; diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index aaa056379e..9f07ffe4a3 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -5104,6 +5104,21 @@ qemuValidateDomainDeviceDefIOMMU(const virDomainIOMM= UDef *iommu, } break; =20 + case VIR_DOMAIN_IOMMU_MODEL_NESTED_SMMUV3: + if (!qemuDomainIsARMVirt(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("IOMMU device: '%1$s' is only supported with = ARM Virt machines"), + virDomainIOMMUModelTypeToString(iommu->model)); + return -1; + } + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_VIRT_IOMMU)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("IOMMU device: '%1$s' is not supported with t= his QEMU binary"), + virDomainIOMMUModelTypeToString(iommu->model)); + return -1; + } + break; + case VIR_DOMAIN_IOMMU_MODEL_LAST: default: virReportEnumRangeError(virDomainIOMMUModel, iommu->model); --=20 2.34.1