Merge tag 'pm-4.13-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
[linux/fpc-iii.git] / arch / x86 / include / asm / kasan.h
blobf527b02a0ee3c802d68161a8054a08b7e6ec3b4f
1 #ifndef _ASM_X86_KASAN_H
2 #define _ASM_X86_KASAN_H
4 #include <linux/const.h>
5 #define KASAN_SHADOW_OFFSET _AC(CONFIG_KASAN_SHADOW_OFFSET, UL)
7 /*
8 * Compiler uses shadow offset assuming that addresses start
9 * from 0. Kernel addresses don't start from 0, so shadow
10 * for kernel really starts from compiler's shadow offset +
11 * 'kernel address space start' >> KASAN_SHADOW_SCALE_SHIFT
13 #define KASAN_SHADOW_START (KASAN_SHADOW_OFFSET + \
14 ((-1UL << __VIRTUAL_MASK_SHIFT) >> 3))
16 * 47 bits for kernel address -> (47 - 3) bits for shadow
17 * 56 bits for kernel address -> (56 - 3) bits for shadow
19 #define KASAN_SHADOW_END (KASAN_SHADOW_START + (1ULL << (__VIRTUAL_MASK_SHIFT - 3)))
21 #ifndef __ASSEMBLY__
23 #ifdef CONFIG_KASAN
24 void __init kasan_early_init(void);
25 void __init kasan_init(void);
26 #else
27 static inline void kasan_early_init(void) { }
28 static inline void kasan_init(void) { }
29 #endif
31 #endif
33 #endif