DUJINLABS.COM

Linux v6.18.37 · ARM64

arch/arm64/kernel/image-vars.h

전체 목록

Linux v6.18.37 · 원본 파일 · 온라인 원본

1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Linker script variables to be set after section resolution, as
4 * ld.lld does not like variables assigned before SECTIONS is processed.
5 */
6#ifndef __ARM64_KERNEL_IMAGE_VARS_H
7#define __ARM64_KERNEL_IMAGE_VARS_H
8
9#ifndef LINKER_SCRIPT
10#error This file should only be included in vmlinux.lds.S
11#endif
12
13#if defined(CONFIG_LD_IS_LLD) && CONFIG_LLD_VERSION < 210000
14#define ASSERT(...)
15#endif
16
17#define PI_EXPORT_SYM(sym)		\
18	__PI_EXPORT_SYM(sym, __pi_ ## sym, Cannot export BSS symbol sym to startup code)
19#define __PI_EXPORT_SYM(sym, pisym, msg)\
20	PROVIDE(pisym = sym);		\
21	ASSERT((sym - KIMAGE_VADDR) < (__bss_start - KIMAGE_VADDR), #msg)
22
23PROVIDE(__efistub_primary_entry		= primary_entry);
24
25/*
26 * The EFI stub has its own symbol namespace prefixed by __efistub_, to
27 * isolate it from the kernel proper. The following symbols are legally
28 * accessed by the stub, so provide some aliases to make them accessible.
29 * Only include data symbols here, or text symbols of functions that are
30 * guaranteed to be safe when executed at another offset than they were
31 * linked at. The routines below are all implemented in assembler in a
32 * position independent manner
33 */
34PROVIDE(__efistub_caches_clean_inval_pou = __pi_caches_clean_inval_pou);
35
36PROVIDE(__efistub__text			= _text);
37PROVIDE(__efistub__end			= _end);
38PROVIDE(__efistub___inittext_end       	= __inittext_end);
39PROVIDE(__efistub__edata		= _edata);
40#if defined(CONFIG_EFI_EARLYCON) || defined(CONFIG_SYSFB)
41PROVIDE(__efistub_screen_info		= screen_info);
42#endif
43PROVIDE(__efistub__ctype		= _ctype);
44
45PROVIDE(__pi___memcpy			= __pi_memcpy);
46PROVIDE(__pi___memmove			= __pi_memmove);
47PROVIDE(__pi___memset			= __pi_memset);
48
49PI_EXPORT_SYM(id_aa64isar1_override);
50PI_EXPORT_SYM(id_aa64isar2_override);
51PI_EXPORT_SYM(id_aa64mmfr0_override);
52PI_EXPORT_SYM(id_aa64mmfr1_override);
53PI_EXPORT_SYM(id_aa64mmfr2_override);
54PI_EXPORT_SYM(id_aa64pfr0_override);
55PI_EXPORT_SYM(id_aa64pfr1_override);
56PI_EXPORT_SYM(id_aa64smfr0_override);
57PI_EXPORT_SYM(id_aa64zfr0_override);
58PI_EXPORT_SYM(arm64_sw_feature_override);
59PI_EXPORT_SYM(arm64_use_ng_mappings);
60PI_EXPORT_SYM(_ctype);
61
62PI_EXPORT_SYM(swapper_pg_dir);
63
64PI_EXPORT_SYM(_text);
65PI_EXPORT_SYM(_stext);
66PI_EXPORT_SYM(_etext);
67PI_EXPORT_SYM(__start_rodata);
68PI_EXPORT_SYM(__inittext_begin);
69PI_EXPORT_SYM(__inittext_end);
70PI_EXPORT_SYM(__initdata_begin);
71PI_EXPORT_SYM(__initdata_end);
72PI_EXPORT_SYM(_data);
73
74#ifdef CONFIG_KVM
75
76/*
77 * KVM nVHE code has its own symbol namespace prefixed with __kvm_nvhe_, to
78 * separate it from the kernel proper. The following symbols are legally
79 * accessed by it, therefore provide aliases to make them linkable.
80 * Do not include symbols which may not be safely accessed under hypervisor
81 * memory mappings.
82 */
83
84/* Alternative callbacks for init-time patching of nVHE hyp code. */
85KVM_NVHE_ALIAS(kvm_patch_vector_branch);
86KVM_NVHE_ALIAS(kvm_update_va_mask);
87KVM_NVHE_ALIAS(kvm_get_kimage_voffset);
88KVM_NVHE_ALIAS(kvm_compute_final_ctr_el0);
89KVM_NVHE_ALIAS(spectre_bhb_patch_loop_iter);
90KVM_NVHE_ALIAS(spectre_bhb_patch_loop_mitigation_enable);
91KVM_NVHE_ALIAS(spectre_bhb_patch_wa3);
92KVM_NVHE_ALIAS(spectre_bhb_patch_clearbhb);
93KVM_NVHE_ALIAS(alt_cb_patch_nops);
94
95/* Global kernel state accessed by nVHE hyp code. */
96KVM_NVHE_ALIAS(kvm_vgic_global_state);
97
98/* Kernel symbols used to call panic() from nVHE hyp code (via ERET). */
99KVM_NVHE_ALIAS(nvhe_hyp_panic_handler);
100
101/* Vectors installed by hyp-init on reset HVC. */
102KVM_NVHE_ALIAS(__hyp_stub_vectors);
103
104/* Static keys which are set if a vGIC trap should be handled in hyp. */
105KVM_NVHE_ALIAS(vgic_v2_cpuif_trap);
106KVM_NVHE_ALIAS(vgic_v3_cpuif_trap);
107
108/* Static key indicating whether GICv3 has GICv2 compatibility */
109KVM_NVHE_ALIAS(vgic_v3_has_v2_compat);
110
111/* Static key which is set if CNTVOFF_EL2 is unusable */
112KVM_NVHE_ALIAS(broken_cntvoff_key);
113
114/* EL2 exception handling */
115KVM_NVHE_ALIAS(__start___kvm_ex_table);
116KVM_NVHE_ALIAS(__stop___kvm_ex_table);
117
118/* Position-independent library routines */
119KVM_NVHE_ALIAS_HYP(clear_page, __pi_clear_page);
120KVM_NVHE_ALIAS_HYP(copy_page, __pi_copy_page);
121KVM_NVHE_ALIAS_HYP(memcpy, __pi_memcpy);
122KVM_NVHE_ALIAS_HYP(memset, __pi_memset);
123
124#ifdef CONFIG_KASAN
125KVM_NVHE_ALIAS_HYP(__memcpy, __pi_memcpy);
126KVM_NVHE_ALIAS_HYP(__memset, __pi_memset);
127#endif
128
129/* Hyp memory sections */
130KVM_NVHE_ALIAS(__hyp_idmap_text_start);
131KVM_NVHE_ALIAS(__hyp_idmap_text_end);
132KVM_NVHE_ALIAS(__hyp_text_start);
133KVM_NVHE_ALIAS(__hyp_text_end);
134KVM_NVHE_ALIAS(__hyp_bss_start);
135KVM_NVHE_ALIAS(__hyp_bss_end);
136KVM_NVHE_ALIAS(__hyp_data_start);
137KVM_NVHE_ALIAS(__hyp_data_end);
138KVM_NVHE_ALIAS(__hyp_rodata_start);
139KVM_NVHE_ALIAS(__hyp_rodata_end);
140
141/* pKVM static key */
142KVM_NVHE_ALIAS(kvm_protected_mode_initialized);
143
144#endif /* CONFIG_KVM */
145
146#ifdef CONFIG_EFI_ZBOOT
147_kernel_codesize = ABSOLUTE(__inittext_end - _text);
148#endif
149
150/*
151 * LLD will occasionally error out with a '__init_end does not converge' error
152 * if INIT_IDMAP_DIR_SIZE is defined in terms of _end, as this results in a
153 * circular dependency. Counter this by dimensioning the initial IDMAP page
154 * tables based on kimage_limit, which is defined such that its value should
155 * not change as a result of the initdata segment being pushed over a 64k
156 * segment boundary due to changes in INIT_IDMAP_DIR_SIZE, provided that its
157 * value doesn't change by more than 2M between linker passes.
158 */
159kimage_limit = ALIGN(ABSOLUTE(_end + SZ_64K), SZ_2M);
160
161#undef ASSERT
162
163#endif /* __ARM64_KERNEL_IMAGE_VARS_H */
맨 위로 ↑