Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

csky: fix csky_cmpxchg_fixup not working

In the csky_cmpxchg_fixup function, it is incorrect to use the global
variable csky_cmpxchg_stw to determine the address where the exception
occurred.The global variable csky_cmpxchg_stw stores the opcode at the
time of the exception, while &csky_cmpxchg_stw shows the address where
the exception occurred.

Signed-off-by: Yang Li <yang.li85200@gmail.com>
Signed-off-by: Guo Ren <guoren@kernel.org>

authored by

Yang Li and committed by
Guo Ren (Alibaba DAMO Academy)
809ef03d 3a866087

+2 -2
+2 -2
arch/csky/mm/fault.c
··· 45 45 if (trap_no(regs) != VEC_TLBMODIFIED) 46 46 return; 47 47 48 - if (instruction_pointer(regs) == csky_cmpxchg_stw) 49 - instruction_pointer_set(regs, csky_cmpxchg_ldw); 48 + if (instruction_pointer(regs) == (unsigned long)&csky_cmpxchg_stw) 49 + instruction_pointer_set(regs, (unsigned long)&csky_cmpxchg_ldw); 50 50 return; 51 51 } 52 52 #endif