Skip to content

Commit 27035c2

Browse files
Sebastian Andrzej SiewiorRussell King (Oracle)
authored andcommitted
ARM: 9425/1: vfp: Use vfp_state_hold() in vfp_support_entry().
vfp_entry() is invoked from exception handler and is fully preemptible. It uses local_bh_disable() to remain uninterrupted while checking the VFP state. This is not working on PREEMPT_RT because local_bh_disable() synchronizes the relevant section but the context remains fully preemptible. Use vfp_state_hold() for uninterrupted access. Reviewed-by: Ard Biesheuvel <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
1 parent b54cdba commit 27035c2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/arm/vfp/vfpmodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ static int vfp_support_entry(struct pt_regs *regs, u32 trigger)
708708
if (!user_mode(regs))
709709
return vfp_kmode_exception(regs, trigger);
710710

711-
local_bh_disable();
711+
vfp_state_hold();
712712
fpexc = fmrx(FPEXC);
713713

714714
/*
@@ -787,7 +787,7 @@ static int vfp_support_entry(struct pt_regs *regs, u32 trigger)
787787
if (!(fpscr & FPSCR_IXE)) {
788788
if (!(fpscr & FPSCR_LENGTH_MASK)) {
789789
pr_debug("not VFP\n");
790-
local_bh_enable();
790+
vfp_state_release();
791791
return -ENOEXEC;
792792
}
793793
fpexc |= FPEXC_DEX;
@@ -797,7 +797,7 @@ bounce: regs->ARM_pc += 4;
797797
VFP_bounce(trigger, fpexc, regs);
798798
}
799799

800-
local_bh_enable();
800+
vfp_state_release();
801801
return 0;
802802
}
803803

0 commit comments

Comments
 (0)