[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1579075500-7065-1-git-send-email-TonyWWang-oc@zhaoxin.com>
Date: Wed, 15 Jan 2020 16:05:00 +0800
From: Tony W Wang-oc <TonyWWang-oc@...oxin.com>
To: <tglx@...utronix.de>, <mingo@...hat.com>, <bp@...en8.de>,
<hpa@...or.com>, <x86@...nel.org>, <linux-kernel@...r.kernel.org>
CC: <DavidWang@...oxin.com>, <CooperYan@...oxin.com>,
<QiyuanWang@...oxin.com>, <HerryYang@...oxin.com>
Subject: [PATCH] x86/cpu: clear X86_BUG_SPECTRE_V2 on Zhaoxin family 7 CPUs
These CPUs are not affected by spectre_v2, so clear spectre_v2 bug flag
in their specific initialization code.
Signed-off-by: Tony W Wang-oc <TonyWWang-oc@...oxin.com>
---
arch/x86/kernel/cpu/centaur.c | 5 +++++
arch/x86/kernel/cpu/zhaoxin.c | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/arch/x86/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c
index b98529e..3567560 100644
--- a/arch/x86/kernel/cpu/centaur.c
+++ b/arch/x86/kernel/cpu/centaur.c
@@ -250,6 +250,11 @@ static void init_centaur(struct cpuinfo_x86 *c)
if (cpu_has(c, X86_FEATURE_VMX))
centaur_detect_vmx_virtcap(c);
+
+ if (c->x86 == 7) {
+ setup_clear_cpu_cap(X86_BUG_SPECTRE_V2);
+ clear_bit(X86_BUG_SPECTRE_V2, (unsigned long *)cpu_caps_set);
+ }
}
#ifdef CONFIG_X86_32
diff --git a/arch/x86/kernel/cpu/zhaoxin.c b/arch/x86/kernel/cpu/zhaoxin.c
index 452fd0a..ea7c52f 100644
--- a/arch/x86/kernel/cpu/zhaoxin.c
+++ b/arch/x86/kernel/cpu/zhaoxin.c
@@ -141,6 +141,11 @@ static void init_zhaoxin(struct cpuinfo_x86 *c)
if (cpu_has(c, X86_FEATURE_VMX))
zhaoxin_detect_vmx_virtcap(c);
+
+ if (c->x86 == 7) {
+ setup_clear_cpu_cap(X86_BUG_SPECTRE_V2);
+ clear_bit(X86_BUG_SPECTRE_V2, (unsigned long *)cpu_caps_set);
+ }
}
#ifdef CONFIG_X86_32
--
2.7.4
Powered by blists - more mailing lists