From patchwork Sun Jun 14 08:57:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 6604191 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 05E3AC0020 for ; Sun, 14 Jun 2015 08:58:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 39653206F9 for ; Sun, 14 Jun 2015 08:58:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 471C7206F8 for ; Sun, 14 Jun 2015 08:58:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751955AbbFNI6H (ORCPT ); Sun, 14 Jun 2015 04:58:07 -0400 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 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 5D27681FCB; Sun, 14 Jun 2015 10:57:36 +0200 (CEST) Date: Sun, 14 Jun 2015 10:57:35 +0200 From: Pavel Machek 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 Subject: Re: [PATCH v2] x86: Load __USER_DS into DS/ES after resume 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-Disposition: inline In-Reply-To: <20150614074922.GA30290@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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