提交 2400fd82 编写于 作者: O Oliver O'Halloran 提交者: Michael Ellerman

powerpc/asm: Mark cr0 as clobbered in mftb()

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: 859deea9 ("[POWERPC] Cell timebase bug workaround")
Cc: stable@vger.kernel.org # v2.6.19+
Signed-off-by: NOliver O'Halloran <oohall@gmail.com>
[mpe: Tweak change log and flag for stable]
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 41d0c2ec
...@@ -1303,7 +1303,7 @@ static inline void msr_check_and_clear(unsigned long bits) ...@@ -1303,7 +1303,7 @@ static inline void msr_check_and_clear(unsigned long bits)
" .llong 0\n" \ " .llong 0\n" \
".previous" \ ".previous" \
: "=r" (rval) \ : "=r" (rval) \
: "i" (CPU_FTR_CELL_TB_BUG), "i" (SPRN_TBRL)); \ : "i" (CPU_FTR_CELL_TB_BUG), "i" (SPRN_TBRL) : "cr0"); \
rval;}) rval;})
#else #else
#define mftb() ({unsigned long rval; \ #define mftb() ({unsigned long rval; \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册