[PATCH v4 0/4] x86/tdx: Clean up the definitions of TDX TD ATTRIBUTES

From: Xiaoyao Li

Date: Mon Mar 02 2026 - 22:21:12 EST


The main purpose of this series was to remove redundant macros between
core TDX and KVM, along with a typo fix. They were implemented as patch 1
and patch 2.

During the review of v1 and v2, there was encouragement to refine the
names of the macros related to TD attributes to clarify their scope.
Thus patch 3 and patch 4 are added.

Note, Binbin suggested to rename tdx_attributes[] to tdx_td_attributes[]
during v3 review. However, this v4 doesn't do it but leaves it for future
cleanup to avoid making it more complicated because it also looks like
it needs to rename "Attributes" to "TD Attributes" in tdx_dump_attributes(),
which has user visibility change.

Changes in v4:
- Collect Reviewed-by and Acked-by tags;
- rebase to v7.0-rc1;

v3: https://lore.kernel.org/kvm/20250715091312.563773-1-xiaoyao.li@xxxxxxxxx/
Changes in v3:
- use the changelog provided by Rick for patch 1;
- collect Reviewed-by on patch 4;
- Add patch 3;

v2: https://lore.kernel.org/all/20250711132620.262334-1-xiaoyao.li@xxxxxxxxx/
Changes in v2:
- collect Reviewed-by;
- Explains the impact of the change in patch 1 changelog;
- Add patch 3.

v1: https://lore.kernel.org/all/20250708080314.43081-1-xiaoyao.li@xxxxxxxxx/

Xiaoyao Li (4):
x86/tdx: Fix the typo in TDX_ATTR_MIGRTABLE
KVM: TDX: Remove redundant definitions of TDX_TD_ATTR_*
x86/tdx: Rename TDX_ATTR_* to TDX_TD_ATTR_*
KVM: TDX: Rename KVM_SUPPORTED_TD_ATTRS to KVM_SUPPORTED_TDX_TD_ATTRS

arch/x86/coco/tdx/debug.c | 26 ++++++++--------
arch/x86/coco/tdx/tdx.c | 8 ++---
arch/x86/include/asm/shared/tdx.h | 50 +++++++++++++++----------------
arch/x86/kvm/vmx/tdx.c | 4 +--
arch/x86/kvm/vmx/tdx_arch.h | 6 ----
5 files changed, 44 insertions(+), 50 deletions(-)


base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
--
2.43.0