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: <Z8g4sU_dsZgY0PuS@gmail.com>
Date: Wed, 5 Mar 2025 12:42:41 +0100
From: Ingo Molnar <mingo@...nel.org>
To: Borislav Petkov <bp@...en8.de>
Cc: Joerg Roedel <joro@...tes.org>, x86@...nel.org, hpa@...or.com,
	Tom Lendacky <thomas.lendacky@....com>,
	Nikunj A Dadhania <nikunj@....com>, linux-kernel@...r.kernel.org,
	Larry.Dewey@....com, Joerg Roedel <jroedel@...e.de>
Subject: Re: [PATCH] x86/sev: Make SEV_STATUS available via SYSFS


* Borislav Petkov <bp@...en8.de> wrote:

> On Wed, Mar 05, 2025 at 12:26:13PM +0100, Ingo Molnar wrote:
> > It's *far* better to expose this via a targeted sysfs entry than 
> > polluting /proc/cpuinfo with it that everyone and their dog is parsing 
> > all the time ...
> 
> Pasting what we're talking on IRC:
> 
> - we don't want to expose a naked MSR u64 to userspace.

As long as it's architected values that won't change randomly, I don't 
see the harm, and we expose raw feature bits all the time in sysfs.

User-space tooling would just unnecessarily parse and decode it anyway.

So if the convenience of tooling is the argument, the raw feature mask 
exposed is the best option overall.

> Might as well use msr-tools
> 
> - the backstory is, there are a bunch of tools which wanna know this so we
>   need to agree on how to supply it to them
> 
> - I think /proc/cpuinfo is the best option right now

So I disagree with that placement: /proc/cpuinfo is fundamentally 
per-CPU, while sev_status is a machine-wide word in .data. Also, 
something that is needed infrequently should not be put into the 
frequently used /proc/cpuinfo file.

> - and then TDX can use the same thing too
> 
> - we have a general need to expose what a confidential guest supports
> 
> - a .../sev sysfs file clearly doesn't cut it because TDX doesn't have "sev"
>   - it is the Intel version of a confidential guest
> 
> - and I don't want to have "0xdeadbeef" in some sys file but "SEV SEV-ES TDX
>   SecureTSC" and so on user-readable strings

So the /sys/devices/system/cpu/sev/ directory already exists and your 
arguments already apply to that, don't they?

As to the hex numbers - do you prefer to put string versions of these 
into the sysfs file:

 MSR_AMD64_SEV_ENABLED
 MSR_AMD64_SEV_ES_ENABLED
 MSR_AMD64_SEV_SNP_ENABLED
 MSR_AMD64_SNP_DEBUG_SWAP
 MSR_AMD64_SNP_SECURE_TSC
 MSR_AMD64_SNP_VTOM

?

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ