diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2017-07-06 18:46:43 +1000 |
---|---|---|
committer | Sasha Levin <alexander.levin@verizon.com> | 2017-09-10 10:59:16 -0400 |
commit | f8340dda9b3a62a26a4e3510379effe180f3f9cc (patch) | |
tree | ea76a1ed74fed07688a517a5d7ad8758eae03291 /arch | |
parent | 726f177c91c5185155e5c5cd79cab05bc247a6fd (diff) |
powerpc/asm: Mark cr0 as clobbered in mftb()
[ Upstream commit 2400fd822f467cb4c886c879d8ad99feac9cf319 ]
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: 859deea949c3 ("[POWERPC] Cell timebase bug workaround")
Cc: stable@vger.kernel.org # v2.6.19+
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
[mpe: Tweak change log and flag for stable]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/include/asm/reg.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index a4bf6e0eb813..e97e58e28668 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h @@ -1237,7 +1237,7 @@ static inline unsigned long mfvtb (void) " .llong 0\n" \ ".previous" \ : "=r" (rval) \ - : "i" (CPU_FTR_CELL_TB_BUG), "i" (SPRN_TBRL)); \ + : "i" (CPU_FTR_CELL_TB_BUG), "i" (SPRN_TBRL) : "cr0"); \ rval;}) #else #define mftb() ({unsigned long rval; \ |