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: <aCWWPmVloPP0_St0@gmail.com>
Date: Thu, 15 May 2025 09:22:38 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Ard Biesheuvel <ardb+git@...gle.com>
Cc: linux-kernel@...r.kernel.org, linux-efi@...r.kernel.org, x86@...nel.org,
	Ard Biesheuvel <ardb@...nel.org>, Borislav Petkov <bp@...en8.de>,
	Dionna Amalie Glaze <dionnaglaze@...gle.com>,
	Kevin Loughlin <kevinloughlin@...gle.com>,
	Tom Lendacky <thomas.lendacky@....com>
Subject: Re: [RFT PATCH v3 01/21] x86/sev: Separate MSR and GHCB based
 snp_cpuid() via a callback


* Ard Biesheuvel <ardb+git@...gle.com> wrote:

> +	if (cr4 & X86_CR4_OSXSAVE)
> +		/* Safe to read xcr0 */
> +		ghcb_set_xcr0(ghcb, xgetbv(XCR_XFEATURE_ENABLED_MASK));
> +	else
> +		/* xgetbv will cause #UD - use reset value for xcr0 */
> +		ghcb_set_xcr0(ghcb, 1);

Just a couple of style nits here - this new __sev_cpuid_hv_ghcb() 
function should follow the existing SEV* (and general x86) style:

 - When mentioning instruction mnemonics, please capitalize them, such 
   as XGETBV here.

 - Same goes for registers, such as XCR0.

 - Finally, if a comment line turns a branch into a multi-line 
   statement, curly braces are needed, even if it's technically still a 
   single statement per the C syntax which eliminates comments at the 
   preprocessor level.

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ