cpu.c (ec527c318036a65a083ef68d8ba95789d2212246) cpu.c (767a67b0b35520348dc3b28dcba06454b0f9023d)
1// SPDX-License-Identifier: GPL-2.0-only
1/*
2 * Suspend support specific for i386/x86-64.
3 *
2/*
3 * Suspend support specific for i386/x86-64.
4 *
4 * Distribute under GPLv2
5 *
6 * Copyright (c) 2007 Rafael J. Wysocki <rjw@sisk.pl>
7 * Copyright (c) 2002 Pavel Machek <pavel@ucw.cz>
8 * Copyright (c) 2001 Patrick Mochel <mochel@osdl.org>
9 */
10
11#include <linux/suspend.h>
12#include <linux/export.h>
13#include <linux/smp.h>

--- 280 unchanged lines hidden (view full) ---

294 /*
295 * Ensure that MONITOR/MWAIT will not be used in the "play dead" loop
296 * during hibernate image restoration, because it is likely that the
297 * monitored address will be actually written to at that time and then
298 * the "dead" CPU will attempt to execute instructions again, but the
299 * address in its instruction pointer may not be possible to resolve
300 * any more at that point (the page tables used by it previously may
301 * have been overwritten by hibernate image data).
5 * Copyright (c) 2007 Rafael J. Wysocki <rjw@sisk.pl>
6 * Copyright (c) 2002 Pavel Machek <pavel@ucw.cz>
7 * Copyright (c) 2001 Patrick Mochel <mochel@osdl.org>
8 */
9
10#include <linux/suspend.h>
11#include <linux/export.h>
12#include <linux/smp.h>

--- 280 unchanged lines hidden (view full) ---

293 /*
294 * Ensure that MONITOR/MWAIT will not be used in the "play dead" loop
295 * during hibernate image restoration, because it is likely that the
296 * monitored address will be actually written to at that time and then
297 * the "dead" CPU will attempt to execute instructions again, but the
298 * address in its instruction pointer may not be possible to resolve
299 * any more at that point (the page tables used by it previously may
300 * have been overwritten by hibernate image data).
302 *
303 * First, make sure that we wake up all the potentially disabled SMT
304 * threads which have been initially brought up and then put into
305 * mwait/cpuidle sleep.
306 * Those will be put to proper (not interfering with hibernation
307 * resume) sleep afterwards, and the resumed kernel will decide itself
308 * what to do with them.
309 */
301 */
310 ret = cpuhp_smt_enable();
311 if (ret)
312 return ret;
313 smp_ops.play_dead = resume_play_dead;
314 ret = disable_nonboot_cpus();
315 smp_ops.play_dead = play_dead;
316 return ret;
317}
318#endif
319
320/*

--- 145 unchanged lines hidden ---
302 smp_ops.play_dead = resume_play_dead;
303 ret = disable_nonboot_cpus();
304 smp_ops.play_dead = play_dead;
305 return ret;
306}
307#endif
308
309/*

--- 145 unchanged lines hidden ---