File Index
Files and directories
Sign in
FILE

image-vars.h

File preview with syntax highlighting.

linux-6.19.14/arch/arm64/kernel/image-vars.h C
  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(kvm_pan_patch_el2_entry);
 90KVM_NVHE_ALIAS(spectre_bhb_patch_loop_iter);
 91KVM_NVHE_ALIAS(spectre_bhb_patch_loop_mitigation_enable);
 92KVM_NVHE_ALIAS(spectre_bhb_patch_wa3);
 93KVM_NVHE_ALIAS(spectre_bhb_patch_clearbhb);
 94KVM_NVHE_ALIAS(alt_cb_patch_nops);
 95KVM_NVHE_ALIAS(kvm_compute_ich_hcr_trap_bits);
 96
 97/* Global kernel state accessed by nVHE hyp code. */
 98KVM_NVHE_ALIAS(kvm_vgic_global_state);
 99
100/* Kernel symbols used to call panic() from nVHE hyp code (via ERET). */
101KVM_NVHE_ALIAS(nvhe_hyp_panic_handler);
102
103/* Vectors installed by hyp-init on reset HVC. */
104KVM_NVHE_ALIAS(__hyp_stub_vectors);
105
106/* Static keys which are set if a vGIC trap should be handled in hyp. */
107KVM_NVHE_ALIAS(vgic_v2_cpuif_trap);
108KVM_NVHE_ALIAS(vgic_v3_cpuif_trap);
109
110/* Static key indicating whether GICv3 has GICv2 compatibility */
111KVM_NVHE_ALIAS(vgic_v3_has_v2_compat);
112
113/* Static key which is set if CNTVOFF_EL2 is unusable */
114KVM_NVHE_ALIAS(broken_cntvoff_key);
115
116/* EL2 exception handling */
117KVM_NVHE_ALIAS(__start___kvm_ex_table);
118KVM_NVHE_ALIAS(__stop___kvm_ex_table);
119
120/* Position-independent library routines */
121KVM_NVHE_ALIAS_HYP(clear_page, __pi_clear_page);
122KVM_NVHE_ALIAS_HYP(copy_page, __pi_copy_page);
123KVM_NVHE_ALIAS_HYP(memcpy, __pi_memcpy);
124KVM_NVHE_ALIAS_HYP(memset, __pi_memset);
125
126#ifdef CONFIG_KASAN
127KVM_NVHE_ALIAS_HYP(__memcpy, __pi_memcpy);
128KVM_NVHE_ALIAS_HYP(__memset, __pi_memset);
129#endif
130
131/* Hyp memory sections */
132KVM_NVHE_ALIAS(__hyp_idmap_text_start);
133KVM_NVHE_ALIAS(__hyp_idmap_text_end);
134KVM_NVHE_ALIAS(__hyp_text_start);
135KVM_NVHE_ALIAS(__hyp_text_end);
136KVM_NVHE_ALIAS(__hyp_bss_start);
137KVM_NVHE_ALIAS(__hyp_bss_end);
138KVM_NVHE_ALIAS(__hyp_data_start);
139KVM_NVHE_ALIAS(__hyp_data_end);
140KVM_NVHE_ALIAS(__hyp_rodata_start);
141KVM_NVHE_ALIAS(__hyp_rodata_end);
142
143/* pKVM static key */
144KVM_NVHE_ALIAS(kvm_protected_mode_initialized);
145
146#endif /* CONFIG_KVM */
147
148#ifdef CONFIG_EFI_ZBOOT
149_kernel_codesize = ABSOLUTE(__inittext_end - _text);
150#endif
151
152/*
153 * LLD will occasionally error out with a '__init_end does not converge' error
154 * if INIT_IDMAP_DIR_SIZE is defined in terms of _end, as this results in a
155 * circular dependency. Counter this by dimensioning the initial IDMAP page
156 * tables based on kimage_limit, which is defined such that its value should
157 * not change as a result of the initdata segment being pushed over a 64k
158 * segment boundary due to changes in INIT_IDMAP_DIR_SIZE, provided that its
159 * value doesn't change by more than 2M between linker passes.
160 */
161kimage_limit = ALIGN(ABSOLUTE(_end + SZ_64K), SZ_2M);
162
163#undef ASSERT
164
165#endif /* __ARM64_KERNEL_IMAGE_VARS_H */
~/ Read-only file preview.