]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
retpoline: display IBPB feature status along with IBRS status
authorChuck Anderson <chuck.anderson@oracle.com>
Mon, 26 Feb 2018 09:27:37 +0000 (01:27 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Sat, 3 Mar 2018 01:58:41 +0000 (17:58 -0800)
retpoline_enabled() lists if the IBRS mitigation is in use and if the
kernel was compiled with retpoline.  Add whether IBPB is in use to the
list.

Orabug: 27625404
Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
arch/x86/kernel/cpu/bugs_64.c
arch/x86/kernel/cpu/scattered.c

index 21cad468d13e7bdf98fcb38a0371a925ed0ac941..30279fe2976f206403b34d1fc41860c6e12b8cbb 100644 (file)
@@ -431,8 +431,9 @@ retpoline_auto:
                mode = retp_compiler() ? SPECTRE_V2_RETPOLINE_GENERIC :
                                         SPECTRE_V2_RETPOLINE_MINIMAL;
 
-               pr_info("Options: %s%s\n",
+               pr_info("Options: %s%s%s\n",
                        check_ibrs_inuse() ? "IBRS " : "",
+                       check_ibpb_inuse() ? "IBPB " : "",
                        retp_compiler() ? "retpoline" : "");
 
                /* IBRS available. Lets see if we are compiled with retpoline. */
index 67a1ea0173d038781ac0f486b96508a443f1e0be..5d0cd6bcc459415e323f735b3fed2f43b303b4d4 100644 (file)
@@ -161,16 +161,19 @@ void init_scattered_cpuid_features(struct cpuinfo_x86 *c,
                        ignore = true;
 
                if (boot_cpu_has(X86_FEATURE_IBRS)) {
-                       printk(KERN_INFO "FEATURE SPEC_CTRL Present%s\n", ignore ? " but ignored (Xen)": "");
-                       if (ignore)
-                               return;
-               } else if (boot_cpu_has(X86_FEATURE_IBPB)) {
-                       printk_once(KERN_INFO "FEATURE IBPB Present%s\n", ignore ? " but ignored (Xen)": "");
-                       if (ignore)
-                               return;
+                       printk_once(KERN_INFO "FEATURE SPEC_CTRL Present%s\n",
+                                   ignore ? " but ignored (Xen)": "");
                } else {
                        printk(KERN_INFO "FEATURE SPEC_CTRL Not Present\n");
                }
+               if (boot_cpu_has(X86_FEATURE_IBPB)) {
+                       printk_once(KERN_INFO "FEATURE IBPB Present%s\n",
+                                           ignore ? " but ignored (Xen)": "");
+               } else {
+                       printk(KERN_INFO "FEATURE IBPB Not Present\n");
+               }
+               if (ignore)
+                       return;
        }
 
        if ((cpu_has(c, X86_FEATURE_IBRS) ||