Re: [PATCH v3] x86/tdx: Dump TDX version During the TD Bootup

From: Huang, Kai
Date: Mon Oct 02 2023 - 07:03:02 EST


On Mon, 2023-10-02 at 13:38 +0300, kirill.shutemov@xxxxxxxxxxxxxxx wrote:
> On Sun, Oct 01, 2023 at 12:11:10AM +0800, Yi Sun wrote:
> > It is essential for TD users to be aware of the vendor and version of
> > the current TDX. Additionally, they can reference the TDX version when
> > reporting bugs or issues.
> >
> > Furthermore, the applications or device drivers running in TD can achieve
> > enhanced reliability and flexibility by following the TDX Module ABI
> > specification, because there are significant differences between different
> > versions of TDX, as mentioned in the "Intel® TDX Module Incompatibilities
> > between v1.0 and v1.5" reference. Here are a few examples:
> >
> > MSR Name Index Reason
> > ----------------------------------------------
> > IA32_UARCH_MISC_CTL 0x1B01 From v1.5
> > IA32_ARCH_CAPABILITIES 0x010A Changed in v1.5
> > IA32_TSX_CTRL 0x0122 Changed in v1.5
> >
> > CPUID Leaf Sub-leaf Reason
> > ---------------------------------------
> > 0x7 2 From v1.5
> > 0x22 0 From v1.5
> > 0x23 0~3 From v1.5
> > 0x80000007 0 From v1.5
> >
> > During TD initialization, the TDX version info can be obtained by calling
> > TDG.SYS.RD. This will fetch the current version of TDX, including the major
> > and minor version numbers and vendor ID.
> >
> > The TDCALL TDG.SYS.RD originates from TDX version 1.5. If the error
> > TDCALL_INVALID_OPERAND occurs, it should be treated as TDX version 1.0.
> >
> > Co-developed-by: Dongcheng Yan <dongcheng.yan@xxxxxxxxx>
> > Signed-off-by: Dongcheng Yan <dongcheng.yan@xxxxxxxxx>
> > Signed-off-by: Yi Sun <yi.sun@xxxxxxxxx>
>
> Looks good to me.
>
> Reviewed-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
>
> But you need to send it to x86 maintainers. I've CCed x86@, but you might
> need to resend it properly to maintainers.
>

I looked at the patch on lore.kernel.org:

https://lore.kernel.org/all/20230930161110.3251107-1-yi.sun@xxxxxxxxx/T/

It seems it hasn't been rebased to the latest tip/x86/tdx yet, which has patches
to unify TDCALL/TDVMCALL assembly.