Re: [alpha] cleanup opDEC workaround

From: Richard Henderson (rth@redhat.com)
Date: Tue Nov 20 2001 - 12:08:18 EST


On Tue, Nov 20, 2001 at 01:31:50PM +0300, Ivan Kokshaysky wrote:
> On Mon, Nov 19, 2001 at 11:23:55PM -0800, Richard Henderson wrote:
> > --- 2.4.15-7/arch/alpha/kernel/traps.c.~2~ Mon Nov 19 23:05:50 2001
> > +++ 2.4.15-7/arch/alpha/kernel/traps.c Mon Nov 19 23:07:32 2001
>
> It seems to be the wrong diff:

Oh, it depended on this one.

r~

--- 2.4.15-7/arch/alpha/kernel/traps.c.~1~ Mon Nov 19 23:03:26 2001
+++ 2.4.15-7/arch/alpha/kernel/traps.c Mon Nov 19 23:05:50 2001
@@ -20,6 +20,7 @@
 #include <asm/unaligned.h>
 #include <asm/sysinfo.h>
 #include <asm/hwrpb.h>
+#include <asm/mmu_context.h>
 
 #include "proto.h"
 
@@ -311,8 +312,22 @@ do_entIF(unsigned long type, unsigned lo
                         if (alpha_fp_emul(regs.pc-4))
                                 return;
                 }
- /* fallthrough as illegal instruction .. */
+ break;
+
               case 3: /* FEN fault */
+ /* Irritating users can call PAL_clrfen to disable the
+ FPU for the process. The kernel will then trap in
+ do_switch_stack and undo_switch_stack when we try
+ to save and restore the FP registers.
+
+ Given that GCC by default generates code that uses the
+ FP registers, PAL_clrfen is not useful except for DoS
+ attacks. So turn the bleeding FPU back on and be done
+ with it. */
+ current->thread.pal_flags |= 1;
+ __reload_thread(&current->thread);
+ return;
+
               case 5: /* illoc */
               default: /* unexpected instruction-fault type */
                       ;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Nov 23 2001 - 21:00:23 EST