Skip to content

Commit caa3cd5

Browse files
author
Vasily Gorbik
committed
s390/kfence: Split kfence pool into 4k mappings in arch_kfence_init_pool()
Since commit d08d4e7 ("s390/mm: use full 4KB page for 2KB PTE"), there is no longer any reason to avoid splitting the kfence pool into 4k mappings in arch_kfence_init_pool(). Remove the architecture-specific kfence_split_mapping(). Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
1 parent d93a855 commit caa3cd5

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

arch/s390/include/asm/kfence.h

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,17 @@
1111
void __kernel_map_pages(struct page *page, int numpages, int enable);
1212

1313
static __always_inline bool arch_kfence_init_pool(void)
14-
{
15-
return true;
16-
}
17-
18-
#define arch_kfence_test_address(addr) ((addr) & PAGE_MASK)
19-
20-
/*
21-
* Do not split kfence pool to 4k mapping with arch_kfence_init_pool(),
22-
* but earlier where page table allocations still happen with memblock.
23-
* Reason is that arch_kfence_init_pool() gets called when the system
24-
* is still in a limbo state - disabling and enabling bottom halves is
25-
* not yet allowed, but that is what our page_table_alloc() would do.
26-
*/
27-
static __always_inline void kfence_split_mapping(void)
2814
{
2915
#ifdef CONFIG_KFENCE
3016
unsigned long pool_pages = KFENCE_POOL_SIZE >> PAGE_SHIFT;
3117

3218
set_memory_4k((unsigned long)__kfence_pool, pool_pages);
3319
#endif
20+
return true;
3421
}
3522

23+
#define arch_kfence_test_address(addr) ((addr) & PAGE_MASK)
24+
3625
static inline bool kfence_protect_page(unsigned long addr, bool protect)
3726
{
3827
__kernel_map_pages(virt_to_page((void *)addr), 1, !protect);

arch/s390/mm/init.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ void __init mem_init(void)
175175
high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
176176

177177
pv_init();
178-
kfence_split_mapping();
179178

180179
/* this will put all low memory onto the freelists */
181180
memblock_free_all();

0 commit comments

Comments
 (0)