From nobody Sat Feb 7 08:27:16 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (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 7735B357A49; Fri, 23 Jan 2026 15:00:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769180435; cv=none; b=pkUMrfUwfiee9ZopKqsA2cyBiAsYPXuww7JaHIo75ZbF9tBriaP/2l0rpoC14ITwW2v3wq3slcjpsWFiIRy4VYA8wCEYXotUZZJFnEXRpdVk+Suow7eTLHXE7GrY5ii+RJlSuPeRZLoUC6KGtBVoFjxvFZNuAX53OjeNOKXOJOY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769180435; c=relaxed/simple; bh=c+YcofYlDsoQPUldf/eodN31yd/szVEY6FullhsT+/4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iN/tlVR/+7Q5DGJ0pgL2+WpwL/wMncni5DGhcF0hTbhGFb6GCo9DKOZT3adAnF79E/9sWfAeeTDadNNPvG0JEZ2zFFZu+Wid21HRP0HwavpfiXuvENkGddC0SzuY9mXiHpgSlhtblLkelmQnmrDpURwhIX9BqZXrpE23g9tV1kQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ePx0B2It; arc=none smtp.client-ip=192.198.163.17 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.b="ePx0B2It" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1769180434; x=1800716434; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=c+YcofYlDsoQPUldf/eodN31yd/szVEY6FullhsT+/4=; b=ePx0B2ItxwiNKnIK4ItuG0Y0Jmu3K3Q76Kgi42qxNjG/ITYGACidhxLN vAexa5N+TzJA3FbHmDWOmSBSZZWxz1YmX1nDh0DRvP+MbKS7eyr9j3c+R HqC86KXTBqKNBcWU3vl2VC0Olwj/5T/V71VM3ptp8RkjJLpLe4DHBMiix pHG5w5M2jC3CxlrChYr5LDInMyv9qiRfJGPemnvE8jzoVbN47kpB+j0vs P+ghVjK+c9atSsZhuTw00pPs7Q4C/so0un5GCWhHBIEm7rVp5baWca/Hq lVtBK4Ixk51w0YDfL22SH/Rx1XbAJWEoDx8dUpj0ZScU88h4ebeV0gCq0 Q==; X-CSE-ConnectionGUID: LwKQMkkiTbmrJtcutNxkKQ== X-CSE-MsgGUID: LlF/CSBWRCSykUoAcAKRrg== X-IronPort-AV: E=McAfee;i="6800,10657,11680"; a="70334478" X-IronPort-AV: E=Sophos;i="6.21,248,1763452800"; d="scan'208";a="70334478" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jan 2026 07:00:18 -0800 X-CSE-ConnectionGUID: J7kqfZNRTNajWQNCmyj28w== X-CSE-MsgGUID: CyYboKZqSRi0wY6y+7izcw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,248,1763452800"; d="scan'208";a="237697180" Received: from 984fee019967.jf.intel.com ([10.23.153.244]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jan 2026 07:00:17 -0800 From: Chao Gao To: linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, x86@kernel.org Cc: reinette.chatre@intel.com, ira.weiny@intel.com, kai.huang@intel.com, dan.j.williams@intel.com, yilun.xu@linux.intel.com, sagis@google.com, vannapurve@google.com, paulmck@kernel.org, nik.borisov@suse.com, zhenzhong.duan@intel.com, seanjc@google.com, rick.p.edgecombe@intel.com, kas@kernel.org, dave.hansen@linux.intel.com, vishal.l.verma@intel.com, Chao Gao , Farrah Chen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" Subject: [PATCH v3 18/26] x86/virt/seamldr: Log TDX Module update failures Date: Fri, 23 Jan 2026 06:55:26 -0800 Message-ID: <20260123145645.90444-19-chao.gao@intel.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260123145645.90444-1-chao.gao@intel.com> References: <20260123145645.90444-1-chao.gao@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If failures occur after the TDX Module has been successfully shut down, they are unrecoverable. The kernel cannot restore the previous TDX Module to a running state. All subsequent SEAMCALLs to the TDX Module will fail, so TDs cannot continue to run. Log a message to clarify that SEAMCALL errors are expected in this case. To prevent TDX Module update failures, admins are encouraged to use the user space tool [1] that will perform compatibility and integrity checks that guarantee TDX Module update success. Signed-off-by: Chao Gao Tested-by: Farrah Chen Link: https://github.com/intel/tdx-module-binaries/blob/main/version_select= _and_load.py # [1] Reviewed-by: Tony Lindgren --- v3: - Rephrase the changelog to eliminate the confusing uses of 'i.e.' and 'e.= g.' [Dave/Yilun] --- arch/x86/virt/vmx/tdx/seamldr.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/x86/virt/vmx/tdx/seamldr.c b/arch/x86/virt/vmx/tdx/seamld= r.c index 76f404d1115c..b497fa72ebb6 100644 --- a/arch/x86/virt/vmx/tdx/seamldr.c +++ b/arch/x86/virt/vmx/tdx/seamldr.c @@ -260,6 +260,14 @@ static void ack_state(void) set_target_state(tdp_data.state + 1); } =20 +static void print_update_failure_message(void) +{ + static atomic_t printed =3D ATOMIC_INIT(0); + + if (atomic_inc_return(&printed) =3D=3D 1) + pr_err("update failed, SEAMCALLs will report failure until TDs killed\n"= ); +} + /* * See multi_cpu_stop() from where this multi-cpu state-machine was * adopted, and the rationale for touch_nmi_watchdog() @@ -289,10 +297,13 @@ static int do_seamldr_install_module(void *params) break; } =20 - if (ret) + if (ret) { atomic_inc(&tdp_data.failed); - else + if (curstate > TDP_SHUTDOWN) + print_update_failure_message(); + } else { ack_state(); + } } else { touch_nmi_watchdog(); rcu_momentary_eqs(); --=20 2.47.3