~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm64/include/asm/hyp_image.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * Copyright (C) 2020 Google LLC.
  4  * Written by David Brazdil <dbrazdil@google.com>
  5  */
  6 
  7 #ifndef __ARM64_HYP_IMAGE_H__
  8 #define __ARM64_HYP_IMAGE_H__
  9 
 10 #define __HYP_CONCAT(a, b)      a ## b
 11 #define HYP_CONCAT(a, b)        __HYP_CONCAT(a, b)
 12 
 13 #ifndef __KVM_NVHE_HYPERVISOR__
 14 /*
 15  * KVM nVHE code has its own symbol namespace prefixed with __kvm_nvhe_,
 16  * to separate it from the kernel proper.
 17  */
 18 #define kvm_nvhe_sym(sym)       __kvm_nvhe_##sym
 19 #else
 20 #define kvm_nvhe_sym(sym)       sym
 21 #endif
 22 
 23 #ifdef LINKER_SCRIPT
 24 
 25 /*
 26  * KVM nVHE ELF section names are prefixed with .hyp, to separate them
 27  * from the kernel proper.
 28  */
 29 #define HYP_SECTION_NAME(NAME)  .hyp##NAME
 30 
 31 /* Symbol defined at the beginning of each hyp section. */
 32 #define HYP_SECTION_SYMBOL_NAME(NAME) \
 33         HYP_CONCAT(__hyp_section_, HYP_SECTION_NAME(NAME))
 34 
 35 /*
 36  * Helper to generate linker script statements starting a hyp section.
 37  *
 38  * A symbol with a well-known name is defined at the first byte. This
 39  * is used as a base for hyp relocations (see gen-hyprel.c). It must
 40  * be defined inside the section so the linker of `vmlinux` cannot
 41  * separate it from the section data.
 42  */
 43 #define BEGIN_HYP_SECTION(NAME)                         \
 44         HYP_SECTION_NAME(NAME) : {                      \
 45                 HYP_SECTION_SYMBOL_NAME(NAME) = .;
 46 
 47 /* Helper to generate linker script statements ending a hyp section. */
 48 #define END_HYP_SECTION                                 \
 49         }
 50 
 51 /* Defines an ELF hyp section from input section @NAME and its subsections. */
 52 #define HYP_SECTION(NAME)                       \
 53         BEGIN_HYP_SECTION(NAME)                 \
 54                 *(NAME NAME##.*)                \
 55         END_HYP_SECTION
 56 
 57 /*
 58  * Defines a linker script alias of a kernel-proper symbol referenced by
 59  * KVM nVHE hyp code.
 60  */
 61 #define KVM_NVHE_ALIAS(sym)     kvm_nvhe_sym(sym) = sym;
 62 
 63 /* Defines a linker script alias for KVM nVHE hyp symbols */
 64 #define KVM_NVHE_ALIAS_HYP(first, sec)  kvm_nvhe_sym(first) = kvm_nvhe_sym(sec);
 65 
 66 #endif /* LINKER_SCRIPT */
 67 
 68 #endif /* __ARM64_HYP_IMAGE_H__ */
 69 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php