[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260203175821.511847-2-brgerst@gmail.com>
Date: Tue, 3 Feb 2026 12:58:18 -0500
From: Brian Gerst <brgerst@...il.com>
To: linux-kernel@...r.kernel.org,
x86@...nel.org
Cc: Ingo Molnar <mingo@...nel.org>,
"H . Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
Borislav Petkov <bp@...en8.de>,
Ard Biesheuvel <ardb@...nel.org>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Len Brown <lenb@...nel.org>,
Pavel Machek <pavel@...nel.org>,
Brian Gerst <brgerst@...il.com>
Subject: [PATCH v2 1/4] x86/acpi/suspend: Remove indirect jump
wakeup_long64() is called from common_startup_64() via initial_code, so
it is already running on the normal virtual mapping. There is no need
to use an indirect jump since it is not switching mappings.
Signed-off-by: Brian Gerst <brgerst@...il.com>
---
arch/x86/kernel/acpi/wakeup_64.S | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/arch/x86/kernel/acpi/wakeup_64.S b/arch/x86/kernel/acpi/wakeup_64.S
index 04f561f75e99..3d56610f0108 100644
--- a/arch/x86/kernel/acpi/wakeup_64.S
+++ b/arch/x86/kernel/acpi/wakeup_64.S
@@ -41,10 +41,9 @@ SYM_FUNC_START(wakeup_long64)
movq saved_rsi(%rip), %rsi
movq saved_rbp(%rip), %rbp
- movq saved_rip(%rip), %rax
- ANNOTATE_RETPOLINE_SAFE
- jmp *%rax
+ jmp .Lresume_point
SYM_FUNC_END(wakeup_long64)
+STACK_FRAME_NON_STANDARD wakeup_long64
SYM_FUNC_START(do_suspend_lowlevel)
FRAME_BEGIN
@@ -71,8 +70,6 @@ SYM_FUNC_START(do_suspend_lowlevel)
pushfq
popq pt_regs_flags(%rax)
- movq $.Lresume_point, saved_rip(%rip)
-
movq %rsp, saved_rsp(%rip)
movq %rbp, saved_rbp(%rip)
movq %rbx, saved_rbx(%rip)
@@ -84,11 +81,8 @@ SYM_FUNC_START(do_suspend_lowlevel)
xorl %eax, %eax
call x86_acpi_enter_sleep_state
/* in case something went wrong, restore the machine status and go on */
- jmp .Lresume_point
- .align 4
.Lresume_point:
- ANNOTATE_NOENDBR
/* We don't restore %rax, it must be 0 anyway */
movq $saved_context, %rax
movq saved_context_cr4(%rax), %rbx
@@ -139,7 +133,6 @@ saved_rsi: .quad 0
saved_rdi: .quad 0
saved_rbx: .quad 0
-saved_rip: .quad 0
saved_rsp: .quad 0
SYM_DATA(saved_magic, .quad 0)
--
2.52.0
Powered by blists - more mailing lists