Floating-point faults and exceptions can happen in the kernel too.
Do not panic when it happens; handle them. Run into by: das
This commit is contained in:
parent
deb118f7cc
commit
2319c1d288
@ -668,11 +668,10 @@ trap(int vector, struct trapframe *tf)
|
|||||||
FPSWA_BUNDLE bundle;
|
FPSWA_BUNDLE bundle;
|
||||||
char *ip;
|
char *ip;
|
||||||
|
|
||||||
/* Always fatal in kernel. Should never happen. */
|
if (fpswa_interface == NULL) {
|
||||||
if (!user)
|
if (!user)
|
||||||
trap_panic(vector, tf);
|
trap_panic(vector, tf);
|
||||||
|
|
||||||
if (fpswa_interface == NULL) {
|
|
||||||
sig = SIGFPE;
|
sig = SIGFPE;
|
||||||
ucode = 0;
|
ucode = 0;
|
||||||
break;
|
break;
|
||||||
@ -682,12 +681,15 @@ trap(int vector, struct trapframe *tf)
|
|||||||
if (vector == IA64_VEC_FLOATING_POINT_TRAP &&
|
if (vector == IA64_VEC_FLOATING_POINT_TRAP &&
|
||||||
(tf->tf_special.psr & IA64_PSR_RI) == 0)
|
(tf->tf_special.psr & IA64_PSR_RI) == 0)
|
||||||
ip -= 16;
|
ip -= 16;
|
||||||
|
if (user) {
|
||||||
error = copyin(ip, &bundle, 16);
|
error = copyin(ip, &bundle, 16);
|
||||||
if (error) {
|
if (error) {
|
||||||
sig = SIGBUS; /* EFAULT, basically */
|
sig = SIGBUS; /* EFAULT, basically */
|
||||||
ucode = 0; /* exception summary */
|
ucode = 0; /* exception summary */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} else
|
||||||
|
bcopy(ip, &bundle, 16);
|
||||||
|
|
||||||
/* f6-f15 are saved in exception_save */
|
/* f6-f15 are saved in exception_save */
|
||||||
fp_state.bitmask_low64 = 0xffc0; /* bits 6 - 15 */
|
fp_state.bitmask_low64 = 0xffc0; /* bits 6 - 15 */
|
||||||
@ -739,11 +741,12 @@ trap(int vector, struct trapframe *tf)
|
|||||||
printf("FATAL: FPSWA err1 %lx, err2 %lx, err3 %lx\n",
|
printf("FATAL: FPSWA err1 %lx, err2 %lx, err3 %lx\n",
|
||||||
fpswa_ret.err1, fpswa_ret.err2, fpswa_ret.err3);
|
fpswa_ret.err1, fpswa_ret.err2, fpswa_ret.err3);
|
||||||
panic("fpswa fatal error on fp fault");
|
panic("fpswa fatal error on fp fault");
|
||||||
} else {
|
} else if (user) {
|
||||||
sig = SIGFPE;
|
sig = SIGFPE;
|
||||||
ucode = 0; /* XXX exception summary */
|
ucode = 0; /* XXX exception summary */
|
||||||
break;
|
break;
|
||||||
}
|
} else
|
||||||
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
case IA64_VEC_IA32_EXCEPTION:
|
case IA64_VEC_IA32_EXCEPTION:
|
||||||
|
Loading…
Reference in New Issue
Block a user