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=192.198.163.13 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796101283; b=rrWOR97uKOUfmb2SjoDz9iA2RgjqWdn42bgOXMtOBLHV1duF5m4i3h4kwARvOOFiEdzA L3+UUi+fexiV49U5/2Djhdr5q0ta5rF+YFRN8+ngSoSvVLHmj3qoUkLeUCXvhylhdeHoz OIs/vXYj3dNEUyOaw2aZql3xRJzzRz+CgTuLLToxZdL5XumAtAWYe1HsSwB/XWCoTj8z2 Zm5LMH9qt7iKRfTucallV9Ol1SbdYsX4DG7mzHlKzmpB/UJ4mjaVDEjD4YOcEoPLL6vmV 5oE88PIx2NFfCAaajVV5VhNNNWuJqhY/dIEVvSTdNcpbKpRUxbDrHW5K8Y9eT0DXQcw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796101283; 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=kOaELtZru9F7SaqFemhZryARvXtmttwMJyqMVDCUG30=; b=eq5hqIpC1k19pvVBv5AjzYl81VZYA3q8951IPbbHaKw51mHIQSlxaiK/rGNrwOC+3K/9 EUs9faTcQi/N5BlS8K0cUmijgXx1vHbHfm0DlabbCtuR7GleYIhu+4QCOOV2DQTtcVE5R 4ObDJrw6pMXpUDKJFD+6HUtdHZ+a3RN6CDRKo7vYlCwm0tN0PaA2wdtoqSGqTwZVwGgKP F0P2Jjog2vZxkPFqj00MP7m9SWgvsEj7k2MtJl/Kz1uZNiyxbwdA8Whp/H7elbPgqE1FM NATpDM82iH+fPXl84MikzgNfwqOBRmtTsu8MJ1LYtN9hVOH+qiZlgnBgP0eytanKWPQ== 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="G/RfAtep"; arc=pass header.oldest-pass=0 smtp.remote-ip=192.198.163.13 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 A0B26606A31A; Tue, 1 Dec 2026 05:01:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A0B26606A31A 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=G/RfAtep DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796101283; x=1827637283; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=kOaELtZru9F7SaqFemhZryARvXtmttwMJyqMVDCUG30=; b=G/RfAtepPzlKQ91LoGRdnNgqk6ujQpOwER4Q6XDWLTEfuZx/Uhlcwtny Sw3QhTrXB3ivcEolvlE7dadNkGdhbQWoJ1i0XBVaIb4Bb+3aalzmnjQta 61MlydjGFtUpIYCeJhfyhKeBlyw8BT1Dq2RogQJtmtWaBSM4ZVwUz1cHr vH4x7F888Lbw3Mn7emNF1+vaAxfEkt/GCtM9ZWRX8gE3ayOCShPrm3Ye4 2adL4zQCd8Vl0/4COra9VuhYAJFUnXb+TUBBD/v4bVRTZidhwVYOz5qy9 MeUfCkhIWo6JZeZyKxhYwrlrfnEuhHLizY6QPD/GKV6cZbPzteNoX3Wwn w==; X-CSE-ConnectionGUID: huXgLqbKTumCsaFsMXU2Qw== X-CSE-MsgGUID: DHfBDpg4TJ23dcYu3XluTg== X-IronPort-AV: E=McAfee;i="6800,10657,11982"; a="4922451" X-IronPort-AV: E=Sophos;i="6.27,244,1787036400"; d="scan'208";a="4922451" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 21:01:21 -0800 X-CSE-ConnectionGUID: QDBI2FGnTCeYTDFZgVkTGA== X-CSE-MsgGUID: hEoxwL9CTp6H05s5Ulzagw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,244,1787036400"; d="scan'208";a="13314170" Received: from fmsmsx901.amr.corp.intel.com ([10.18.126.90]) by orviesa001.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 21:01:20 -0800 Received: from FMSMSX903.amr.corp.intel.com (10.18.126.92) by fmsmsx901.amr.corp.intel.com (10.18.126.90) 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 21:01:19 -0800 Received: from fmsedg903.ED.cps.intel.com (10.1.192.145) by FMSMSX903.amr.corp.intel.com (10.18.126.92) 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 21:01:19 -0800 Received: from SN4PR2101CU001.outbound.protection.outlook.com (40.93.195.11) by edgegateway.intel.com (192.55.55.83) 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 21:01:19 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Kva9kr1b4v3YAx6Q3S78UMUJ2OSZSWtkTM5OlHpJvQKRJX+g7gut+0XDB7+7I5FgU8QTtBTGzQfoQqcepZaJAKwmEUoJJdjse8KJOKSCN+YvM5ih9NUl6tDBWIrRlj0tHrh4bz77uiDGyoP8qtgXRLGX69wrPdc9BwDDwOzcDP0pNu9KlJDLgpqCf6msUKJ0TuH1+IQUtKwN06OmFhFTIflhH+hvdQrBprPlcS60szY5oAgMN6FON5PTwLHtP7bqkwzJzDMvfq3vkCbyU3yk5eEaer0+gZyPQoqPco6Bl8Yo+anuZ/pDnpLz2a0dd0MUA1FOUdCXwE2dyM9rf5Oc7Q== 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=kOaELtZru9F7SaqFemhZryARvXtmttwMJyqMVDCUG30=; b=aeJisOyOjQrux55Tj9iRYMSvX19UgiES5lVuGZGxDVmo47ud7crOuEQrhEBYOUPxIMCkqtZjBEQ+tFxWNqSOgcN1kWSiQQqj0fpcHiGjQ7P6Qu2ulET9IZADdIpDTWP0cTPd1NUhJqbiul3B/koRscFAsM8SYKzJQpKTyVhVTx6XZ9MOhzk/E9JO0QSLP9U/zrWi/LZyue9747bHYnmwiHmY7Q2Zao32a3G3YNzUfQusH1VHe8hiY2m6Yr1ke4YEZ0jWq/Vf4BPXibZedbusxG+Y1rX7Ual/pJ65weyYoWCV54hSru+SuXN0Jp7hYYoEi74R+RCUCPYIlbg4nMgHcA== 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 SJ0PR11MB7154.namprd11.prod.outlook.com (2603:10b6:a03:48d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.13; Tue, 1 Dec 2026 05:01:15 +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; Tue, 1 Dec 2026 05:01:14 +0000 Date: Tue, 1 Dec 2026 13:01:03 +0800 From: Chao Gao To: "Edgecombe, Rick P" CC: "hpa@zytor.com" , "Xu, Yilun" , "bp@alien8.de" , "baolu.lu@linux.intel.com" , "Peng, Chao P" , "dave.hansen@linux.intel.com" , "linux-kernel@vger.kernel.org" , "mingo@redhat.com" , "x86@kernel.org" , "kvm@vger.kernel.org" , "linux-coco@lists.linux.dev" , "Tian, Kevin" , "tglx@kernel.org" , "kas@kernel.org" Subject: Re: [RFC PATCH 1/7] coco/tdx-host: Create metadata for an SPDM session Message-ID: References: <20261116111037.3478844-1-chao.gao@intel.com> <20261116111037.3478844-2-chao.gao@intel.com> <73f765130067dc608532294b555e97f59b51e992.camel@intel.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <73f765130067dc608532294b555e97f59b51e992.camel@intel.com> X-ClientProxiedBy: SG2PR06CA0246.apcprd06.prod.outlook.com (2603:1096:4:c8::25) To IA0PR11MB8380.namprd11.prod.outlook.com (2603:10b6:208:485::21) X-Mailing-List: kvm@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_|SJ0PR11MB7154:EE_ X-MS-Office365-Filtering-Correlation-Id: bd2aa246-bcab-4728-0e38-08df4f682041 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|1800799024|366016|23010399003|11063799006|4143699003|22082099003|18002099003|56012099006|10067099003|261028144727099003|261026121527099003|261026140227099003|261022105027099003|261021121427099003|261022075727099003|261102123227099003|261021123027099003; X-Microsoft-Antispam-Message-Info: R1Mh6y3KSm+cPmlKlpONaHNxXD5+6BK4KY8Glv+8IE7B6wC+Z5qdFsQwjggnN9ZhgKulz2UWg8YZ3N0d7UqKp1TzLiGuobO9/labiHZBFUUUAcAzj58xy62e1Qbnxygcw4s4gGutraMqUx3rHxAch1EHGthaH5hHKj88viv3VUeTx6zkmxiC5W4ffdvveTKox0HvL9/7vNLeNppKgnIQl8sjFddbO5yD8qpe2IMzq8Og/as4lr9C94qAqtRiU/sQDAr8mAKiilhTMeeYLyXKIrLNu9bk6l4t+BAODEy+afUzbK3lY65DhKzQS4QJzShsNweC92ftjOMzaBjljQtXSmH3J5JZm1GxBDVxIzD2wjEE4yu/P+fgNTHgLTIsjQ9J0bKrIscWiOp7d7tp6895IGIPDEfthEsf1qPjxmPz0wdQMGOuzX12kwN8hbS0dSUUa2cvRDey71njDw/caEccWQcEaaQMT9WsfBd8i1Tv1f+ry7vMT3suHBfILbX+G6TV0fISGLf2hiQL5Uz4qLo0vJ+w68xhfUfaZkH0zaeL0s/OUjRvrv8E0CQlG6Bk2AVEE3dZrMADfOBumpfYwf7wxz7L2U6gBmYUclt8LucY+MhweV6jwPeagLOonWlqWto2BstJ/2g8zPkUWvue92Dj4Ljww7yqS10W0el9gFQrlgY= 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)(376014)(7416014)(1800799024)(366016)(23010399003)(11063799006)(4143699003)(22082099003)(18002099003)(56012099006)(10067099003)(261028144727099003)(261026121527099003)(261026140227099003)(261022105027099003)(261021121427099003)(261022075727099003)(261102123227099003)(261021123027099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?zz4gpSyRbIYZTH1nqElLs0BhkPj7RQpI2I4QvOQCNYucnXMjVmrQJi085fjW?= =?us-ascii?Q?YXfRL/LAs/2zcL0d+4uge+vKqWmrFfEQB4EQMQnuH11woYT6lzHrlZ8osNJA?= =?us-ascii?Q?TK6dqcrB+3duQhLBF+wuqAeLiljjuNzRqVfq3GYuYCFs77VP6QpGYwVD71mk?= =?us-ascii?Q?0skYdre/ZjE5lca5+l3uFheZoB7LiPUrnYP9hj1hwk+W47C2r78jxXmxoJzV?= =?us-ascii?Q?vbzjczklY6dCRriT9/z5QFVAxJTeKK4aqVOoH0VAEYb22DbvleNmiIE7Z2hr?= =?us-ascii?Q?VKUYk5zVbG5P1FdQyLqUqj/e0n7U1z0OGk4+A4dMH0J1vkUgKym20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+yWirsQFZF1hCYgJn/jYRBmcPfaZ?= =?us-ascii?Q?WjNmd9nEiL5sKvjjTaMpyJlVS/fXyeH9gRWC5nknD9827wDefE2t1Nh2PTGv?= =?us-ascii?Q?l+mdomQp+hPZvz8JsdN7pEYi9p4KFQbR/dDg3+amp8/B7iJRfxlI7XQN7xX/?= =?us-ascii?Q?3hll0Kom0K+BJL7gT2o6XAqfXjOIQK05tQqznbFkVOnVICONm0isxqJPuLGw?= =?us-ascii?Q?2tOXfNniGfSdSmOILMzBlITzBEgOdgTdl9iDabLCoSRdCY9/lmgHatxeY4rr?= =?us-ascii?Q?cCWk7zQMprW8zv5/KmVpAJnovBXrptBLV+aJjMCzb6AmARjc6Gq3WbuYkIxS?= =?us-ascii?Q?QRzjmFUC+zZ0mJKpj4Dd+UbpDOoiuhd43KzmlaBDJj5XZVpuPKY/KaMMYXGe?= =?us-ascii?Q?CLY3vAlBb5bCxJMh3bYNNAcREwX7fyp6ChCF53cIkpDUIVTfr1jEHZXjqMxQ?= =?us-ascii?Q?qVKmVqc4KevLG3rMsaowFdwVrJ+TZaSghigWZD43FJIWI9/CUUelmvt6ZVLz?= =?us-ascii?Q?kOj3RlFpSw=3D=3D?= X-Exchange-RoutingPolicyChecked: BqfvEdtneq0/MA5KuaJ+5jeFIzi/oNUueGZzSc2JRFNwW6zz64wswZ6jdzDVNgnODOJ/mxoPkRZBSS8ah5qh43pEo4vykeJH726XFjbMCacPRiZlQ5ebKs3lRXt0ARBVwSOzcTYhH1yYJxfyzF2KugfZ3bxazMRPRMbRDQdpMpbcr16BxVlxmyfGQGYqQcfPtjuEjYxRKeDPaviwHippTtCJAIxymyamIEAFuXmbIoarwoOUdDSzgPoa35RhL0L+tu+IQklD7kpYWUUihQVXa43SO5CBWmR9mm9zPdZue7RVTI3Op2utZQUdC4TV9xtUtdnCdJqKu8Yrp05hwq/lBw== X-MS-Exchange-CrossTenant-Network-Message-Id: bd2aa246-bcab-4728-0e38-08df4f682041 X-MS-Exchange-CrossTenant-AuthSource: IA0PR11MB8380.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2026 05:01:14.7838 (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: BOF4cyfkN+PHqIH6WI9dy2422HHTQziQZd0E/6SQ/+YLfr6WkMS7PoQG2RXzWMngavT3PqrKoJIdew+lX5qJqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB7154 X-OriginatorOrg: intel.com On Tue, Dec 01, 2026 at 06:08:07AM +0800, Edgecombe, Rick P wrote: >> > > When tearing the session down, reclaim the memory with >> > > TDH.SPDM.DELETE. If that fails, leak the memory, as the TDX module may >> > > still be using it. >> > >> > When would it fail? >> >> It shouldn't in practice. Per the spec, it fails if the input is wrong, >> if the session is still in use (by another SEAMCALL or by an IDE >> stream that has not been torn down), or if the TDX module extension >> hit a fatal error. Any of them would be unexpected. They mean a bug in >> the kernel or in the TDX module, or an earlier failure to tear down >> the IDE stream. >> >> I would just say in the changelog that TDH.SPDM.DELETE should not >> fail, and WARN_ON() and leak the memory if it does. > >I think we really need to strip these patches down to the bare minimum for the >initial upstreaming. We see this again and again and just need lots of revisions >to get them down to the true bare minimum. So let's just start there. Agreed. I will go through the series again and drop everything that is not needed for the initial upstreaming. > >In this case we could just WARN and have have no special logic around surviving >the bug. It is the simplest way to not have it look weird ignoring the error. Will do.