Re: [PATCH] Ability to read the MKTME status from userspace

From: Borislav Petkov
Date: Fri Jun 19 2020 - 09:44:38 EST


On Fri, Jun 19, 2020 at 02:31:11PM +0100, Richard Hughes wrote:
> 1. that the CPU supports TME (->cpuid, already done)
> 2. that the platform has not disabled TME in some way

Yes, this is what I'm proposing with clearing the flag in /proc/cpuinfo.
The needed information is there:

1. TME in CPUID
2. TME *not* in /proc/cpuinfo

which means the platform doesn't support it.

If we are going to export a list of features which the OS
kernel/platform has enabled - and this means a contract between kernel
and userspace - then this should not be a misc driver which gets loaded
as a module but builtin, maybe a proper sysfs layout similar to

/sys/devices/system/cpu/vulnerabilities

which userspace can use. Along with proper ABI definition, design,
documentation and all that belongs to a proper interface with userspace.
Because once userspace uses it, it is practically cast in stone.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette