1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 2020 Google LLC.
4 * Written by David Brazdil <dbrazdil@google.com>
7 #ifndef __ARM64_HYP_IMAGE_H__
8 #define __ARM64_HYP_IMAGE_H__
11 * KVM nVHE code has its own symbol namespace prefixed with __kvm_nvhe_,
12 * to separate it from the kernel proper.
14 #define kvm_nvhe_sym(sym) __kvm_nvhe_##sym
19 * KVM nVHE ELF section names are prefixed with .hyp, to separate them
20 * from the kernel proper.
22 #define HYP_SECTION_NAME(NAME) .hyp##NAME
24 /* Defines an ELF hyp section from input section @NAME and its subsections. */
25 #define HYP_SECTION(NAME) \
26 HYP_SECTION_NAME(NAME) : { *(NAME NAME##.*) }
29 * Defines a linker script alias of a kernel-proper symbol referenced by
32 #define KVM_NVHE_ALIAS(sym) kvm_nvhe_sym(sym) = sym;
34 #endif /* LINKER_SCRIPT */
36 #endif /* __ARM64_HYP_IMAGE_H__ */