Skip to content

Commit b8c6a93

Browse files
oohalgregkh
authored andcommitted
powerpc/asm: Mark cr0 as clobbered in mftb()
commit 2400fd8 upstream. The workaround for the CELL timebase bug does not correctly mark cr0 as being clobbered. This means GCC doesn't know that the asm block changes cr0 and might leave the result of an unrelated comparison in cr0 across the block, which we then trash, leading to basically random behaviour. Fixes: 859deea ("[POWERPC] Cell timebase bug workaround") Signed-off-by: Oliver O'Halloran <[email protected]> [mpe: Tweak change log and flag for stable] Signed-off-by: Michael Ellerman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 79afeb3 commit b8c6a93

File tree

1 file changed

+1
-1
lines changed
  • arch/powerpc/include/asm

1 file changed

+1
-1
lines changed

arch/powerpc/include/asm/reg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@ static inline unsigned long mfvtb (void)
12361236
" .llong 0\n" \
12371237
".previous" \
12381238
: "=r" (rval) \
1239-
: "i" (CPU_FTR_CELL_TB_BUG), "i" (SPRN_TBRL)); \
1239+
: "i" (CPU_FTR_CELL_TB_BUG), "i" (SPRN_TBRL) : "cr0"); \
12401240
rval;})
12411241
#else
12421242
#define mftb() ({unsigned long rval; \

0 commit comments

Comments
 (0)