aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
diff options
context:
space:
mode:
authorTiezhu Yang <[email protected]>2025-04-24 12:15:41 +0000
committerHuacai Chen <[email protected]>2025-04-26 01:58:12 +0000
commitcc73cc6bcdb5f959670e3ff9abdc62461452ddff (patch)
treea3249f3f925773cf283f96b627cea8630dc4f0e3 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
parentLoongArch: Make regs_irqs_disabled() more clear (diff)
downloadkernel-cc73cc6bcdb5f959670e3ff9abdc62461452ddff.tar.gz
kernel-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 <[email protected]> Suggested-by: Huacai Chen <[email protected]> Co-developed-by: Tianyang Zhang <[email protected]> Signed-off-by: Tianyang Zhang <[email protected]> Signed-off-by: Tiezhu Yang <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
0 files changed, 0 insertions, 0 deletions