ARM: vfp: Use vfp_lock() in vfp_support_entry().

BugLink: https://bugs.launchpad.net/bugs/2060704

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_lock() for uninterrupted access.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Kevin Becker <kevin.becker@canonical.com>
This commit is contained in:
Sebastian Andrzej Siewior
2023-06-28 09:36:10 +02:00
committed by Kevin Becker
parent 6fee72ac5f
commit e76cd4c7ce
+3 -3
View File
@@ -708,7 +708,7 @@ static int vfp_support_entry(struct pt_regs *regs, u32 trigger)
if (!user_mode(regs))
return vfp_kmode_exception(regs, trigger);
local_bh_disable();
vfp_lock();
fpexc = fmrx(FPEXC);
/*
@@ -787,7 +787,7 @@ static int vfp_support_entry(struct pt_regs *regs, u32 trigger)
if (!(fpscr & FPSCR_IXE)) {
if (!(fpscr & FPSCR_LENGTH_MASK)) {
pr_debug("not VFP\n");
local_bh_enable();
vfp_unlock();
return -ENOEXEC;
}
fpexc |= FPEXC_DEX;
@@ -797,7 +797,7 @@ bounce: regs->ARM_pc += 4;
VFP_bounce(trigger, fpexc, regs);
}
local_bh_enable();
vfp_unlock();
return 0;
}