提交 5d4cae5f 编写于 作者: R Russell King 提交者: Russell King

[ARM] VFP: fix section mismatch error

Fix a real section mismatch issue; the test code is thrown away after
initialisation, but if we do not detect the VFP hardware, it is left
hooked into the exception handler.  Any VFP instructions which are
subsequently executed risk calling the discarded exception handler.

Introduce a new "null" handler which returns to the "unrecognised
fault" return address.
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 845a2fdc
...@@ -29,6 +29,10 @@ do_vfp: ...@@ -29,6 +29,10 @@ do_vfp:
add r10, r10, #TI_VFPSTATE @ r10 = workspace add r10, r10, #TI_VFPSTATE @ r10 = workspace
ldr pc, [r4] @ call VFP entry point ldr pc, [r4] @ call VFP entry point
ENTRY(vfp_null_entry)
mov pc, lr
ENDPROC(vfp_null_entry)
.LCvfp: .LCvfp:
.word vfp_vector .word vfp_vector
......
...@@ -26,8 +26,9 @@ ...@@ -26,8 +26,9 @@
*/ */
void vfp_testing_entry(void); void vfp_testing_entry(void);
void vfp_support_entry(void); void vfp_support_entry(void);
void vfp_null_entry(void);
void (*vfp_vector)(void) = vfp_testing_entry; void (*vfp_vector)(void) = vfp_null_entry;
union vfp_state *last_VFP_context[NR_CPUS]; union vfp_state *last_VFP_context[NR_CPUS];
/* /*
...@@ -321,8 +322,10 @@ static int __init vfp_init(void) ...@@ -321,8 +322,10 @@ static int __init vfp_init(void)
* The handler is already setup to just log calls, so * The handler is already setup to just log calls, so
* we just need to read the VFPSID register. * we just need to read the VFPSID register.
*/ */
vfp_vector = vfp_testing_entry;
vfpsid = fmrx(FPSID); vfpsid = fmrx(FPSID);
barrier(); barrier();
vfp_vector = vfp_null_entry;
printk(KERN_INFO "VFP support v0.3: "); printk(KERN_INFO "VFP support v0.3: ");
if (VFP_arch) { if (VFP_arch) {
......
...@@ -4,4 +4,8 @@ ...@@ -4,4 +4,8 @@
#define __ALIGN .align 0 #define __ALIGN .align 0
#define __ALIGN_STR ".align 0" #define __ALIGN_STR ".align 0"
#define ENDPROC(name) \
.type name, %function; \
END(name)
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册