mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 21:33:00 +00:00
920e277e17
Current definition of KASAN_SHADOW_OFFSET in include/linux/kasan.h will not work for upcomming arm64, so move it to the arch header. Signed-off-by: Andrey Ryabinin <ryabinin.a.a@gmail.com> Cc: Alexander Potapenko <glider@google.com> Cc: Alexey Klimov <klimov.linux@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: David Keitel <dkeitel@codeaurora.org> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rik van Riel <riel@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Will Deacon <will.deacon@arm.com> Cc: Yury <yury.norov@gmail.com> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mm@kvack.org Link: http://lkml.kernel.org/r/1439444244-26057-2-git-send-email-ryabinin.a.a@gmail.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
31 lines
838 B
C
31 lines
838 B
C
#ifndef _ASM_X86_KASAN_H
|
|
#define _ASM_X86_KASAN_H
|
|
|
|
#include <linux/const.h>
|
|
#define KASAN_SHADOW_OFFSET _AC(CONFIG_KASAN_SHADOW_OFFSET, UL)
|
|
|
|
/*
|
|
* Compiler uses shadow offset assuming that addresses start
|
|
* from 0. Kernel addresses don't start from 0, so shadow
|
|
* for kernel really starts from compiler's shadow offset +
|
|
* 'kernel address space start' >> KASAN_SHADOW_SCALE_SHIFT
|
|
*/
|
|
#define KASAN_SHADOW_START (KASAN_SHADOW_OFFSET + \
|
|
(0xffff800000000000ULL >> 3))
|
|
/* 47 bits for kernel address -> (47 - 3) bits for shadow */
|
|
#define KASAN_SHADOW_END (KASAN_SHADOW_START + (1ULL << (47 - 3)))
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
#ifdef CONFIG_KASAN
|
|
void __init kasan_early_init(void);
|
|
void __init kasan_init(void);
|
|
#else
|
|
static inline void kasan_early_init(void) { }
|
|
static inline void kasan_init(void) { }
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|