summaryrefslogtreecommitdiffstats
path: root/net/lapb/lapb_iface.c
diff options
context:
space:
mode:
authorTiezhu Yang <yangtiezhu@loongson.cn>2025-04-24 20:15:41 +0800
committerHuacai Chen <chenhuacai@loongson.cn>2025-04-26 09:58:12 +0800
commitcc73cc6bcdb5f959670e3ff9abdc62461452ddff (patch)
treea3249f3f925773cf283f96b627cea8630dc4f0e3 /net/lapb/lapb_iface.c
parentbb0511d59db9b3e40c8d51f0d151ccd0fd44071d (diff)
downloadlinux-cc73cc6bcdb5f959670e3ff9abdc62461452ddff.tar.gz
linux-cc73cc6bcdb5f959670e3ff9abdc62461452ddff.tar.bz2
linux-cc73cc6bcdb5f959670e3ff9abdc62461452ddff.zip
LoongArch: Make do_xyz() exception handlers more robust
Currently, interrupts need to be disabled before single-step mode is set, it requires that CSR_PRMD_PIE be cleared in save_local_irqflag() which is called by setup_singlestep(), this is reasonable. But in the first kprobe breakpoint exception, if the irq is enabled at the beginning of do_bp(), it will not be disabled at the end of do_bp() due to the CSR_PRMD_PIE has been cleared in save_local_irqflag(). So for this case, it may corrupt exception context when restoring the exception after do_bp() in handle_bp(), this is not reasonable. In order to restore exception safely in handle_bp(), it needs to ensure the irq is disabled at the end of do_bp(), so just add a local variable to record the original interrupt status in the parent context, then use it as the check condition to enable and disable irq in do_bp(). While at it, do the similar thing for other do_xyz() exception handlers to make them more robust. Fixes: 6d4cc40fb5f5 ("LoongArch: Add kprobes support") Suggested-by: Jinyang He <hejinyang@loongson.cn> Suggested-by: Huacai Chen <chenhuacai@loongson.cn> Co-developed-by: Tianyang Zhang <zhangtianyang@loongson.cn> Signed-off-by: Tianyang Zhang <zhangtianyang@loongson.cn> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'net/lapb/lapb_iface.c')
0 files changed, 0 insertions, 0 deletions