|
@@ -1015,6 +1015,24 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
|
|
setup_force_cpu_bug(X86_BUG_CPU_MELTDOWN);
|
|
setup_force_cpu_bug(X86_BUG_CPU_MELTDOWN);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/*
|
|
|
|
+ * The NOPL instruction is supposed to exist on all CPUs of family >= 6;
|
|
|
|
+ * unfortunately, that's not true in practice because of early VIA
|
|
|
|
+ * chips and (more importantly) broken virtualizers that are not easy
|
|
|
|
+ * to detect. In the latter case it doesn't even *fail* reliably, so
|
|
|
|
+ * probing for it doesn't even work. Disable it completely on 32-bit
|
|
|
|
+ * unless we can find a reliable way to detect all the broken cases.
|
|
|
|
+ * Enable it explicitly on 64-bit for non-constant inputs of cpu_has().
|
|
|
|
+ */
|
|
|
|
+static void detect_nopl(struct cpuinfo_x86 *c)
|
|
|
|
+{
|
|
|
|
+#ifdef CONFIG_X86_32
|
|
|
|
+ clear_cpu_cap(c, X86_FEATURE_NOPL);
|
|
|
|
+#else
|
|
|
|
+ set_cpu_cap(c, X86_FEATURE_NOPL);
|
|
|
|
+#endif
|
|
|
|
+}
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Do minimum CPU detection early.
|
|
* Do minimum CPU detection early.
|
|
* Fields really needed: vendor, cpuid_level, family, model, mask,
|
|
* Fields really needed: vendor, cpuid_level, family, model, mask,
|
|
@@ -1089,6 +1107,8 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
|
|
*/
|
|
*/
|
|
if (!pgtable_l5_enabled())
|
|
if (!pgtable_l5_enabled())
|
|
setup_clear_cpu_cap(X86_FEATURE_LA57);
|
|
setup_clear_cpu_cap(X86_FEATURE_LA57);
|
|
|
|
+
|
|
|
|
+ detect_nopl(c);
|
|
}
|
|
}
|
|
|
|
|
|
void __init early_cpu_init(void)
|
|
void __init early_cpu_init(void)
|
|
@@ -1124,24 +1144,6 @@ void __init early_cpu_init(void)
|
|
early_identify_cpu(&boot_cpu_data);
|
|
early_identify_cpu(&boot_cpu_data);
|
|
}
|
|
}
|
|
|
|
|
|
-/*
|
|
|
|
- * The NOPL instruction is supposed to exist on all CPUs of family >= 6;
|
|
|
|
- * unfortunately, that's not true in practice because of early VIA
|
|
|
|
- * chips and (more importantly) broken virtualizers that are not easy
|
|
|
|
- * to detect. In the latter case it doesn't even *fail* reliably, so
|
|
|
|
- * probing for it doesn't even work. Disable it completely on 32-bit
|
|
|
|
- * unless we can find a reliable way to detect all the broken cases.
|
|
|
|
- * Enable it explicitly on 64-bit for non-constant inputs of cpu_has().
|
|
|
|
- */
|
|
|
|
-static void detect_nopl(struct cpuinfo_x86 *c)
|
|
|
|
-{
|
|
|
|
-#ifdef CONFIG_X86_32
|
|
|
|
- clear_cpu_cap(c, X86_FEATURE_NOPL);
|
|
|
|
-#else
|
|
|
|
- set_cpu_cap(c, X86_FEATURE_NOPL);
|
|
|
|
-#endif
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static void detect_null_seg_behavior(struct cpuinfo_x86 *c)
|
|
static void detect_null_seg_behavior(struct cpuinfo_x86 *c)
|
|
{
|
|
{
|
|
#ifdef CONFIG_X86_64
|
|
#ifdef CONFIG_X86_64
|