Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp568641lqt; Thu, 6 Jun 2024 11:24:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVOC11GNOwWu1EmJ7pHEUpp1mSBf/qrV/OHXMMocF3zzC9kXRUyNv0odyU5qaIr9k1IqB9+vjAPSGTDRQIVEApmuKORAxZRJmKELs1o8A== X-Google-Smtp-Source: AGHT+IHgWAhZgj2An3HdicQCwFZsoVCIkRQmv9+b7ZjjZJi+nSKBKwbtK4norWSrRw4BSRX2C1D+ X-Received: by 2002:a05:6e02:1e02:b0:374:a788:1ab8 with SMTP id e9e14a558f8ab-3758038119bmr5676695ab.21.1717698285951; Thu, 06 Jun 2024 11:24:45 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de262c0172si1517686a12.263.2024.06.06.11.24.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 11:24:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204876-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=k63ORTmo; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-204876-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204876-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 892F3281F4A for ; Thu, 6 Jun 2024 18:24:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7AC87FC02; Thu, 6 Jun 2024 18:24:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="k63ORTmo" Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2086.outbound.protection.outlook.com [40.107.100.86]) (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 9608219753C; Thu, 6 Jun 2024 18:24:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.100.86 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717698276; cv=fail; b=I9bJ07uf5p6DG+jwF1UbeSQCx39jh3nNOyn5o1lpFvTfHtba14Zj1Ep5QyyUt3uKfuSOTDWa/CssJ04RnNpN/fOljH8YRDV7c/Oe0u0/gDta96e6KWrKQ8K1JKNeU4kRH/1dLzSdYho5B+yTfFguY8rLdptf2Kg4w9hh6A8gCyM= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717698276; c=relaxed/simple; bh=y1fNpj6A1eb89ZMVSegQdyAcNoSiAXraLfC5lcdy0pE=; h=Date:From:To:Cc:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:MIME-Version; b=Ul9sVA8cz+sc7R+c4TW34ZJyXBqPSYk5A2RG00xF5f0gNlvJpkUWrv8Pyj2MfxvaEowkPxCfqvt2Dn87Fz8P76Z7z6FwdUAWqEvIGgCM7CSXYxJnfmEjBi3HrMhTEDJf9JKGaEZHHY9DcHAwhhhMq9Gt82yrlVF31g3PhuyFyP8= 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=k63ORTmo; arc=fail smtp.client-ip=40.107.100.86 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=G8CNiatn2siq0bGiVYM2tdYHwhCTkJED8Kkb8HR4XO7GWShk3ieFfGDgQdT68kDj6UC1Vn4maB6FWUohsOznkT1h1b3pBn1yh7lqGdViHxUuIbdJqcRg73xlS2QxgIB+nG+gt9IQgHuopO5pz9GHVMJS0KKu6o4aP6UrYOrjXo6QWSB3kBkTvvYlUL+EoyG9GVwvQk3MtvL6uDR1XFbJhozqatn1AnzzjJQ05LIcaD9mEraSN4oD5XorTUW2mMqsiEKPnoBOzffHOO9SZ0Tj2X4F9aTC7IMb+0xwPhnN9TqeaWM/MhOtHuNObZTC9SS8mFhsnxDbw17yy7ss4rlPOA== 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=vA2mB+t9ZmNNRqZYi/dBaEd0oBbdpS5JN9UWnf4QGvg=; b=RvcpWbVsvSj5L3qI9d65eO8UtYBd6S7y0hsvUjrnRA2IOYZq4FmXjnPSlg8Nr2KtsdmPKNvHILfw769/Jbc8ST1ikUY0+8ptwHDSkJTSAxKOj15hlQvnmVY4L1W4uskQJdSSoiL50FXU2FxsvPEtyFpljsoBnwEwGExWDI8f9frzOtgPneAHW8m2vm/BhIpYfjlEQ9c+sGs3vuIMyyEO2vx3KyACp3BExIZIR6Y9i3FQK4uiVzTYuK/+pG5/OMFzmVbFxrrRdzpGiQ563GGlRx0UA+EEq6vsh3M9T3h2ar2GygIrKnlJrBYtPxYLbHFYOYwGJ4aN9SwLGU5By2MSyw== 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=vA2mB+t9ZmNNRqZYi/dBaEd0oBbdpS5JN9UWnf4QGvg=; b=k63ORTmo39eGpNdtkCpbQbeHDDWvt5mcpUuafN+vpRFjK+tJyXvU7B9bVKXIRjEUIHUVDuZ+vVBJn/ebTs0jvjZ7p6It8g/y+15ENGay14wvyUOEaNlJusyqUS24l3q2nOocPkZjunO9XFlqN1ne94knkWh9d8BqP2u4CImPBw4wCyyrdGlWxo6/6in+jJiYQtQRsAvNTEiQUxiH/3guE91Vxzi4sg4w3DDlYhfZ5eCtFe+2Wnfwq61c0NSj7Lpl5azVSRv0TcW5tMTmIVjRRQZZcPSeHg4CYKwisuQWNEFpM6dTmbeduYkMgacgP3EnbOG16cOlXuvWPdkeFiTW8w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB3849.namprd12.prod.outlook.com (2603:10b6:5:1c7::26) by MW4PR12MB5642.namprd12.prod.outlook.com (2603:10b6:303:187::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.33; Thu, 6 Jun 2024 18:24:25 +0000 Received: from DM6PR12MB3849.namprd12.prod.outlook.com ([fe80::c296:774b:a5fc:965e]) by DM6PR12MB3849.namprd12.prod.outlook.com ([fe80::c296:774b:a5fc:965e%4]) with mapi id 15.20.7633.033; Thu, 6 Jun 2024 18:24:25 +0000 Date: Thu, 6 Jun 2024 15:24:23 -0300 From: Jason Gunthorpe To: Nicolin Chen 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: <20240606182423.GF19897@nvidia.com> References: <20240524131912.GT20229@nvidia.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: MN2PR13CA0005.namprd13.prod.outlook.com (2603:10b6:208:160::18) To DM6PR12MB3849.namprd12.prod.outlook.com (2603:10b6:5:1c7::26) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR12MB3849:EE_|MW4PR12MB5642:EE_ X-MS-Office365-Filtering-Correlation-Id: 091f5287-2078-465f-4329-08dc8655e4ca X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|7416005|376005|1800799015|366007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?RU/P8SaB+QiW/9Ljmo0SYohzzdUYWCSH70rThxKHytOgUHYAmVC6Y9GpiOYH?= =?us-ascii?Q?un49rkAlNcufly1XK05TKb57jS/SJctIC7YyPldMIAZvhvNKx4xmN6Vv3ltR?= =?us-ascii?Q?LKw4bI1Bg4Xa1UvFx5TbInKh9axCb0XA/lVIWL2CgJyWNSTaJ1G0rtHVYaJt?= =?us-ascii?Q?qxGxkVOfEsTDviX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?us-ascii?Q?x0gXWzaK7eCl1PggM1utUm3e7aAyyT8uIe+otzV5JUGIeN15PWO1880tzPeU?= =?us-ascii?Q?F+orP0I2ofb9G2PnRsxAWIVTgKDJ5HVnYrHxUYUwTgixNTZsuBycYs4Ln9O3?= =?us-ascii?Q?Z+/HmFIv9zJSQgEoDEJGkLFSz/gHjW6bN9pMkyYkgosvYsCXesq9GAW/jAwF?= =?us-ascii?Q?jopuKT4J1bMfHK2dTTMMsriw8PyFXFudA3q7VmYmjJGDttbsI+pbOhr0UpwX?= =?us-ascii?Q?jXfNbTqSlYMPjrL3jrPhOU0F?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB3849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7416005)(376005)(1800799015)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?lLe35z0ToteTWvINWKN99J1XAWcc462qfwH8w7VT9uOy3nvICkMwussdqM7L?= =?us-ascii?Q?MoSoGpchwmO4eVIEE3Ma5R1YZoYZfffclYMzxb0I5LGB5n5orSLiPfiACv/i?= =?us-ascii?Q?0FcnqyxemDM0Ij0OU7t/+5el28uoHkBQNoWpcj2XO/iiZ3SiH2FDzl7KIsyN?= =?us-ascii?Q?MOMlOU3/hVuIVfHQVgE9qISvRX1mPCrugt0Mox7VLEt5jKg3Yv+1UA/F9IKp?= =?us-ascii?Q?ZkdTNf2hVUdTkCoH4IjV2Hq1cBeRE2VZXiHmqee0KLLoaI4Qj+sWaLBASqe0?= =?us-ascii?Q?DfsB2AqBPcllDbA8CdE5Kf72iro0euaAHnCmfGjteQ6W+4VeB48PbRsHRfje?= =?us-ascii?Q?Pn1REpI3NkRG3B4Az2ot5VzNPoOPsirFLDFmjrSvU0CBLaFnXHbSONfeZ7CP?= =?us-ascii?Q?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gywo3HcWf3?= =?us-ascii?Q?PciJAA1KiL8no4w8bGgF5ZXZH2QNi/6rQGJnUog8NZIbaFXCQbuIkrKh+VAM?= =?us-ascii?Q?sZBRqQCZUiionC9q7yj3Q3kxSmA3ua9iHjkjXOi5AJhmhkJ92BrcLZrbSKWq?= =?us-ascii?Q?SVtcg8L3StyWNK7TS1Rmro3Cj60e3Y5tUMaFw3kGk/a347fWykEYjZAj2Wma?= =?us-ascii?Q?1xevSnaXg/AUvLlNpuFWZ++NyO1YGiEDY0pH89nr60TqtnmF1IZAc88Fv4Qq?= =?us-ascii?Q?z8qSj617ZQoZ86c4r55oTo6tkTl6ADQeMFXI9ecb?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 091f5287-2078-465f-4329-08dc8655e4ca X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3849.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2024 18:24:24.9780 (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: h909WFd7VqtfoPzpt3P/tPNX5VdclkZYeeVOUQ5V3SHwKkpAH7OZbryfhuuyIUsz X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB5642 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. Jason