Re: regression suspend/resume on Lenovo T420

From: Manuel Stühn <freebsdnewbie_at_freenet.de>
Date: Mon, 15 May 2017 20:49:02 +0200
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_at_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
> _at__at_ -369,6 +369,11 _at__at_ 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).
Received on Mon May 15 2017 - 16:51:19 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:11 UTC