mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 08:17:46 +00:00

Once hyp functions are moved to a hyp object, they will have prefixed symbols. This change declares and gets the address of the prefixed version for calls to the hyp functions. To aid migration, the hyp functions that have not yet moved have their prefixed versions aliased to their non-prefixed version. This begins with all the hyp functions being listed and will reduce to none of them once the migration is complete. Signed-off-by: Andrew Scull <ascull@google.com> [David: Extracted kvm_call_hyp nVHE branches into own helper macros, added comments around symbol aliases.] Signed-off-by: David Brazdil <dbrazdil@google.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20200625131420.71444-6-dbrazdil@google.com
94 lines
3 KiB
C
94 lines
3 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Linker script variables to be set after section resolution, as
|
|
* ld.lld does not like variables assigned before SECTIONS is processed.
|
|
*/
|
|
#ifndef __ARM64_KERNEL_IMAGE_VARS_H
|
|
#define __ARM64_KERNEL_IMAGE_VARS_H
|
|
|
|
#ifndef LINKER_SCRIPT
|
|
#error This file should only be included in vmlinux.lds.S
|
|
#endif
|
|
|
|
#ifdef CONFIG_EFI
|
|
|
|
__efistub_kernel_size = _edata - _text;
|
|
__efistub_primary_entry_offset = primary_entry - _text;
|
|
|
|
|
|
/*
|
|
* The EFI stub has its own symbol namespace prefixed by __efistub_, to
|
|
* isolate it from the kernel proper. The following symbols are legally
|
|
* accessed by the stub, so provide some aliases to make them accessible.
|
|
* Only include data symbols here, or text symbols of functions that are
|
|
* guaranteed to be safe when executed at another offset than they were
|
|
* linked at. The routines below are all implemented in assembler in a
|
|
* position independent manner
|
|
*/
|
|
__efistub_memcmp = __pi_memcmp;
|
|
__efistub_memchr = __pi_memchr;
|
|
__efistub_memcpy = __pi_memcpy;
|
|
__efistub_memmove = __pi_memmove;
|
|
__efistub_memset = __pi_memset;
|
|
__efistub_strlen = __pi_strlen;
|
|
__efistub_strnlen = __pi_strnlen;
|
|
__efistub_strcmp = __pi_strcmp;
|
|
__efistub_strncmp = __pi_strncmp;
|
|
__efistub_strrchr = __pi_strrchr;
|
|
__efistub___clean_dcache_area_poc = __pi___clean_dcache_area_poc;
|
|
|
|
#ifdef CONFIG_KASAN
|
|
__efistub___memcpy = __pi_memcpy;
|
|
__efistub___memmove = __pi_memmove;
|
|
__efistub___memset = __pi_memset;
|
|
#endif
|
|
|
|
__efistub__text = _text;
|
|
__efistub__end = _end;
|
|
__efistub__edata = _edata;
|
|
__efistub_screen_info = screen_info;
|
|
__efistub__ctype = _ctype;
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_KVM
|
|
|
|
/*
|
|
* KVM nVHE code has its own symbol namespace prefixed with __kvm_nvhe_, to
|
|
* separate it from the kernel proper. The following symbols are legally
|
|
* accessed by it, therefore provide aliases to make them linkable.
|
|
* Do not include symbols which may not be safely accessed under hypervisor
|
|
* memory mappings.
|
|
*/
|
|
|
|
#define KVM_NVHE_ALIAS(sym) __kvm_nvhe_##sym = sym;
|
|
|
|
/* Symbols defined in debug-sr.c (not yet compiled with nVHE build rules). */
|
|
KVM_NVHE_ALIAS(__kvm_get_mdcr_el2);
|
|
|
|
/* Symbols defined in switch.c (not yet compiled with nVHE build rules). */
|
|
KVM_NVHE_ALIAS(__kvm_vcpu_run_nvhe);
|
|
|
|
/* Symbols defined in sysreg-sr.c (not yet compiled with nVHE build rules). */
|
|
KVM_NVHE_ALIAS(__kvm_enable_ssbs);
|
|
|
|
/* Symbols defined in timer-sr.c (not yet compiled with nVHE build rules). */
|
|
KVM_NVHE_ALIAS(__kvm_timer_set_cntvoff);
|
|
|
|
/* Symbols defined in tlb.c (not yet compiled with nVHE build rules). */
|
|
KVM_NVHE_ALIAS(__kvm_flush_vm_context);
|
|
KVM_NVHE_ALIAS(__kvm_tlb_flush_local_vmid);
|
|
KVM_NVHE_ALIAS(__kvm_tlb_flush_vmid);
|
|
KVM_NVHE_ALIAS(__kvm_tlb_flush_vmid_ipa);
|
|
|
|
/* Symbols defined in vgic-v3-sr.c (not yet compiled with nVHE build rules). */
|
|
KVM_NVHE_ALIAS(__vgic_v3_get_ich_vtr_el2);
|
|
KVM_NVHE_ALIAS(__vgic_v3_init_lrs);
|
|
KVM_NVHE_ALIAS(__vgic_v3_read_vmcr);
|
|
KVM_NVHE_ALIAS(__vgic_v3_restore_aprs);
|
|
KVM_NVHE_ALIAS(__vgic_v3_save_aprs);
|
|
KVM_NVHE_ALIAS(__vgic_v3_write_vmcr);
|
|
|
|
#endif /* CONFIG_KVM */
|
|
|
|
#endif /* __ARM64_KERNEL_IMAGE_VARS_H */
|