[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260108092526.28586-37-ardb@kernel.org>
Date: Thu, 8 Jan 2026 09:25:43 +0000
From: Ard Biesheuvel <ardb@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: x86@...nel.org,
Ard Biesheuvel <ardb@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Kees Cook <kees@...nel.org>,
Uros Bizjak <ubizjak@...il.com>,
Brian Gerst <brgerst@...il.com>,
linux-hardening@...r.kernel.org
Subject: [RFC/RFT PATCH 16/19] x86/kexec: Use 64-bit wide absolute reference from relocated code
The virtual_mapped() kexec routine runs from a different virtual address
than it was linked at, and so it needs to use an absolute reference to
load the address of 'saved_context'. Change this reference to a 64-bit
wide one, to make the code compatible with linking in PIE mode.
Signed-off-by: Ard Biesheuvel <ardb@...nel.org>
---
arch/x86/kernel/relocate_kernel_64.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/relocate_kernel_64.S b/arch/x86/kernel/relocate_kernel_64.S
index 4ffba68dc57b..3fc1a3002e32 100644
--- a/arch/x86/kernel/relocate_kernel_64.S
+++ b/arch/x86/kernel/relocate_kernel_64.S
@@ -311,7 +311,7 @@ SYM_CODE_START_LOCAL_NOALIGN(virtual_mapped)
#ifdef CONFIG_KEXEC_JUMP
/* Saved in save_processor_state. */
- movq $saved_context, %rax
+ movabsq $saved_context, %rax
lgdt saved_context_gdt_desc(%rax)
#endif
--
2.47.3
Powered by blists - more mailing lists