From owner-freebsd-current@freebsd.org Mon May 15 17:34:18 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 C2BBDD6D67A for ; Mon, 15 May 2017 17:34:18 +0000 (UTC) (envelope-from pete@nomadlogic.org) Received: from vps-mail.nomadlogic.org (unknown [IPv6:2607:f2f8:a098::2]) (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 AA77622D for ; Mon, 15 May 2017 17:34:18 +0000 (UTC) (envelope-from pete@nomadlogic.org) Received: from [10.44.135.177] (nat-192-187-90-116.nat.tribpub.com [192.187.90.116]) by vps-mail.nomadlogic.org (OpenSMTPD) with ESMTPSA id faea8aac TLS version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO for ; Mon, 15 May 2017 10:34:17 -0700 (PDT) Subject: Re: regression suspend/resume on Lenovo T420 To: 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> <20170515172725.GE1622@kib.kiev.ua> From: Pete Wright Message-ID: <0203e71c-657a-386e-55e1-1d1c4a0b48d9@nomadlogic.org> Date: Mon, 15 May 2017 10:34:16 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <20170515172725.GE1622@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US 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 17:34:18 -0000 On 05/15/2017 10:27, Konstantin Belousov wrote: > On Mon, May 15, 2017 at 02:37:16PM -0230, Jonathan Anderson wrote: >> On 15 May 2017, at 7:26, Konstantin Belousov wrote: >>> 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 >> Running drm-next (which has -CURRENT last merged somewhere around >> r317651), this patch fixes one of the two problems I've been >> experiencing with suspend/resume. Definite progress. :) > Could you, please, clarify. Does the resume work after this ? If not, > how did you diagnosed that 'one of two problems' is solved with the change ? I can confirm that suspending to a S3 state and resuming now works on the drm-next branch as well. this matches the previous behavior on my systems before recent updates which broke suspend/resume - so i believe this patch works from a functional POV. -pete -- Pete Wright pete@nomadlogic.org @nomadlogicLA