From owner-freebsd-current@freebsd.org Mon May 15 18:51:19 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A9B1D6E44F for ; Mon, 15 May 2017 18:51:19 +0000 (UTC) (envelope-from freebsdnewbie@freenet.de) Received: from mout3.freenet.de (mout3.freenet.de [IPv6:2001:748:100:40::2:5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.freenet.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30E8270 for ; Mon, 15 May 2017 18:51:19 +0000 (UTC) (envelope-from freebsdnewbie@freenet.de) Received: from [195.4.92.142] (helo=mjail2.freenet.de) by mout3.freenet.de with esmtpa (ID freebsdnewbie@freenet.de) (port 25) (Exim 4.85 #1) id 1dAL5O-0004tV-QE; Mon, 15 May 2017 20:51:14 +0200 Received: from localhost ([::1]:37382 helo=mjail2.freenet.de) by mjail2.freenet.de with esmtpa (ID freebsdnewbie@freenet.de) (Exim 4.85 #1) id 1dAL5O-0000ik-MK; Mon, 15 May 2017 20:51:14 +0200 Received: from mx17.freenet.de ([195.4.92.27]:40950) by mjail2.freenet.de with esmtpa (ID freebsdnewbie@freenet.de) (Exim 4.85 #1) id 1dAL3H-0007Hc-MC; Mon, 15 May 2017 20:49:03 +0200 Received: from p5ddd4a8e.dip0.t-ipconnect.de ([93.221.74.142]:56483 helo=[192.168.178.45]) by mx17.freenet.de with esmtpsa (ID freebsdnewbie@freenet.de) (TLSv1.2:DHE-RSA-AES128-SHA:128) (port 587) (Exim 4.85 #1) id 1dAL3H-0003dZ-Is; Mon, 15 May 2017 20:49:03 +0200 Subject: Re: regression suspend/resume on Lenovo T420 To: Konstantin Belousov Cc: freebsd-current@freebsd.org References: <5746a37cd73e062c963512df1a6d24c6@email.freenet.de> <20170506090341.GA12163@freebsd-t420.fritz.box> <20170514193006.GA1298@brick> <1190.1494792172@critter.freebsd.dk> <20170515095647.GA1622@kib.kiev.ua> From: =?UTF-8?Q?Manuel_St=c3=bchn?= Message-ID: <9ef73eef-bfb7-0980-3da6-03a28ee18a0a@freenet.de> Date: Mon, 15 May 2017 20:49:02 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <20170515095647.GA1622@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originated-At: 93.221.74.142!56483 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 May 2017 18:51:19 -0000 On Mon, 15 May 2017 12:56:47 +0300, Konstantin Belousov wrote > On Sun, May 14, 2017 at 08:02:52PM +0000, Poul-Henning Kamp wrote: >> -------- >> In message <20170514193006.GA1298@brick>, Edward Tomasz =?utf-8?Q?Napiera=C5=82 >> a?= writes: >> >>> I've tried to verify that, and sadly it wasn't it for me. The commit >>> that does break resume for me is r316767. The current -CURRENT with >>> this one commit reverted ("svn merge -c -r316767 .") suspends and resumes >>> correctly, at least in VT; I decided to take X out of the picture for >>> now. >> >> I can confirm that this also makes resume work on my T430s running: >> >> FreeBSD 12.0-CURRENT #0 r318250M amd64 > > Try this. If it works, I will write a proper patch. > > diff --git a/sys/amd64/amd64/cpu_switch.S b/sys/amd64/amd64/cpu_switch.S > index 33437ad16e6..9c0cd05ebea 100644 > --- a/sys/amd64/amd64/cpu_switch.S > +++ b/sys/amd64/amd64/cpu_switch.S > @@ -369,6 +369,11 @@ END(savectx) > * Resuming processor state from pcb. > */ > ENTRY(resumectx) > + movl $MSR_EFER,%ecx > + rdmsr > + orl $EFER_NXE,%eax > + wrmsr > + > /* Switch to KPML4phys. */ > movq KPML4phys,%rax > movq %rax,%cr3 > This patch makes resume work on my machine also (at least in VT; X is unfortunately still not working).