lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZR/q/VaR8gF1CdOg@ysun46-mobl.ccr.corp.intel.com>
Date:   Fri, 6 Oct 2023 19:09:49 +0800
From:   "Sun, Yi" <Yi.Sun@...el.com>
To:     "Huang, Kai" <kai.huang@...el.com>
CC:     "tglx@...utronix.de" <tglx@...utronix.de>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "x86@...nel.org" <x86@...nel.org>, "bp@...en8.de" <bp@...en8.de>,
        "dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
        "kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
        "sathyanarayanan.kuppuswamy@...ux.intel.com" 
        <sathyanarayanan.kuppuswamy@...ux.intel.com>,
        "Su, Heng" <heng.su@...el.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "Yan, Dongcheng" <dongcheng.yan@...el.com>,
        "yi.sun@...ux.intel.com" <yi.sun@...ux.intel.com>
Subject: Re: [PATCH v4] x86/tdx: Dump TDX version During the TD Bootup

On 06.10.2023 17:48, Huang, Kai wrote:
>On Fri, 2023-10-06 at 14:28 +0800, Yi Sun wrote:
>
>
>It's better if you can maintain the code change history among different versions
>so that people can see what changes have been done:
>
>	<your SoB>
>	---
>	code change history
>	---
>	...
>
>The "code change history" will be thrown away when the patch is applied.
>
I'll refine commit log and the change history.

...

>> +	td_sys->vendor_id = (u32)args.r8;
>> +
>> +	args.rdx = TDX_SYS_MAJOR_FID;
>> +	__tdcall_ret(TDX_SYS_RD, &args);
>> +
>> +	td_sys->major_version = (u16)args.r8;
>> +
>> +	args.rdx = TDX_SYS_MINOR_FID;
>> +	__tdcall_ret(TDX_SYS_RD, &args);
>> +
>> +	td_sys->minor_version = (u16)args.r8;
>> +
>> +	return;
>> +
>> +	/* TDX 1.0 does not have the TDCALL TDG.SYS.RD */
>> +version_1_0:
>> +	td_sys->vendor_id = TDX_VENDOR_INTEL;
>> +	td_sys->major_version = 1;
>> +	td_sys->minor_version = 0;
>
>So the main reason that I think you can just print module version in this
>function instead of tdx_early_init() is because IIUC you are setting up some
>random value for TDX module 1.0.  Probably it's better to just print it's module
>1.0 w/o mentioning major/minor.

Actually, it is not a random value here; it is the fixed value for TDX 1.0
becasue there is not such version info in TDX 1.0.
I assume we can state major=1 and minor=0 when TDX 1.0 is detected.
This will prevent confusion for the users.

>As replied above, I think you can print module info in tdg_get_sysinfo().
>
>If you do so, perhaps to rename the function to something like
>detect_tdx_version().
>
>You can either still keep
>
>	pr_info("Guest detected\n");
>
>here, or remove it but embed it to the message when you print module version.
Get it. I'll do that.
>
>
>> diff --git a/arch/x86/include/asm/shared/tdx.h b/arch/x86/include/asm/shared/tdx.h
>> index f74695dea217..d326509832e6 100644
>> --- a/arch/x86/include/asm/shared/tdx.h
>> +++ b/arch/x86/include/asm/shared/tdx.h
>> @@ -17,6 +17,7 @@
>>  #define TDG_MR_REPORT			4
>>  #define TDG_MEM_PAGE_ACCEPT		6
>>  #define TDG_VM_WR			8
>> +#define TDX_SYS_RD			11
>
>TDG_SYS_RD, please.

Appreciate Kai's detailed comments.

Thanks
    --Sun, Yi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ