From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (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 15C4E36C0C6 for ; Sun, 15 Mar 2026 13:59:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773583192; cv=none; b=ozWSWrEtLLi6zA4k3a9wcBBqL50Lj3rqhcFt0JXTpMaHCMmiD1EoNvJCE4icnWd2d8omk78NA0tUnyQx07N9ijJANv20CsfKg2crg4YqvijCbowVHv0Fuu0oMe1VpmCbWSt995YrZXSN9hx+8q/GfKIOOLxlcUMKkJBQE6++XFs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773583192; c=relaxed/simple; bh=Yzu2x/DJWrsTvYoPcjRvw5DbCXExO+H80V5s63j7pOo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pprsCiMZKlN2SmBDXf/D4S2h2rNkaaF+h+IX84fbaC3Ja5yKfn+B502PbjvnpTkL82LhiTPB0jzs//5zHu7ZrzdT5wh19O8V8YRRwls93H532Vp67XGb/lqBFWxzb/uv3kxkcu9q+a2bHcXXoNcA1ovBS7ayycpixmUiYBjZnR4= 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=j5kRX+pC; arc=none smtp.client-ip=192.198.163.15 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="j5kRX+pC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1773583191; x=1805119191; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Yzu2x/DJWrsTvYoPcjRvw5DbCXExO+H80V5s63j7pOo=; b=j5kRX+pCURd8PjMSY+u3RCIA4qGCwHvKjb5N+K8jnCgTM/XHlL13UjTO dfZgYuN85+QCe2iqXoNKTv2pYswdFi7arSDet/XEMvVKeA+9Dv6TGaZwg ffXInXDffLiAEimsDgZUuXBRSE/rsfuZXyGoBBbjBxV9E+rHejnuhVnCD jHKJiYiMlgB93E5unrUn+qR/Phdj1Uz2h5Bf/N1QF4reCnT1cYTf9bU6p xJ9a3mi3wZI176LafctVSpALIDQivfWDpBJRnbusnN8zp497KWJMpiEDc KZBNaQ+oJQfAuYDYyY+ojniq9h+bsymtPh0+DuD6RhBiO18y6TuPB1dTW Q==; X-CSE-ConnectionGUID: Apl9pNQSRRCapSOGkdIXEQ== X-CSE-MsgGUID: qiyMUHkiRxuR+IMr42niUQ== X-IronPort-AV: E=McAfee;i="6800,10657,11730"; a="74732560" X-IronPort-AV: E=Sophos;i="6.23,122,1770624000"; d="scan'208";a="74732560" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2026 06:59:45 -0700 X-CSE-ConnectionGUID: h/qkFZjUSGeEAe6Wdn23bA== X-CSE-MsgGUID: l6XCRXPtRg6uj7zR3EN/5w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,122,1770624000"; d="scan'208";a="226123083" Received: from 984fee019967.jf.intel.com ([10.23.153.244]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2026 06:59:45 -0700 From: Chao Gao To: linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, kvm@vger.kernel.org Cc: binbin.wu@linux.intel.com, dan.j.williams@intel.com, dave.hansen@linux.intel.com, ira.weiny@intel.com, kai.huang@intel.com, kas@kernel.org, nik.borisov@suse.com, paulmck@kernel.org, pbonzini@redhat.com, reinette.chatre@intel.com, rick.p.edgecombe@intel.com, sagis@google.com, seanjc@google.com, tony.lindgren@linux.intel.com, vannapurve@google.com, vishal.l.verma@intel.com, yilun.xu@linux.intel.com, Chao Gao , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" Subject: [PATCH v5 19/22] x86/virt/tdx: Enable TDX module runtime updates Date: Sun, 15 Mar 2026 06:58:39 -0700 Message-ID: <20260315135920.354657-20-chao.gao@intel.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260315135920.354657-1-chao.gao@intel.com> References: <20260315135920.354657-1-chao.gao@intel.com> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit All pieces of TDX module runtime updates are in place. Enable it if it is supported. Signed-off-by: Chao Gao Reviewed-by: Xu Yilun Reviewed-by: Tony Lindgren --- arch/x86/include/asm/tdx.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/tdx.h b/arch/x86/include/asm/tdx.h index 4c4f7acd4044..386097b2e01b 100644 --- a/arch/x86/include/asm/tdx.h +++ b/arch/x86/include/asm/tdx.h @@ -36,6 +36,7 @@ #define TDX_UPDATE_COMPAT_SENSITIVE 0x8000051200000000ULL /* Bit definitions of TDX_FEATURES0 metadata field */ +#define TDX_FEATURES0_TD_PRESERVING BIT_ULL(1) #define TDX_FEATURES0_NO_RBP_MOD BIT_ULL(18) #define TDX_FEATURES0_UPDATE_COMPAT BIT_ULL(47) @@ -112,8 +113,7 @@ const struct tdx_sys_info *tdx_get_sysinfo(void); static inline bool tdx_supports_runtime_update(const struct tdx_sys_info *sysinfo) { - /* To be enabled when kernel is ready. */ - return false; + return sysinfo->features.tdx_features0 & TDX_FEATURES0_TD_PRESERVING; } static inline bool tdx_supports_update_compatibility(const struct tdx_sys_info *sysinfo) -- 2.47.3