1 From d2a285d65bfde3218fd0c3b88794d0135ced680b Mon Sep 17 00:00:00 2001
2 From: Hou Wenlong <houwenlong.hwl@antgroup.com>
3 Date: Tue, 17 Oct 2023 15:08:06 +0800
4 Subject: x86/head/64: Move the __head definition to <asm/init.h>
6 From: Hou Wenlong <houwenlong.hwl@antgroup.com>
8 commit d2a285d65bfde3218fd0c3b88794d0135ced680b upstream.
10 Move the __head section definition to a header to widen its use.
12 An upcoming patch will mark the code as __head in mem_encrypt_identity.c too.
14 Signed-off-by: Hou Wenlong <houwenlong.hwl@antgroup.com>
15 Signed-off-by: Ingo Molnar <mingo@kernel.org>
16 Link: https://lore.kernel.org/r/0583f57977be184689c373fe540cbd7d85ca2047.1697525407.git.houwenlong.hwl@antgroup.com
17 Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 arch/x86/include/asm/init.h | 2 ++
21 arch/x86/kernel/head64.c | 3 +--
22 2 files changed, 3 insertions(+), 2 deletions(-)
24 --- a/arch/x86/include/asm/init.h
25 +++ b/arch/x86/include/asm/init.h
27 #ifndef _ASM_X86_INIT_H
28 #define _ASM_X86_INIT_H
30 +#define __head __section(".head.text")
32 struct x86_mapping_info {
33 void *(*alloc_pgt_page)(void *); /* allocate buf for page table */
34 void *context; /* context for alloc_pgt_page */
35 --- a/arch/x86/kernel/head64.c
36 +++ b/arch/x86/kernel/head64.c
38 #include <asm/trapnr.h>
41 +#include <asm/init.h>
44 * Manage page tables very early on.
45 @@ -84,8 +85,6 @@ static struct desc_ptr startup_gdt_descr
49 -#define __head __section(".head.text")
51 static void __head *fixup_pointer(void *ptr, unsigned long physaddr)
53 return ptr - (void *)_text + (void *)physaddr;