x86/cpu/centaur: Add Centaur family >=7 CPUs initialization support

mainline inclusion
from mainline-v5.9-rc1
commit <33b4711df4c1b3aec7c267c60fc24abccfadd40c>
category: feature

-------------------
Add Centaur family >=7 CPUs specific initialization support.

Signed-off-by: Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/1599562666-31351-3-git-send-email-TonyWWang-oc@zhaoxin.com

Signed-off-by: leoliu-oc <leoliu-oc@zhaoxin.com>
This commit is contained in:
leoliu-oc 2024-08-26 16:29:02 +08:00
parent 0e070b4bb8
commit 8beb9ef189
1 changed files with 6 additions and 2 deletions

View File

@ -71,6 +71,9 @@ static void init_c3(struct cpuinfo_x86 *c)
c->x86_cache_alignment = c->x86_clflush_size * 2; c->x86_cache_alignment = c->x86_clflush_size * 2;
set_cpu_cap(c, X86_FEATURE_REP_GOOD); set_cpu_cap(c, X86_FEATURE_REP_GOOD);
} }
if (c->x86 >= 7)
set_cpu_cap(c, X86_FEATURE_REP_GOOD);
} }
enum { enum {
@ -101,7 +104,8 @@ static void early_init_centaur(struct cpuinfo_x86 *c)
if (c->x86 == 5) if (c->x86 == 5)
set_cpu_cap(c, X86_FEATURE_CENTAUR_MCR); set_cpu_cap(c, X86_FEATURE_CENTAUR_MCR);
#endif #endif
if (c->x86 == 6 && c->x86_model >= 0xf) if ((c->x86 == 6 && c->x86_model >= 0xf) ||
(c->x86 >= 7))
set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
@ -235,7 +239,7 @@ static void init_centaur(struct cpuinfo_x86 *c)
sprintf(c->x86_model_id, "WinChip %s", name); sprintf(c->x86_model_id, "WinChip %s", name);
} }
#endif #endif
if (c->x86 == 6) if (c->x86 == 6 || c->x86 >= 7)
init_c3(c); init_c3(c);
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC); set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC);