From owner-freebsd-current@freebsd.org Mon May 15 17:38:03 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 5D4EED6D899 for ; Mon, 15 May 2017 17:38:03 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E12627ED for ; Mon, 15 May 2017 17:38:02 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x241.google.com with SMTP id d127so30195051wmf.1 for ; Mon, 15 May 2017 10:38:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=WJm7VG+CDzSYuW0asmnlgroTsiF3NjxIVLw5NBds2Wk=; b=bmBUogZ51YIzgnXrsBJKoXU2akWSVlpyy71Qw0bGbQbDr74t8fDtdeIExabnt+MZ8l ugu3ZSU6+P38NO8PGb0zprccPXifUCzyvo/KSyge0WbgTZf7Pf+4Cn2OVCqsz8B5m71R qtbrcux3aRQsOnDAuo9zziWSs/pyy5oIwn13NvumMYYwKWJQsj/3aU1Mx/YMwx5/dM/k Sswsg33di86cppaQfLyDiaHWOXCqax7/vHN4jJir1rZstI+KaV8z2rsOx5P5ftNfwr7/ hCosd172c/gkiunLSOgcU5uGGy8y6IIonNHI5Pg/ZBGagWbghu+x8BbIlthN5UaujRDn R/xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=WJm7VG+CDzSYuW0asmnlgroTsiF3NjxIVLw5NBds2Wk=; b=b+faPgMDwcBy9mRPONWF+7Rt3rU6SgozzkLhH5XOwrJ3rlqYnk6JV2W8ba54ZA8+eR D7xisW9W8rJZeeAkP9vXUCyHHuvkEz8l09RYRguuirXowJ+58vcIh5+ZgCZKJ7piB0BX hK+6bFWP84jBxTQDkX5CyWMKca0gtmqL4raG5tsJxe2OQ4Mlucm/0J/A3kDLfSQi20v2 ukCc0IhT/FivJvwDMHyAxFpvRD+zwwcaqzVJxexNvE8X0QZrZ1Anma0vTA06Ij9ZliCw ucszhTTmNwoU4jPjOOn+7uGL3zgnSgfowcxgj7Yek5JzFoxFQKuaIymeEK77PYHz6U9V 7DhA== X-Gm-Message-State: AODbwcDZiU88lzXFw6x4UYTMaTBQWv1mmN1OvyGdKNJSLjrrex1JUoof YUGieS+9cuarHQ== X-Received: by 10.28.127.193 with SMTP id a184mr5201395wmd.110.1494869881206; Mon, 15 May 2017 10:38:01 -0700 (PDT) Received: from brick (cpc92310-cmbg19-2-0-cust934.5-4.cable.virginm.net. [82.9.227.167]) by smtp.gmail.com with ESMTPSA id x133sm6869253wme.0.2017.05.15.10.38.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 May 2017 10:38:00 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Mon, 15 May 2017 18:37:58 +0100 From: Edward Tomasz Napiera??a To: Konstantin Belousov Cc: Poul-Henning Kamp , Manuel St?hn , freebsd-current@freebsd.org Subject: Re: regression suspend/resume on Lenovo T420 Message-ID: <20170515173758.GA1730@brick> Mail-Followup-To: Konstantin Belousov , Poul-Henning Kamp , Manuel St?hn , 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170515095647.GA1622@kib.kiev.ua> User-Agent: Mutt/1.8.2 (2017-04-18) 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:38:03 -0000 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.