From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Molnar Subject: [PATCH v2] x86: Load __USER_DS into DS/ES after resume Date: Sun, 14 Jun 2015 09:49:22 +0200 Message-ID: <20150614074922.GA30290@gmail.com> References: <20150612075013.GA8759@gmail.com> <20150612083625.GA22760@gmail.com> <20150613070359.GB26502@gmail.com> <20150614065635.GA5294@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-wi0-f174.google.com ([209.85.212.174]:34127 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751417AbbFNHt1 (ORCPT ); Sun, 14 Jun 2015 03:49:27 -0400 Received: by wibut5 with SMTP id ut5so49463587wib.1 for ; Sun, 14 Jun 2015 00:49:26 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Linus Torvalds Cc: Denys Vlasenko , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Srinivas Pandruvada , the arch/x86 maintainers , linux-pm@vger.kernel.org, "Rafael J. Wysocki" , Pavel Machek , Andy Lutomirski , Brian Gerst , Peter Anvin * Linus Torvalds wrote: > On Jun 13, 2015 8:56 PM, "Ingo Molnar" wrote: > > > > Ok, so something like the patch below, right? > > > > movw $__KERNEL_DS, %ax > > movw %ax, %ss > > - movw %ax, %ds > > - movw %ax, %es > > movw %ax, %fs > > movw %ax, %gs > > > > + movw $__KERNEL_DS, %ax > > + movw %ax, %ds > > + movw %ax, %es > > .. except with less cut-and-paste bugs. > > That second KERNEL should be USER. Yeah, doh :-/ Updated patch below. Thanks, Ingo ===== arch/x86/kernel/acpi/wakeup_32.S | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/acpi/wakeup_32.S b/arch/x86/kernel/acpi/wakeup_32.S index 665c6b7d2ea9..0c26b1b44e51 100644 --- a/arch/x86/kernel/acpi/wakeup_32.S +++ b/arch/x86/kernel/acpi/wakeup_32.S @@ -12,11 +12,13 @@ ENTRY(wakeup_pmode_return) wakeup_pmode_return: movw $__KERNEL_DS, %ax movw %ax, %ss - movw %ax, %ds - movw %ax, %es movw %ax, %fs movw %ax, %gs + movw $__USER_DS, %ax + movw %ax, %ds + movw %ax, %es + # reload the gdt, as we need the full 32 bit address lidt saved_idt lldt saved_ldt