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] [day] [month] [year] [list]
Message-ID: <aRUzXbIAcv8vOyBe@intel.com>
Date: Thu, 13 Nov 2025 09:24:45 +0800
From: Chao Gao <chao.gao@...el.com>
To: Dave Hansen <dave.hansen@...el.com>
CC: <linux-coco@...ts.linux.dev>, <linux-kernel@...r.kernel.org>,
	<x86@...nel.org>, Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar
	<mingo@...hat.com>, Borislav Petkov <bp@...en8.de>, Dave Hansen
	<dave.hansen@...ux.intel.com>, "H. Peter Anvin" <hpa@...or.com>, "Kirill A.
 Shutemov" <kas@...nel.org>, Kai Huang <kai.huang@...el.com>, Paolo Bonzini
	<pbonzini@...hat.com>, Dan Williams <dan.j.williams@...el.com>
Subject: Re: [PATCH 1/2] x86/virt/tdx: Retrieve TDX module version

On Wed, Oct 22, 2025 at 03:55:01PM +0800, Chao Gao wrote:
>On Wed, Oct 01, 2025 at 08:15:46AM -0700, Dave Hansen wrote:
>>On 9/30/25 19:22, Chao Gao wrote:
>>> +	if (!ret && !(ret = read_sys_metadata_field(0x0800000100000003, &val)))
>>> +		sysinfo_version->minor_version = val;
>>> +	if (!ret && !(ret = read_sys_metadata_field(0x0800000100000004, &val)))
>>> +		sysinfo_version->major_version = val;
>>> +	if (!ret && !(ret = read_sys_metadata_field(0x0800000100000005, &val)))
>>> +		sysinfo_version->update_version = val;
>>
>>Heh, how long does this take in practice to get 6 bytes of data out of
>>the module?
>
>~8us. And the whole metadata reading process (i.e., get_tdx_sys_info()) takes
>~113us.
>
>>When is the point that we move  over to TDH.SYS.RDALL?
>
>TDH.SYS.RDALL takes ~16us.
>
>I'm uncertain whether the saved CPU time of ~100us justifies implementing
>TDH.SYS.RDALL.

I chatted with Dave and Yilun offline. We think that saving 100us for this
one-off operation isn't worth the code churn.

For the record, the idea of moving over to TDH.SYS.RDALL is:

1. Call TDH.SYS.RDALL to dump all metadata into a data structure
2. Add a tdx_get_one() helper to look up the data structure and get the
   metadata for a given field ID
3. Replace read_sys_metadata_field() with tdx_get_one()

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ