image-vars.h (e03fa29164ec1db1a81dc0168d0017a9e0366c7c) image-vars.h (09cf57eba304246141367b95c89801fd2047ac96)
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

--- 49 unchanged lines hidden (view full) ---

58 * separate it from the kernel proper. The following symbols are legally
59 * accessed by it, therefore provide aliases to make them linkable.
60 * Do not include symbols which may not be safely accessed under hypervisor
61 * memory mappings.
62 */
63
64#define KVM_NVHE_ALIAS(sym) __kvm_nvhe_##sym = sym;
65
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

--- 49 unchanged lines hidden (view full) ---

58 * separate it from the kernel proper. The following symbols are legally
59 * accessed by it, therefore provide aliases to make them linkable.
60 * Do not include symbols which may not be safely accessed under hypervisor
61 * memory mappings.
62 */
63
64#define KVM_NVHE_ALIAS(sym) __kvm_nvhe_##sym = sym;
65
66/* Symbols defined in aarch32.c (not yet compiled with nVHE build rules). */
67KVM_NVHE_ALIAS(kvm_skip_instr32);
68
66/* Symbols defined in debug-sr.c (not yet compiled with nVHE build rules). */
69/* Symbols defined in debug-sr.c (not yet compiled with nVHE build rules). */
70KVM_NVHE_ALIAS(__debug_switch_to_guest);
71KVM_NVHE_ALIAS(__debug_switch_to_host);
67KVM_NVHE_ALIAS(__kvm_get_mdcr_el2);
68
69/* Symbols defined in entry.S (not yet compiled with nVHE build rules). */
72KVM_NVHE_ALIAS(__kvm_get_mdcr_el2);
73
74/* Symbols defined in entry.S (not yet compiled with nVHE build rules). */
75KVM_NVHE_ALIAS(__guest_enter);
70KVM_NVHE_ALIAS(__guest_exit);
71KVM_NVHE_ALIAS(abort_guest_exit_end);
72KVM_NVHE_ALIAS(abort_guest_exit_start);
73
76KVM_NVHE_ALIAS(__guest_exit);
77KVM_NVHE_ALIAS(abort_guest_exit_end);
78KVM_NVHE_ALIAS(abort_guest_exit_start);
79
74/* Symbols defined in switch.c (not yet compiled with nVHE build rules). */
75KVM_NVHE_ALIAS(__kvm_vcpu_run_nvhe);
76KVM_NVHE_ALIAS(hyp_panic);
80/* Symbols defined in fpsimd.S (not yet compiled with nVHE build rules). */
81KVM_NVHE_ALIAS(__fpsimd_restore_state);
82KVM_NVHE_ALIAS(__fpsimd_save_state);
77
78/* Symbols defined in sysreg-sr.c (not yet compiled with nVHE build rules). */
79KVM_NVHE_ALIAS(__kvm_enable_ssbs);
83
84/* Symbols defined in sysreg-sr.c (not yet compiled with nVHE build rules). */
85KVM_NVHE_ALIAS(__kvm_enable_ssbs);
86KVM_NVHE_ALIAS(__sysreg32_restore_state);
87KVM_NVHE_ALIAS(__sysreg32_save_state);
88KVM_NVHE_ALIAS(__sysreg_restore_state_nvhe);
89KVM_NVHE_ALIAS(__sysreg_save_state_nvhe);
80
81/* Symbols defined in timer-sr.c (not yet compiled with nVHE build rules). */
82KVM_NVHE_ALIAS(__kvm_timer_set_cntvoff);
90
91/* Symbols defined in timer-sr.c (not yet compiled with nVHE build rules). */
92KVM_NVHE_ALIAS(__kvm_timer_set_cntvoff);
93KVM_NVHE_ALIAS(__timer_disable_traps);
94KVM_NVHE_ALIAS(__timer_enable_traps);
83
95
96/* Symbols defined in vgic-v2-cpuif-proxy.c (not yet compiled with nVHE build rules). */
97KVM_NVHE_ALIAS(__vgic_v2_perform_cpuif_access);
98
84/* Symbols defined in vgic-v3-sr.c (not yet compiled with nVHE build rules). */
99/* Symbols defined in vgic-v3-sr.c (not yet compiled with nVHE build rules). */
100KVM_NVHE_ALIAS(__vgic_v3_activate_traps);
101KVM_NVHE_ALIAS(__vgic_v3_deactivate_traps);
85KVM_NVHE_ALIAS(__vgic_v3_get_ich_vtr_el2);
86KVM_NVHE_ALIAS(__vgic_v3_init_lrs);
102KVM_NVHE_ALIAS(__vgic_v3_get_ich_vtr_el2);
103KVM_NVHE_ALIAS(__vgic_v3_init_lrs);
104KVM_NVHE_ALIAS(__vgic_v3_perform_cpuif_access);
87KVM_NVHE_ALIAS(__vgic_v3_read_vmcr);
88KVM_NVHE_ALIAS(__vgic_v3_restore_aprs);
105KVM_NVHE_ALIAS(__vgic_v3_read_vmcr);
106KVM_NVHE_ALIAS(__vgic_v3_restore_aprs);
107KVM_NVHE_ALIAS(__vgic_v3_restore_state);
89KVM_NVHE_ALIAS(__vgic_v3_save_aprs);
108KVM_NVHE_ALIAS(__vgic_v3_save_aprs);
109KVM_NVHE_ALIAS(__vgic_v3_save_state);
90KVM_NVHE_ALIAS(__vgic_v3_write_vmcr);
91
92/* Alternative callbacks for init-time patching of nVHE hyp code. */
93KVM_NVHE_ALIAS(arm64_enable_wa2_handling);
94KVM_NVHE_ALIAS(kvm_patch_vector_branch);
95KVM_NVHE_ALIAS(kvm_update_va_mask);
96
97/* Global kernel state accessed by nVHE hyp code. */
98KVM_NVHE_ALIAS(arm64_ssbd_callback_required);
99KVM_NVHE_ALIAS(kvm_host_data);
110KVM_NVHE_ALIAS(__vgic_v3_write_vmcr);
111
112/* Alternative callbacks for init-time patching of nVHE hyp code. */
113KVM_NVHE_ALIAS(arm64_enable_wa2_handling);
114KVM_NVHE_ALIAS(kvm_patch_vector_branch);
115KVM_NVHE_ALIAS(kvm_update_va_mask);
116
117/* Global kernel state accessed by nVHE hyp code. */
118KVM_NVHE_ALIAS(arm64_ssbd_callback_required);
119KVM_NVHE_ALIAS(kvm_host_data);
120KVM_NVHE_ALIAS(kvm_vgic_global_state);
100
101/* Kernel constant needed to compute idmap addresses. */
102KVM_NVHE_ALIAS(kimage_voffset);
103
104/* Kernel symbols used to call panic() from nVHE hyp code (via ERET). */
121
122/* Kernel constant needed to compute idmap addresses. */
123KVM_NVHE_ALIAS(kimage_voffset);
124
125/* Kernel symbols used to call panic() from nVHE hyp code (via ERET). */
126KVM_NVHE_ALIAS(__hyp_panic_string);
105KVM_NVHE_ALIAS(panic);
106
107/* Vectors installed by hyp-init on reset HVC. */
108KVM_NVHE_ALIAS(__hyp_stub_vectors);
109
110/* IDMAP TCR_EL1.T0SZ as computed by the EL1 init code */
111KVM_NVHE_ALIAS(idmap_t0sz);
112
113/* Kernel symbol used by icache_is_vpipt(). */
114KVM_NVHE_ALIAS(__icache_flags);
115
116/* Kernel symbols needed for cpus_have_final/const_caps checks. */
117KVM_NVHE_ALIAS(arm64_const_caps_ready);
118KVM_NVHE_ALIAS(cpu_hwcap_keys);
119KVM_NVHE_ALIAS(cpu_hwcaps);
120
127KVM_NVHE_ALIAS(panic);
128
129/* Vectors installed by hyp-init on reset HVC. */
130KVM_NVHE_ALIAS(__hyp_stub_vectors);
131
132/* IDMAP TCR_EL1.T0SZ as computed by the EL1 init code */
133KVM_NVHE_ALIAS(idmap_t0sz);
134
135/* Kernel symbol used by icache_is_vpipt(). */
136KVM_NVHE_ALIAS(__icache_flags);
137
138/* Kernel symbols needed for cpus_have_final/const_caps checks. */
139KVM_NVHE_ALIAS(arm64_const_caps_ready);
140KVM_NVHE_ALIAS(cpu_hwcap_keys);
141KVM_NVHE_ALIAS(cpu_hwcaps);
142
143/* Static keys which are set if a vGIC trap should be handled in hyp. */
144KVM_NVHE_ALIAS(vgic_v2_cpuif_trap);
145KVM_NVHE_ALIAS(vgic_v3_cpuif_trap);
146
147/* Static key checked in pmr_sync(). */
148#ifdef CONFIG_ARM64_PSEUDO_NMI
149KVM_NVHE_ALIAS(gic_pmr_sync);
150#endif
151
121#endif /* CONFIG_KVM */
122
123#endif /* __ARM64_KERNEL_IMAGE_VARS_H */
152#endif /* CONFIG_KVM */
153
154#endif /* __ARM64_KERNEL_IMAGE_VARS_H */