diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c index 78c61c8ecfa8..ca5d978b86a0 100644 --- a/arch/x86/power/cpu.c +++ b/arch/x86/power/cpu.c @@ -245,14 +245,17 @@ static void notrace __restore_processor_state(struct saved_context *ctxt) asm volatile ("movw %0, %%ds" :: "r" (ctxt->ds)); asm volatile ("movw %0, %%es" :: "r" (ctxt->es)); asm volatile ("movw %0, %%fs" :: "r" (ctxt->fs)); - load_gs_index(0xffff); - WARN_ON(1); - load_gs_index(ctxt->gs); asm volatile ("movw %0, %%ss" :: "r" (ctxt->ss)); wrmsrl(MSR_FS_BASE, ctxt->fs_base); wrmsrl(MSR_GS_BASE, ctxt->gs_base); wrmsrl(MSR_KERNEL_GS_BASE, ctxt->gs_kernel_base); + + /* + * load_gs_index() potentially calls normal C code (irqflag tracing), + * so it needs GSBASE restored first. + */ + load_gs_index(ctxt->gs); #endif fix_processor_context();