From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752329AbdLJUny (ORCPT ); Sun, 10 Dec 2017 15:43:54 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:51986 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752015AbdLJUnw (ORCPT ); Sun, 10 Dec 2017 15:43:52 -0500 Date: Sun, 10 Dec 2017 21:43:50 +0100 From: Pavel Machek To: Linus Torvalds Cc: Zhang Rui , Andrew Lutomirski , Thomas Gleixner , Jarkko Nikula , "Rafael J. Wysocki" , Linux Kernel Mailing List , the arch/x86 maintainers Subject: Re: Linux 4.15-rc2: Regression in resume from ACPI S3 Message-ID: <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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dDRMvlgZJXvWKvBx" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --dDRMvlgZJXvWKvBx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun 2017-12-10 12:30:52, Linus Torvalds wrote: > On Sun, Dec 10, 2017 at 10:56 AM, Pavel Machek wrote: > > > > Confirmed, revert fixes it. You see how it moves fix_processor_context > > around #ifdef CONFIG_X86_32 block? And how people forget 32-bit > > machines exist? Aha. >=20 > Yeah, people do. >=20 > Andy? For the record... this should fix it. Tested on x60. More tests pending. Signed-off-by: Pavel Machek diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c index 5191de1..d59f05f 100644 --- a/arch/x86/power/cpu.c +++ b/arch/x86/power/cpu.c @@ -216,8 +216,8 @@ static void notrace __restore_processor_state(struct sa= ved_context *ctxt) write_cr0(ctxt->cr0); =20 /* - * now restore the descriptor tables to their proper values - * ltr is done i fix_processor_context(). + * Now restore the descriptor tables to their proper values + * ltr is done in fix_processor_context(). */ #ifdef CONFIG_X86_32 load_idt(&ctxt->idt); @@ -235,8 +235,6 @@ static void notrace __restore_processor_state(struct sa= ved_context *ctxt) wrmsrl(MSR_GS_BASE, ctxt->gs_base); #endif =20 - fix_processor_context(); - /* * Restore segment registers. This happens after restoring the GDT * and LDT, which happen in fix_processor_context(). @@ -252,8 +250,12 @@ static void notrace __restore_processor_state(struct s= aved_context *ctxt) */ if (boot_cpu_has(X86_FEATURE_SEP)) enable_sep_cpu(); + + fix_processor_context(); #else /* CONFIG_X86_64 */ + fix_processor_context(); + asm volatile ("movw %0, %%ds" :: "r" (ctxt->ds)); asm volatile ("movw %0, %%es" :: "r" (ctxt->es)); asm volatile ("movw %0, %%fs" :: "r" (ctxt->fs)); --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --dDRMvlgZJXvWKvBx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlotnIYACgkQMOfwapXb+vIlJwCggBmFFOejnKv1n3X62O13vQs6 zYcAoJGuRGfL/Sd3WV51M9JZe2fUlmdY =/YrY -----END PGP SIGNATURE----- --dDRMvlgZJXvWKvBx--