1 #ifndef _LINUX_KAISER_H
2 #define _LINUX_KAISER_H
4 #ifdef CONFIG_PAGE_TABLE_ISOLATION
5 #include <asm/kaiser.h>
7 static inline int kaiser_map_thread_stack(void *stack)
10 * Map that page of kernel stack on which we enter from user context.
12 return kaiser_add_mapping((unsigned long)stack +
13 THREAD_SIZE - PAGE_SIZE, PAGE_SIZE, __PAGE_KERNEL);
16 static inline void kaiser_unmap_thread_stack(void *stack)
19 * Note: may be called even when kaiser_map_thread_stack() failed.
21 kaiser_remove_mapping((unsigned long)stack +
22 THREAD_SIZE - PAGE_SIZE, PAGE_SIZE);
27 * These stubs are used whenever CONFIG_PAGE_TABLE_ISOLATION is off, which
28 * includes architectures that support KAISER, but have it disabled.
31 static inline void kaiser_init(void)
34 static inline int kaiser_add_mapping(unsigned long addr,
35 unsigned long size, u64 flags)
39 static inline void kaiser_remove_mapping(unsigned long start,
43 static inline int kaiser_map_thread_stack(void *stack)
47 static inline void kaiser_unmap_thread_stack(void *stack)
51 #endif /* !CONFIG_PAGE_TABLE_ISOLATION */
52 #endif /* _LINUX_KAISER_H */