Skip to content

Commit d2a285d

Browse files
bysuiIngo Molnar
authored and
Ingo Molnar
committed
x86/head/64: Move the __head definition to <asm/init.h>
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
1 parent 7f6874e commit d2a285d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

arch/x86/include/asm/init.h

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#ifndef _ASM_X86_INIT_H
33
#define _ASM_X86_INIT_H
44

5+
#define __head __section(".head.text")
6+
57
struct x86_mapping_info {
68
void *(*alloc_pgt_page)(void *); /* allocate buf for page table */
79
void *context; /* context for alloc_pgt_page */

arch/x86/kernel/head64.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <asm/trapnr.h>
4242
#include <asm/sev.h>
4343
#include <asm/tdx.h>
44+
#include <asm/init.h>
4445

4546
/*
4647
* Manage page tables very early on.
@@ -84,8 +85,6 @@ static struct desc_ptr startup_gdt_descr __initdata = {
8485
.address = 0,
8586
};
8687

87-
#define __head __section(".head.text")
88-
8988
static void __head *fixup_pointer(void *ptr, unsigned long physaddr)
9089
{
9190
return ptr - (void *)_text + (void *)physaddr;

0 commit comments

Comments
 (0)