kasan.h 838 B

123456789101112131415161718192021222324252627282930
  1. #ifndef _ASM_X86_KASAN_H
  2. #define _ASM_X86_KASAN_H
  3. #include <linux/const.h>
  4. #define KASAN_SHADOW_OFFSET _AC(CONFIG_KASAN_SHADOW_OFFSET, UL)
  5. /*
  6. * Compiler uses shadow offset assuming that addresses start
  7. * from 0. Kernel addresses don't start from 0, so shadow
  8. * for kernel really starts from compiler's shadow offset +
  9. * 'kernel address space start' >> KASAN_SHADOW_SCALE_SHIFT
  10. */
  11. #define KASAN_SHADOW_START (KASAN_SHADOW_OFFSET + \
  12. (0xffff800000000000ULL >> 3))
  13. /* 47 bits for kernel address -> (47 - 3) bits for shadow */
  14. #define KASAN_SHADOW_END (KASAN_SHADOW_START + (1ULL << (47 - 3)))
  15. #ifndef __ASSEMBLY__
  16. #ifdef CONFIG_KASAN
  17. void __init kasan_early_init(void);
  18. void __init kasan_init(void);
  19. #else
  20. static inline void kasan_early_init(void) { }
  21. static inline void kasan_init(void) { }
  22. #endif
  23. #endif
  24. #endif