From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A873606A325 for ; Fri, 30 Oct 2026 12:08:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=NCr7moHn; dkim=pass (2048-bit key, unprotected) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-NXP1-onmicrosoft-com header.b=cqPThT8f DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To: Content-Type:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=lW0wLcheEeoD6ntTT61Iywuyf5+FHGoJ+vP2SUi06bQ=; b=NCr7moHndn92LEW9ELt3frRuiR Qyan3kpo96JX8Dj3CVierlsvuKqJSsrWxWr4ncQLz8N2esa6S6ZqRtzgg64pZVNAgSTvNOSvdfX3n RV7Mx50Ymn+0S6d6ZGEx8plMGdvtony8EX6pkRthUpiFi+FzRVezgemiDeqcdpUZnwXJqZnsDyvDK XfFjFt9I3p3IdgZpCTcN8nmK1KhxgWBGk73KCX1jl5nYwjHgH4ojtpATrf5rSGI+vSne7DmfneFH+ wEFzAysktOfGK5mPHcRlN3pm68SXL3nQpHueitmhmn13FGj6gnBzEa9gWQydjrAoLBVGphB1Di50D UTR1Xb7A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xMlP6-0000000BeIj-2dnZ; Fri, 30 Oct 2026 12:08:16 +0000 Received: from mail-norwayeastazlp170130007.outbound.protection.outlook.com ([2a01:111:f403:c20f::7] helo=OSPPR02CU001.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xMlP5-0000000BeII-1HjL for linux-arm-kernel@lists.infradead.org; Fri, 30 Oct 2026 12:08:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TK4D6jW22ODYdYWyn3WZd6HTaODxSoVkQ/CefcQ1aiRPOb9V0HYg/860QdQM942KJ4M9iJuyZFFG7orOy0FPc58UJDrG2jaLjjvJQaYp1Gcy9OZmghf1RQSnGMayMa5vH/bA1DV3/nX2B308ndygAEKpiXJmfPwmVR9lPVr6CZIh10KoNFBmevqwf6AeK3JuP8pBNiKYT+2t8dBB6QSOxCekJ4zhvMxeEVbcSe14i+woAHcnQl0XtyxEnS7hf6yVQYlnBCE0VSwQ1j2lE0FKiIlgxmMtvogWeQ2uw4/UCVeIPR4Ad/itmVv6XM4S5opyM7iXBKi0JxHP4JJvLkAMFA== 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=lW0wLcheEeoD6ntTT61Iywuyf5+FHGoJ+vP2SUi06bQ=; b=L7TZLTw7QSzTTTEULjC6jOBJ5Ku0Qh+AXWIWqlc6c4a5D/ALHyu0hsJCUOkCzFHpIpzwGidYnGQPtKhYamrNt2ej5tgQo0ETP1vifWPEqa+lKXXAv9G/ULsTWdAzctoL9X+VfVTo1y/A748/Sz3jjfvn8Fxm4zloTqrL7+8via6NkZOFVrZJf1cJwppynvoVEmywC7bjWuDYa9Ch5WhVGWpASGkoasSsGByQf8eaZsoGAkrSl24jO2/jNKxUjfZukk9N+LKU+EPDMcTp8vThtvxgTFo7iCwl3M3P655D4i6pkkSYMWF38IP6NxCsarFTgkYQHgAtzr2SOVDSEqryBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lW0wLcheEeoD6ntTT61Iywuyf5+FHGoJ+vP2SUi06bQ=; b=cqPThT8fCdA3jNfy7OzTs5mnPzYQ249/d7eDwVNCOPmjB6RmsdJoaIpzXhvDZ1/9k/hdusT7Sv3TiCbUVr52WbXJt6HS0oIQC6b0pP37i/ep/u75pk+VOWHDOHgvO7oJivpa6paNGtbNtx/Qf704igl9DxeW6hgPVIzfKp75YTeIem5A4qfKZq89IuUyOHDDD9oLf9AkGQVXCn9WPPCw26L+QxFnB6uHoLC7SpUxi1HZoCRjOoBy1ct+RGjEJjm6v6977YAREaQFuqzKOz7GcffwUWAnARbMd4d5BvkBYOW9k/aAo1rFz4lp+Rwn5t3pQPSfvnuSEve675Bn0K7tKA== Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM8PR04MB7874.eurprd04.prod.outlook.com (2603:10a6:20b:24d::9) by PA3PPFBB9BDA27D.eurprd04.prod.outlook.com (2603:10a6:108:1::b0) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.546.22; Fri, 30 Oct 2026 12:08:09 +0000 Received: from AM8PR04MB7874.eurprd04.prod.outlook.com ([fe80::ac38:1699:6f18:c5d9]) by AM8PR04MB7874.eurprd04.prod.outlook.com ([fe80::ac38:1699:6f18:c5d9%6]) with mapi id 15.21.0569.009; Fri, 30 Oct 2026 12:08:09 +0000 Date: Fri, 30 Oct 2026 20:12:54 +0800 From: Peng Fan To: Nicolin Chen , Robin Murphy , Jason Gunthorpe Cc: Robin Murphy , Jason Gunthorpe , Will Deacon , "Joerg Roedel (AMD)" , Jean-Philippe Brucker , Thierry Reding , Krishna Reddy , Jonathan Hunter , linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, Peng Fan Subject: Re: [PATCH RFC v6 5/5] iommu/arm-smmu-v3: Wire up shared-SID STE ordering and feature gating Message-ID: References: <20261011-smmu-shared-sid-v6-0-cb76b89dc612@nxp.com> <20261011-smmu-shared-sid-v6-5-cb76b89dc612@nxp.com> <20261013124400.GI14213@ziepe.ca> <4d2a05c3-f7f6-4348-a3b4-c8f3ffa79b6c@arm.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: SI2PR02CA0016.apcprd02.prod.outlook.com (2603:1096:4:194::9) To AM8PR04MB7874.eurprd04.prod.outlook.com (2603:10a6:20b:24d::9) X-Archived-By: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM8PR04MB7874:EE_|PA3PPFBB9BDA27D:EE_ X-MS-Office365-Filtering-Correlation-Id: c7f1e643-a0cf-4934-a0c8-08df367e7630 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|23010399003|376014|19092799006|1800799024|366016|261026121527099003|11063799006|4143699003|56012099006|261021135927099003|10067099003|261021121427099003|261022105027099003|18002099003|22082099003|261026140227099003|261028144727099003; X-Microsoft-Antispam-Message-Info: RerJWSTW7qqmZ3JqtDhR40OqbsnD9uoidILJIHCPNoUi3tvDyP0TOHshYL6iDFkFCDLToSvLvCTtNRA6Jee8YNzm+g/R7PKjob9SES7y8Ob5tibTQK1d3VsglMUVLkJ34uV5jOCWYa4b2hEKOT42IP0MUnWsqQ7lgwyzV7SUZJldTn/YvoiCi8l9HKJXERt/bmjsXA0aQmaXjdDsi960z7My949WIVBkU1jPc694wcdjqvHSbUhf8Temwu9uooAZ+fSXWWGySnsU0llkhpU0KA8oMK5Vpxq1+vSpDgRlz0+H4F9t4Km/NETNLJHAWvXpDffDq4ax6la+uvoDe5leWj/S2jQKeW017vVhzQTJOdc9ECb+YnecSWCDTQJfCEQ7W8mUEL/sqaPJSxEVN07lrTSNxfkFv9Bxpcq2uGWNURiuJ+hqVw5GaPXOio8HfMWGrbc/M2o0xvjqfEphZI6S6hZv005PjYOHus80rQ5lge//VCn6dDvIufDqBPIP1BjguhC4JReZxJgaBOZIE82PnGWeNU6BPTZvNMB3vVDDvZvTUCSrGgl4h8w2dStTRJFtHDjKHnsrTFswnNNnzGrahbtRNl5KSuaB+5yb5SBdZWzcT0pTMbVCspgldNXWCcT/MiGkipLlT+SAZ3BDjkiRctKm2pU29akmm4lv7Zm0b88= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM8PR04MB7874.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(23010399003)(376014)(19092799006)(1800799024)(366016)(261026121527099003)(11063799006)(4143699003)(56012099006)(261021135927099003)(10067099003)(261021121427099003)(261022105027099003)(18002099003)(22082099003)(261026140227099003)(261028144727099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?nvJCRGF5gpfADybxkaJu3fC5ldWsPcM7BcfIs/4JsUaewY4KXk3InsNAjN38?= =?us-ascii?Q?Dcj7+xPgJk0C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BJHQlLzdE8kpx?= =?us-ascii?Q?j9sCXyX4GIxZgLgFIOifRtkhpZTuouQoO1rhKMQMPz9CPcBBJLHE+U4D195P?= =?us-ascii?Q?/Tmz9mFfML5oDEB90bymZDXd8gx1LVy6LvU0rBFvJBsjmqN89fz0S0NJugCM?= =?us-ascii?Q?48vJ62pzMqeyn0Cjhjqzexd2e0nbLzOmi3jA5h+ZnL7wQcaj0z684c9qkSb/?= =?us-ascii?Q?k0VTE4yunkMQMgPJ1aD0zdHjIzxOaodjfcKtJOMRnGzKU5lVKcLYg96XdK5k?= =?us-ascii?Q?BrAZBrRgcG/am5J7UdPNkS9tJlsNFvVgbvqFruBapR27ovXENxU0FYHx4/kf?= =?us-ascii?Q?9znYpobP5LXssTuIeDl20qr02hpB59TrkCNYv0Nf17RkVnhCsd8vY23Um3Y6?= =?us-ascii?Q?rGy+FyhgLKufXxYFpakGbC0CVzhJ4mTwdYCeCg6LYMrcTjJ5Wveck13WfBox?= =?us-ascii?Q?O7I3PbIPpNNedLUwTewKWsoLcBwWN2/CrcBvXgIlihbUPcnOQ/zytQAYJejl?= =?us-ascii?Q?wP77+l/KmdkQgk5JWNO3mDguskBG4qLvn6naPsnxI8bNnYCjtCAw8Bxq6IhY?= =?us-ascii?Q?bMy7OPEKZdsKBjloSV3zgq6rDmq4wPDITjPOK6813f97q7r+szkzP1nXtkM6?= =?us-ascii?Q?hbbJiYVLtJJ4iJeiWIiA7BKdipjuwUPadij0+FZ1Pego7nAIJRtp4whvU/GO?= =?us-ascii?Q?knS4q5VwWrnbo6wH5sEGNJu34mAA+ZvZORcq4KMAphSB1e9WbF0oVWyVh2FX?= =?us-ascii?Q?QxDKUWpFRnTxLFiFBoDz8NJhNzzVuPqhB7dhMAEdb+UEeudYJdauXIs2yCSW?= =?us-ascii?Q?IgalWBrfLZU1n5QwHAc+WB5XLD8n0/MSD1gzS10SYMETnaSaIVve?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c7f1e643-a0cf-4934-a0c8-08df367e7630 X-MS-Exchange-CrossTenant-AuthSource: AM8PR04MB7874.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2026 12:08:09.0122 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OMlCPgSjtfw4VZzmMBjhkvr/FeFtC5aOuw0tARJnO8G1eLFnQHt9yc8y3KTNUmsZNSOYIuxGkp224o2n5eAXWaT1/Tk1t0A/0EAd9axWa9f3YE0q8ZLYF0Tik7i13AoQ X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA3PPFBB9BDA27D X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261030_050815_348847_6660FA12 X-CRM114-Status: GOOD ( 23.89 ) X-Spam-Score: 0.0 (/) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Hi Nicolin, Robin, Jason On Tue, Oct 13, 2026 at 12:33:19PM -0700, Nicolin Chen wrote: >On Tue, Oct 13, 2026 at 05:23:21PM +0100, Robin Murphy wrote: >> On 13/10/2026 1:44 pm, Jason Gunthorpe wrote: >> > On Tue, Oct 13, 2026 at 12:22:06PM +0100, Robin Murphy wrote: >> > > If we're not going to support PASID for shared streams (which I suggest we >> > > don't...) than we shouldn't strictly need to worry about CD tables anyway. >> > > So rather than having to special-case CD table sharing for shared streams, >> > > perhaps it might make sense to generalise back to a "default" per-domain CD >> > > for non-PASID use, which can then get switched for the private per-stream >> > > cd_table if and when a device does enable PASID? >> > >> > If we have stared STEs then the group becomes the per-STE data >> > structure not the master.. We don't have any way right now to do that, >> > but it would make some sense for the group to store the shared CD >> >> That would be precisely the aforementioned special case that I'd hope to >> avoid. My point is that the CD represents the domain context, so we really >> shouldn't have to have multiple copies of that per-device _or_ per-group, >> _unless_ it is attached via a PASID, since in that case it does need to be >> copied into a per-device CD table (since the per-domain CD table was indeed >> the wrong move in hindsight). >> >> So what I'm saying is that if we're going to make anything share CDs, then >> ideally we should just make all non-PASID devices always directly share the >> domain's own CD, then if we just enforce that any devices sharing StreamIDs >> must be non-PASID devices, it should all work out, we save some memory in >> the normal case, and never have to be concerned with rewriting any STE with >> a different S1ContextPtr for the _same_ domain except when enabling or >> disabling PASID for the (single) device owning that STE. > >FWIW, master->ats_always_on would be a special case here: it is >non-PASID but needs s1cdmax to be non zero. > >But yea, that sounds like a good approach, though requires a big >refactor. I just post out RFC V7 version with sharing CD table. But I not have the hardware to test the advanced features (: only tested i.MX95, Qemu, KUNIT. Thanks Peng > >Thanks >Nicolin > >