From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=198.175.65.20 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796037107; b=LsJZy6JIlsuPPVawvfjTcmPooWeABbri+MKzCvlUhAXsiMlBdasNHgiEZYnUfLUcgXKY XcE07dTBxWP06y/+/4tobwuEBL0DLz1XCk6x24PqHbJvJU7bFS2Dia9cb1RMgg+kwfzzm NDCFe7mU8+NrfkwaEnCaPw0u7bfWDPyX7VuP6zhNh0pmOmU5arP0p5DPzsJaFAo806OkO 2ZtytweICeOMQC7C4C6dda3XMLv00LeHsXbkMOK6CEQarlmNdfzPNFhSSDzCXEDPPQvCM I8DI7duDd8/7r8k7aP2r6BAxZcWzDm6kinYUfbgdR9RJJv1EZolITXHylt2nH7eKQsA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796037107; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Received:Received: Received:Received:Received:Date:From:To:CC:Subject:Message-ID: References:Content-Type:Content-Disposition:In-Reply-To: X-ClientProxiedBy:MIME-Version:X-MS-PublicTrafficType: X-MS-TrafficTypeDiagnostic:X-MS-Office365-Filtering-Correlation-Id: X-MS-Exchange-SenderADCheck:X-MS-Exchange-AntiSpam-Relay: X-Microsoft-Antispam:X-Microsoft-Antispam-Message-Info: X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-Exchange-RoutingPolicyChecked: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType: X-MS-Exchange-CrossTenant-UserPrincipalName: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; bh=3gWtIy9WlzlOQQFdQIbjIew16Uau4N20ESxSwaD+aLA=; b=3TdYm7a4OjGD6KZEjar0TiDBlRjE7IhFmMfUpSD7tLSwUL8I9uZhgwSNVIqUVbgW9qFp up/ktTDXlq3E0p4lOhabFp+yrdJwCGrYwnD2WXRXFuAiMMNP2z+GeX12Q+zK5LwpnaXYE lx/vhY9DXgvT3sdKCFiMSfMmVpHIQE2eML6As6XBpYk1IdY7svMJJXEAclClflBLB6yFv ZzBdI4z29RX1NFaqGfXH5Z1PIRAU9IHtXu+F8xohqIPc+2LwQdxxU1SWY1JowV6IZFQzu 3QbJNYk1Hk5qcVwbUB7ftcbXFE7m/olwVG9OdZ9fiU0DMPUsYtplHi/8Gsv6h9Dqn1w== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=A75ppHQN; arc=pass header.oldest-pass=0 smtp.remote-ip=198.175.65.20 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5494A606A320; Mon, 30 Nov 2026 11:11:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5494A606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=A75ppHQN DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796037107; x=1827573107; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=3gWtIy9WlzlOQQFdQIbjIew16Uau4N20ESxSwaD+aLA=; b=A75ppHQNcOteLvcH/UsgU8KqulYCBuU2p8CHR6ArwN5g7s92csiBvlWW pXvyjWrMpLQ9PiOozpEPNWE1AcYLJkh6cSFM9JWL7gGQh8qnFX1CZaaJx s4hLveN8w9ZDQN1iVXbf7GU/mK0jjhpL6i2c7czzX0XC1J48UWCChGanN 6IG5NhJBFUm1Brem9s7pDfGH3LRjRlKwl71wB6Mcq8JBo0sLfFb6COLQt pYjvmVM2pTBPyT00U2F8MknfFmWz7kC2+pGBlZwXTYfLe9VsosGb6FimC Qd2W/MKrm6ixho5Tm6lKSmfICaqmjaxfb8bdsGu0KA9HnSo05b32KNKJE Q==; X-CSE-ConnectionGUID: 8fclJbgDRiK7p4RjycAzZw== X-CSE-MsgGUID: nKvnsG98RB6qIyAKf62gtg== X-IronPort-AV: E=McAfee;i="6800,10657,11981"; a="4913038" X-IronPort-AV: E=Sophos;i="6.27,242,1787036400"; d="scan'208";a="4913038" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 03:11:46 -0800 X-CSE-ConnectionGUID: LNwE2RXGT9awCUrxjOS1QA== X-CSE-MsgGUID: FLV+XqSEQvC0TNrd6SZmEw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,242,1787036400"; d="scan'208";a="13432395" Received: from orsmsx903.amr.corp.intel.com ([10.22.229.25]) by fmviesa001.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 03:11:45 -0800 Received: from ORSMSX902.amr.corp.intel.com (10.22.229.24) by ORSMSX903.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Mon, 30 Nov 2026 03:11:44 -0800 Received: from ORSEDG902.ED.cps.intel.com (10.7.248.12) by ORSMSX902.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57 via Frontend Transport; Mon, 30 Nov 2026 03:11:44 -0800 Received: from SN4PR0501CU005.outbound.protection.outlook.com (40.93.194.65) by edgegateway.intel.com (134.134.137.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Mon, 30 Nov 2026 03:11:43 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=inpaMuLpHESnKBBTZrG2JmIv2RMybwXatXYf9RoL2r2RTEDCm7dJqu6Io9tVXjBxdgtYPkkfpT43B4QN7B1XLxyyfW0D2oFq5xzqXBtPq6E0qHcSXuzbcZK1MiECJz9fHTG1RoTSJtD3jQOjstbx0UxYDRv/2F6Q2K/x3Gp1HeugCaCZGqtDWsh5B5j4VTLKfbD0vqdbXC5LEXWcarmyJD/O7DbGbDPIqHREH3tYaV64l8WziobMYiLbZk7muS1AiKLMsGW23sU4dRqsaMhYcJ4uYper9uz8km7FgtPKwFJ8IfilOn5KpSyJG+tzngmAGR8bgbz0zN43yKUUNEUhpQ== 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=3gWtIy9WlzlOQQFdQIbjIew16Uau4N20ESxSwaD+aLA=; b=XxDo0PPRIqqTR0jOlrt4YlTT8wXMB984sCPD6Mhycc00zHpfP5Hc56LNOnhIRgqQxyF9Wfbgd6PazMLiVNhFJZV3z3MnLzSMTbDNYYx7iDpHRHEJNRbcyKvw3w4A8bGy5nQtQRmOV2GmDVDPKDWoKW8FezB/yhRpv1esLo+FB4jV8DkhWFSl83nm93TIroNZ8GwsfociD5fp0JN2rCA1J757YdUnl1gO+fiOjuAdPK1S7x8f3qqYB34Vryhut5gJlP+E+pYoTOEQj+Z9W0Cj2+clkmVVT84S4ZwZNzpOqaVErIWmucc57Ab2G6bnS0mt5UwVZwCFGEaS8oQO15RGcw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from IA0PR11MB8380.namprd11.prod.outlook.com (2603:10b6:208:485::21) by PH7PR11MB6498.namprd11.prod.outlook.com (2603:10b6:510:1f1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.12; Mon, 30 Nov 2026 11:11:41 +0000 Received: from IA0PR11MB8380.namprd11.prod.outlook.com ([fe80::ea8e:eec4:f8d3:f95d]) by IA0PR11MB8380.namprd11.prod.outlook.com ([fe80::ea8e:eec4:f8d3:f95d%5]) with mapi id 15.21.0662.007; Mon, 30 Nov 2026 11:11:41 +0000 Date: Mon, 30 Nov 2026 19:11:29 +0800 From: Chao Gao To: "Edgecombe, Rick P" CC: "kvm@vger.kernel.org" , "linux-coco@lists.linux.dev" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "linux-pci@vger.kernel.org" , "Xu, Yilun" , "dave.hansen@linux.intel.com" , "baolu.lu@linux.intel.com" , "Peng, Chao P" , "bp@alien8.de" , "kas@kernel.org" , "mingo@redhat.com" , "hpa@zytor.com" , "tglx@kernel.org" , "Tian, Kevin" , "bhelgaas@google.com" Subject: Re: [RFC PATCH 0/7] TDX: Enable PCIe link encryption for trusted I/O Message-ID: References: <20261116111037.3478844-1-chao.gao@intel.com> <76f4fbf366451fe48d689ce9c8b231b9fe07338a.camel@intel.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <76f4fbf366451fe48d689ce9c8b231b9fe07338a.camel@intel.com> X-ClientProxiedBy: SI1PR02CA0053.apcprd02.prod.outlook.com (2603:1096:4:1f5::8) To IA0PR11MB8380.namprd11.prod.outlook.com (2603:10b6:208:485::21) X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA0PR11MB8380:EE_|PH7PR11MB6498:EE_ X-MS-Office365-Filtering-Correlation-Id: f8670b0e-35fe-40db-86af-08df4ed2b54f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|23010399003|1800799024|376014|7416014|10067099003|56012099006|261028144727099003|261026121527099003|261026140227099003|261102123227099003|261021121427099003|261022105027099003|261022075727099003|22082099003|18002099003|11063799006|4143699003|6133799003; X-Microsoft-Antispam-Message-Info: 4c59DdJrr64zNBCvGI2pFnZ3HYuFA6dffrncH3psgX/a9GJUhhG96mZdFmLnysJE7r5yEsWKNpsqApm0M7lLD2aySsIqImPTeVaB7Hkry8IiRQianN0J6aJ2NJWpuVdhas51KfvJ9OQRLpUXDWqC/EbXFo78xFNd0t3hZS/C9Pp6rvzfIM6QWICGzfMycqYkFXyZDnKA9oiDdLJMLyG7s1gAMmUgruysGbM1MxFnQYrI+yXWty1UXc1ME+cZ44ct6Pd/hZzRKE38VVgz/B5nsn6CwOXRbyoqDOaGd/MtnPVRMSNvLHGejQdLdFfNhE1AYG/pJOZqw8PU58nwZxg9yjIEVefD1bOqwGdE1LKFD2IYsK4Mc/IHO2ucHU0Uhzs8Xet5JlG2zxhRQK8YoOiN6wgNEO5paN+9Mqbm2XTSaAgUqGXWqIYxWB+pq/VfWVtPwD/FyynEbekZLqA6QAJ/7/nPneC/VEbAx4AZWkngl7Y8AoD9Kvb+NRwew0Pt8wCr1t6FKQdE7Dx2n5CadByxuQuclmqpxi3mclpsyYzNGD3xOLGQbMeKryALuHqAgnDcp4g1wM4b5spoKV512M57dPQ2oBaDsCuDkhl710Uc+Wg1uauo8LMFZYU2t6ZFvrmw X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA0PR11MB8380.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(23010399003)(1800799024)(376014)(7416014)(10067099003)(56012099006)(261028144727099003)(261026121527099003)(261026140227099003)(261102123227099003)(261021121427099003)(261022105027099003)(261022075727099003)(22082099003)(18002099003)(11063799006)(4143699003)(6133799003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?vjOQt2UE3TR2gWZt5Kf1sLdAV982W4w/pvN7sYch3BnFuaLZ7AAxulD2S1sw?= =?us-ascii?Q?NvdtNe74R88ILegHqoG6d4GRQWsqsW5fWrX+d1O7AqDBOfu+FsXpvRj+mQiT?= =?us-ascii?Q?DONym0n/8QH6gnB/ZfPjrJkoQE+3fXVoBzATNMr0dcC2wLWQ+b95W1ZqfCWp?= =?us-ascii?Q?6k4f79Fi0ungduekIPqzSViKRJ4MZXujZCY5EurX8w7IOQHP1nt1EfvzxYpv?= =?us-ascii?Q?MDtiZnhF4oRKtEKGGqL/Wu20FQ3mlu77nMzgWAWZEHKz77rD1Iw8Q9Oupvxg?= =?us-ascii?Q?VYaYioDqbxM+IA9Rg5CPAdKE/qycyewcpKaLjz7vvBDpYwvy1jD+nr1UIX//?= =?us-ascii?Q?X5kDPtadvew+nE9/iapRNqpj3nWYRBszhz93m0hk6dGpnhoc7yDuC1O/EJEU?= =?us-ascii?Q?fEpLn3dlF314ZOdxe9xifjsQrr3H2oibnFm1plZN3SLpxEkfzTClBWnfI0Ph?= =?us-ascii?Q?GcRrtgf2g5ZZJbxKP3kUhqeD45XZJOKyxdxv4tDGcft31xFCQhXlYNuZz3NT?= =?us-ascii?Q?quxCpCFcE9CAInwOim1GYW0kGRut3sVOocO7qnSrtqtWjBhLHYhac3Z9FP4w?= =?us-ascii?Q?x6uN8rrvU9J6jfuU9sd5bytnzyUPOF/svFpP87KT9HbPQheJxi3r/46/4079?= =?us-ascii?Q?UKjcLf7IzXJtG73tcq7oXEp5Sdy1fJ++uWgmnb5u7/LxD22yP+vLtMOdj5G4?= =?us-ascii?Q?Dbi2z9iR19QI8hbh0auFkVotgMihoKEu51+On626AwprK4hGZ6Auvt/C7WdY?= =?us-ascii?Q?FpIoXBiG404lFjlVB4hESJJGImtaq4WrFe14aLHl2koQlN9QB+gZBcNzvwcw?= =?us-ascii?Q?0FhNwuZxDZBH4qj2q7WfCjPXcWwy51l6rMDN8T3RYrQbrUiLVdfWHVj1kmQK?= =?us-ascii?Q?Xjx6/LAipnD3akz6kNuCUiR/CIHxGNwzMOWPr+SfiOmPGAgtpCvCLj6iIwhs?= =?us-ascii?Q?QETbrDf3mrvUxaKT06raHP+HTMjxFddq1OFuItV0ySgb0yjHzixxp9QgRfCQ?= =?us-ascii?Q?vlgkmfD3vtOk4e/0Wh84GLBOTsl21TFivf9pA63e6hBpWlVUTsZDBIQ5QLOB?= =?us-ascii?Q?ZKjNlGqX7fyJlPxCyzqklYfDa0cPLDAvh8BXTJT2mQ2SCFj/Wxyq3clPNieS?= =?us-ascii?Q?V0pWT/DaP2cIMdwIp7s2kAvMwTRMveVNT2LgEmDNGI5FOdG4jpy3/AdlY+Um?= =?us-ascii?Q?0nHvh4Do59bt0Nn+gSunnOD+QrzDeHLq2HyAZQokBCu71CdBJU/7z28Qa2Y9?= =?us-ascii?Q?wKx4WrX79FiKexz0ZqFgUeWcMLHPS+4ns5iq+GRerP6no5O2uCTfNWw0xtCC?= =?us-ascii?Q?2HF/N9jfa6EB+54QI9WJxnIpG9QNxOsnleTDEoY8nEBvdrvg0fo3JbhnyKU4?= =?us-ascii?Q?lOY2VpzBmjdTucdCGvt2KAZo7BtjHQBgr918rkt4WpWNBo8UJAdravsya6pl?= =?us-ascii?Q?1gEDWyl9VeF1sgoCZ1lXVs17lJ1Os5EWu0tHRAVARwxS75vXV5qEI8OYXvyO?= =?us-ascii?Q?e+uBDWfQaL8vpum8WON09Zul4W6lRr8Io2sIexvhuB9d8Whl4WtQPlGvrtL1?= =?us-ascii?Q?FCy8Tl6fO7Xj0TZLBfMZ6C8k/AKtKyQ3n94JZkb+dvObSqAGvztDrVA4eEnv?= =?us-ascii?Q?+TKLimklOatsqMkc53V8m3i0qS/YIXArZwxYbNFon4D/A4RmqBecHEr3LjNH?= =?us-ascii?Q?r2Nv0JnKzs6XqEyaMr8cYxCpxiQfg3tUfshMtHpfMgyjS8/P/WQw7u8B+D4P?= =?us-ascii?Q?ZnG3wWXmfQ=3D=3D?= X-Exchange-RoutingPolicyChecked: gbSVDSkOct4RaZZohDfQQtXWwjsvjWxzzWVZ2a/5IFCo7eEBJAkgdTdDx4Oux0EqMkUt954NtctF4KKtT+Ket5rTG5vWrAjYGKpd47hwxgTMrXAe6unzHa0maqyKOOxvenDj/jTFJ84xIVexVY1CjyITcaaAXQnnvhrMi6pxIz+bz5CtxpWLJZFXfxEvgtMyPjXcr4AFeeZSZ7/xsfdJnlazGp8XoYd3vc+kWHUGB7DrsB0fuDDUXVo6CFOypozimiVMWZu2iwLhfg5NsoBbb/5PHuyLlvesp8cAAhvsuUkf58mh406W9qyr9qz9ZX7pNi9QNYhyyK3FJi6UjbH71A== X-MS-Exchange-CrossTenant-Network-Message-Id: f8670b0e-35fe-40db-86af-08df4ed2b54f X-MS-Exchange-CrossTenant-AuthSource: IA0PR11MB8380.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2026 11:11:40.5959 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TdnIEuqkNlt06bDrluYexqfbsiKkog7EXUG/vXnOELaJ9yxVzc/09zMrkplQxaNyRt0N4UoKsGG08TME7TJBHg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6498 X-OriginatorOrg: intel.com On Sat, Nov 21, 2026 at 09:35:10AM +0800, Edgecombe, Rick P wrote: >On Mon, 2026-11-16 at 03:10 -0800, Chao Gao wrote: >> 1. Raw DOE frames (See patch 3) >> >> The TDX module produces and consumes whole DOE objects, header included, >> but the PCI DOE API takes payloads only. The TDX-TSM driver therefore >> strips and rebuilds the DOE header itself. The code is small, but it >> puts DOE format details in a TSM driver, while the DOE core already >> handles them. A PCI DOE API that takes whole objects would keep them in >> the core, but the TDX-TSM driver would be its only user. Is such an API >> worth adding, or can we live with the DOE format handling in the >> TDX-TSM driver? > >Why can't the TDX module return what we need? I guess AMD's firmware must >already return just the payload. Any idea what ARM will do? The kernel needs the type and the length of a DOE payload to send it to the device, and each vendor passes them in its own way. AMD's firmware puts a header of its own in front of the payload, which its driver parses and strips before calling pci_doe(). Arm's firmware returns them as two separate fields [1]. The TDX module uses the DOE header. The TDX module could do the same as Arm's firmware, which is likely the easiest for the kernel. The kernel would get the type and the length and pass them straight to pci_doe(). I am just not sure that the code it saves is worth an ABI change. >> 2. Default IDE Stream (See patch 5) >> >> TDISP requires each device to have one default IDE stream [8]. The PCI >> core does not set Default Stream, so each TSM driver sets it itself, by >> looking up the device's IDE settings with pci_ide_to_settings() and >> setting default_stream. AMD's driver already does this, and the TDX-TSM >> driver does the same. Since the requirement is shared, the PCI core >> could instead set Default Stream on the device's TC0 stream, which is >> what TDISP expects. Should this move into the PCI core now, or can it be >> a later cleanup? > >Not very sure on this point. Do you think the TSM drivers would never want to >pick a different default stream? If they did is there a point to moving it? >Might be better to wait to see how it shakes out. There is not much for a TSM driver to pick. TDISP wants exactly one default stream, and it has to be the stream for TC0 (traffic class 0). The PCIe spec (r7.0, sec 11.3.8, LOCK_INTERFACE_REQUEST) says the device must fail the request if: - The default Stream does not match the Stream_ID indicated - Multiple IDE configuration registers in the device have been configured as the default stream - The default Stream is associated with a TC other than TC0 No TSM driver sets up more than one stream for a device today, so that stream is always the default one. What bothers me is that the reason is not obvious from the code, and each driver explains it differently. AMD's driver has no comment on it, and the Arm patches [2] and an earlier version of the TDX patches [3] describe it as a quirk of some test devices. If the PCI core cannot set the default stream for TSM drivers, a helper in drivers/pci/tsm.c that marks a given stream as the default would also do. The TSM driver still picks the stream, and the explanation lives in one place. >> The TDX module configures the root port's IDE settings and accepts >> only one address range for the stream. The root port therefore encrypts >> only traffic to the device's prefetchable MMIO range, and a device with >> no prefetchable range cannot be connected. We are evaluating whether >> this can be lifted. > >Can you describe how it impacts the initial support here? Is it about enabling >more devices, or simplifying the initial code? Simplifying the code. The TDX-TSM driver has to take the address ranges that the PCI core prepared and drop all but one before passing them to the TDX module. If the limit is lifted, that trimming and the explanation it needs go away. >> Link encryption needs the root complex to enter a TDX mode, in which >> only the TDX module can configure the root port's IDE settings. The >> kernel opts in to this mode with TDH.IOMMU.SETUP. As its name suggests, >> this SEAMCALL also puts the IOMMU into TDX mode, which changes the >> IOMMU's behavior. Unfortunately, the two cannot be enabled separately, >> even though link encryption does not need IOMMU TDX mode. > >Hmm, usually TDX is not easy to enable on a system. So users are not likely to >accidentally hit the existing limitations. So I'm thinking we just do the same >here. Document the limits and not add a switch. But the limits should be cleanly >handled and understood. Which is a WIP. Agreed. [1]: https://lore.kernel.org/all/20260910140509.868402-4-aneesh.kumar@kernel.org/ [2]: https://lore.kernel.org/all/20260910140509.868402-2-aneesh.kumar@kernel.org/ [3]: https://lore.kernel.org/all/20260327160132.2946114-31-yilun.xu@linux.intel.com/