public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] x86: Fix build regression with CONFIG_KEXEC_JUMP enabled
Date: Mon,  9 Dec 2024 08:53:32 +0900	[thread overview]
Message-ID: <20241208235332.479460-1-dlemoal@kernel.org> (raw)

Build 6.13-rc12 for x86_64 with gcc 14.2.1 fails with the error:

ld: vmlinux.o: in function `virtual_mapped':
linux/arch/x86/kernel/relocate_kernel_64.S:249:(.text+0x5915b): undefined reference to `saved_context_gdt_desc'

when CONFIG_KEXEC_JUMP is enabled. This regression was introduced by
commit 07fa619f2a40 ("x86/kexec: Restore GDT on return from
::preserve_context kexec") which introduced a use of
saved_context_gdt_desc without a declaration for it. Fix that by
including asm/asm-offsets.h where saved_context_gdt_desc is defined
(indirectly in include/generated/asm-offsets.h which asm/asm-offsets.h
includes).

Fixes: 07fa619f2a40 ("x86/kexec: Restore GDT on return from ::preserve_context kexec")
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
---
 arch/x86/kernel/relocate_kernel_64.S | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/relocate_kernel_64.S b/arch/x86/kernel/relocate_kernel_64.S
index 1236f25fc8d1..540443d699e3 100644
--- a/arch/x86/kernel/relocate_kernel_64.S
+++ b/arch/x86/kernel/relocate_kernel_64.S
@@ -13,6 +13,7 @@
 #include <asm/pgtable_types.h>
 #include <asm/nospec-branch.h>
 #include <asm/unwind_hints.h>
+#include <asm/asm-offsets.h>
 
 /*
  * Must be relocatable PIC code callable as a C function, in particular
-- 
2.47.1


             reply	other threads:[~2024-12-08 23:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-08 23:53 Damien Le Moal [this message]
2024-12-09 10:29 ` [PATCH] x86: Fix build regression with CONFIG_KEXEC_JUMP enabled Borislav Petkov
2024-12-09 10:34   ` Damien Le Moal
2024-12-09 13:54     ` Borislav Petkov
2024-12-09 15:59   ` [EXTERNAL] " David Woodhouse
2024-12-09 16:22     ` Borislav Petkov
2024-12-09 17:07       ` David Woodhouse
2024-12-09 17:18         ` Borislav Petkov
2024-12-09 21:52           ` David Woodhouse
2024-12-09 22:22             ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241208235332.479460-1-dlemoal@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=dwmw@amazon.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox