Skip to content

Commit 10e1c77

Browse files
chleroymaddy-kerneldev
authored andcommitted
powerpc/32: Fix unpaired stwcx. on interrupt exit
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
1 parent 2997876 commit 10e1c77

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
@@ -275,10 +275,9 @@ interrupt_return:
275275
mtspr SPRN_SRR1,r12
276276

277277
BEGIN_FTR_SECTION
278+
lwarx r0,0,r1
279+
END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
278280
stwcx. r0,0,r1 /* to clear the reservation */
279-
FTR_SECTION_ELSE
280-
lwarx r0,0,r1
281-
ALT_FTR_SECTION_END_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS)
282281

283282
lwz r3,_CCR(r1)
284283
lwz r4,_LINK(r1)
@@ -319,10 +318,9 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS)
319318
mtspr SPRN_SRR1,r12
320319

321320
BEGIN_FTR_SECTION
321+
lwarx r0,0,r1
322+
END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
322323
stwcx. r0,0,r1 /* to clear the reservation */
323-
FTR_SECTION_ELSE
324-
lwarx r0,0,r1
325-
ALT_FTR_SECTION_END_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS)
326324

327325
lwz r3,_LINK(r1)
328326
lwz r4,_CTR(r1)

0 commit comments

Comments
 (0)