* Set the retpoline capability to advertise that that retpoline
* is available, however the retpoline feature is enabled via
* the retpoline_enabled_key static key.
- *
- * By default, we don't provide retpoline on Skylake. However,
- * the feature will be provided if it is selected from the boot
- * sequence.
*/
- if (!is_skylake_era())
- setup_force_cpu_cap(X86_FEATURE_RETPOLINE);
+ setup_force_cpu_cap(X86_FEATURE_RETPOLINE);
if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) {
if (!boot_cpu_has(X86_FEATURE_LFENCE_RDTSC))
}
}
- /*
- * We are enabling retpoline so advertise the retpoline feature.
- * This only needs to be done for Skylake because the feature
- * is already provided on other platforms.
- */
- if (is_skylake_era())
- setup_force_cpu_cap(X86_FEATURE_RETPOLINE);
-
retpoline_enable();
display:
if (enable > 1)
return -EINVAL;
- /*
- * The retpoline feature is always present except on Skylake
- * if the system wasn't explicitly booted with retpoline.
- */
- if (enable && !boot_cpu_has(X86_FEATURE_RETPOLINE)) {
- pr_warn("Retpoline is disabled by default on Skylake-generation system.\n");
- pr_warn("Use the 'spectre_v2=retpoline' parameter to boot with retpoline.\n");
- return -EINVAL;
- }
-
if (enable) {
if (test_taint(TAINT_NO_RETPOLINE))
pr_warn("Enabling retpoline with a module not compiled with retpoline compiler.\n");