]> www.infradead.org Git - users/willy/pagecache.git/commitdiff
csky: fix csky_cmpxchg_fixup not working
authorYang Li <yang.li85200@gmail.com>
Wed, 16 Oct 2024 09:56:26 +0000 (17:56 +0800)
committerGuo Ren <guoren@linux.alibaba.com>
Mon, 28 Oct 2024 03:06:19 +0000 (23:06 -0400)
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>
arch/csky/mm/fault.c

index a885518ce1dd285671e1e06d548cd91aa7f855f5..5226bc08c336097f74fb87dcce5cf0e9bf0f3c4c 100644 (file)
@@ -45,8 +45,8 @@ static inline void csky_cmpxchg_fixup(struct pt_regs *regs)
        if (trap_no(regs) != VEC_TLBMODIFIED)
                return;
 
-       if (instruction_pointer(regs) == csky_cmpxchg_stw)
-               instruction_pointer_set(regs, csky_cmpxchg_ldw);
+       if (instruction_pointer(regs) == (unsigned long)&csky_cmpxchg_stw)
+               instruction_pointer_set(regs, (unsigned long)&csky_cmpxchg_ldw);
        return;
 }
 #endif