Commit 0072abfc authored by T.J. Purtell's avatar T.J. Purtell Committed by Jiri Slaby

ARM: 7880/1: Clear the IT state independent of the Thumb-2 mode

commit 6ecf830e upstream.

The ARM architecture reference specifies that the IT state bits in the
PSR must be all zeros in ARM mode or behavior is unspecified.  On the
Qualcomm Snapdragon S4/Krait architecture CPUs the processor continues
to consider the IT state bits while in ARM mode.  This makes it so
that some instructions are skipped by the CPU.
Signed-off-by: default avatarT.J. Purtell <tj@mobisocial.us>
[rmk+kernel@arm.linux.org.uk: fixed whitespace formatting in patch]
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent d5f1bab4
...@@ -375,12 +375,18 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig, ...@@ -375,12 +375,18 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig,
*/ */
thumb = handler & 1; thumb = handler & 1;
if (thumb) {
cpsr |= PSR_T_BIT;
#if __LINUX_ARM_ARCH__ >= 7 #if __LINUX_ARM_ARCH__ >= 7
/* clear the If-Then Thumb-2 execution state */ /*
cpsr &= ~PSR_IT_MASK; * Clear the If-Then Thumb-2 execution state
* ARM spec requires this to be all 000s in ARM mode
* Snapdragon S4/Krait misbehaves on a Thumb=>ARM
* signal transition without this.
*/
cpsr &= ~PSR_IT_MASK;
#endif #endif
if (thumb) {
cpsr |= PSR_T_BIT;
} else } else
cpsr &= ~PSR_T_BIT; cpsr &= ~PSR_T_BIT;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment