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

From: Yi Sun
Date: Fri Oct 06 2023 - 09:47:30 EST


On 06.10.2023 11:11, Nikolay Borisov wrote:


On 6.10.23 г. 9:28 ч., Yi Sun wrote:
+static void tdg_get_sysinfo(struct tdg_sys_info *td_sys)
+{
+ u64 ret;
+ struct tdx_module_args args = {
+ .rdx = TDX_SYS_VENDOR_ID_FID,
+ };
+
+ if (!td_sys)
+ return;
+
+ memset(td_sys, 0, sizeof(struct tdg_sys_info));

So in case of an error this function would effectively zero out tdg_sys_info and not explicitly mention that something went wrong. Dunno how sensible or likely it is to get an error while requesting the ID_FID ? Also why don't you check for errors on subsequent calls to TDG.SYS.RD ?

I'll add some error info before each error return to know what going
on when some error occurs.

Actually, I removed the error check for subsequent calls to TDG.SYS.RD
in this version, since it's probably not necessary when the first call
is successful. I can add them back with warning dumping when errors occurs.

Thanks
--Sun, Yi