hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/alpha/kernel/traps.c
....@@ -192,7 +192,7 @@
192192 local_irq_enable();
193193 while (1);
194194 }
195
- do_exit(SIGSEGV);
195
+ make_task_dead(SIGSEGV);
196196 }
197197
198198 #ifndef CONFIG_MATHEMU
....@@ -235,7 +235,21 @@
235235 {
236236 int signo, code;
237237
238
- if ((regs->ps & ~IPL_MAX) == 0) {
238
+ if (type == 3) { /* FEN fault */
239
+ /* Irritating users can call PAL_clrfen to disable the
240
+ FPU for the process. The kernel will then trap in
241
+ do_switch_stack and undo_switch_stack when we try
242
+ to save and restore the FP registers.
243
+
244
+ Given that GCC by default generates code that uses the
245
+ FP registers, PAL_clrfen is not useful except for DoS
246
+ attacks. So turn the bleeding FPU back on and be done
247
+ with it. */
248
+ current_thread_info()->pcb.flags |= 1;
249
+ __reload_thread(&current_thread_info()->pcb);
250
+ return;
251
+ }
252
+ if (!user_mode(regs)) {
239253 if (type == 1) {
240254 const unsigned int *data
241255 = (const unsigned int *) regs->pc;
....@@ -367,20 +381,6 @@
367381 }
368382 }
369383 break;
370
-
371
- case 3: /* FEN fault */
372
- /* Irritating users can call PAL_clrfen to disable the
373
- FPU for the process. The kernel will then trap in
374
- do_switch_stack and undo_switch_stack when we try
375
- to save and restore the FP registers.
376
-
377
- Given that GCC by default generates code that uses the
378
- FP registers, PAL_clrfen is not useful except for DoS
379
- attacks. So turn the bleeding FPU back on and be done
380
- with it. */
381
- current_thread_info()->pcb.flags |= 1;
382
- __reload_thread(&current_thread_info()->pcb);
383
- return;
384384
385385 case 5: /* illoc */
386386 default: /* unexpected instruction-fault type */
....@@ -577,7 +577,7 @@
577577
578578 printk("Bad unaligned kernel access at %016lx: %p %lx %lu\n",
579579 pc, va, opcode, reg);
580
- do_exit(SIGSEGV);
580
+ make_task_dead(SIGSEGV);
581581
582582 got_exception:
583583 /* Ok, we caught the exception, but we don't want it. Is there
....@@ -632,7 +632,7 @@
632632 local_irq_enable();
633633 while (1);
634634 }
635
- do_exit(SIGSEGV);
635
+ make_task_dead(SIGSEGV);
636636 }
637637
638638 /*