[PW_SID:1126321] mm/sparse-vmemmap: flush_cache_vmap() after hotplugging vmemmap#2267
[PW_SID:1126321] mm/sparse-vmemmap: flush_cache_vmap() after hotplugging vmemmap#2267linux-riscv-bot wants to merge 3 commits into
Conversation
None of the code relating to mark_new_valid_map() does anything useful without CONFIG_64BIT=y && CONFIG_MMU=y, because the new_valid_map_cpus_check code is only used if CONFIG_64BIT, and the exception codes checked there can only happen with CONFIG_MMU=y. Therefore, make these conditional on CONFIG_64BIT=y && CONFIG_MMU=y to simplify programming, since we do not have to handle CONFIG_MMU=n when changing this code in the future. This also removes some unused code on the entry path for CONFIG_MMU=n. Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
section_activate() does not flush TLB after populating new vmemmap pages. On most architectures, this is okay. However it is a problem on RISC-V since there the TLB caching non-present entries is permitted, which causes spurious faults on some hardwares. This seems to be most easily reproduced with DEBUG_VM=y and PAGE_POISONING=y, which causes these newly mapped struct pages to be poisoned i.e. written to immediately after mapping. Extend the RISC-V flush_cache_vmap() to also handle the vmemmap range, and call it after hotplugging vmemmap, which gets the possible spurious fault handled in the exception handler. At least for now, the only other architecture with both SPARSEMEM_VMEMMAP and flush_cache_vmap() is PowerPC, which has a similar problem with newly valid PTEs. But there flush_cache_vmap() is just a ptesync. So it should be safe to do this for generic code while having minimal performance impact. Suggested-by: Muchun Song <muchun.song@linux.dev> Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn> Reviewed-by: Muchun Song <muchun.song@linux.dev> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v6,1/2] riscv: mm: Make mark_new_valid_map() stuff depend on 64BIT && MMU" |
|
Patch 1: "[v6,1/2] riscv: mm: Make mark_new_valid_map() stuff depend on 64BIT && MMU" |
|
Patch 1: "[v6,1/2] riscv: mm: Make mark_new_valid_map() stuff depend on 64BIT && MMU" |
|
Patch 1: "[v6,1/2] riscv: mm: Make mark_new_valid_map() stuff depend on 64BIT && MMU" |
|
Patch 1: "[v6,1/2] riscv: mm: Make mark_new_valid_map() stuff depend on 64BIT && MMU" |
|
Patch 1: "[v6,1/2] riscv: mm: Make mark_new_valid_map() stuff depend on 64BIT && MMU" |
|
Patch 1: "[v6,1/2] riscv: mm: Make mark_new_valid_map() stuff depend on 64BIT && MMU" |
|
Patch 1: "[v6,1/2] riscv: mm: Make mark_new_valid_map() stuff depend on 64BIT && MMU" |
|
Patch 1: "[v6,1/2] riscv: mm: Make mark_new_valid_map() stuff depend on 64BIT && MMU" |
|
Patch 1: "[v6,1/2] riscv: mm: Make mark_new_valid_map() stuff depend on 64BIT && MMU" |
|
Patch 1: "[v6,1/2] riscv: mm: Make mark_new_valid_map() stuff depend on 64BIT && MMU" |
|
Patch 1: "[v6,1/2] riscv: mm: Make mark_new_valid_map() stuff depend on 64BIT && MMU" |
|
Patch 2: "[v6,2/2] mm/sparse-vmemmap: flush_cache_vmap() after hotplugging vmemmap" |
|
Patch 2: "[v6,2/2] mm/sparse-vmemmap: flush_cache_vmap() after hotplugging vmemmap" |
|
Patch 2: "[v6,2/2] mm/sparse-vmemmap: flush_cache_vmap() after hotplugging vmemmap" |
|
Patch 2: "[v6,2/2] mm/sparse-vmemmap: flush_cache_vmap() after hotplugging vmemmap" |
|
Patch 2: "[v6,2/2] mm/sparse-vmemmap: flush_cache_vmap() after hotplugging vmemmap" |
|
Patch 2: "[v6,2/2] mm/sparse-vmemmap: flush_cache_vmap() after hotplugging vmemmap" |
|
Patch 2: "[v6,2/2] mm/sparse-vmemmap: flush_cache_vmap() after hotplugging vmemmap" |
|
Patch 2: "[v6,2/2] mm/sparse-vmemmap: flush_cache_vmap() after hotplugging vmemmap" |
|
Patch 2: "[v6,2/2] mm/sparse-vmemmap: flush_cache_vmap() after hotplugging vmemmap" |
|
Patch 2: "[v6,2/2] mm/sparse-vmemmap: flush_cache_vmap() after hotplugging vmemmap" |
|
Patch 2: "[v6,2/2] mm/sparse-vmemmap: flush_cache_vmap() after hotplugging vmemmap" |
|
Patch 2: "[v6,2/2] mm/sparse-vmemmap: flush_cache_vmap() after hotplugging vmemmap" |
da477a6 to
869345e
Compare
PR for series 1126321 applied to workflow__riscv__fixes
Name: mm/sparse-vmemmap: flush_cache_vmap() after hotplugging vmemmap
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1126321
Version: 6