Skip to content

Commit d8a3693

Browse files
chleroygregkh
authored andcommitted
powerpc/32: Fix unpaired stwcx. on interrupt exit
[ Upstream commit 10e1c77 ] Commit b96bae3 ("powerpc/32: Replace ASM exception exit by C exception exit from ppc64") erroneouly copied to powerpc/32 the logic from powerpc/64 based on feature CPU_FTR_STCX_CHECKS_ADDRESS which is always 0 on powerpc/32. Re-instate the logic implemented by commit b64f87c ("[POWERPC] Avoid unpaired stwcx. on some processors") which is based on CPU_FTR_NEED_PAIRED_STWCX feature. Fixes: b96bae3 ("powerpc/32: Replace ASM exception exit by C exception exit from ppc64") Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/6040b5dbcf5cdaa1cd919fcf0790f12974ea6e5a.1757666244.git.christophe.leroy@csgroup.eu Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent d8c5734 commit d8a3693

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

arch/powerpc/kernel/entry_32.S

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,9 @@ interrupt_return:
263263
mtspr SPRN_SRR1,r12
264264

265265
BEGIN_FTR_SECTION
266+
lwarx r0,0,r1
267+
END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
266268
stwcx. r0,0,r1 /* to clear the reservation */
267-
FTR_SECTION_ELSE
268-
lwarx r0,0,r1
269-
ALT_FTR_SECTION_END_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS)
270269

271270
lwz r3,_CCR(r1)
272271
lwz r4,_LINK(r1)
@@ -306,10 +305,9 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS)
306305
mtspr SPRN_SRR1,r12
307306

308307
BEGIN_FTR_SECTION
308+
lwarx r0,0,r1
309+
END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
309310
stwcx. r0,0,r1 /* to clear the reservation */
310-
FTR_SECTION_ELSE
311-
lwarx r0,0,r1
312-
ALT_FTR_SECTION_END_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS)
313311

314312
lwz r3,_LINK(r1)
315313
lwz r4,_CTR(r1)

0 commit comments

Comments
 (0)