[PATCH v2 0/3] TDX: Clean up the definitions of TDX ATTRIBUTES

Xiaoyao Li posted 3 patches 2 months, 3 weeks ago
arch/x86/coco/tdx/debug.c         | 2 +-
arch/x86/include/asm/shared/tdx.h | 4 ++--
arch/x86/kvm/vmx/tdx.c            | 6 +++---
arch/x86/kvm/vmx/tdx_arch.h       | 6 ------
4 files changed, 6 insertions(+), 12 deletions(-)
[PATCH v2 0/3] TDX: Clean up the definitions of TDX ATTRIBUTES
Posted by Xiaoyao Li 2 months, 3 weeks ago
Although some duplications were identified during the community review
of TDX KVM base support[1][2], a few slipped through unnoticed due to
the simultaneous evolution of the TD guest part.

Patch 1 fixes the typo. Patch 2 removes the redundant definitions of
TD ATTRIBUTES bits. Patch 3 rename KVM_SUPPORTED_TD_ATTRS to include
"TDX" in it, based on Sean's preference[3].

Note, this series doesn't rename TDX_ATTR_* in asm/shared/tdx.h to
TDX_TD_ATTR_*, so that KVM_SUPPORTED_TDX_TD_ATTRS in patch 3 looks
a little inconsistent. Because I'm not sure what the preference of tip
maintainers on the name is. So I only honor KVM maintainer's preference
and leave the stuff outside KVM unchanged.

[1] https://lore.kernel.org/all/e5387c7c-9df8-4e39-bbe9-23e8bb09e527@intel.com/
[2] https://lore.kernel.org/all/25bf543723a176bf910f27ede288f3d20f20aed1.camel@intel.com/
[3] https://lore.kernel.org/all/aG0uyLwxqfKSX72s@google.com/


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@intel.com/ 

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

 arch/x86/coco/tdx/debug.c         | 2 +-
 arch/x86/include/asm/shared/tdx.h | 4 ++--
 arch/x86/kvm/vmx/tdx.c            | 6 +++---
 arch/x86/kvm/vmx/tdx_arch.h       | 6 ------
 4 files changed, 6 insertions(+), 12 deletions(-)


base-commit: e4775f57ad51a5a7f1646ac058a3d00c8eec1e98
prerequisite-patch-id: 96c55dfc551bf62e0b18e75547ba3bf671e30ee8
-- 
2.43.0
Re: [PATCH v2 0/3] TDX: Clean up the definitions of TDX ATTRIBUTES
Posted by Edgecombe, Rick P 2 months, 3 weeks ago
On Fri, 2025-07-11 at 21:26 +0800, Xiaoyao Li wrote:
> Note, this series doesn't rename TDX_ATTR_* in asm/shared/tdx.h to
> TDX_TD_ATTR_*, so that KVM_SUPPORTED_TDX_TD_ATTRS in patch 3 looks
> a little inconsistent. Because I'm not sure what the preference of tip
> maintainers on the name is. So I only honor KVM maintainer's preference
> and leave the stuff outside KVM unchanged.

I prefer the names with "TD" based on the argument that it's clearer that it is
TD scoped. My read was that Sean has the same reasoning. This series changes KVM
code to use the non-"TD" defines. So I feel Sean's opinion counts here. We don't
have any x86 maintainer NAK on the other direction, so it doesn't seem like a
reason to give up trying.

That said I think this series is an overall improvement. We could always add TD
to the names later. But the sooner we do it, the less we'll have to change.
Re: [PATCH v2 0/3] TDX: Clean up the definitions of TDX ATTRIBUTES
Posted by Xiaoyao Li 2 months, 3 weeks ago
On 7/12/2025 2:02 AM, Edgecombe, Rick P wrote:
> On Fri, 2025-07-11 at 21:26 +0800, Xiaoyao Li wrote:
>> Note, this series doesn't rename TDX_ATTR_* in asm/shared/tdx.h to
>> TDX_TD_ATTR_*, so that KVM_SUPPORTED_TDX_TD_ATTRS in patch 3 looks
>> a little inconsistent. Because I'm not sure what the preference of tip
>> maintainers on the name is. So I only honor KVM maintainer's preference
>> and leave the stuff outside KVM unchanged.
> 
> I prefer the names with "TD" based on the argument that it's clearer that it is
> TD scoped. My read was that Sean has the same reasoning. This series changes KVM
> code to use the non-"TD" defines. So I feel Sean's opinion counts here. We don't
> have any x86 maintainer NAK on the other direction, so it doesn't seem like a
> reason to give up trying.
> 
> That said I think this series is an overall improvement. We could always add TD
> to the names later. But the sooner we do it, the less we'll have to change.

Just sent the v3 which adds one additional patch to rename it.