Skip to content

Commit dc62830

Browse files
bysuiIngo Molnar
authored and
Ingo Molnar
committed
x86/head/64: Mark 'startup_gdt[]' and 'startup_gdt_descr' as __initdata
As 'startup_gdt[]' and 'startup_gdt_descr' are only used in booting, mark them as __initdata to allow them to be freed after boot. Signed-off-by: Hou Wenlong <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/c85903a7cfad37d14a7e5a4df9fc7119a3669fb3.1689130310.git.houwenlong.hwl@antgroup.com
1 parent 9f76d60 commit dc62830

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/kernel/head64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ EXPORT_SYMBOL(vmemmap_base);
6969
/*
7070
* GDT used on the boot CPU before switching to virtual addresses.
7171
*/
72-
static struct desc_struct startup_gdt[GDT_ENTRIES] = {
72+
static struct desc_struct startup_gdt[GDT_ENTRIES] __initdata = {
7373
[GDT_ENTRY_KERNEL32_CS] = GDT_ENTRY_INIT(0xc09b, 0, 0xfffff),
7474
[GDT_ENTRY_KERNEL_CS] = GDT_ENTRY_INIT(0xa09b, 0, 0xfffff),
7575
[GDT_ENTRY_KERNEL_DS] = GDT_ENTRY_INIT(0xc093, 0, 0xfffff),
@@ -79,7 +79,7 @@ static struct desc_struct startup_gdt[GDT_ENTRIES] = {
7979
* Address needs to be set at runtime because it references the startup_gdt
8080
* while the kernel still uses a direct mapping.
8181
*/
82-
static struct desc_ptr startup_gdt_descr = {
82+
static struct desc_ptr startup_gdt_descr __initdata = {
8383
.size = sizeof(startup_gdt)-1,
8484
.address = 0,
8585
};

0 commit comments

Comments
 (0)