Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 May 2017 18:37:58 +0100
From:      Edward Tomasz Napiera??a <trasz@FreeBSD.org>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Poul-Henning Kamp <phk@phk.freebsd.dk>, Manuel St?hn <freebsdnewbie@freenet.de>, freebsd-current@freebsd.org
Subject:   Re: regression suspend/resume on Lenovo T420
Message-ID:  <20170515173758.GA1730@brick>
In-Reply-To: <20170515095647.GA1622@kib.kiev.ua>
References:  <5746a37cd73e062c963512df1a6d24c6@email.freenet.de> <e1405329-412a-2c12-c599-dfe6a8870aaf@freenet.de> <20170506090341.GA12163@freebsd-t420.fritz.box> <20170514193006.GA1298@brick> <1190.1494792172@critter.freebsd.dk> <20170515095647.GA1622@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On 0515T1256, 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

Thanks!  The patch fixes resume for me, for both vt(4) and X11.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170515173758.GA1730>