1b2441318SGreg Kroah-Hartman/* SPDX-License-Identifier: GPL-2.0 */ 28c2c3df3SCatalin Marinas/* 38c2c3df3SCatalin Marinas * ld script to make ARM Linux kernel 48c2c3df3SCatalin Marinas * taken from the i386 version by Russell King 58c2c3df3SCatalin Marinas * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz> 68c2c3df3SCatalin Marinas */ 78c2c3df3SCatalin Marinas 8ce492a16SDavid Brazdil#include <asm/hyp_image.h> 93471ee06SDavid Brazdil#ifdef CONFIG_KVM 10e9ee186bSJames Morse#define HYPERVISOR_EXTABLE \ 11e9ee186bSJames Morse . = ALIGN(SZ_8); \ 12e9ee186bSJames Morse __start___kvm_ex_table = .; \ 13e9ee186bSJames Morse *(__kvm_ex_table) \ 14e9ee186bSJames Morse __stop___kvm_ex_table = .; 1530c95391SDavid Brazdil 162d7bf218SDavid Brazdil#define HYPERVISOR_DATA_SECTIONS \ 1716174eeaSDavid Brazdil HYP_SECTION_NAME(.rodata) : { \ 18b83042f0SQuentin Perret . = ALIGN(PAGE_SIZE); \ 1916174eeaSDavid Brazdil __hyp_rodata_start = .; \ 202d7bf218SDavid Brazdil *(HYP_SECTION_NAME(.data..ro_after_init)) \ 2116174eeaSDavid Brazdil *(HYP_SECTION_NAME(.rodata)) \ 22b83042f0SQuentin Perret . = ALIGN(PAGE_SIZE); \ 2316174eeaSDavid Brazdil __hyp_rodata_end = .; \ 242d7bf218SDavid Brazdil } 252d7bf218SDavid Brazdil 2630c95391SDavid Brazdil#define HYPERVISOR_PERCPU_SECTION \ 2730c95391SDavid Brazdil . = ALIGN(PAGE_SIZE); \ 2830c95391SDavid Brazdil HYP_SECTION_NAME(.data..percpu) : { \ 2930c95391SDavid Brazdil *(HYP_SECTION_NAME(.data..percpu)) \ 3030c95391SDavid Brazdil } 318c49b5d4SDavid Brazdil 328c49b5d4SDavid Brazdil#define HYPERVISOR_RELOC_SECTION \ 338c49b5d4SDavid Brazdil .hyp.reloc : ALIGN(4) { \ 348c49b5d4SDavid Brazdil __hyp_reloc_begin = .; \ 358c49b5d4SDavid Brazdil *(.hyp.reloc) \ 368c49b5d4SDavid Brazdil __hyp_reloc_end = .; \ 378c49b5d4SDavid Brazdil } 388c49b5d4SDavid Brazdil 39380e18adSQuentin Perret#define BSS_FIRST_SECTIONS \ 40380e18adSQuentin Perret __hyp_bss_start = .; \ 41380e18adSQuentin Perret *(HYP_SECTION_NAME(.bss)) \ 42380e18adSQuentin Perret . = ALIGN(PAGE_SIZE); \ 43380e18adSQuentin Perret __hyp_bss_end = .; 44380e18adSQuentin Perret 45380e18adSQuentin Perret/* 46380e18adSQuentin Perret * We require that __hyp_bss_start and __bss_start are aligned, and enforce it 47380e18adSQuentin Perret * with an assertion. But the BSS_SECTION macro places an empty .sbss section 48380e18adSQuentin Perret * between them, which can in some cases cause the linker to misalign them. To 49380e18adSQuentin Perret * work around the issue, force a page alignment for __bss_start. 50380e18adSQuentin Perret */ 51380e18adSQuentin Perret#define SBSS_ALIGN PAGE_SIZE 523471ee06SDavid Brazdil#else /* CONFIG_KVM */ 533471ee06SDavid Brazdil#define HYPERVISOR_EXTABLE 542d7bf218SDavid Brazdil#define HYPERVISOR_DATA_SECTIONS 5530c95391SDavid Brazdil#define HYPERVISOR_PERCPU_SECTION 568c49b5d4SDavid Brazdil#define HYPERVISOR_RELOC_SECTION 57380e18adSQuentin Perret#define SBSS_ALIGN 0 583471ee06SDavid Brazdil#endif 59e9ee186bSJames Morse 60d6e2cc56SMark Rutland#define RO_EXCEPTION_TABLE_ALIGN 4 61380e18adSQuentin Perret#define RUNTIME_DISCARD_EXIT 62380e18adSQuentin Perret 63380e18adSQuentin Perret#include <asm-generic/vmlinux.lds.h> 64380e18adSQuentin Perret#include <asm/cache.h> 65380e18adSQuentin Perret#include <asm/kernel-pgtable.h> 6619a046f0SPasha Tatashin#include <asm/kexec.h> 67380e18adSQuentin Perret#include <asm/memory.h> 68380e18adSQuentin Perret#include <asm/page.h> 69380e18adSQuentin Perret 70380e18adSQuentin Perret#include "image.h" 71380e18adSQuentin Perret 72380e18adSQuentin PerretOUTPUT_ARCH(aarch64) 73380e18adSQuentin PerretENTRY(_text) 74380e18adSQuentin Perret 75380e18adSQuentin Perretjiffies = jiffies_64; 76380e18adSQuentin Perret 772240bbb6SMarc Zyngier#define HYPERVISOR_TEXT \ 78b83042f0SQuentin Perret . = ALIGN(PAGE_SIZE); \ 795c636aa0SMasahiro Yamada __hyp_idmap_text_start = .; \ 802240bbb6SMarc Zyngier *(.hyp.idmap.text) \ 815c636aa0SMasahiro Yamada __hyp_idmap_text_end = .; \ 825c636aa0SMasahiro Yamada __hyp_text_start = .; \ 832240bbb6SMarc Zyngier *(.hyp.text) \ 84e9ee186bSJames Morse HYPERVISOR_EXTABLE \ 85b83042f0SQuentin Perret . = ALIGN(PAGE_SIZE); \ 865c636aa0SMasahiro Yamada __hyp_text_end = .; 872240bbb6SMarc Zyngier 885dfe9d7dSArd Biesheuvel#define IDMAP_TEXT \ 895dfe9d7dSArd Biesheuvel . = ALIGN(SZ_4K); \ 905c636aa0SMasahiro Yamada __idmap_text_start = .; \ 915dfe9d7dSArd Biesheuvel *(.idmap.text) \ 925c636aa0SMasahiro Yamada __idmap_text_end = .; 935dfe9d7dSArd Biesheuvel 9482869ac5SJames Morse#ifdef CONFIG_HIBERNATION 9582869ac5SJames Morse#define HIBERNATE_TEXT \ 965c636aa0SMasahiro Yamada __hibernate_exit_text_start = .; \ 9782869ac5SJames Morse *(.hibernate_exit.text) \ 985c636aa0SMasahiro Yamada __hibernate_exit_text_end = .; 9982869ac5SJames Morse#else 10082869ac5SJames Morse#define HIBERNATE_TEXT 10182869ac5SJames Morse#endif 10282869ac5SJames Morse 10319a046f0SPasha Tatashin#ifdef CONFIG_KEXEC_CORE 10419a046f0SPasha Tatashin#define KEXEC_TEXT \ 10519a046f0SPasha Tatashin __relocate_new_kernel_start = .; \ 10619a046f0SPasha Tatashin *(.kexec_relocate.text) \ 10719a046f0SPasha Tatashin __relocate_new_kernel_end = .; 10819a046f0SPasha Tatashin#else 10919a046f0SPasha Tatashin#define KEXEC_TEXT 11019a046f0SPasha Tatashin#endif 11119a046f0SPasha Tatashin 112c7b9adafSWill Deacon#ifdef CONFIG_UNMAP_KERNEL_AT_EL0 113c7b9adafSWill Deacon#define TRAMP_TEXT \ 114c7b9adafSWill Deacon . = ALIGN(PAGE_SIZE); \ 1155c636aa0SMasahiro Yamada __entry_tramp_text_start = .; \ 116c7b9adafSWill Deacon *(.entry.tramp.text) \ 117c7b9adafSWill Deacon . = ALIGN(PAGE_SIZE); \ 1185c636aa0SMasahiro Yamada __entry_tramp_text_end = .; 119c7b9adafSWill Deacon#else 120c7b9adafSWill Deacon#define TRAMP_TEXT 121c7b9adafSWill Deacon#endif 122c7b9adafSWill Deacon 123a352ea3eSArd Biesheuvel/* 124a352ea3eSArd Biesheuvel * The size of the PE/COFF section that covers the kernel image, which 125348a625dSArd Biesheuvel * runs from _stext to _edata, must be a round multiple of the PE/COFF 126348a625dSArd Biesheuvel * FileAlignment, which we set to its minimum value of 0x200. '_stext' 127a352ea3eSArd Biesheuvel * itself is 4 KB aligned, so padding out _edata to a 0x200 aligned 128a352ea3eSArd Biesheuvel * boundary should be sufficient. 129a352ea3eSArd Biesheuvel */ 130a352ea3eSArd BiesheuvelPECOFF_FILE_ALIGNMENT = 0x200; 131a352ea3eSArd Biesheuvel 132a352ea3eSArd Biesheuvel#ifdef CONFIG_EFI 133a352ea3eSArd Biesheuvel#define PECOFF_EDATA_PADDING \ 134a352ea3eSArd Biesheuvel .pecoff_edata_padding : { BYTE(0); . = ALIGN(PECOFF_FILE_ALIGNMENT); } 135a352ea3eSArd Biesheuvel#else 136a352ea3eSArd Biesheuvel#define PECOFF_EDATA_PADDING 137a352ea3eSArd Biesheuvel#endif 138a352ea3eSArd Biesheuvel 1398c2c3df3SCatalin MarinasSECTIONS 1408c2c3df3SCatalin Marinas{ 1418c2c3df3SCatalin Marinas /* 1428c2c3df3SCatalin Marinas * XXX: The linker does not define how output sections are 1438c2c3df3SCatalin Marinas * assigned to input sections when there are multiple statements 1448c2c3df3SCatalin Marinas * matching the same input section name. There is no documented 1458c2c3df3SCatalin Marinas * order of matching. 1468c2c3df3SCatalin Marinas */ 1472883352bSKees Cook DISCARDS 1488c2c3df3SCatalin Marinas /DISCARD/ : { 1491e48ef7fSArd Biesheuvel *(.interp .dynamic) 1503bbd3db8SArd Biesheuvel *(.dynsym .dynstr .hash .gnu.hash) 1518c2c3df3SCatalin Marinas } 1528c2c3df3SCatalin Marinas 153120dc60dSArd Biesheuvel . = KIMAGE_VADDR; 1548c2c3df3SCatalin Marinas 1558c2c3df3SCatalin Marinas .head.text : { 1568c2c3df3SCatalin Marinas _text = .; 1578c2c3df3SCatalin Marinas HEAD_TEXT 1588c2c3df3SCatalin Marinas } 159e2a073ddSArd Biesheuvel .text : ALIGN(SEGMENT_ALIGN) { /* Real text segment */ 1608c2c3df3SCatalin Marinas _stext = .; /* Text and read-only data */ 1618c2c3df3SCatalin Marinas IRQENTRY_TEXT 162be7635e7SAlexander Potapenko SOFTIRQENTRY_TEXT 163888b3c87SPratyush Anand ENTRY_TEXT 1648c2c3df3SCatalin Marinas TEXT_TEXT 1658c2c3df3SCatalin Marinas SCHED_TEXT 1666727ad9eSChris Metcalf CPUIDLE_TEXT 1678c2c3df3SCatalin Marinas LOCK_TEXT 1682dd0e8d2SSandeepa Prabhu KPROBES_TEXT 1692240bbb6SMarc Zyngier HYPERVISOR_TEXT 1705dfe9d7dSArd Biesheuvel IDMAP_TEXT 1718c2c3df3SCatalin Marinas *(.gnu.warning) 1728c2c3df3SCatalin Marinas . = ALIGN(16); 1738c2c3df3SCatalin Marinas *(.got) /* Global offset table */ 1748c2c3df3SCatalin Marinas } 1758c2c3df3SCatalin Marinas 176be288182SKees Cook /* 177be288182SKees Cook * Make sure that the .got.plt is either completely empty or it 178be288182SKees Cook * contains only the lazy dispatch entries. 179be288182SKees Cook */ 180be288182SKees Cook .got.plt : { *(.got.plt) } 181be288182SKees Cook ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0x18, 182be288182SKees Cook "Unexpected GOT/PLT entries detected!") 183be288182SKees Cook 18497740051SArd Biesheuvel . = ALIGN(SEGMENT_ALIGN); 1859fdc14c5SArd Biesheuvel _etext = .; /* End of text section */ 1869fdc14c5SArd Biesheuvel 18719f6bc32SKees Cook /* everything from this point to __init_begin will be marked RO NX */ 18819f6bc32SKees Cook RO_DATA(PAGE_SIZE) 1898c2c3df3SCatalin Marinas 190eb48d154SMarc Zyngier HYPERVISOR_DATA_SECTIONS 191eb48d154SMarc Zyngier 1926ee3cf6aSArd Biesheuvel /* code sections that are never executed via the kernel mapping */ 1936ee3cf6aSArd Biesheuvel .rodata.text : { 1946ee3cf6aSArd Biesheuvel TRAMP_TEXT 1956ee3cf6aSArd Biesheuvel HIBERNATE_TEXT 1966ee3cf6aSArd Biesheuvel KEXEC_TEXT 1976ee3cf6aSArd Biesheuvel . = ALIGN(PAGE_SIZE); 1986ee3cf6aSArd Biesheuvel } 1996ee3cf6aSArd Biesheuvel 2008eb7e28dSJun Yao idmap_pg_dir = .; 201*c3cee924SArd Biesheuvel . += PAGE_SIZE; 2028eb7e28dSJun Yao 2038eb7e28dSJun Yao#ifdef CONFIG_UNMAP_KERNEL_AT_EL0 2048eb7e28dSJun Yao tramp_pg_dir = .; 2058eb7e28dSJun Yao . += PAGE_SIZE; 2068eb7e28dSJun Yao#endif 2078eb7e28dSJun Yao 208833be850SMark Rutland reserved_pg_dir = .; 209833be850SMark Rutland . += PAGE_SIZE; 210833be850SMark Rutland 2118eb7e28dSJun Yao swapper_pg_dir = .; 2128eb7e28dSJun Yao . += PAGE_SIZE; 2138eb7e28dSJun Yao 21497740051SArd Biesheuvel . = ALIGN(SEGMENT_ALIGN); 2158c2c3df3SCatalin Marinas __init_begin = .; 2162ebe088bSArd Biesheuvel __inittext_begin = .; 2178c2c3df3SCatalin Marinas 2188c2c3df3SCatalin Marinas INIT_TEXT_SECTION(8) 219ca2ef4ffSMark Rutland 220ca2ef4ffSMark Rutland __exittext_begin = .; 2218c2c3df3SCatalin Marinas .exit.text : { 2221eae811dSArd Biesheuvel EXIT_TEXT 2238c2c3df3SCatalin Marinas } 224ca2ef4ffSMark Rutland __exittext_end = .; 225da141706SLaura Abbott 2262ebe088bSArd Biesheuvel . = ALIGN(4); 2272ebe088bSArd Biesheuvel .altinstructions : { 2282ebe088bSArd Biesheuvel __alt_instructions = .; 2292ebe088bSArd Biesheuvel *(.altinstructions) 2302ebe088bSArd Biesheuvel __alt_instructions_end = .; 2312ebe088bSArd Biesheuvel } 2322ebe088bSArd Biesheuvel 23376085affSArd Biesheuvel . = ALIGN(SEGMENT_ALIGN); 2342ebe088bSArd Biesheuvel __inittext_end = .; 2352ebe088bSArd Biesheuvel __initdata_begin = .; 2362ebe088bSArd Biesheuvel 237*c3cee924SArd Biesheuvel init_idmap_pg_dir = .; 238*c3cee924SArd Biesheuvel . += INIT_IDMAP_DIR_SIZE; 239*c3cee924SArd Biesheuvel init_idmap_pg_end = .; 240*c3cee924SArd Biesheuvel 2418c2c3df3SCatalin Marinas .init.data : { 2428c2c3df3SCatalin Marinas INIT_DATA 2438c2c3df3SCatalin Marinas INIT_SETUP(16) 2448c2c3df3SCatalin Marinas INIT_CALLS 2458c2c3df3SCatalin Marinas CON_INITCALL 2468c2c3df3SCatalin Marinas INIT_RAM_FS 247ba4259a6SCatalin Marinas *(.init.altinstructions .init.bss) /* from the EFI stub */ 2488c2c3df3SCatalin Marinas } 2498c2c3df3SCatalin Marinas .exit.data : { 2501eae811dSArd Biesheuvel EXIT_DATA 2518c2c3df3SCatalin Marinas } 2528c2c3df3SCatalin Marinas 25398fb7548SArd Biesheuvel PERCPU_SECTION(L1_CACHE_BYTES) 25430c95391SDavid Brazdil HYPERVISOR_PERCPU_SECTION 2558c2c3df3SCatalin Marinas 2568c49b5d4SDavid Brazdil HYPERVISOR_RELOC_SECTION 2578c49b5d4SDavid Brazdil 2583bbd3db8SArd Biesheuvel .rela.dyn : ALIGN(8) { 2591e48ef7fSArd Biesheuvel *(.rela .rela*) 2601e48ef7fSArd Biesheuvel } 261e039ee4eSAndre Przywara 2623bbd3db8SArd Biesheuvel __rela_offset = ABSOLUTE(ADDR(.rela.dyn) - KIMAGE_VADDR); 2633bbd3db8SArd Biesheuvel __rela_size = SIZEOF(.rela.dyn); 2640cd3defeSArd Biesheuvel 2655cf896fbSPeter Collingbourne#ifdef CONFIG_RELR 2665cf896fbSPeter Collingbourne .relr.dyn : ALIGN(8) { 2675cf896fbSPeter Collingbourne *(.relr.dyn) 2685cf896fbSPeter Collingbourne } 2695cf896fbSPeter Collingbourne 2705cf896fbSPeter Collingbourne __relr_offset = ABSOLUTE(ADDR(.relr.dyn) - KIMAGE_VADDR); 2715cf896fbSPeter Collingbourne __relr_size = SIZEOF(.relr.dyn); 2725cf896fbSPeter Collingbourne#endif 2735cf896fbSPeter Collingbourne 27497740051SArd Biesheuvel . = ALIGN(SEGMENT_ALIGN); 2752ebe088bSArd Biesheuvel __initdata_end = .; 2769aa4ec15SMark Rutland __init_end = .; 2779aa4ec15SMark Rutland 2783c620626SMark Salter _data = .; 2798c2c3df3SCatalin Marinas _sdata = .; 280c9174047SKees Cook RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_ALIGN) 281b6113038SJames Morse 282b6113038SJames Morse /* 283b6113038SJames Morse * Data written with the MMU off but read with the MMU on requires 284b6113038SJames Morse * cache lines to be invalidated, discarding up to a Cache Writeback 285b6113038SJames Morse * Granule (CWG) of data from the cache. Keep the section that 286b6113038SJames Morse * requires this type of maintenance to be in its own Cache Writeback 287b6113038SJames Morse * Granule (CWG) area so the cache maintenance operations don't 288b6113038SJames Morse * interfere with adjacent data. 289b6113038SJames Morse */ 290b6113038SJames Morse .mmuoff.data.write : ALIGN(SZ_2K) { 291b6113038SJames Morse __mmuoff_data_start = .; 292b6113038SJames Morse *(.mmuoff.data.write) 293b6113038SJames Morse } 294b6113038SJames Morse . = ALIGN(SZ_2K); 295b6113038SJames Morse .mmuoff.data.read : { 296b6113038SJames Morse *(.mmuoff.data.read) 297b6113038SJames Morse __mmuoff_data_end = .; 298b6113038SJames Morse } 299b6113038SJames Morse 300a352ea3eSArd Biesheuvel PECOFF_EDATA_PADDING 301cad27ef2SArd Biesheuvel __pecoff_data_rawsize = ABSOLUTE(. - __initdata_begin); 3028c2c3df3SCatalin Marinas _edata = .; 3038c2c3df3SCatalin Marinas 304380e18adSQuentin Perret BSS_SECTION(SBSS_ALIGN, 0, 0) 305bd00cd5fSMark Rutland 306bd00cd5fSMark Rutland . = ALIGN(PAGE_SIZE); 3072b5548b6SJun Yao init_pg_dir = .; 3082b5548b6SJun Yao . += INIT_DIR_SIZE; 3092b5548b6SJun Yao init_pg_end = .; 3102b5548b6SJun Yao 31176085affSArd Biesheuvel . = ALIGN(SEGMENT_ALIGN); 312cad27ef2SArd Biesheuvel __pecoff_data_size = ABSOLUTE(. - __initdata_begin); 3138c2c3df3SCatalin Marinas _end = .; 3148c2c3df3SCatalin Marinas 3158c2c3df3SCatalin Marinas STABS_DEBUG 316578d7f0fSKees Cook DWARF_DEBUG 317c604abc3SKees Cook ELF_DETAILS 318a2c1d73bSMark Rutland 319a2c1d73bSMark Rutland HEAD_SYMBOLS 320be288182SKees Cook 321be288182SKees Cook /* 322be288182SKees Cook * Sections that should stay zero sized, which is safer to 323be288182SKees Cook * explicitly check instead of blindly discarding. 324be288182SKees Cook */ 325be288182SKees Cook .plt : { 3265f692a81SArd Biesheuvel *(.plt) *(.plt.*) *(.iplt) *(.igot .igot.plt) 327be288182SKees Cook } 328be288182SKees Cook ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!") 329be288182SKees Cook 330be288182SKees Cook .data.rel.ro : { *(.data.rel.ro) } 331be288182SKees Cook ASSERT(SIZEOF(.data.rel.ro) == 0, "Unexpected RELRO detected!") 3328c2c3df3SCatalin Marinas} 3332240bbb6SMarc Zyngier 33490776dd1SKees Cook#include "image-vars.h" 33590776dd1SKees Cook 3362240bbb6SMarc Zyngier/* 337b83042f0SQuentin Perret * The HYP init code and ID map text can't be longer than a page each. The 338b83042f0SQuentin Perret * former is page-aligned, but the latter may not be with 16K or 64K pages, so 339b83042f0SQuentin Perret * it should also not cross a page boundary. 3402240bbb6SMarc Zyngier */ 341b83042f0SQuentin PerretASSERT(__hyp_idmap_text_end - __hyp_idmap_text_start <= PAGE_SIZE, 342b83042f0SQuentin Perret "HYP init code too big") 3435dfe9d7dSArd BiesheuvelASSERT(__idmap_text_end - (__idmap_text_start & ~(SZ_4K - 1)) <= SZ_4K, 3445dfe9d7dSArd Biesheuvel "ID map text too big or misaligned") 34582869ac5SJames Morse#ifdef CONFIG_HIBERNATION 3466ee3cf6aSArd BiesheuvelASSERT(__hibernate_exit_text_end - __hibernate_exit_text_start <= SZ_4K, 3476ee3cf6aSArd Biesheuvel "Hibernate exit text is bigger than 4 KiB") 34882869ac5SJames Morse#endif 3496c27c408SWill Deacon#ifdef CONFIG_UNMAP_KERNEL_AT_EL0 350a9c406e6SJames MorseASSERT((__entry_tramp_text_end - __entry_tramp_text_start) <= 3*PAGE_SIZE, 3516c27c408SWill Deacon "Entry trampoline text too big") 3526c27c408SWill Deacon#endif 353380e18adSQuentin Perret#ifdef CONFIG_KVM 354380e18adSQuentin PerretASSERT(__hyp_bss_start == __bss_start, "HYP and Host BSS are misaligned") 355380e18adSQuentin Perret#endif 356da57a369SMark Rutland/* 357da57a369SMark Rutland * If padding is applied before .head.text, virt<->phys conversions will fail. 358da57a369SMark Rutland */ 359120dc60dSArd BiesheuvelASSERT(_text == KIMAGE_VADDR, "HEAD is misaligned") 36000ef5434SJoey Gouly 36100ef5434SJoey GoulyASSERT(swapper_pg_dir - reserved_pg_dir == RESERVED_SWAPPER_OFFSET, 36200ef5434SJoey Gouly "RESERVED_SWAPPER_OFFSET is wrong!") 3630188a894SJoey Gouly 3640188a894SJoey Gouly#ifdef CONFIG_UNMAP_KERNEL_AT_EL0 3650188a894SJoey GoulyASSERT(swapper_pg_dir - tramp_pg_dir == TRAMP_SWAPPER_OFFSET, 3660188a894SJoey Gouly "TRAMP_SWAPPER_OFFSET is wrong!") 3670188a894SJoey Gouly#endif 36819a046f0SPasha Tatashin 36919a046f0SPasha Tatashin#ifdef CONFIG_KEXEC_CORE 37019a046f0SPasha Tatashin/* kexec relocation code should fit into one KEXEC_CONTROL_PAGE_SIZE */ 3716ee3cf6aSArd BiesheuvelASSERT(__relocate_new_kernel_end - __relocate_new_kernel_start <= SZ_4K, 3726ee3cf6aSArd Biesheuvel "kexec relocation code is bigger than 4 KiB") 37319a046f0SPasha TatashinASSERT(KEXEC_CONTROL_PAGE_SIZE >= SZ_4K, "KEXEC_CONTROL_PAGE_SIZE is broken") 37419a046f0SPasha Tatashin#endif 375