]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - kernel/cpu.c
gpio: Fix up merge collision in include file
[linux.git] / kernel / cpu.c
index 077fde6fb953feddcb67e803dbed4e2469aab0c0..e84c0873559ed3f4dff968a6240293bb22f0978b 100644 (file)
@@ -522,7 +522,7 @@ static int bringup_wait_for_ap(unsigned int cpu)
        /*
         * SMT soft disabling on X86 requires to bring the CPU out of the
         * BIOS 'wait for SIPI' state in order to set the CR4.MCE bit.  The
-        * CPU marked itself as booted_once in cpu_notify_starting() so the
+        * CPU marked itself as booted_once in notify_cpu_starting() so the
         * cpu_smt_allowed() check will now return false if this is not the
         * primary sibling.
         */
@@ -1221,6 +1221,13 @@ int freeze_secondary_cpus(int primary)
        for_each_online_cpu(cpu) {
                if (cpu == primary)
                        continue;
+
+               if (pm_wakeup_pending()) {
+                       pr_info("Wakeup pending. Abort CPU freeze\n");
+                       error = -EBUSY;
+                       break;
+               }
+
                trace_suspend_resume(TPS("CPU_OFF"), cpu, true);
                error = _cpu_down(cpu, 1, CPUHP_OFFLINE);
                trace_suspend_resume(TPS("CPU_OFF"), cpu, false);
@@ -1964,6 +1971,9 @@ static ssize_t write_cpuhp_fail(struct device *dev,
        if (ret)
                return ret;
 
+       if (fail < CPUHP_OFFLINE || fail > CPUHP_ONLINE)
+               return -EINVAL;
+
        /*
         * Cannot fail STARTING/DYING callbacks.
         */
@@ -2339,6 +2349,9 @@ static int __init mitigations_parse_cmdline(char *arg)
                cpu_mitigations = CPU_MITIGATIONS_AUTO;
        else if (!strcmp(arg, "auto,nosmt"))
                cpu_mitigations = CPU_MITIGATIONS_AUTO_NOSMT;
+       else
+               pr_crit("Unsupported mitigations=%s, system may still be vulnerable\n",
+                       arg);
 
        return 0;
 }