From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Machek Subject: Re: [PATCH v2] x86: Load __USER_DS into DS/ES after resume Date: Sun, 14 Jun 2015 10:57:35 +0200 Message-ID: <20150614085735.GA22174@amd> References: <20150612075013.GA8759@gmail.com> <20150612083625.GA22760@gmail.com> <20150613070359.GB26502@gmail.com> <20150614065635.GA5294@gmail.com> <20150614074922.GA30290@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:49778 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752034AbbFNI5i (ORCPT ); Sun, 14 Jun 2015 04:57:38 -0400 Content-Disposition: inline In-Reply-To: <20150614074922.GA30290@gmail.com> Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Ingo Molnar Cc: Linus Torvalds , Denys Vlasenko , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Srinivas Pandruvada , the arch/x86 maintainers , linux-pm@vger.kernel.org, "Rafael J. Wysocki" , Andy Lutomirski , Brian Gerst , Peter Anvin On Sun 2015-06-14 09:49:22, Ingo Molnar wrote: > > * 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. Do we want similar patch for 64-bit, too? Signed-off-by: Pavel Machek diff --git a/arch/x86/kernel/acpi/wakeup_64.S b/arch/x86/kernel/acpi/wakeup_64.S index ae693b5..2ac2bc7 100644 --- a/arch/x86/kernel/acpi/wakeup_64.S +++ b/arch/x86/kernel/acpi/wakeup_64.S @@ -18,10 +18,12 @@ ENTRY(wakeup_long64) cmpq %rdx, %rax jne bogus_64_magic - movw $__KERNEL_DS, %ax - movw %ax, %ss + movw $__USER_DS, %ax movw %ax, %ds movw %ax, %es + + movw $__KERNEL_DS, %ax + movw %ax, %ss movw %ax, %fs movw %ax, %gs movq saved_rsp, %rsp -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html