lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260203175821.511847-5-brgerst@gmail.com>
Date: Tue,  3 Feb 2026 12:58:21 -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 4/4] x86/acpi/suspend: Remove redundant register saves

All general purpose registers are saved in save_context.  Remove the
redundant saves to local data.

Signed-off-by: Brian Gerst <brgerst@...il.com>
---
 arch/x86/kernel/acpi/wakeup_64.S | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/arch/x86/kernel/acpi/wakeup_64.S b/arch/x86/kernel/acpi/wakeup_64.S
index b4bb1ca228b6..e8b3d01ba14a 100644
--- a/arch/x86/kernel/acpi/wakeup_64.S
+++ b/arch/x86/kernel/acpi/wakeup_64.S
@@ -25,19 +25,12 @@ SYM_FUNC_START(wakeup_long64)
 	movq	saved_magic(%rip), %rax
 	movq	$0x123456789abcdef0, %rdx
 	cmpq	%rdx, %rax
-	je	2f
+	je	.Lresume_point
 
 	/* stop here on a saved_magic mismatch */
 	movq $0xbad6d61676963, %rcx
 1:
 	jmp 1b
-2:
-	movq	saved_rbx(%rip), %rbx
-	movq	saved_rdi(%rip), %rdi
-	movq	saved_rsi(%rip), %rsi
-	movq	saved_rbp(%rip), %rbp
-
-	jmp	.Lresume_point
 SYM_FUNC_END(wakeup_long64)
 STACK_FRAME_NON_STANDARD wakeup_long64
 
@@ -67,11 +60,6 @@ SYM_FUNC_START(do_suspend_lowlevel)
 	movq	PER_CPU_VAR(current_task), %rax
 	movq	%rsp, TASK_threadsp(%rax)
 
-	movq	%rbp, saved_rbp(%rip)
-	movq	%rbx, saved_rbx(%rip)
-	movq	%rdi, saved_rdi(%rip)
-	movq	%rsi, saved_rsi(%rip)
-
 	movl	$3, %edi
 	xorl	%eax, %eax
 	call	x86_acpi_enter_sleep_state
@@ -120,9 +108,4 @@ SYM_FUNC_START(do_suspend_lowlevel)
 SYM_FUNC_END(do_suspend_lowlevel)
 
 .data
-saved_rbp:		.quad	0
-saved_rsi:		.quad	0
-saved_rdi:		.quad	0
-saved_rbx:		.quad	0
-
 SYM_DATA(saved_magic,	.quad	0)
-- 
2.52.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ