|
@@ -861,31 +861,6 @@ static void detect_nopl(struct cpuinfo_x86 *c)
|
|
|
clear_cpu_cap(c, X86_FEATURE_NOPL);
|
|
|
#else
|
|
|
set_cpu_cap(c, X86_FEATURE_NOPL);
|
|
|
-#endif
|
|
|
-
|
|
|
- /*
|
|
|
- * ESPFIX is a strange bug. All real CPUs have it. Paravirt
|
|
|
- * systems that run Linux at CPL > 0 may or may not have the
|
|
|
- * issue, but, even if they have the issue, there's absolutely
|
|
|
- * nothing we can do about it because we can't use the real IRET
|
|
|
- * instruction.
|
|
|
- *
|
|
|
- * NB: For the time being, only 32-bit kernels support
|
|
|
- * X86_BUG_ESPFIX as such. 64-bit kernels directly choose
|
|
|
- * whether to apply espfix using paravirt hooks. If any
|
|
|
- * non-paravirt system ever shows up that does *not* have the
|
|
|
- * ESPFIX issue, we can change this.
|
|
|
- */
|
|
|
-#ifdef CONFIG_X86_32
|
|
|
-#ifdef CONFIG_PARAVIRT
|
|
|
- do {
|
|
|
- extern void native_iret(void);
|
|
|
- if (pv_cpu_ops.iret == native_iret)
|
|
|
- set_cpu_bug(c, X86_BUG_ESPFIX);
|
|
|
- } while (0);
|
|
|
-#else
|
|
|
- set_cpu_bug(c, X86_BUG_ESPFIX);
|
|
|
-#endif
|
|
|
#endif
|
|
|
}
|
|
|
|
|
@@ -952,6 +927,31 @@ static void generic_identify(struct cpuinfo_x86 *c)
|
|
|
detect_nopl(c);
|
|
|
|
|
|
detect_null_seg_behavior(c);
|
|
|
+
|
|
|
+ /*
|
|
|
+ * ESPFIX is a strange bug. All real CPUs have it. Paravirt
|
|
|
+ * systems that run Linux at CPL > 0 may or may not have the
|
|
|
+ * issue, but, even if they have the issue, there's absolutely
|
|
|
+ * nothing we can do about it because we can't use the real IRET
|
|
|
+ * instruction.
|
|
|
+ *
|
|
|
+ * NB: For the time being, only 32-bit kernels support
|
|
|
+ * X86_BUG_ESPFIX as such. 64-bit kernels directly choose
|
|
|
+ * whether to apply espfix using paravirt hooks. If any
|
|
|
+ * non-paravirt system ever shows up that does *not* have the
|
|
|
+ * ESPFIX issue, we can change this.
|
|
|
+ */
|
|
|
+#ifdef CONFIG_X86_32
|
|
|
+# ifdef CONFIG_PARAVIRT
|
|
|
+ do {
|
|
|
+ extern void native_iret(void);
|
|
|
+ if (pv_cpu_ops.iret == native_iret)
|
|
|
+ set_cpu_bug(c, X86_BUG_ESPFIX);
|
|
|
+ } while (0);
|
|
|
+# else
|
|
|
+ set_cpu_bug(c, X86_BUG_ESPFIX);
|
|
|
+# endif
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
static void x86_init_cache_qos(struct cpuinfo_x86 *c)
|