All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] x86/asm/suspend: Get rid of bogus_64_magic
@ 2019-09-06  7:55 Jiri Slaby
  2019-09-06  7:55 ` [PATCH 2/2] x86/asm: Make some functions local labels Jiri Slaby
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Jiri Slaby @ 2019-09-06  7:55 UTC (permalink / raw)
  To: bp
  Cc: tglx, mingo, hpa, x86, linux-kernel, Jiri Slaby,
	Rafael J. Wysocki, Pavel Machek, Len Brown, linux-pm

bogus_64_magic is only a dead-end loop. There is no need for an
out-of-order function (and unannotated local label), so just handle it
in-place and also store 0xbad-m-a-g-i-c to rcx beforehand.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Len Brown <lenb@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: linux-pm@vger.kernel.org
---
 arch/x86/kernel/acpi/wakeup_64.S | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/acpi/wakeup_64.S b/arch/x86/kernel/acpi/wakeup_64.S
index b0715c3ac18d..7f9ade13bbcf 100644
--- a/arch/x86/kernel/acpi/wakeup_64.S
+++ b/arch/x86/kernel/acpi/wakeup_64.S
@@ -18,8 +18,13 @@ ENTRY(wakeup_long64)
 	movq	saved_magic, %rax
 	movq	$0x123456789abcdef0, %rdx
 	cmpq	%rdx, %rax
-	jne	bogus_64_magic
+	je	2f
 
+	/* stop here on a saved_magic mismatch */
+	movq $0xbad6d61676963, %rcx
+1:
+	jmp 1b
+2:
 	movw	$__KERNEL_DS, %ax
 	movw	%ax, %ss	
 	movw	%ax, %ds
@@ -37,9 +42,6 @@ ENTRY(wakeup_long64)
 	jmp	*%rax
 ENDPROC(wakeup_long64)
 
-bogus_64_magic:
-	jmp	bogus_64_magic
-
 ENTRY(do_suspend_lowlevel)
 	FRAME_BEGIN
 	subq	$8, %rsp
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-09-07 13:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06  7:55 [PATCH 1/2] x86/asm/suspend: Get rid of bogus_64_magic Jiri Slaby
2019-09-06  7:55 ` [PATCH 2/2] x86/asm: Make some functions local labels Jiri Slaby
2019-09-06  9:52   ` [tip: x86/asm] " tip-bot2 for Jiri Slaby
2019-09-06  9:52 ` [tip: x86/asm] x86/asm/suspend: Get rid of bogus_64_magic tip-bot2 for Jiri Slaby
2019-09-06 10:57 ` [PATCH 1/2] " Pavel Machek
2019-09-07 13:10 ` Pavel Machek

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.