Commit c04c82ff authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Stefan Bader

x86/cpu/AMD: Evaluate smp_num_siblings early

To support force disabling of SMT it's required to know the number of
thread siblings early. amd_get_topology() cannot be called before the APIC
driver is selected, so split out the part which initializes
smp_num_siblings and invoke it from amd_early_init().
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Acked-by: default avatarIngo Molnar <mingo@kernel.org>

CVE-2018-3620
CVE-2018-3646
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
parent 1cdba5ac
...@@ -291,6 +291,18 @@ static int nearby_node(int apicid) ...@@ -291,6 +291,18 @@ static int nearby_node(int apicid)
} }
#endif #endif
static void amd_get_topology_early(struct cpuinfo_x86 *c)
{
#ifdef CONFIG_SMP
if (boot_cpu_has(X86_FEATURE_TOPOEXT)) {
u32 eax, ebx, ecx, edx;
cpuid(0x8000001e, &eax, &ebx, &ecx, &edx);
smp_num_siblings = ((ebx >> 8) & 0xff) + 1;
}
#endif
}
/* /*
* Fixup core topology information for * Fixup core topology information for
* (1) AMD multi-node processors * (1) AMD multi-node processors
...@@ -594,6 +606,8 @@ static void early_init_amd(struct cpuinfo_x86 *c) ...@@ -594,6 +606,8 @@ static void early_init_amd(struct cpuinfo_x86 *c)
/* F16h erratum 793, CVE-2013-6885 */ /* F16h erratum 793, CVE-2013-6885 */
if (c->x86 == 0x16 && c->x86_model <= 0xf) if (c->x86 == 0x16 && c->x86_model <= 0xf)
msr_set_bit(MSR_AMD64_LS_CFG, 15); msr_set_bit(MSR_AMD64_LS_CFG, 15);
amd_get_topology_early(c);
} }
static const int amd_erratum_383[]; static const int amd_erratum_383[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment