b506923ee4
This reverts commitd2a91cef9b
. This commit moved too much work in kasan_init(). The allocation of shadow pages has to be moved for the reason explained in that patch, but the allocation of page tables still need to be done before switching to the final hash table. First revert the incorrect commit, following patch redoes it properly. Fixes:d2a91cef9b
("powerpc/kasan: Fix shadow pages allocation failure") Cc: stable@vger.kernel.org Reported-by: Erhard F. <erhard_f@mailbox.org> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://bugzilla.kernel.org/show_bug.cgi?id=208181 Link: https://lore.kernel.org/r/3667deb0911affbf999b99f87c31c77d5e870cd2.1593690707.git.christophe.leroy@csgroup.eu
45 lines
1.2 KiB
C
45 lines
1.2 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __ASM_KASAN_H
|
|
#define __ASM_KASAN_H
|
|
|
|
#ifdef CONFIG_KASAN
|
|
#define _GLOBAL_KASAN(fn) _GLOBAL(__##fn)
|
|
#define _GLOBAL_TOC_KASAN(fn) _GLOBAL_TOC(__##fn)
|
|
#define EXPORT_SYMBOL_KASAN(fn) EXPORT_SYMBOL(__##fn)
|
|
#else
|
|
#define _GLOBAL_KASAN(fn) _GLOBAL(fn)
|
|
#define _GLOBAL_TOC_KASAN(fn) _GLOBAL_TOC(fn)
|
|
#define EXPORT_SYMBOL_KASAN(fn)
|
|
#endif
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
#include <asm/page.h>
|
|
|
|
#define KASAN_SHADOW_SCALE_SHIFT 3
|
|
|
|
#define KASAN_SHADOW_START (KASAN_SHADOW_OFFSET + \
|
|
(PAGE_OFFSET >> KASAN_SHADOW_SCALE_SHIFT))
|
|
|
|
#define KASAN_SHADOW_OFFSET ASM_CONST(CONFIG_KASAN_SHADOW_OFFSET)
|
|
|
|
#define KASAN_SHADOW_END (-(-KASAN_SHADOW_START >> KASAN_SHADOW_SCALE_SHIFT))
|
|
|
|
#ifdef CONFIG_KASAN
|
|
void kasan_early_init(void);
|
|
void kasan_mmu_init(void);
|
|
void kasan_init(void);
|
|
void kasan_late_init(void);
|
|
#else
|
|
static inline void kasan_init(void) { }
|
|
static inline void kasan_mmu_init(void) { }
|
|
static inline void kasan_late_init(void) { }
|
|
#endif
|
|
|
|
void kasan_update_early_region(unsigned long k_start, unsigned long k_end, pte_t pte);
|
|
int kasan_init_shadow_page_tables(unsigned long k_start, unsigned long k_end);
|
|
int kasan_init_region(void *start, size_t size);
|
|
|
|
#endif /* __ASSEMBLY */
|
|
#endif
|