From owner-freebsd-current@freebsd.org Mon May 15 09:56:54 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 CC87FD6DAA1 for ; Mon, 15 May 2017 09:56:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4489D1E05; Mon, 15 May 2017 09:56:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v4F9um84074543 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 May 2017 12:56:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v4F9um84074543 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v4F9ulDC074542; Mon, 15 May 2017 12:56:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 May 2017 12:56:47 +0300 From: Konstantin Belousov To: Poul-Henning Kamp Cc: Edward Tomasz Napiera??a , Manuel St?hn , freebsd-current@freebsd.org Subject: Re: regression suspend/resume on Lenovo T420 Message-ID: <20170515095647.GA1622@kib.kiev.ua> References: <5746a37cd73e062c963512df1a6d24c6@email.freenet.de> <20170506090341.GA12163@freebsd-t420.fritz.box> <20170514193006.GA1298@brick> <1190.1494792172@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1190.1494792172@critter.freebsd.dk> User-Agent: Mutt/1.8.2 (2017-04-18) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home 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 09:56:54 -0000 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