summaryrefslogtreecommitdiffstats
path: root/arch/riscv/kernel/process.c
diff options
context:
space:
mode:
authorAlexandre Ghiti <alexghiti@rivosinc.com>2024-03-26 21:30:17 +0100
committerPalmer Dabbelt <palmer@rivosinc.com>2024-04-04 21:33:38 +0200
commita370c2419e4680a27382d9231edcf739d5d74efc (patch)
tree88cf0b14fd813909937e53855c0ea6cab8380288 /arch/riscv/kernel/process.c
parentriscv: Fix warning by declaring arch_cpu_idle() as noinstr (diff)
downloadlinux-a370c2419e4680a27382d9231edcf739d5d74efc.tar.xz
linux-a370c2419e4680a27382d9231edcf739d5d74efc.zip
riscv: Disable preemption when using patch_map()
patch_map() uses fixmap mappings to circumvent the non-writability of the kernel text mapping. The __set_fixmap() function only flushes the current cpu tlb, it does not emit an IPI so we must make sure that while we use a fixmap mapping, the current task is not migrated on another cpu which could miss the newly introduced fixmap mapping. So in order to avoid any task migration, disable the preemption. Reported-by: Andrea Parri <andrea@rivosinc.com> Closes: https://lore.kernel.org/all/ZcS+GAaM25LXsBOl@andrea/ Reported-by: Andy Chiu <andy.chiu@sifive.com> Closes: https://lore.kernel.org/linux-riscv/CABgGipUMz3Sffu-CkmeUB1dKVwVQ73+7=sgC45-m0AE9RCjOZg@mail.gmail.com/ Fixes: cad539baa48f ("riscv: implement a memset like function for text") Fixes: 0ff7c3b33127 ("riscv: Use text_mutex instead of patch_lock") Co-developed-by: Andy Chiu <andy.chiu@sifive.com> Signed-off-by: Andy Chiu <andy.chiu@sifive.com> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com> Acked-by: Puranjay Mohan <puranjay12@gmail.com> Link: https://lore.kernel.org/r/20240326203017.310422-3-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'arch/riscv/kernel/process.c')
0 files changed, 0 insertions, 0 deletions