From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a17:505:564d:b0:1be9:327d:8ee3 with SMTP id jl13csp3427271njb; Tue, 9 Jul 2024 10:13:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWp47GiDR0sLVwnwlMNqjBX0rZyE12Fycd9at8oosCz6TGgOwoLlvt/Q5pz1IrmrOP8Uco0WjNeXbHHyyZ2grLHimOmu0Tc X-Google-Smtp-Source: AGHT+IHiabCKSgmdv/rKSwnMlEkPN58DVKxTj9qg1OSmtz7PdExZUb6hxX425v5t8ETK2DQgeQTb X-Received: by 2002:a25:7448:0:b0:e03:4fcf:9508 with SMTP id 3f1490d57ef6-e041b03bb5bmr3683267276.11.1720545187275; Tue, 09 Jul 2024 10:13:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720545187; cv=pass; d=google.com; s=arc-20160816; b=l2OtmZJwfNAvXiKnPsomUZnbcEQLsLJB9QlIDxWpV3C/1KGwme+dl2F16LsAYHrzeC +iPMKWSamFXO5BIFAbxsPez4Bbx6mthhTbEEhY28ljIqlbctPsMEdiL+Kl++q+/kDQ14 0vYBLeNmjfqmpMLi0EGUu+bXl5Uby1OpbuJrONd78fZzs36kxwCNkCPWrStSXKl8p7n/ u4YI1PcttM3CowHdu27HkvUtnacz7ElSqsaOey/zWc27PxCtq5SfpXTiotLsKsJrgLh4 KH9Zjqu8M/D5BC8j/xpt9H8bHdZul1s+eU03YPl6SgjXRJCSFTyGO1P/gSpWwkUJhISW z39w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=HAB8a7UycWYWgV9D4xDe01Y4KZBbFrRI+NsBXxRBCVs=; fh=3xWE0IW7veEhpolgwzKxf19ygXkIgh+JlYIMj8YAYmc=; b=dl5pGniAIy8F1lwtob9E7XN80Yhlt7Cu/IYSmso39P7qx/YinRYOyJu72KiW6RYAOG 6OLqErZYnaQBxdJbjNvJx7zD9GJSYFkqgsqfsbiSdn7VtzjxHqHlIovApJeYRK3aQasB FYSadeMr5Pr5aRZs7Syb05v1MocQNBpuws/el6fZcp7VlQ3dGlIv8j+F+cc2WUJwe/Gg N6EMjpqxFXJQSqsUVncUqu+uxkI+cuiDMmEOjEAa5Ad2/MLyXGETSgNXupudOOJPemBH B+uijjMLiV1NKdmYvRuS9tqOjd3RXfbd/uHmV9v25qmpITYrUqgrOhQhJOOfQ3s6HDD4 5c4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=qlaNvZC3; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a1e0cc1a2514c-81076919c59si369498241.15.2024.07.09.10.13.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Jul 2024 10:13:07 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=qlaNvZC3; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sREOa-0008CL-JT; Tue, 09 Jul 2024 13:12:54 -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 1sREOT-0008BB-Eq; Tue, 09 Jul 2024 13:12:46 -0400 Received: from mail-bn1nam02on20619.outbound.protection.outlook.com ([2a01:111:f403:2407::619] helo=NAM02-BN1-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 1sREOK-0000kk-Bk; Tue, 09 Jul 2024 13:12:44 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Azdgczcbm15nahgNeeRDRf2I1aKa55PPPbzYgDchxF+J5oBMo9um+h6fEaae0DOAKq87QSkB18jSoZZzXIjd1lsO9WiPCja75C69PEvKn8OW0cAenFpnbF3NEgPsPgv9kV9ML09LNqxUB/LqvxVvuMx7f0h3nihDWn4EU6p4/D042TYZTg+KbLr//8XCyBZCBNCrThBf69cu/L0Hu6t5+lKsptd4hWQwSHurSkfZlH+mXlJVjG4p7pVZoer4fgCm19Xd/W03HdSA2QC56XSxzl2NOOrKTJ0Ftz2liwtoMGMoBieSljHs6Z287LoPZHigGU7gnhrv+br05FBRF3tXbA== 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=HAB8a7UycWYWgV9D4xDe01Y4KZBbFrRI+NsBXxRBCVs=; b=gWwybXPQFYPxcuI5pt9BardzllID03+R1/N4BYTKRNhSmQuPS4Wyy/h4HSJ2sKp5CkNsuslMdDzVwZjhzRUYhkQ7iPXVKVFaTjDs3he3MMn9x1OOx7chyJRz2B90KOsHpjtBIm4qizajhRdn2RFv6/wgNZ+gM7lv9PiDnQTufNWD+UbUVXGenlbCWjmmiPyMIf8ECbgD4PhVsxRdUYxuECnMDukISFUJDAxYrruDTQ2nBna3glPfkQmVDT53o9TJvPGqnAYdQgunMjpTJ8QnBCSCfLuiaHCakCH+1PSc1QPBvrqQncCSPsgwR0Jkolb+Ir4rsAHCjbBcGE6Yo3hh/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=redhat.com 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=HAB8a7UycWYWgV9D4xDe01Y4KZBbFrRI+NsBXxRBCVs=; b=qlaNvZC3GORH1ZH62hSX79no5mic9OBp18NF2/Mip6aS9JpypVSQzYiYscXTSUpyblbaLy2QP3J9GnORoRcYW/+MAfnCZHu+KmhFVpnE8EyWfp5F67QEGyIqM3DooFNHyZ3u/jIWKgRTcMFx/YVSyq4UZMX6LwbR3kOKnrxxWhqF+MHdtE5R5W327fMu0WyChnT+mqfAWD1+wlP38yJg/G2lIXMwX6aziQnTBSTV9jKZjpvoQycoKcoALzcywDCwb2uGNCH5+3xuaB1frRN5LaZ9kTWzWk5erPqiLmwI4kMeSkvVgbB64k+6z54FIYjZAVqaJLEUOiXH0YT9qZEOlA== Received: from CH5PR04CA0024.namprd04.prod.outlook.com (2603:10b6:610:1f4::9) by SA1PR12MB8144.namprd12.prod.outlook.com (2603:10b6:806:337::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Tue, 9 Jul 2024 17:12:25 +0000 Received: from CH3PEPF0000000D.namprd04.prod.outlook.com (2603:10b6:610:1f4:cafe::43) by CH5PR04CA0024.outlook.office365.com (2603:10b6:610:1f4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.19 via Frontend Transport; Tue, 9 Jul 2024 17:12:20 +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 CH3PEPF0000000D.mail.protection.outlook.com (10.167.244.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Tue, 9 Jul 2024 17:12:20 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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; Tue, 9 Jul 2024 10:11:58 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 9 Jul 2024 10:11:58 -0700 Received: from Asurada-Nvidia (10.127.8.14) by mail.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 via Frontend Transport; Tue, 9 Jul 2024 10:11:57 -0700 Date: Tue, 9 Jul 2024 10:11:55 -0700 From: Nicolin Chen To: Eric Auger CC: , , , , , , , , , , Subject: Re: [PATCH RFCv1 03/10] hw/arm/virt: Get the number of host-level SMMUv3 instances Message-ID: References: <886883c4cb43117ef26e6c9434247b75cd827f31.1719361174.git.nicolinc@nvidia.com> <3d151591-4cc6-4de4-8055-27d6fb7200df@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <3d151591-4cc6-4de4-8055-27d6fb7200df@redhat.com> X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PEPF0000000D:EE_|SA1PR12MB8144:EE_ X-MS-Office365-Filtering-Correlation-Id: 1d8183a8-b73a-4ee6-b7b2-08dca03a4b12 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|7416014|1800799024|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?AgViRgk2TORBblnUz2v4ary3kIjZ5yLOyV90ziIw0ck1XDYaApJKOkQs3GjI?= =?us-ascii?Q?sp/BTowOJcQsTRMooiRtoN4TfdM+sFLM5v6tuJdcIF3UKIxxyg1q/Rko/y0U?= =?us-ascii?Q?qkxvRRHyv1EASGsNvQnXy8mjS34DA+OWIX6zauBYRiuLS+62IlrVJRlftZ/+?= =?us-ascii?Q?eGzwgTNWNXzk5q/irnbmQfI76MXdJhLdnX1WFdZvxj+2+WDTLxQDwmkbyvis?= =?us-ascii?Q?KdUhetfhW5MVzj7y4fyaZaLb20xqg8aTwZn3UPDJI7HOkbzeh/gGZIFtjW5W?= =?us-ascii?Q?fhP2u4OdUlePM0BX9pU47dekGTB2tooD08DB5nCzCYtqwEBIq3TG+9k0hI3t?= =?us-ascii?Q?/6GVdm+eNMdZJ1zJQMNNaDfzHRuOWyj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-ascii?Q?WVsMkTQpEcW13rT0CgSdtykBPlkzlUUbtcfODwM35gEVtrwA8AtLXPjvvL7G?= =?us-ascii?Q?N067PFGwnOnG630sPM3tF5GvsPfbQblLOsypAaeuwMCM3AirM5YLEGaI3YI/?= =?us-ascii?Q?f+NecbiYefPHxWQBKIqvK6XvTsqn4KuG9ePdSkFiVNoTVBaEbSf58xFb67VT?= =?us-ascii?Q?03ii7ta9sT398gbaXV+uY1kgh92zLC/e?= 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)(7416014)(1800799024)(376014)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2024 17:12:20.6270 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1d8183a8-b73a-4ee6-b7b2-08dca03a4b12 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: CH3PEPF0000000D.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8144 Received-SPF: softfail client-ip=2a01:111:f403:2407::619; envelope-from=nicolinc@nvidia.com; helo=NAM02-BN1-obe.outbound.protection.outlook.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.144, 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-arm@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-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: 3jMUQsppxy9a On Tue, Jul 09, 2024 at 11:20:16AM +0200, Eric Auger wrote: > On 6/26/24 02:28, Nicolin Chen wrote: > > Nested SMMUv3 feature requires the support/presence of host-level SMMUv3 > > instance(s). Add a helper to read the sysfs for the number of instances. > > Log them in a vms list using a new struct VirtNestedSmmu. > > > > This will be used by a following patch to assign a passthrough device to > > corresponding nested SMMUv3 instance. > Laterly the HostIOMMUDevice has been introduced to allow, among other > things, to pass information related to the physical IOMMU to the virtual > IOMMU. > I guess it would be well fitted to associate the viommu with its > underlying piommu. Wow, I missed that part -- backends/host_iommu_device. I will see how I can fit these well with that. > I don't think we have such kind of host introspection in machine type. > Generally in can happen in the very device or in libvirt. I think the biggest reason for having such an introspection in the virt code is because of hotplug, (though it's not properly implemented yet), as we don't know what new devices requiring for nested translation would be joining later. So somebody has to hold a full list. Would you mind elaborating how the "device" or "libvirt" can handle that? Thanks! Nicolin