Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp579551lqt; Thu, 6 Jun 2024 11:45:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvGJef0zR5Vtd7hNEjgY2xhFLxZqpeVLzykvF2Ypvz5jFeHAn0FOBQE5KzSoKE3AIotYPrT882neasIIOMvey8ePYeZHhLU/yZa2YN0Q== X-Google-Smtp-Source: AGHT+IEAWbIvz54vE3/MU1Vf1RmkEf1BD3NPG36bq7St7XBVI12+F02Jdsr+Or5zheCypxWOR10e X-Received: by 2002:a17:906:5590:b0:a68:fb6b:3d29 with SMTP id a640c23a62f3a-a6cd7a7a957mr27746666b.41.1717699530761; Thu, 06 Jun 2024 11:45:30 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c807494f5si100562566b.955.2024.06.06.11.45.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 11:45:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204906-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="nFpH/lCz"; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-204906-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204906-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 282A81F275EF for ; Thu, 6 Jun 2024 18:45:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CCCF74E1D6; Thu, 6 Jun 2024 18:45:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="nFpH/lCz" Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2078.outbound.protection.outlook.com [40.107.101.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 582B144C73; Thu, 6 Jun 2024 18:45:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.101.78 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717699522; cv=fail; b=dvCKHH82qSsyRgba11qGUbY7+9zSUWSALOu+Cs/0jzV5pAMok5vzmyjxRjwVcJlucF1+Nq5no4YNwpGuV3NP/RAirBzzDVVCo21MGlu2zczjMfr+cLUqnuJuo6VO2haT6zoOnA6k/T3ocRQEeogARmd6NDy6LJ8DQ/Ts9MrG0rk= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717699522; c=relaxed/simple; bh=y1pkgsDTsGQXeYq+O23ikZxMwuDFzGGVcGmBTXGnxMc=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tzNQfwXeCXAQ/qCQJoOb26+sq6Y+BaVXhVcZemZq1tAYqIp1RjwesMHMf5UInb9EGCseZs0i5ExnxEwzYU6aEzWgraNGPxDzEXUH0D5aWznw0AbQALelzzyug6osjLq2snBe62ZPP/HXf5/RXKdKWlAI0M8cfaR7yApJl4oRSLE= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=nFpH/lCz; arc=fail smtp.client-ip=40.107.101.78 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VJT3qgJvuTfE7lQr29XneZ2oPS97+tHYIS+fGS4LR6VCxCNGes7wOSfu+9h3NKK+qBq7xrX+RDtgFxevQsr6adDHXcrXLGRXbzvMA9DHCo5A5SqABr3ol6/1khNg4GSBnWXZaG4eNFXTc9xmt6DK8VxkxxkZFTUXuZMCQv6YuNC78VKICOj8EJQNfDM9VrutgahmJxYr8mdtxugWUhYBOcClxyQUkHK23W1lfHFyiIwfWmO7giD63YA9DmdkNTZvPLQbUiqY5boBwpL6VwPVUTjcrTgMSri/0mkVtefvrKC95mWmsboH/l5tlzQO+LLI8KHoV2RsDAtYbcDONG94jw== 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=DYSgA8Ab/29JkzZQs4QF9l1tc1SwDPJ0O/tHJ4/BpDM=; b=Js7AQq9HVnOH6aaym9VVbcaeogFtX+OaaSi002fPosh/vgGS5rHi/crJqgjaM0JOQVpyidtRpl7U10FCuBvt03NMeoG23ezq+LoPaJkUb9AJUIlvvR/rht59ZGgr7cnmRjpLOaRWzLGQKZ2E7MdZ3t0qDCFW6ervJcLwEA+lP24kQVLG2n2igoGHdqLvs65fLqDW3vRTXi7zAAkAi5yyoiZuCQDjp0FU8i2UtHsRDLJ0mTOYbpOSwHqA21A67nVyeosnZ5ZDozgiyGWBq+k7irpzsSMDYQSXBipvh3D7o9FRs+ElScQYOZARy3xQrzOtCeLgCzkvw3hmzGhuqSl6Ng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=amd.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=DYSgA8Ab/29JkzZQs4QF9l1tc1SwDPJ0O/tHJ4/BpDM=; b=nFpH/lCzRCYtIrKRd+wK2xqGRYZ+qqecCVNmcT8Us9rj6pipNYAmVplGqp8/RNoDFwYQEmrgOKyCM00gdjmyd91HEHXHBLaCAAS13D1oGqDbkFCegsBcj8GR2pe1DhSxNJ0zz53xKkbSSYFMqD9IdHGwu9976qFtCcKnXnn0F6zeZlV8jP9wEEt4Tp0+FZOyCtvHZrCG/y2+tix+91pfZW5QbqgUWnX7pecOIe+Rkw9OMlrrzSIJZOOnboCebx+mEWHhdZkR4NgGKmJXFirBa8BhtOmrFpPeKbvCvOJYccAL1flDp6WZ0jjDVm8nVcGge1PBVuHtZ0RfOm9e5OD/+g== Received: from PH8PR05CA0017.namprd05.prod.outlook.com (2603:10b6:510:2cc::29) by SN7PR12MB6716.namprd12.prod.outlook.com (2603:10b6:806:270::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.31; Thu, 6 Jun 2024 18:45:16 +0000 Received: from CY4PEPF0000E9D4.namprd03.prod.outlook.com (2603:10b6:510:2cc:cafe::59) by PH8PR05CA0017.outlook.office365.com (2603:10b6:510:2cc::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.46 via Frontend Transport; Thu, 6 Jun 2024 18:45:16 +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 CY4PEPF0000E9D4.mail.protection.outlook.com (10.167.241.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Thu, 6 Jun 2024 18:45:16 +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; Thu, 6 Jun 2024 11:45:01 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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; Thu, 6 Jun 2024 11:45:01 -0700 Received: from Asurada-Nvidia (10.127.8.11) 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; Thu, 6 Jun 2024 11:44:59 -0700 Date: Thu, 6 Jun 2024 11:44:58 -0700 From: Nicolin Chen To: Jason Gunthorpe CC: "Tian, Kevin" , "will@kernel.org" , "robin.murphy@arm.com" , "suravee.suthikulpanit@amd.com" , "joro@8bytes.org" , "linux-kernel@vger.kernel.org" , "iommu@lists.linux.dev" , "linux-arm-kernel@lists.infradead.org" , "linux-tegra@vger.kernel.org" , "Liu, Yi L" , "eric.auger@redhat.com" , "vasant.hegde@amd.com" , "jon.grimm@amd.com" , "santosh.shukla@amd.com" , "Dhaval.Giani@amd.com" , "shameerali.kolothum.thodi@huawei.com" Subject: Re: [PATCH RFCv1 08/14] iommufd: Add IOMMU_VIOMMU_SET_DEV_ID ioctl Message-ID: References: <20240524131912.GT20229@nvidia.com> <20240606182423.GF19897@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20240606182423.GF19897@nvidia.com> X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D4:EE_|SN7PR12MB6716:EE_ X-MS-Office365-Filtering-Correlation-Id: e74cda1a-7fb5-4d54-9c51-08dc8658cee1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|82310400017|376005|7416005|36860700004|1800799015; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?ZdhMbIT0O79yj3VZOEnF/4bEDwYHqQTQgdOXtMKNWoHip2NJiRdL72+ZvyaC?= =?us-ascii?Q?WP3+uTUUi/B2G3CA8LruO69NumOxEQtkVlNcY2oXr6gi8kIqoybTUZXI3URW?= =?us-ascii?Q?iBUefLwAfydGVW1sDa02umPfBQ4wASBb+ySD3zy8NUE/IMyxUWnkT0xvJKsK?= =?us-ascii?Q?+gW4sNAzzzXXS6WF08PP1/qUb2P1mQgQSst865UG++ES4TduV+ub/J1ua9w8?= =?us-ascii?Q?NR8laMCbXvt7o8KsinmID8QuJDPYmA97q7SMZEl+A8NZp3lSFCAr3lJNbwiw?= =?us-ascii?Q?FQg0stAMvQ9pW5urwD12RF9WM4q/M5TXFOgGkkHNdpnW3KoGJL7yQBSIZPuK?= =?us-ascii?Q?d4fgv4erHgLxmKlZUTtis6iA5rCLQBzBF7/+ggRLl4t55y0Xj6zeQ3OyGx8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Kuxw1VR7DGsx7QuRqAoEGbyAxVv?= =?us-ascii?Q?huASvjRZdjtOopwITvN/Mhn6j2Nj3BCpJiU4z/Iqfpe6eC0I13Q5x+eaQ00W?= =?us-ascii?Q?jIibkkOWlMYJ7GqLFt0aJ4/tvKB5SNlmloZunXnXcY1EVMDi7g=3D=3D?= 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:(13230031)(82310400017)(376005)(7416005)(36860700004)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2024 18:45:16.4810 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e74cda1a-7fb5-4d54-9c51-08dc8658cee1 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: CY4PEPF0000E9D4.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6716 On Thu, Jun 06, 2024 at 03:24:23PM -0300, Jason Gunthorpe wrote: > On Sun, Jun 02, 2024 at 08:25:34PM -0700, Nicolin Chen wrote: > > > > I understand the appeal of doing this has been to minimize qemu > > > changes in its ACPI parts if we tackle that instead maybe we should > > > just not implement viommu to multiple piommu. It is somewhat > > > complicated. > > > > Would you please clarify that suggestion "not implement viommu > > to multiple piommu"? > > > > For regular nesting (SMMU), we are still doing one vSMMU in the > > VMM, though VCMDQ case would be an exception.... > > This is what I mean, always do multiple vSMMU if there are multiple > physical pSMMUs. Don't replicate any virtual commands across pSMMUs. Thanks for clarifying. That also means you'd prefer putting the command dispatcher in VMM, which is what we have at this moment. Nicolin