2017-11-17 21:29:13 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef __ASM_KASAN_H
|
|
|
|
#define __ASM_KASAN_H
|
|
|
|
|
|
|
|
#include <asm/pgtable.h>
|
|
|
|
|
|
|
|
#ifdef CONFIG_KASAN
|
|
|
|
|
|
|
|
#define KASAN_SHADOW_SCALE_SHIFT 3
|
2017-11-19 18:54:14 +08:00
|
|
|
#ifdef CONFIG_KASAN_S390_4_LEVEL_PAGING
|
|
|
|
#define KASAN_SHADOW_SIZE \
|
|
|
|
(_AC(1, UL) << (_REGION1_SHIFT - KASAN_SHADOW_SCALE_SHIFT))
|
|
|
|
#else
|
2017-11-17 21:29:13 +08:00
|
|
|
#define KASAN_SHADOW_SIZE \
|
|
|
|
(_AC(1, UL) << (_REGION2_SHIFT - KASAN_SHADOW_SCALE_SHIFT))
|
2017-11-19 18:54:14 +08:00
|
|
|
#endif
|
2017-11-19 18:39:39 +08:00
|
|
|
#define KASAN_SHADOW_OFFSET _AC(CONFIG_KASAN_SHADOW_OFFSET, UL)
|
2017-11-17 21:29:13 +08:00
|
|
|
#define KASAN_SHADOW_START KASAN_SHADOW_OFFSET
|
|
|
|
#define KASAN_SHADOW_END (KASAN_SHADOW_START + KASAN_SHADOW_SIZE)
|
|
|
|
|
|
|
|
extern void kasan_early_init(void);
|
|
|
|
extern void kasan_copy_shadow(pgd_t *dst);
|
2017-11-20 19:56:10 +08:00
|
|
|
extern void kasan_free_early_identity(void);
|
2017-11-17 21:29:13 +08:00
|
|
|
#else
|
|
|
|
static inline void kasan_early_init(void) { }
|
|
|
|
static inline void kasan_copy_shadow(pgd_t *dst) { }
|
2017-11-20 19:56:10 +08:00
|
|
|
static inline void kasan_free_early_identity(void) { }
|
2017-11-17 21:29:13 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|