]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/6.6.26/x86-head-64-move-the-__head-definition-to-asm-init.h.patch
Linux 6.1.85
[thirdparty/kernel/stable-queue.git] / releases / 6.6.26 / x86-head-64-move-the-__head-definition-to-asm-init.h.patch
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>
5
6 From: Hou Wenlong <houwenlong.hwl@antgroup.com>
7
8 commit d2a285d65bfde3218fd0c3b88794d0135ced680b upstream.
9
10 Move the __head section definition to a header to widen its use.
11
12 An upcoming patch will mark the code as __head in mem_encrypt_identity.c too.
13
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>
19 ---
20 arch/x86/include/asm/init.h | 2 ++
21 arch/x86/kernel/head64.c | 3 +--
22 2 files changed, 3 insertions(+), 2 deletions(-)
23
24 --- a/arch/x86/include/asm/init.h
25 +++ b/arch/x86/include/asm/init.h
26 @@ -2,6 +2,8 @@
27 #ifndef _ASM_X86_INIT_H
28 #define _ASM_X86_INIT_H
29
30 +#define __head __section(".head.text")
31 +
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
37 @@ -41,6 +41,7 @@
38 #include <asm/trapnr.h>
39 #include <asm/sev.h>
40 #include <asm/tdx.h>
41 +#include <asm/init.h>
42
43 /*
44 * Manage page tables very early on.
45 @@ -84,8 +85,6 @@ static struct desc_ptr startup_gdt_descr
46 .address = 0,
47 };
48
49 -#define __head __section(".head.text")
50 -
51 static void __head *fixup_pointer(void *ptr, unsigned long physaddr)
52 {
53 return ptr - (void *)_text + (void *)physaddr;