Merge tag 'fbdev-for-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller...
[platform/kernel/linux-rpi.git] / arch / arm64 / kernel / image-vars.h
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 PROVIDE(__efistub_primary_entry_offset  = primary_entry - _text);
14
15 /*
16  * The EFI stub has its own symbol namespace prefixed by __efistub_, to
17  * isolate it from the kernel proper. The following symbols are legally
18  * accessed by the stub, so provide some aliases to make them accessible.
19  * Only include data symbols here, or text symbols of functions that are
20  * guaranteed to be safe when executed at another offset than they were
21  * linked at. The routines below are all implemented in assembler in a
22  * position independent manner
23  */
24 PROVIDE(__efistub_dcache_clean_poc      = __pi_dcache_clean_poc);
25
26 PROVIDE(__efistub__text                 = _text);
27 PROVIDE(__efistub__end                  = _end);
28 PROVIDE(__efistub__edata                = _edata);
29 PROVIDE(__efistub_screen_info           = screen_info);
30 PROVIDE(__efistub__ctype                = _ctype);
31
32 PROVIDE(__pi___memcpy                   = __pi_memcpy);
33 PROVIDE(__pi___memmove                  = __pi_memmove);
34 PROVIDE(__pi___memset                   = __pi_memset);
35
36 #ifdef CONFIG_KVM
37
38 /*
39  * KVM nVHE code has its own symbol namespace prefixed with __kvm_nvhe_, to
40  * separate it from the kernel proper. The following symbols are legally
41  * accessed by it, therefore provide aliases to make them linkable.
42  * Do not include symbols which may not be safely accessed under hypervisor
43  * memory mappings.
44  */
45
46 /* Alternative callbacks for init-time patching of nVHE hyp code. */
47 KVM_NVHE_ALIAS(kvm_patch_vector_branch);
48 KVM_NVHE_ALIAS(kvm_update_va_mask);
49 KVM_NVHE_ALIAS(kvm_get_kimage_voffset);
50 KVM_NVHE_ALIAS(kvm_compute_final_ctr_el0);
51 KVM_NVHE_ALIAS(spectre_bhb_patch_loop_iter);
52 KVM_NVHE_ALIAS(spectre_bhb_patch_loop_mitigation_enable);
53 KVM_NVHE_ALIAS(spectre_bhb_patch_wa3);
54 KVM_NVHE_ALIAS(spectre_bhb_patch_clearbhb);
55 KVM_NVHE_ALIAS(alt_cb_patch_nops);
56
57 /* Global kernel state accessed by nVHE hyp code. */
58 KVM_NVHE_ALIAS(kvm_vgic_global_state);
59
60 /* Kernel symbols used to call panic() from nVHE hyp code (via ERET). */
61 KVM_NVHE_ALIAS(nvhe_hyp_panic_handler);
62
63 /* Vectors installed by hyp-init on reset HVC. */
64 KVM_NVHE_ALIAS(__hyp_stub_vectors);
65
66 /* Kernel symbol used by icache_is_vpipt(). */
67 KVM_NVHE_ALIAS(__icache_flags);
68
69 /* VMID bits set by the KVM VMID allocator */
70 KVM_NVHE_ALIAS(kvm_arm_vmid_bits);
71
72 /* Static keys which are set if a vGIC trap should be handled in hyp. */
73 KVM_NVHE_ALIAS(vgic_v2_cpuif_trap);
74 KVM_NVHE_ALIAS(vgic_v3_cpuif_trap);
75
76 /* Static key checked in pmr_sync(). */
77 #ifdef CONFIG_ARM64_PSEUDO_NMI
78 KVM_NVHE_ALIAS(gic_pmr_sync);
79 /* Static key checked in GIC_PRIO_IRQOFF. */
80 KVM_NVHE_ALIAS(gic_nonsecure_priorities);
81 #endif
82
83 /* EL2 exception handling */
84 KVM_NVHE_ALIAS(__start___kvm_ex_table);
85 KVM_NVHE_ALIAS(__stop___kvm_ex_table);
86
87 /* Array containing bases of nVHE per-CPU memory regions. */
88 KVM_NVHE_ALIAS(kvm_arm_hyp_percpu_base);
89
90 /* PMU available static key */
91 #ifdef CONFIG_HW_PERF_EVENTS
92 KVM_NVHE_ALIAS(kvm_arm_pmu_available);
93 #endif
94
95 /* Position-independent library routines */
96 KVM_NVHE_ALIAS_HYP(clear_page, __pi_clear_page);
97 KVM_NVHE_ALIAS_HYP(copy_page, __pi_copy_page);
98 KVM_NVHE_ALIAS_HYP(memcpy, __pi_memcpy);
99 KVM_NVHE_ALIAS_HYP(memset, __pi_memset);
100
101 #ifdef CONFIG_KASAN
102 KVM_NVHE_ALIAS_HYP(__memcpy, __pi_memcpy);
103 KVM_NVHE_ALIAS_HYP(__memset, __pi_memset);
104 #endif
105
106 /* Kernel memory sections */
107 KVM_NVHE_ALIAS(__start_rodata);
108 KVM_NVHE_ALIAS(__end_rodata);
109 KVM_NVHE_ALIAS(__bss_start);
110 KVM_NVHE_ALIAS(__bss_stop);
111
112 /* Hyp memory sections */
113 KVM_NVHE_ALIAS(__hyp_idmap_text_start);
114 KVM_NVHE_ALIAS(__hyp_idmap_text_end);
115 KVM_NVHE_ALIAS(__hyp_text_start);
116 KVM_NVHE_ALIAS(__hyp_text_end);
117 KVM_NVHE_ALIAS(__hyp_bss_start);
118 KVM_NVHE_ALIAS(__hyp_bss_end);
119 KVM_NVHE_ALIAS(__hyp_rodata_start);
120 KVM_NVHE_ALIAS(__hyp_rodata_end);
121
122 /* pKVM static key */
123 KVM_NVHE_ALIAS(kvm_protected_mode_initialized);
124
125 #endif /* CONFIG_KVM */
126
127 #endif /* __ARM64_KERNEL_IMAGE_VARS_H */