Commit 47a87c76 authored by hanliyang's avatar hanliyang
Browse files

x86/cpu/hygon: Clear SME feature flag when not in use

hygon inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I98NP1


CVE: NA

---------------------------

The commit 08f253ec ("x86/cpu: Clear SME feature flag when not in
use") will clear SME feature flag if the kernel is not using it on AMD
CPUs, this will help userspace to determine if SME is available and in
use from /proc/cpuinfo.

Apply this change to Hygon CPUs as well.

Signed-off-by: default avatarhanliyang <hanliyang@hygon.cn>
parent e7239590
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -285,6 +285,10 @@ static void early_detect_mem_encrypt(struct cpuinfo_x86 *c)
	if (IS_ENABLED(CONFIG_X86_32))
		goto clear_all;

	/* Clear the SME feature flag if the kernel is not using it. */
	if (!sme_me_mask)
		setup_clear_cpu_cap(X86_FEATURE_SME);

	/*
	 * If BIOS has not enabled CSV then don't advertise the CSV and CSV2
	 * feature.