Re: [PATCH v9 2/4] LoongArch: Add kprobe support

From: Tiezhu Yang
Date: Fri Dec 09 2022 - 02:04:44 EST




On 12/09/2022 10:22 AM, Huacai Chen wrote:
cas

On Thu, Dec 8, 2022 at 9:41 PM Tiezhu Yang <yangtiezhu@xxxxxxxxxxx> wrote:

Kprobes allows you to trap at almost any kernel address and
execute a callback function, this commit adds kprobe support
for LoongArch.

...

+ case KPROBE_HIT_ACTIVE:
+ case KPROBE_HIT_SSDONE:
+ /*
+ * In case the user-specified fault handler returned
+ * zero, try to fix up.
+ */
+ if (fixup_exception(regs))
+ return true;
Does here need to enable preemption too?


No need, because in this two case, after call fixup_exception() or
do_page_fault(), the original process will continue, preemption will
be enabled in the original process.

Thanks,
Tiezhu