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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4sqvd3zghwp5o23r2s47i56qg34obammtggbtneof26ghbwrxv@rskezsmaqgim>
Date: Thu, 4 Jul 2024 16:03:36 +0300
From: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
To: Dave Hansen <dave.hansen@...el.com>
Cc: Nikolay Borisov <nik.borisov@...e.com>, 
	Dave Hansen <dave.hansen@...ux.intel.com>, Thomas Gleixner <tglx@...utronix.de>, 
	Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>, x86@...nel.org, 
	"H. Peter Anvin" <hpa@...or.com>, linux-coco@...ts.linux.dev, linux-kernel@...r.kernel.org, 
	stable@...r.kernel.org
Subject: Re: [PATCHv5 3/4] x86/tdx: Dynamically disable SEPT violations from
 causing #VEs

On Wed, Jul 03, 2024 at 07:49:48AM -0700, Dave Hansen wrote:
> On 7/3/24 06:04, Kirill A. Shutemov wrote:
> >>> -/* TDCS fields. To be used by TDG.VM.WR and TDG.VM.RD module calls */
> >>> +/* TDX TD-Scope Metadata. To be used by TDG.VM.WR and TDG.VM.RD */
> >>> +#define TDCS_CONFIG_FLAGS		0x1110000300000016
> >> 0x9110000300000016
> >>> +#define TDCS_TD_CTLS			0x11104800000017
> >> 0x9110000300000017
> > Setting bit 63 in these field id is regression in new TDX spec and TDX
> > module. It is going to be fixed in next version. Both versions of field
> > ids are going to be valid.
> 
> I kinda never liked the big ol' magic numbers approach here.  But could
> we please introduce some helpers here?
> 
> Then we'll end up with something like this (if the 0x111 can't be
> decomposed):
> 
> #define _TDCS_CMD(c)	((0x1110UL << 48) | (c))
> 
> #define TDCS_CONFIG_FLAGS _TDCS_CMD(0x16)
> #define TDCS_TD_CTLS	  _TDCS_CMD(0x17)
> 
> Then when folks change their mind about what should be in the TDX spec,
> we have one place to go fix it up in addition to making this all more
> readable.

Hm. I am not sure about this. It can be tedious if we want to encode all
info this way. Like, size of the field, number of elements in the
field, number of elements in the sequence, etc. It is going to be macro on
the macro on the macro. I don't think it would improve readability.

On related note, I think the TDX 1.5 definitions of field ids are more
useful as you can infer more info from them. I consider to switching all
definitions to the new format. It effectively drops TDX 1.0 support as the
newly used bits are reserved in 1.0.

TDX module 1.0 is no longer supported, but kernel haven't broken anything
from the guest side yet. I don't think anybody actually uses it and I need
to jump hoops to get it running for validation.

Any objections for dropping TDX 1.0 support?

-- 
  Kiryl Shutsemau / Kirill A. Shutemov

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ