Re: [PATCH v4] x86/cpu: clear SME feature flag when not in use

From: Tom Lendacky
Date: Wed Feb 16 2022 - 10:05:14 EST


On 2/15/22 21:44, Mario Limonciello wrote:
Currently the SME CPU feature flag is reflective of whether the CPU
supports the feature but not whether is has been activated by the
kernel.

Change this around to clear the SME feature flag if the kernel is not
using it so userspace can determine if it is available and in use
from `/proc/cpuinfo`.

As the feature flag is cleared on systems where SME isn't active use
CPUID 0x8000001f to confirm SME availability before calling
`native_wbinvd`.

Signed-off-by: Mario Limonciello <mario.limonciello@xxxxxxx>

Acked-by: Tom Lendacky <thomas.lendacky@xxxxxxx>

---