Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752702AbdLKQ10 (ORCPT ); Mon, 11 Dec 2017 11:27:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:59590 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752646AbdLKQ1U (ORCPT ); Mon, 11 Dec 2017 11:27:20 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A8D3D2197C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org X-Google-Smtp-Source: ACJfBoun7mSnBzQ8saNSdcybGdaPqZiRSAUl+dRQ/sqf1fdUzok593FSa2HjgOe8NOxyVU6QhVMJfTvZYcnLIOtENW0= MIME-Version: 1.0 In-Reply-To: <20171211151314.c3ip654ww4eghfpp@gmail.com> References: <20171209103325.GA13867@amd> <20171209220110.GA11496@amd> <20171210162305.GA10159@amd> <20171210185638.GA10363@amd> <20171210213804.GA4660@amd> <76028A95-1CE1-49AA-9929-9C15FFC520EB@amacapital.net> <20171211151314.c3ip654ww4eghfpp@gmail.com> From: Andy Lutomirski Date: Mon, 11 Dec 2017 08:26:58 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] Fix resume on x86-32 machines To: Ingo Molnar Cc: Pavel Machek , Linus Torvalds , Zhang Rui , Andrew Lutomirski , Thomas Gleixner , Jarkko Nikula , "Rafael J. Wysocki" , Linux Kernel Mailing List , "the arch/x86 maintainers" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 916 Lines: 27 On Mon, Dec 11, 2017 at 7:13 AM, Ingo Molnar wrote: > > * Andy Lutomirski wrote: > >> >> >> > On Dec 10, 2017, at 1:38 PM, Pavel Machek wrote: >> > >> > >> > After 4.15-rc2, suspend stopped working on Thinkpad X60. 5b06bbc >> > (unintentionally?) reordered stuff with respect to >> > fix_processor_context() on 32-bit and 64-bit. We undo that change on >> > 32-bit. >> > >> >> Can you explain what was wrong with the reordering? Your patch certainly *looks* incorrect. >> >> I'm guessing that the real issue is that 32-bit needs %fs restored early for TLS. > > Does some early percpu primitive need GS as well perhaps? > > Might be safest to restore both FS and GS early. > fs needs to be restored early for TLS. gs needs to be restored early, maybe, if !X86_32_LAZY_GS -- it's used for stack-protector. If X86_32_LAZY_GS, gs must *not* be restored early.