On Sun 2017-12-10 12:30:52, Linus Torvalds wrote:
> On Sun, Dec 10, 2017 at 10:56 AM, Pavel Machek <pa...@ucw.cz> wrote:
> >
> > Confirmed, revert fixes it. You see how it moves fix_processor_context
> > around #ifdef CONFIG_X86_32 block? And how people forget 32-bit
> > machines exist? Aha.
> 
> Yeah, people do.
> 
> Andy?

For the record... this should fix it. Tested on x60. More tests pending.

Signed-off-by: Pavel Machek <pa...@ucw.cz>


diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
index 5191de1..d59f05f 100644
--- a/arch/x86/power/cpu.c
+++ b/arch/x86/power/cpu.c
@@ -216,8 +216,8 @@ static void notrace __restore_processor_state(struct 
saved_context *ctxt)
        write_cr0(ctxt->cr0);
 
        /*
-        * now restore the descriptor tables to their proper values
-        * ltr is done i fix_processor_context().
+        * Now restore the descriptor tables to their proper values
+        * ltr is done in fix_processor_context().
         */
 #ifdef CONFIG_X86_32
        load_idt(&ctxt->idt);
@@ -235,8 +235,6 @@ static void notrace __restore_processor_state(struct 
saved_context *ctxt)
        wrmsrl(MSR_GS_BASE, ctxt->gs_base);
 #endif
 
-       fix_processor_context();
-
        /*
         * Restore segment registers.  This happens after restoring the GDT
         * and LDT, which happen in fix_processor_context().
@@ -252,8 +250,12 @@ static void notrace __restore_processor_state(struct 
saved_context *ctxt)
         */
        if (boot_cpu_has(X86_FEATURE_SEP))
                enable_sep_cpu();
+
+       fix_processor_context();
 #else
 /* CONFIG_X86_64 */
+       fix_processor_context();
+
        asm volatile ("movw %0, %%ds" :: "r" (ctxt->ds));
        asm volatile ("movw %0, %%es" :: "r" (ctxt->es));
        asm volatile ("movw %0, %%fs" :: "r" (ctxt->fs));


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Attachment: signature.asc
Description: Digital signature

Reply via email to