1 /* SPDX-License-Identifier: GPL-2.0 */ 1 2 /* Copyright (C) 2019 Andes Technology Corpora 3 4 #ifndef __ASM_KASAN_H 5 #define __ASM_KASAN_H 6 7 #ifndef __ASSEMBLY__ 8 9 /* 10 * The following comment was copied from arm64 11 * KASAN_SHADOW_START: beginning of the kernel 12 * KASAN_SHADOW_END: KASAN_SHADOW_START + 1/N 13 * where N = (1 << KASAN_SHADOW_SCALE_SHIFT). 14 * 15 * KASAN_SHADOW_OFFSET: 16 * This value is used to map an address to the 17 * address by the following formula: 18 * shadow_addr = (address >> KASAN_SHADOW_ 19 * 20 * (1 << (64 - KASAN_SHADOW_SCALE_SHIFT)) shad 21 * [KASAN_SHADOW_OFFSET, KASAN_SHADOW_END) cov 22 * addresses. So KASAN_SHADOW_OFFSET should sa 23 * KASAN_SHADOW_OFFSET = KASAN_SHADOW_END 24 * (1ULL << (64 - 25 */ 26 #define KASAN_SHADOW_SCALE_SHIFT 3 27 28 #define KASAN_SHADOW_SIZE (UL(1) << ((VA 29 /* 30 * Depending on the size of the virtual addres 31 * aligned on PGDIR_SIZE, so force its alignme 32 */ 33 #define KASAN_SHADOW_START ((KASAN_SHADOW 34 #define KASAN_SHADOW_END MODULES_LOWEST 35 36 #ifdef CONFIG_KASAN 37 #define KASAN_SHADOW_OFFSET _AC(CONFIG_KAS 38 39 void kasan_init(void); 40 asmlinkage void kasan_early_init(void); 41 void kasan_swapper_init(void); 42 43 #endif 44 #endif 45 #endif /* __ASM_KASAN_H */ 46
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.