Merge tag 'x86-fsgsbase-2020-08-04' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / arch / x86 / kernel / cpu / bugs.c
index 7beaefa..f0b743a 100644 (file)
@@ -543,14 +543,12 @@ static void __init spectre_v1_select_mitigation(void)
                 * If FSGSBASE is enabled, the user can put a kernel address in
                 * GS, in which case SMAP provides no protection.
                 *
-                * [ NOTE: Don't check for X86_FEATURE_FSGSBASE until the
-                *         FSGSBASE enablement patches have been merged. ]
-                *
                 * If FSGSBASE is disabled, the user can only put a user space
                 * address in GS.  That makes an attack harder, but still
                 * possible if there's no SMAP protection.
                 */
-               if (!smap_works_speculatively()) {
+               if (boot_cpu_has(X86_FEATURE_FSGSBASE) ||
+                   !smap_works_speculatively()) {
                        /*
                         * Mitigation can be provided from SWAPGS itself or
                         * PTI as the CR3 write in the Meltdown mitigation