Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4216206rdb; Mon, 11 Dec 2023 12:12:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IHy9yBN58bTCCI4JP1HVFQhNoKrbXOBHAnu58YsKn/YrNaa9dzgPLVxYMOnqq498BuR8NZZ X-Received: by 2002:a17:903:2288:b0:1d0:1e49:3f60 with SMTP id b8-20020a170903228800b001d01e493f60mr2657866plh.27.1702325523552; Mon, 11 Dec 2023 12:12:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702325523; cv=pass; d=google.com; s=arc-20160816; b=yn+YSQyziWMzaF/rbzj6VsLohxeR1XM2pzGD+RAIoRinhoxXUpt00k5IeHmM4+7Vl1 htCiJ8FZIL1JnijHQRPRnjCQSWl1aYXBK8ClNKhmvvbtrwOy51HECrWRX5x2Ly5Qlfi3 xorlRRgppSpVpN2c1iEu0kcSrhpgWqw/lw3pUGe5USXKsup8YNFghfxIN1udrpJuIgPO EuIMK9w1K1VKJUINqp+D9YMnuzKTZ8WDT9iqjc2tiDq4V69WlZIuN/CmHOHmexvyi78P EfRE4swdfdMwJPrWZhhllwDMNLf6oVslt3m4rMZAFsdExMfZ/0epF4UT+eq+CEjbh6zv sx4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vGBcpctAsuvv1BQ2+Cx81ERhehDJ0sZrjsjKT6lX0/I=; fh=ugZx6LhjCxrEZ2+wMd+ah5gpw1MPVUpk2PnbNjbIu4g=; b=IMpxmqG6BmCR9KStEqj24bW0w+2SHCHqm01sdJKxOQoFIzmWfYWz7T80kX8USU80W6 jQEQJeUBEcBvG+dfutdTs8Si8dsXdd0wo3jJ254c5F58WQz3V8y6aJX56LMiGh2hHxCL 5pFeNt0GnvUhdHVMtYBAfIjuoWyT/wFhUmlTj0nFIqC4Pu9/GGzg6ho07q6hJROTTeSy yqI679XTZVnsWelfLcScNT71A07Yvj1lkvBJ3b9Gd5YCcb+WuD3r3tCsn8KtBBDe08UJ TSaEPSPaJ4IPj/82leXYp2zdxfgWlHllC0+UBmmYz9ysfAs0vjLZhxFz/wMFH0ih6wWR 38Ww== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=KGOZaqcd; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id o18-20020a170902d4d200b001d07c3e89fesi6616786plg.478.2023.12.11.12.12.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 12:12:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=KGOZaqcd; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 3677C803DAD8; Mon, 11 Dec 2023 12:11:57 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229661AbjLKULm (ORCPT + 99 others); Mon, 11 Dec 2023 15:11:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbjLKULl (ORCPT ); Mon, 11 Dec 2023 15:11:41 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 175B7D8; Mon, 11 Dec 2023 12:11:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MCO56p2f/hJJVt4trapfi+2mY0z5QHKgWtEDy2xHwEKB4yQzIPEjMgQWc2KAkeJ+G+BDhdZhOlu/Uj0/Wy139fkwiSkrTsYd7SKZyGgn5/tOGot90ZNFAwfnqG4ips8Y+Nnz49h7+UP00JQmhYK1AOyvmKP8XpPAmXnP/UgkOKC8fr4dYThV98x+6Y6FtkW53qUJijlbLVM1G2Nk5kQPnpdCHJnL6z/YO8ynL66WjkiYqhLW3EOE+EPFvF2C1qrmRI5+MqM2RyXkrno0Hdfvf0gOl6jEQ3sqOg3s7IrUJpZ7+bDglUkVIlbsry7bTRxTb+cjUUNEAdCb/Qa9voTp9Q== 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=vGBcpctAsuvv1BQ2+Cx81ERhehDJ0sZrjsjKT6lX0/I=; b=AQ6MIpN2SWLXfpdHDzNAxBvHzTxG0or9/gy2v+BuEJbBI0gvlehZTuojAghUeLio3oUDM80ar77Q/zY7fnpevHuEGq0QUJGUpJQskGIypBFAKKllOKS9AokpN2uc5X03ELuWjwuRuI98xyA/W6NE3Bk6lhuIC9d2EV0FlwUcIoHYvlf+/3OmMLBhZOufsEhT1svbufwJIjvoGEO52Ic+iMW3SK/Gbh6+JJSV8C9CDUm2Vzi9IsPv8i8KEsj0I2DycR1DOh6m2ZDuOYN0G8uKtY8fC5JnRbfmAxpVJ4PmlanlqvRO8UZndwbRq0t6tx4NrT+Wh6pTMOE4d3ugj8b8RQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=oracle.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=vGBcpctAsuvv1BQ2+Cx81ERhehDJ0sZrjsjKT6lX0/I=; b=KGOZaqcdw9qUBjHfu7W6bEP2pZp4u5jS2P8N7vIes6CrY8G9JmOBQsbQqtzp4rDtUEitG57FnZVwniyQ3VtS3rsZS0zMgXvQxEP4cSazbZxpdZgutYfuvvMnIsMKGo45iv3yrKoVAu47CuQXE/RC8DPmIesNSnlcwMLOEbvtEiQHzdsbjI1u/4VYj78/RQoPHmekh+UZxnsOPU9Hecb95pOALtbgNKL9RKWWoLvZhLPsow7rqVW8DOZz0E+bUCizVYdpG5+ZwgyrT9Fk6ygkOiun3P2RT2+r/WQx9vauCeNOqFmGo/PNSmNSomJ++YhE6aaQsKmTh1YL8HNn6Bx7fQ== Received: from CH2PR10CA0027.namprd10.prod.outlook.com (2603:10b6:610:4c::37) by DM8PR12MB5399.namprd12.prod.outlook.com (2603:10b6:8:34::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32; Mon, 11 Dec 2023 20:11:44 +0000 Received: from DS3PEPF000099DC.namprd04.prod.outlook.com (2603:10b6:610:4c:cafe::f2) by CH2PR10CA0027.outlook.office365.com (2603:10b6:610:4c::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.32 via Frontend Transport; Mon, 11 Dec 2023 20:11:44 +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 DS3PEPF000099DC.mail.protection.outlook.com (10.167.17.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.18 via Frontend Transport; Mon, 11 Dec 2023 20:11:44 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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.986.41; Mon, 11 Dec 2023 12:11:28 -0800 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 11 Dec 2023 12:11:27 -0800 Received: from Asurada-Nvidia (10.127.8.9) by mail.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.986.41 via Frontend Transport; Mon, 11 Dec 2023 12:11:26 -0800 Date: Mon, 11 Dec 2023 12:11:25 -0800 From: Nicolin Chen To: Jason Gunthorpe CC: Yi Liu , "Giani, Dhaval" , Vasant Hegde , Suravee Suthikulpanit , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v6 0/6] iommufd: Add nesting infrastructure (part 2/2) Message-ID: References: <20231117130717.19875-1-yi.l.liu@intel.com> <20231209014726.GA2945299@nvidia.com> <77ac47d0-2ef0-41fa-86c2-091358541465@intel.com> <20231211132041.GE2944114@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20231211132041.GE2944114@nvidia.com> X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099DC:EE_|DM8PR12MB5399:EE_ X-MS-Office365-Filtering-Correlation-Id: 348ab46a-cbd1-4c1f-f1bb-08dbfa85656c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DxpQIPYlNjgIeKYB7doBOlOK5N49fOpsMDYFlLcfsZK07ZlF9kGePziCQiS1tfnO/NFrGjlpdO67qQMurDKJN7wbyE1l+07rOOijTKGxcPeIU/RZYWknWlJdvSEMbjCo9Y0iJnNzopV7ac1syYkk62yAipL4L6G6b2sv1PSBoA0PsRR8JtI5/nli93pGU8NqNUa4tYkkBpRSNv8cH+ABvfuDC+lu1IvEjGVRAcBjgOXHbdR2ywDPvRnpvUCxl85AgX5/gLYnSOB0aProTHaDY7nn/Xe0qE/6m2XhLKO0O4R3nxF2K34wzSGSbjfkduIpDsGNMJ9IHrY/qsAKhl/5YMLtNiRhAEBbd3ObNT8PRBKuxLAvi+yrtoHOlIiMR8gxb0D0n2t6FxsUi4rzWnaAMLBWEVdsh9JG/NYW+Ic23kibkAGa2nIwynpFU0QVKeGhomjZUKhSCOMXcXnDKIZFhr3VkKnDbFuqFr2SuqjZWoXluIl3zCGxwZFRHYMELo9ul8ATDLO7PyZo63yjzku2Zwh3iMu+addfOkbpHV4ca4NXAbWIwKa4GD653V5/iwc2weVnThzMS8oJT0aiGsEgbUfgGbT20GJ5PoRvJoPsI5wxQMKnuCsNNJUtczKhTsFHZ+doUjCjo5OrnPj+8P9hICAQ2M/LED/nFOxzVzeOWP8/8RmOCi08tWUR50CVrSBsaWq+XsvF3bjRouG7jrG/3+7tdIhLgiR9g2H6J8klTbmmxCb+4WafAh1X/f/3nLm8 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:(13230031)(4636009)(346002)(396003)(136003)(39860400002)(376002)(230922051799003)(1800799012)(451199024)(186009)(82310400011)(64100799003)(36840700001)(46966006)(40470700004)(55016003)(40480700001)(66899024)(26005)(426003)(336012)(40460700003)(82740400003)(7636003)(86362001)(356005)(47076005)(70586007)(83380400001)(70206006)(5660300002)(7416002)(36860700001)(316002)(8936002)(8676002)(6636002)(54906003)(9686003)(478600001)(4326008)(41300700001)(2906002)(33716001)(6862004);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 20:11:44.0882 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 348ab46a-cbd1-4c1f-f1bb-08dbfa85656c 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: DS3PEPF000099DC.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR12MB5399 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 11 Dec 2023 12:11:57 -0800 (PST) On Mon, Dec 11, 2023 at 09:20:41AM -0400, Jason Gunthorpe wrote: > On Mon, Dec 11, 2023 at 08:35:09PM +0800, Yi Liu wrote: > > > So.. In short.. Invalidation is a PITA. The idea is the same but > > > annoying little details interfere with actually having a compltely > > > common API here. IMHO the uAPI in this series is fine. It will support > > > Intel invalidation and non-ATC invalidation on AMD/ARM. It should be > > > setup to allow that the target domain object can be any HWPT. > > > > This HWPT is still nested domain. Is it? But it can represent a guest I/O > > page table (VT-d), guest CD table (ARM), guest CR3 Table (AMD, it seems to > > be a set of guest CR3 table pointers). May ARM and AMD guys keep me honest > > here. > > I was thinking ARM would not want to use a nested domain because > really the invalidation is global to the entire nesting parent. > > But, there is an issue with that - the nesting parent could be > attached to multiple iommu instances but we only want to invalidate a > single instance. I am still not sure about attaching an S2 domain to multiple SMMUs. An S2 domain is created per SMMU, and we have such a rejection in arm_smmu_attach_dev(): } else if (smmu_domain->smmu != smmu) ret = -EINVAL; I understand that it would be probably ideal to share the S2 iopt among the SMMUs. But in the driver the objects (domain) holding a shared S2 iopt must be different to allocate their own VMIDs, right? Thanks Nicolin