]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: kprobes: Restore local irqflag if kprobes is cancelled
authorJisheng Zhang <Jisheng.Zhang@synaptics.com>
Mon, 12 Apr 2021 09:41:01 +0000 (17:41 +0800)
committerWill Deacon <will@kernel.org>
Tue, 13 Apr 2021 08:30:16 +0000 (09:30 +0100)
commit24f9cf40cdb5dd8d9ad415e8c81f899951dfb54c
tree7416515cdf399615f7db1f154dac49e0b8ee8665
parent56c42a9244108aafd2f98d7472b1a1e4fc7d19c0
arm64: kprobes: Restore local irqflag if kprobes is cancelled

If instruction being single stepped caused a page fault, the kprobes
is cancelled to let the page fault handler continue as a normal page
fault. But the local irqflags are disabled so cpu will restore pstate
with DAIF masked. After pagefault is serviced, the kprobes is
triggerred again, we overwrite the saved_irqflag by calling
kprobes_save_local_irqflag(). NOTE, DAIF is masked in this new saved
irqflag. After kprobes is serviced, the cpu pstate is retored with
DAIF masked.

This patch is inspired by one patch for riscv from Liao Chang.

Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Link: https://lore.kernel.org/r/20210412174101.6bfb0594@xhacker.debian
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/probes/kprobes.c