[PATCH v2 1/3] x86/tdx: Fix the typo of TDX_ATTR_MIGRTABLE

Xiaoyao Li posted 3 patches 2 months, 3 weeks ago
[PATCH v2 1/3] x86/tdx: Fix the typo of TDX_ATTR_MIGRTABLE
Posted by Xiaoyao Li 2 months, 3 weeks ago
Fix the typo from TDX_ATTR_MIGRTABLE to TDX_ATTR_MIGRATABLE.

Since the names are stringified and printed out to dmesg in
tdx_dump_attributes(), this correction will also fix the dmesg output.
But not any kind of machine readable proc or anything like that.

Reviewed-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
---
Changes in v2:
 - Add the impact of the change in the commit message. (provided by Rick)
---
 arch/x86/coco/tdx/debug.c         | 2 +-
 arch/x86/include/asm/shared/tdx.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/coco/tdx/debug.c b/arch/x86/coco/tdx/debug.c
index cef847c8bb67..28990c2ab0a1 100644
--- a/arch/x86/coco/tdx/debug.c
+++ b/arch/x86/coco/tdx/debug.c
@@ -17,7 +17,7 @@ static __initdata const char *tdx_attributes[] = {
 	DEF_TDX_ATTR_NAME(ICSSD),
 	DEF_TDX_ATTR_NAME(LASS),
 	DEF_TDX_ATTR_NAME(SEPT_VE_DISABLE),
-	DEF_TDX_ATTR_NAME(MIGRTABLE),
+	DEF_TDX_ATTR_NAME(MIGRATABLE),
 	DEF_TDX_ATTR_NAME(PKS),
 	DEF_TDX_ATTR_NAME(KL),
 	DEF_TDX_ATTR_NAME(TPA),
diff --git a/arch/x86/include/asm/shared/tdx.h b/arch/x86/include/asm/shared/tdx.h
index 8bc074c8d7c6..11f3cf30b1ac 100644
--- a/arch/x86/include/asm/shared/tdx.h
+++ b/arch/x86/include/asm/shared/tdx.h
@@ -35,8 +35,8 @@
 #define TDX_ATTR_LASS			BIT_ULL(TDX_ATTR_LASS_BIT)
 #define TDX_ATTR_SEPT_VE_DISABLE_BIT	28
 #define TDX_ATTR_SEPT_VE_DISABLE	BIT_ULL(TDX_ATTR_SEPT_VE_DISABLE_BIT)
-#define TDX_ATTR_MIGRTABLE_BIT		29
-#define TDX_ATTR_MIGRTABLE		BIT_ULL(TDX_ATTR_MIGRTABLE_BIT)
+#define TDX_ATTR_MIGRATABLE_BIT		29
+#define TDX_ATTR_MIGRATABLE		BIT_ULL(TDX_ATTR_MIGRATABLE_BIT)
 #define TDX_ATTR_PKS_BIT		30
 #define TDX_ATTR_PKS			BIT_ULL(TDX_ATTR_PKS_BIT)
 #define TDX_ATTR_KL_BIT			31
-- 
2.43.0
Re: [PATCH v2 1/3] x86/tdx: Fix the typo of TDX_ATTR_MIGRTABLE
Posted by Edgecombe, Rick P 2 months, 3 weeks ago
On Fri, 2025-07-11 at 21:26 +0800, Xiaoyao Li wrote:
> Fix the typo from TDX_ATTR_MIGRTABLE to TDX_ATTR_MIGRATABLE.
> 
> Since the names are stringified and printed out to dmesg in
> tdx_dump_attributes(), this correction will also fix the dmesg output.
> 
> 

> But not any kind of machine readable proc or anything like that.

Thanks for adding the impact. This is such a small patch that I hate to generate
a v3, but this is too imprecise for a tip commit log.

Here is how I would write it, what do you think?


x86/tdx: Fix the typo in TDX_ATTR_MIGRTABLE

The TD scoped TDCS attributes are defined by a bit position. In the guest side
of the TDX code, the 'tdx_attributes' string array holds pretty print names for
these attributes, which are generated via macros and defines. Today these pretty
print names are only used to print the attribute names to dmesg.

Unfortunately there is a typo in define for the migratable bit define. Change
the defines TDX_ATTR_MIGRTABLE* to TDX_ATTR_MIGRATABLE*. Update the sole user,
the tdx_attributes array, to use the fixed name.

Since these defines control the string printed to dmesg, the change is user
visible. But the risk of breakage is almost zero since is not exposed in any
interface expected to be consumed programatically.

Fixes: 564ea84c8c14 ("x86/tdx: Dump attributes and TD_CTLS on boot")
Reviewed-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Re: [PATCH v2 1/3] x86/tdx: Fix the typo of TDX_ATTR_MIGRTABLE
Posted by Xiaoyao Li 2 months, 3 weeks ago
On 7/12/2025 1:51 AM, Edgecombe, Rick P wrote:
> On Fri, 2025-07-11 at 21:26 +0800, Xiaoyao Li wrote:
>> Fix the typo from TDX_ATTR_MIGRTABLE to TDX_ATTR_MIGRATABLE.
>>
>> Since the names are stringified and printed out to dmesg in
>> tdx_dump_attributes(), this correction will also fix the dmesg output.
>>
>>
> 
>> But not any kind of machine readable proc or anything like that.
> 
> Thanks for adding the impact. This is such a small patch that I hate to generate
> a v3, but this is too imprecise for a tip commit log.
> 
> Here is how I would write it, what do you think?

It's way better than mine!

I use it in v3 with few fix (by gpt).

thanks!

> 
> x86/tdx: Fix the typo in TDX_ATTR_MIGRTABLE
> 
> The TD scoped TDCS attributes are defined by a bit position. In the guest side
> of the TDX code, the 'tdx_attributes' string array holds pretty print names for
> these attributes, which are generated via macros and defines. Today these pretty
> print names are only used to print the attribute names to dmesg.
> 
> Unfortunately there is a typo in define for the migratable bit define. Change
> the defines TDX_ATTR_MIGRTABLE* to TDX_ATTR_MIGRATABLE*. Update the sole user,
> the tdx_attributes array, to use the fixed name.
> 
> Since these defines control the string printed to dmesg, the change is user
> visible. But the risk of breakage is almost zero since is not exposed in any
> interface expected to be consumed programatically.
> 
> Fixes: 564ea84c8c14 ("x86/tdx: Dump attributes and TD_CTLS on boot")
> Reviewed-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Reviewed-by: Kai Huang <kai.huang@intel.com>
> Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>