Skip to contentSkip to conversation

x86_64: fix s3 fail path

PATCH In review Jiri Slaby 4 participants 6 messages Feb 9, 2009 – Feb 14, 2009

Subsystems (3)
lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

PATCH 1/1 x86_64: fix s3 fail path

As acpi_enter_sleep_state can fail, take this into account in do_suspend_lowlevel and don't return to the do_suspend_lowlevel's caller. This would break (currently) fpu status and preempt count.

Technically, this means use call' instead of jmp' and jmp' to the resume_point' after the call' (i.e. if acpi_enter_sleep_state returns=fails). resume_point' will handle the restore of fpu and preempt count gracefully.

Cc Len Brown <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Rafael J. Wysocki <[email protected]>
---
 arch/x86/kernel/acpi/wakeup_64.S |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/x86/kernel/acpi/wakeup_64.S +3 -1
index b5dee6a..96258d9 100644
@@ -73,7 +73,9 @@ ENTRY(do_suspend_lowlevel)
 	addq	$8, %rsp
 	movl	$3, %edi
 	xorl	%eax, %eax
-	jmp	acpi_enter_sleep_state
+	call	acpi_enter_sleep_state
+	/* in case something went wrong, restore the machine status and go on */
+	jmp	resume_point
 
 	.align 4
 resume_point:
Signature · 1 line
1.6.1.3
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines

As acpi_enter_sleep_state can fail, take this into account in do_suspend_lowlevel and don't return to the do_suspend_lowlevel's caller. This would break (currently) fpu status and preempt count.

Quoted 8 lines

Technically, this means use call' instead of jmp' and jmp' to the resume_point' after the call' (i.e. if acpi_enter_sleep_state returns=fails). resume_point' will handle the restore of fpu and preempt count gracefully.

Cc Len Brown <[email protected]>
Cc Pavel Machek <[email protected]>
Quoted 20 lines
Cc Rafael J. Wysocki <[email protected]>
---
 arch/x86/kernel/acpi/wakeup_64.S |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/x86/kernel/acpi/wakeup_64.S +3 -1
index b5dee6a..96258d9 100644
@@ -73,7 +73,9 @@ ENTRY(do_suspend_lowlevel)
 	addq	$8, %rsp
 	movl	$3, %edi
 	xorl	%eax, %eax
-	jmp	acpi_enter_sleep_state
+	call	acpi_enter_sleep_state
+	/* in case something went wrong, restore the machine status and go on */
+	jmp	resume_point
 
 	.align 4
 resume_point:
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#2 lore raw
In reply to Jiri Slaby
Quoted 9 lines · Jiri Slaby

As acpi_enter_sleep_state can fail, take this into account in do_suspend_lowlevel and don't return to the do_suspend_lowlevel's caller. This would break (currently) fpu status and preempt count.

Technically, this means use call' instead of jmp' and jmp' to the resume_point' after the call' (i.e. if acpi_enter_sleep_state returns=fails). resume_point' will handle the restore of fpu and preempt count gracefully.

Quoted 4 lines
Cc Len Brown <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Rafael J. Wysocki <[email protected]>

What kernel is this patch against? It doesn't apply to the mainline.

Thanks,
Rafael

Quoted 19 lines
---
 arch/x86/kernel/acpi/wakeup_64.S |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/x86/kernel/acpi/wakeup_64.S +3 -1
index b5dee6a..96258d9 100644
@@ -73,7 +73,9 @@ ENTRY(do_suspend_lowlevel)
 	addq	$8, %rsp
 	movl	$3, %edi
 	xorl	%eax, %eax
-	jmp	acpi_enter_sleep_state
+	call	acpi_enter_sleep_state
+	/* in case something went wrong, restore the machine status and go on */
+	jmp	resume_point
 
 	.align 4
 resume_point:
author
#3 lore raw

Rafael J. Wysocki napsal(a):

Quoted 10 lines · Jiri Slaby
Quoted 9 lines

As acpi_enter_sleep_state can fail, take this into account in do_suspend_lowlevel and don't return to the do_suspend_lowlevel's caller. This would break (currently) fpu status and preempt count.

Technically, this means use call' instead of jmp' and jmp' to the resume_point' after the call' (i.e. if acpi_enter_sleep_state returns=fails). resume_point' will handle the restore of fpu and preempt count gracefully.

Quoted 6 lines
Quoted 4 lines
Cc Len Brown <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Rafael J. Wysocki <[email protected]>

What kernel is this patch against? It doesn't apply to the mainline.

It is applicable even after
[PATCH v2 1/1] x86_64: acpi/wakeup_64 cleanup
from
http://lkml.org/lkml/2009/2/7/101
which is not present anywhere so far.

#4 lore raw
Quoted 16 lines · Jiri Slaby

Rafael J. Wysocki napsal(a):

Quoted 15 lines · Jiri Slaby
Quoted 13 lines

As acpi_enter_sleep_state can fail, take this into account in do_suspend_lowlevel and don't return to the do_suspend_lowlevel's caller. This would break (currently) fpu status and preempt count.

Technically, this means use call' instead of jmp' and jmp' to the resume_point' after the call' (i.e. if acpi_enter_sleep_state returns=fails). resume_point' will handle the restore of fpu and preempt count gracefully.

Cc Len Brown <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Rafael J. Wysocki <[email protected]>
Quoted 7 lines
Quoted 1 line

What kernel is this patch against? It doesn't apply to the mainline.

It is applicable even after
[PATCH v2 1/1] x86_64: acpi/wakeup_64 cleanup
from
http://lkml.org/lkml/2009/2/7/101
which is not present anywhere so far.

Thanks, I'm going to push both patches through Len, if Ingo doesn't mind.

Rafael

#5 lore raw
Quoted 19 lines · Rafael J. Wysocki
Quoted 18 lines · Jiri Slaby

Rafael J. Wysocki napsal(a):

Quoted 16 lines · Jiri Slaby
Quoted 9 lines

As acpi_enter_sleep_state can fail, take this into account in do_suspend_lowlevel and don't return to the do_suspend_lowlevel's caller. This would break (currently) fpu status and preempt count.

Technically, this means use call' instead of jmp' and jmp' to the resume_point' after the call' (i.e. if acpi_enter_sleep_state returns=fails). resume_point' will handle the restore of fpu and preempt count gracefully.

Quoted 4 lines
Cc Len Brown <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Rafael J. Wysocki <[email protected]>

What kernel is this patch against? It doesn't apply to the mainline.

Quoted 7 lines
Quoted 5 lines

It is applicable even after
[PATCH v2 1/1] x86_64: acpi/wakeup_64 cleanup
from
http://lkml.org/lkml/2009/2/7/101
which is not present anywhere so far.

Thanks, I'm going to push both patches through Len, if Ingo doesn't mind.

Fine with me.

Ingo