Skip to content

Commit 4a0548c

Browse files
committed
ARM: vfp: Remove workaround for Feroceon CPUs
Feroceon CPUs have a non-standard implementation of VFP which reports synchronous VFP exceptions using the async VFP flag. This requires a workaround which is difficult to reconcile with other implementations, making it tricky to support both versions in a single image. Since this is a v5 CPU, it is not supported by armhf and so the likelihood that anybody is using this with recent distros/kernels and rely on the VFP at the same time is extremely low. So let's just disable VFP support on these cores, so we can remove the workaround. This will help future development to support v5 and v6 CPUs with a single kernel image. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Nicolas Pitre <nico@fluxnic.net> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
1 parent 8769177 commit 4a0548c

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

arch/arm/mm/proc-feroceon.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ ENTRY(cpu_feroceon_proc_init)
5656
movne r2, r2, lsr #2 @ turned into # of sets
5757
sub r2, r2, #(1 << 5)
5858
stmia r1, {r2, r3}
59+
#ifdef CONFIG_VFP
60+
mov r1, #1 @ disable quirky VFP
61+
str_l r1, VFP_arch_feroceon, r2
62+
#endif
5963
ret lr
6064

6165
/*

arch/arm/vfp/vfphw.S

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,13 @@ ENTRY(vfp_support_entry)
110110
beq vfp_reload_hw @ then the hw state needs reloading
111111
VFPFSTMIA r4, r5 @ save the working registers
112112
VFPFMRX r5, FPSCR @ current status
113-
#ifndef CONFIG_CPU_FEROCEON
114113
tst r1, #FPEXC_EX @ is there additional state to save?
115114
beq 1f
116115
VFPFMRX r6, FPINST @ FPINST (only if FPEXC.EX is set)
117116
tst r1, #FPEXC_FP2V @ is there an FPINST2 to read?
118117
beq 1f
119118
VFPFMRX r8, FPINST2 @ FPINST2 if needed (and present)
120119
1:
121-
#endif
122120
stmia r4, {r1, r5, r6, r8} @ save FPEXC, FPSCR, FPINST, FPINST2
123121
vfp_reload_hw:
124122

@@ -153,15 +151,13 @@ vfp_reload_hw:
153151
VFPFLDMIA r10, r5 @ reload the working registers while
154152
@ FPEXC is in a safe state
155153
ldmia r10, {r1, r5, r6, r8} @ load FPEXC, FPSCR, FPINST, FPINST2
156-
#ifndef CONFIG_CPU_FEROCEON
157154
tst r1, #FPEXC_EX @ is there additional state to restore?
158155
beq 1f
159156
VFPFMXR FPINST, r6 @ restore FPINST (only if FPEXC.EX is set)
160157
tst r1, #FPEXC_FP2V @ is there an FPINST2 to write?
161158
beq 1f
162159
VFPFMXR FPINST2, r8 @ FPINST2 if needed (and present)
163160
1:
164-
#endif
165161
VFPFMXR FPSCR, r5 @ restore status
166162

167163
@ The context stored in the VFP hardware is up to date with this thread

arch/arm/vfp/vfpmodule.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ static bool have_vfp __ro_after_init;
4242
* Used in startup: set to non-zero if VFP checks fail
4343
* After startup, holds VFP architecture
4444
*/
45-
static unsigned int __initdata VFP_arch;
45+
static unsigned int VFP_arch;
46+
47+
#ifdef CONFIG_CPU_FEROCEON
48+
extern unsigned int VFP_arch_feroceon __alias(VFP_arch);
49+
#endif
4650

4751
/*
4852
* The pointer to the vfpstate structure of the thread which currently
@@ -357,14 +361,12 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
357361
}
358362

359363
if (fpexc & FPEXC_EX) {
360-
#ifndef CONFIG_CPU_FEROCEON
361364
/*
362365
* Asynchronous exception. The instruction is read from FPINST
363366
* and the interrupted instruction has to be restarted.
364367
*/
365368
trigger = fmrx(FPINST);
366369
regs->ARM_pc -= 4;
367-
#endif
368370
} else if (!(fpexc & FPEXC_DEX)) {
369371
/*
370372
* Illegal combination of bits. It can be caused by an

0 commit comments

Comments
 (0)