public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: "Cédric Godin" <cedric@belbone.be>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	x86@kernel.org, Linux Kernel <linux-kernel@vger.kernel.org>,
	linux-pm@vger.kernel.org
Subject: Re: [Bisected] 3.7-rc1 can't resume
Date: Thu, 18 Oct 2012 07:17:48 -0700	[thread overview]
Message-ID: <50800F8C.10600@zytor.com> (raw)
In-Reply-To: <507FF583.1070407@belbone.be>

[-- Attachment #1: Type: text/plain, Size: 401 bytes --]

On 10/18/2012 05:26 AM, Cédric Godin wrote:
> Hello,
>
> After upgrading my kernel from 3.6 to 3.7-rc1 on my laptop, I can't resume anymore.
> I bisected the problem to
>

There is a fix for this already queued up.  Please try the attached 
patch to verify that it fixes your problem.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


[-- Attachment #2: 0001-x86-suspend-Correct-the-restore-of-CR4-EFER-skip-com.patch --]
[-- Type: text/x-patch, Size: 1817 bytes --]

>From 1396adc3c2bdc556d4cdd1cf107aa0b6d59fbb1e Mon Sep 17 00:00:00 2001
From: "H. Peter Anvin" <hpa@linux.intel.com>
Date: Mon, 1 Oct 2012 14:34:42 -0700
Subject: [PATCH] x86, suspend: Correct the restore of CR4, EFER; skip
 computing EFLAGS.ID

The patch:

    73201dbe x86, suspend: On wakeup always initialize cr4 and EFER

... was incorrectly committed in an intermediate (unfinished) form.

- We need to test CF, not ZF, for a bit test with btl.
- We don't actually need to compute the existence of EFLAGS.ID,
  since we set a flag at suspend time if CR4 should be restored.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Link: http://lkml.kernel.org/r/1348529239-17943-1-git-send-email-hpa@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/realmode/rm/wakeup_asm.S | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/arch/x86/realmode/rm/wakeup_asm.S b/arch/x86/realmode/rm/wakeup_asm.S
index e56479e..9e7e147 100644
--- a/arch/x86/realmode/rm/wakeup_asm.S
+++ b/arch/x86/realmode/rm/wakeup_asm.S
@@ -74,18 +74,9 @@ ENTRY(wakeup_start)
 
 	lidtl	wakeup_idt
 
-	/* Clear the EFLAGS but remember if we have EFLAGS.ID */
-	movl $X86_EFLAGS_ID, %ecx
-	pushl %ecx
-	popfl
-	pushfl
-	popl %edi
+	/* Clear the EFLAGS */
 	pushl $0
 	popfl
-	pushfl
-	popl %edx
-	xorl %edx, %edi
-	andl %ecx, %edi		/* %edi is zero iff CPUID & %cr4 are missing */
 
 	/* Check header signature... */
 	movl	signature, %eax
@@ -120,12 +111,12 @@ ENTRY(wakeup_start)
 	movl	%eax, %cr3
 
 	btl	$WAKEUP_BEHAVIOR_RESTORE_CR4, %edi
-	jz	1f
+	jnc	1f
 	movl	pmode_cr4, %eax
 	movl	%eax, %cr4
 1:
 	btl	$WAKEUP_BEHAVIOR_RESTORE_EFER, %edi
-	jz	1f
+	jnc	1f
 	movl	pmode_efer, %eax
 	movl	pmode_efer + 4, %edx
 	movl	$MSR_EFER, %ecx
-- 
1.7.11.7


  reply	other threads:[~2012-10-18 14:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-18 12:26 [Bisected] 3.7-rc1 can't resume Cédric Godin
2012-10-18 14:17 ` H. Peter Anvin [this message]
2012-10-19  7:10   ` Cédric Godin
  -- strict thread matches above, loose matches on Subject: below --
2013-02-17 17:48 Jonas Heinrich
2013-02-17 20:40 ` Rafael J. Wysocki
2013-02-17 20:52 ` H. Peter Anvin
2013-02-18 15:54 Jonas Heinrich
2013-02-18 16:21 ` H. Peter Anvin
2013-02-23 13:18   ` Jonas Heinrich
2013-02-23 21:54     ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50800F8C.10600@zytor.com \
    --to=hpa@zytor.com \
    --cc=cedric@belbone.be \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox