OSDN Git Service

powerpc/asm: Mark cr0 as clobbered in mftb()
authorOliver O'Halloran <oohall@gmail.com>
Thu, 6 Jul 2017 08:46:43 +0000 (18:46 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jul 2017 22:06:05 +0000 (15:06 -0700)
commitb8c6a93837f0527a5cb4505cf90c83cc1538610e
tree1841244be89f7ded51e0339953a07471c5ea9f3f
parent79afeb379cf496cad4cb0aefb8ed4f9670a74f18
powerpc/asm: Mark cr0 as clobbered in mftb()

commit 2400fd822f467cb4c886c879d8ad99feac9cf319 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: 859deea949c3 ("[POWERPC] Cell timebase bug workaround")
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/include/asm/reg.h