All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonas Heinrich <onny@project-insanity.org>
To: "Rafael J. Wysocki" <rjw@sisk.pl>, "H. Peter Anvin" <hpa@zytor.com>
Cc: len.brown@intel.com, pavel@ucw.cz, tglx@linutronix.de,
	mingo@redhat.com, x86@kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org,
	Jarkko Sakkinen <jarkko.sakkinen@intel.com>
Subject: Re: [Bisected] 3.7-rc1 can't resume (still present in 3.9)
Date: Thu, 2 May 2013 20:32:30 +0000	[thread overview]
Message-ID: <20130502203229.GA433@onny.intranet.entropia.de> (raw)
In-Reply-To: <1682771.1PVxk2VyJS@vostro.rjw.lan>


[-- Attachment #1.1: Type: text/plain, Size: 2551 bytes --]

On 05-02 02:45, Rafael J. Wysocki wrote:
> On Wednesday, May 01, 2013 11:55:10 AM H. Peter Anvin wrote:
> > On 05/01/2013 11:51 AM, Jonas Heinrich wrote:
> > > Well, you could give me instructions on how to debug this (I'll do 
> > > everything ;)) or I could ship you the Thinkpad T43. I guess this
> > > would worth the effort since this bug is somehow critical.
> > > 
> > > Best regards, Jonas
> > 
> > I'll put together a debug patch unless I can trick Rafael into doing
> > it first...
> 
> I'm afraid that code has changed quite a bit since I looked at it last time.
> [Jarkko Sakkinen seems to have worked on it lately, CCed.]
> 
> Jonas, I wonder what happens if you drop the first hunk of the patch (it just
> uses a different register, which shouldn't matter)?  Does it still help then?

Hello Rafel, first of all, thank you for helping me out :)
You're right, the patch still solves the suspend bug, after removing the first 
hunk of the patch and applying it (see attachement:
suspendfix_first_hunk_dropped.patch).

> 
> If so, there are still a few things you can do to it, e.g:
> (1) drop the
> 
> -       btl     $WAKEUP_BEHAVIOR_RESTORE_CR4, %edi
> -       jnc     1f
> 

Still works :) (used suspendfix_1.patch)

> lines,
> (2) drop the
> 
> -       btl     $WAKEUP_BEHAVIOR_RESTORE_EFER, %edi
> -       jnc     1f
> 
> lines,

Still works :) (used suspendfix_2.patch)

> (3) drop the
> 
> +       jecxz   1f
> 

Still works :) (used suspendfix_3.patch)

> line,
> (4) drop the
> 
> +       movl    %eax, %ecx
> +       orl     %edx, %ecx
> +       jz      1f
> 

At this point, the bug reoccurs (used suspendfix_4.patch)! 
But that doesn't mean these lines are the only critical, because the more
minimal patch

@@ -119,6 +119,9 @@
        jnc     1f
        movl    pmode_efer, %eax
        movl    pmode_efer + 4, %edx
+       movl    %eax, %ecx
+       orl     %edx, %ecx
+       jz      1f
        movl    $MSR_EFER, %ecx
        wrmsr
 1:


with removing this part

-       movl    pmode_cr4, %eax
-       movl    %eax, %cr4
+       movl    pmode_cr4, %ecx
+       movl    %ecx, %cr4

also doesn't fix the issue (see suspendfix_5.patch).

> lines and see what the minimal patch needed for things to work again is.
> 

So the most minimal working patch is suspendfix_3.patch.

> Thanks,
> Rafael

Thank you and best regards,
Jonas

> 
> 
> -- 
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.

[-- Attachment #1.2: suspendfix_first_hunk_dropped.patch --]
[-- Type: text/plain, Size: 569 bytes --]

--- a/arch/x86/realmode/rm/wakeup_asm.S	2013-04-29 02:36:01.000000000 +0200
+++ b/arch/x86/realmode/rm/wakeup_asm.S	2013-05-01 11:42:07.359999895 +0200
@@ -110,15 +110,15 @@
 	movl	pmode_cr3, %eax
 	movl	%eax, %cr3
 
-	btl	$WAKEUP_BEHAVIOR_RESTORE_CR4, %edi
-	jnc	1f
-	movl	pmode_cr4, %eax
-	movl	%eax, %cr4
+	movl	pmode_cr4, %ecx
+	jecxz	1f
+	movl	%ecx, %cr4
 1:
-	btl	$WAKEUP_BEHAVIOR_RESTORE_EFER, %edi
-	jnc	1f
 	movl	pmode_efer, %eax
 	movl	pmode_efer + 4, %edx
+	movl	%eax, %ecx
+	orl	%edx, %ecx
+	jz	1f
 	movl	$MSR_EFER, %ecx
 	wrmsr
 1:

[-- Attachment #1.3: suspendfix_1.patch --]
[-- Type: text/plain, Size: 526 bytes --]

--- a/arch/x86/realmode/rm/wakeup_asm.S 2013-05-02 17:20:25.266667541 +0200
+++ b/arch/x86/realmode/rm/wakeup_asm.S	2013-05-02 17:22:51.880000874 +0200
@@ -112,13 +112,15 @@
 
 	btl	$WAKEUP_BEHAVIOR_RESTORE_CR4, %edi
 	jnc	1f
-	movl	pmode_cr4, %eax
-	movl	%eax, %cr4
+	movl	pmode_cr4, %ecx
+	jecxz	1f
+	movl	%ecx, %cr4
 1:
-	btl	$WAKEUP_BEHAVIOR_RESTORE_EFER, %edi
-	jnc	1f
 	movl	pmode_efer, %eax
 	movl	pmode_efer + 4, %edx
+	movl	%eax, %ecx
+	orl	%edx, %ecx
+	jz	1f
 	movl	$MSR_EFER, %ecx
 	wrmsr
 1:

[-- Attachment #1.4: suspendfix_2.patch --]
[-- Type: text/plain, Size: 526 bytes --]

--- a/arch/x86/realmode/rm/wakeup_asm.S	2013-05-02 17:20:25.266667541 +0200
+++ b/arch/x86/realmode/rm/wakeup_asm.S	2013-05-02 18:54:49.176667541 +0200
@@ -112,13 +112,17 @@
 
 	btl	$WAKEUP_BEHAVIOR_RESTORE_CR4, %edi
 	jnc	1f
-	movl	pmode_cr4, %eax
-	movl	%eax, %cr4
+	movl	pmode_cr4, %ecx
+	jecxz	1f
+	movl	%ecx, %cr4
 1:
 	btl	$WAKEUP_BEHAVIOR_RESTORE_EFER, %edi
 	jnc	1f
 	movl	pmode_efer, %eax
 	movl	pmode_efer + 4, %edx
+	movl	%eax, %ecx
+	orl	%edx, %ecx
+	jz	1f
 	movl	$MSR_EFER, %ecx
 	wrmsr
 1:

[-- Attachment #1.5: suspendfix_3.patch --]
[-- Type: text/plain, Size: 518 bytes --]

--- a/arch/x86/realmode/rm/wakeup_asm.S.org	2013-05-02 17:20:25.266667541 +0200
+++ b/arch/x86/realmode/rm/wakeup_asm.S	2013-05-02 19:56:58.083334207 +0200
@@ -112,13 +112,16 @@
 
 	btl	$WAKEUP_BEHAVIOR_RESTORE_CR4, %edi
 	jnc	1f
-	movl	pmode_cr4, %eax
-	movl	%eax, %cr4
+	movl	pmode_cr4, %ecx
+	movl	%ecx, %cr4
 1:
 	btl	$WAKEUP_BEHAVIOR_RESTORE_EFER, %edi
 	jnc	1f
 	movl	pmode_efer, %eax
 	movl	pmode_efer + 4, %edx
+	movl	%eax, %ecx
+	orl	%edx, %ecx
+	jz	1f
 	movl	$MSR_EFER, %ecx
 	wrmsr
 1:

[-- Attachment #1.6: suspendfix_4.patch --]
[-- Type: text/plain, Size: 374 bytes --]

--- a/arch/x86/realmode/rm/wakeup_asm.S	2013-05-02 17:20:25.266667541 +0200
+++ b/arch/x86/realmode/rm/wakeup_asm.S	2013-05-02 20:43:40.623334207 +0200
@@ -112,8 +112,8 @@
 
 	btl	$WAKEUP_BEHAVIOR_RESTORE_CR4, %edi
 	jnc	1f
-	movl	pmode_cr4, %eax
-	movl	%eax, %cr4
+	movl	pmode_cr4, %ecx
+	movl	%ecx, %cr4
 1:
 	btl	$WAKEUP_BEHAVIOR_RESTORE_EFER, %edi
 	jnc	1f

[-- Attachment #1.7: suspendfix_5.patch --]
[-- Type: text/plain, Size: 311 bytes --]

--- a/arch/x86/realmode/rm/wakeup_asm.S	2013-05-02 17:20:25.266667541 +0200
+++ b/arch/x86/realmode/rm/wakeup_asm.S	2013-05-02 21:44:57.973334207 +0200
@@ -119,6 +119,9 @@
 	jnc	1f
 	movl	pmode_efer, %eax
 	movl	pmode_efer + 4, %edx
+	movl	%eax, %ecx
+	orl	%edx, %ecx
+	jz	1f
 	movl	$MSR_EFER, %ecx
 	wrmsr
 1:

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

  reply	other threads:[~2013-05-02 20:34 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-18 15:54 [Bisected] 3.7-rc1 can't resume 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
     [not found]       ` <20130320143257.GA473@onny>
2013-05-01 17:01         ` [Bisected] 3.7-rc1 can't resume (still present in 3.9) Jonas Heinrich
2013-05-01 17:33           ` H. Peter Anvin
2013-05-01 18:51             ` Jonas Heinrich
2013-05-01 18:55               ` H. Peter Anvin
2013-05-02  0:45                 ` Rafael J. Wysocki
2013-05-02 20:32                   ` Jonas Heinrich [this message]
2013-05-02 23:29                     ` Rafael J. Wysocki
2013-05-03 11:07                       ` Jonas Heinrich
2013-05-03 11:37                         ` Rafael J. Wysocki
2013-05-28 21:36                           ` Rafael J. Wysocki
2013-05-03 12:15                         ` Jarkko Sakkinen
2013-07-08  9:50                           ` Jonas Heinrich
2013-07-08 13:05                             ` Rafael J. Wysocki
2013-07-15 21:11                               ` H. Peter Anvin
2013-07-10 20:52             ` Christian Sünkenberg
2013-07-10 23:57               ` H. Peter Anvin
2013-07-12 23:36                 ` Christian Sünkenberg
2013-07-12 23:45                   ` H. Peter Anvin
2013-07-13  3:21               ` [tip:x86/urgent] x86, suspend: Handle CPUs which fail to #GP on RDMSR tip-bot for H. Peter Anvin
2013-07-15 20:58               ` tip-bot for 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=20130502203229.GA433@onny.intranet.entropia.de \
    --to=onny@project-insanity.org \
    --cc=hpa@zytor.com \
    --cc=jarkko.sakkinen@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.