diff mbox

[3/3] arm: vfp: Bounce undefined instructions in vectored mode

Message ID 1411076592-6157-4-git-send-email-sboyd@codeaurora.org (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Stephen Boyd Sept. 18, 2014, 9:43 p.m. UTC
From: Stepan Moskovchenko <stepanm@codeaurora.org>

Certain ARM CPU implementations (e.g. Cortex-A15) may not raise a
floating- point exception whenever deprecated short-vector VFP
instructions are executed. Instead these instructions are treated
as UNALLOCATED. Change the VFP exception handling code to emulate
short-vector instructions even if FPEXC exception bits are not
set.

Tested-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Stepan Moskovchenko <stepanm@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
 arch/arm/vfp/vfphw.S | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Russell King - ARM Linux Sept. 18, 2014, 10:55 p.m. UTC | #1
On Thu, Sep 18, 2014 at 02:43:12PM -0700, Stephen Boyd wrote:
> From: Stepan Moskovchenko <stepanm@codeaurora.org>
> 
> Certain ARM CPU implementations (e.g. Cortex-A15) may not raise a
> floating- point exception whenever deprecated short-vector VFP
> instructions are executed. Instead these instructions are treated
> as UNALLOCATED. Change the VFP exception handling code to emulate
> short-vector instructions even if FPEXC exception bits are not
> set.

Purely out of interest, how much use do these instructions have in
real programs?
Will Deacon Sept. 19, 2014, 1:40 a.m. UTC | #2
On Thu, Sep 18, 2014 at 11:55:31PM +0100, Russell King - ARM Linux wrote:
> On Thu, Sep 18, 2014 at 02:43:12PM -0700, Stephen Boyd wrote:
> > From: Stepan Moskovchenko <stepanm@codeaurora.org>
> > 
> > Certain ARM CPU implementations (e.g. Cortex-A15) may not raise a
> > floating- point exception whenever deprecated short-vector VFP
> > instructions are executed. Instead these instructions are treated
> > as UNALLOCATED. Change the VFP exception handling code to emulate
> > short-vector instructions even if FPEXC exception bits are not
> > set.
> 
> Purely out of interest, how much use do these instructions have in
> real programs?

They're seldom used, but there are apps in the app store that use short
vectors to play music.

Will
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
index be807625ed8c..c041579a8d82 100644
--- a/arch/arm/vfp/vfphw.S
+++ b/arch/arm/vfp/vfphw.S
@@ -197,6 +197,12 @@  look_for_VFP_exceptions:
 	tst	r5, #FPSCR_IXE
 	bne	process_exception
 
+	tst	r5, #FPSCR_LENGTH_MASK
+	beq	skip
+	orr	r1, r1, #FPEXC_DEX
+	b process_exception
+skip:
+
 	@ Fall into hand on to next handler - appropriate coproc instr
 	@ not recognised by VFP