Provide information whether SMT is supoorted by the CPUs. Preparatory patch
for SMT control mechanism.
Suggested-by: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@kernel.org>
Orabug:
28220674
CVE: CVE-2018-3620
(cherry picked from commit
f048c399e0f7490ab7296bc2c255d37eb14a9675)
Signed-off-by: Mihai Carabas <mihai.carabas@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Conflicts:
arch/x86/kernel/smpboot.c
Contextual
#ifdef CONFIG_SMP
bool topology_is_primary_thread(unsigned int cpu);
+bool topology_smt_supported(void);
#else
static inline bool topology_is_primary_thread(unsigned int cpu) { return true; }
+static inline bool topology_smt_supported(void) { return false; }
#endif
#ifdef ENABLE_TOPO_DEFINES
return apic_id_is_primary_thread(per_cpu(x86_cpu_to_apicid, cpu));
}
+/**
+ * topology_smt_supported - Check whether SMT is supported by the CPUs
+ */
+bool topology_smt_supported(void)
+{
+ return smp_num_siblings > 1;
+}
+
void __init smp_store_boot_cpu_info(void)
{
int id = 0; /* CPU 0 */