1
linux/mm/kasan
Bibo Mao d2f8671045 LoongArch: Set initial pte entry with PAGE_GLOBAL for kernel space
There are two pages in one TLB entry on LoongArch system. For kernel
space, it requires both two pte entries (buddies) with PAGE_GLOBAL bit
set, otherwise HW treats it as non-global tlb, there will be potential
problems if tlb entry for kernel space is not global. Such as fail to
flush kernel tlb with the function local_flush_tlb_kernel_range() which
supposed only flush tlb with global bit.

Kernel address space areas include percpu, vmalloc, vmemmap, fixmap and
kasan areas. For these areas both two consecutive page table entries
should be enabled with PAGE_GLOBAL bit. So with function set_pte() and
pte_clear(), pte buddy entry is checked and set besides its own pte
entry. However it is not atomic operation to set both two pte entries,
there is problem with test_vmalloc test case.

So function kernel_pte_init() is added to init a pte table when it is
created for kernel address space, and the default initial pte value is
PAGE_GLOBAL rather than zero at beginning. Then only its own pte entry
need update with function set_pte() and pte_clear(), nothing to do with
the pte buddy entry.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2024-10-21 22:11:19 +08:00
..
common.c slub: Introduce CONFIG_SLUB_RCU_DEBUG 2024-08-27 14:12:51 +02:00
generic.c slab changes for 6.9 2024-03-12 20:14:54 -07:00
hw_tags.c fix missing vmalloc.h includes 2024-04-25 20:55:49 -07:00
init.c LoongArch: Set initial pte entry with PAGE_GLOBAL for kernel space 2024-10-21 22:11:19 +08:00
kasan_test_c.c Rust changes for v6.12 2024-09-25 10:25:40 -07:00
kasan_test_module.c kasan: rename test_kasan_module_init to kasan_test_module_init 2024-02-22 10:24:53 -08:00
kasan_test_rust.rs kasan: rust: Add KASAN smoke test via UAF 2024-09-16 18:04:37 +02:00
kasan.h kasan: rust: Add KASAN smoke test via UAF 2024-09-16 18:04:37 +02:00
Makefile kasan: rust: Add KASAN smoke test via UAF 2024-09-16 18:04:37 +02:00
quarantine.c kasan: revert eviction of stack traces in generic mode 2024-02-23 17:27:12 -08:00
report_generic.c
report_hw_tags.c
report_sw_tags.c
report_tags.c
report.c kasan: increase the number of bits to shift when recording extra timestamps 2024-02-22 15:27:20 -08:00
shadow.c mm/kasan: use pXd_leaf() in shadow_mapped() 2024-03-06 13:04:19 -08:00
sw_tags.c
tags.c