From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752582AbdLJV3x (ORCPT ); Sun, 10 Dec 2017 16:29:53 -0500 Received: from mail-it0-f68.google.com ([209.85.214.68]:36969 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752189AbdLJV2w (ORCPT ); Sun, 10 Dec 2017 16:28:52 -0500 X-Google-Smtp-Source: AGs4zMbkDYFRrmAWBBETqDE+HUyXybyUUo5RluCMS1ulxNgNkrXYAPx7MVZINFUVDXv82IM59cOdxlXMpmL2A/n304w= MIME-Version: 1.0 In-Reply-To: <20171210204350.GA25013@amd> References: <2809506.pL8kVbvXcY@aspire.rjw.lan> <1578405.51lzoSX1jh@aspire.rjw.lan> <20171209103325.GA13867@amd> <20171209220110.GA11496@amd> <20171210162305.GA10159@amd> <20171210185638.GA10363@amd> <20171210204350.GA25013@amd> From: Linus Torvalds Date: Sun, 10 Dec 2017 13:28:50 -0800 X-Google-Sender-Auth: YKCbMLZYX4JJFil5lTZdrWAbRX0 Message-ID: Subject: Re: Linux 4.15-rc2: Regression in resume from ACPI S3 To: Pavel Machek Cc: 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 On Sun, Dec 10, 2017 at 12:43 PM, Pavel Machek wrote: > > For the record... this should fix it. Tested on x60. More tests pending. This can't be right. At the very least, now the comment is wrong. And the comment does seem relevant for 32-bit too: > - fix_processor_context(); > - > /* > * Restore segment registers. This happens after restoring the GDT > * and LDT, which happen in fix_processor_context(). Notice? You've moved down the 32-bit fix_processor_context() call to after the loadsegment() calls, which smells wrong. That said, this *all* smells wrong. Why is there a special fix_processor_context() function at all with different 32-bit and 64-bit behavior? This code is all written to be maximally confusing. I think this could do with some re-org to make it more logical. That "some random things done in fix_processor_context(), other random things done directly in __restore_processor_state()" makes no sense at all to me. There's no logic to what is done where. Linus