Re: [PATCH v2] x86/power: Fix 'nosmt' vs. hibernation triple fault during resume

From: Peter Zijlstra
Date: Wed May 29 2019 - 08:06:12 EST


On Wed, May 29, 2019 at 12:32:02PM +0200, Jiri Kosina wrote:
> arch/x86/power/cpu.c | 10 ++++++++++
> include/linux/cpu.h | 2 ++
> kernel/cpu.c | 2 +-
> 3 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
> index a7d966964c6f..513ce09e9950 100644
> --- a/arch/x86/power/cpu.c
> +++ b/arch/x86/power/cpu.c
> @@ -299,7 +299,17 @@ int hibernate_resume_nonboot_cpu_disable(void)
> * address in its instruction pointer may not be possible to resolve
> * any more at that point (the page tables used by it previously may
> * have been overwritten by hibernate image data).
> + *
> + * First, make sure that we wake up all the potentially disabled SMT
> + * threads which have been initially brought up and then put into
> + * mwait/cpuidle sleep.
> + * Those will be put to proper (not interfering with hibernation
> + * resume) sleep afterwards, and the resumed kernel will decide itself
> + * what to do with them.
> */
> + ret = cpuhp_smt_enable();
> + if (ret)
> + return ret;
> smp_ops.play_dead = resume_play_dead;
> ret = disable_nonboot_cpus();
> smp_ops.play_dead = play_dead;

Acked-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>