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

From: Nikolay Borisov
Date: Fri Oct 13 2023 - 07:18:22 EST




On 12.10.23 г. 16:41 ч., 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.

Add function detect_tdx_version to fetch and dump the version of the
TDX, which is called during TD initialization. Obtain the info by calling
TDG.SYS.RD, 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.

Reviewed-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
Co-developed-by: Dongcheng Yan <dongcheng.yan@xxxxxxxxx>
Signed-off-by: Dongcheng Yan <dongcheng.yan@xxxxxxxxx>
Signed-off-by: Yi Sun <yi.sun@xxxxxxxxx>

Reviewed-by: Nikolay Borisov <nik.borisov@xxxxxxxx>


<rant>

Intel really outdid themselves in creating the most horrendous document to read/comprehend aka tdx's 1.5 ABI ...

</rant>