]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
x86/head/64: Move the __head definition to <asm/init.h>
authorHou Wenlong <houwenlong.hwl@antgroup.com>
Tue, 17 Oct 2023 07:08:06 +0000 (15:08 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:36:07 +0000 (16:36 +0200)
commit d2a285d65bfde3218fd0c3b88794d0135ced680b upstream.

Move the __head section definition to a header to widen its use.

An upcoming patch will mark the code as __head in mem_encrypt_identity.c too.

Signed-off-by: Hou Wenlong <houwenlong.hwl@antgroup.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/0583f57977be184689c373fe540cbd7d85ca2047.1697525407.git.houwenlong.hwl@antgroup.com
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/include/asm/init.h
arch/x86/kernel/head64.c

index 5f1d3c421f686019847efd0533c049a608e401bf..cc9ccf61b6bd114df3ee9c5fdfa3134daee0f043 100644 (file)
@@ -2,6 +2,8 @@
 #ifndef _ASM_X86_INIT_H
 #define _ASM_X86_INIT_H
 
+#define __head __section(".head.text")
+
 struct x86_mapping_info {
        void *(*alloc_pgt_page)(void *); /* allocate buf for page table */
        void *context;                   /* context for alloc_pgt_page */
index bbc21798df10ec79fa7267b80d6ee4e0a4f987a0..c58213bce294e9f4cb8eaa65704203817a35e76f 100644 (file)
@@ -41,6 +41,7 @@
 #include <asm/trapnr.h>
 #include <asm/sev.h>
 #include <asm/tdx.h>
+#include <asm/init.h>
 
 /*
  * Manage page tables very early on.
@@ -84,8 +85,6 @@ static struct desc_ptr startup_gdt_descr = {
        .address = 0,
 };
 
-#define __head __section(".head.text")
-
 static void __head *fixup_pointer(void *ptr, unsigned long physaddr)
 {
        return ptr - (void *)_text + (void *)physaddr;