Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/fpu/math-emu: Remove !NO_UNDOC_CODE

We always want to support all FPU opcodes, including
undocumented ones. That define was fully justified ~20 years ago
but not today. Let's not complicate the code with it.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1440699330-1305-1-git-send-email-dvlasenk@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Denys Vlasenko and committed by
Ingo Molnar
73477bbb ef78f2a4

-36
-36
arch/x86/math-emu/fpu_entry.c
··· 40 40 41 41 #define __BAD__ FPU_illegal /* Illegal on an 80486, causes SIGILL */ 42 42 43 - #ifndef NO_UNDOC_CODE /* Un-documented FPU op-codes supported by default. */ 44 - 45 43 /* WARNING: These codes are not documented by Intel in their 80486 manual 46 44 and may not work on FPU clones or later Intel FPUs. */ 47 45 ··· 66 68 fdivr_, FPU_trigb, __BAD__, __BAD__, fdiv_i, __BAD__, fdivp_, __BAD__, 67 69 }; 68 70 69 - #else /* Support only documented FPU op-codes */ 70 - 71 - static FUNC const st_instr_table[64] = { 72 - fadd__, fld_i_, __BAD__, __BAD__, fadd_i, ffree_, faddp_, __BAD__, 73 - fmul__, fxch_i, __BAD__, __BAD__, fmul_i, __BAD__, fmulp_, __BAD__, 74 - fcom_st, fp_nop, __BAD__, __BAD__, __BAD__, fst_i_, __BAD__, __BAD__, 75 - fcompst, __BAD__, __BAD__, __BAD__, __BAD__, fstp_i, fcompp, __BAD__, 76 - fsub__, FPU_etc, __BAD__, finit_, fsubri, fucom_, fsubrp, fstsw_, 77 - fsubr_, fconst, fucompp, __BAD__, fsub_i, fucomp, fsubp_, __BAD__, 78 - fdiv__, FPU_triga, __BAD__, __BAD__, fdivri, __BAD__, fdivrp, __BAD__, 79 - fdivr_, FPU_trigb, __BAD__, __BAD__, fdiv_i, __BAD__, fdivp_, __BAD__, 80 - }; 81 - 82 - #endif /* NO_UNDOC_CODE */ 83 - 84 71 #define _NONE_ 0 /* Take no special action */ 85 72 #define _REG0_ 1 /* Need to check for not empty st(0) */ 86 73 #define _REGI_ 2 /* Need to check for not empty st(0) and st(rm) */ ··· 77 94 #define _REGIc 0 /* Compare st(0) and st(rm) */ 78 95 #define _REGIn 0 /* Uses st(0) and st(rm), but handle checks later */ 79 96 80 - #ifndef NO_UNDOC_CODE 81 - 82 - /* Un-documented FPU op-codes supported by default. (see above) */ 83 - 84 97 static u_char const type_table[64] = { 85 98 _REGI_, _NONE_, _null_, _null_, _REGIi, _REGi_, _REGIp, _REGi_, 86 99 _REGI_, _REGIn, _null_, _null_, _REGIi, _REGI_, _REGIp, _REGI_, ··· 87 108 _REGI_, _NONE_, _null_, _null_, _REGIi, _null_, _REGIp, _null_, 88 109 _REGI_, _NONE_, _null_, _null_, _REGIi, _null_, _REGIp, _null_ 89 110 }; 90 - 91 - #else /* Support only documented FPU op-codes */ 92 - 93 - static u_char const type_table[64] = { 94 - _REGI_, _NONE_, _null_, _null_, _REGIi, _REGi_, _REGIp, _null_, 95 - _REGI_, _REGIn, _null_, _null_, _REGIi, _null_, _REGIp, _null_, 96 - _REGIc, _NONE_, _null_, _null_, _null_, _REG0_, _null_, _null_, 97 - _REGIc, _null_, _null_, _null_, _null_, _REG0_, _REGIc, _null_, 98 - _REGI_, _NONE_, _null_, _NONE_, _REGIi, _REGIc, _REGIp, _NONE_, 99 - _REGI_, _NONE_, _REGIc, _null_, _REGIi, _REGIc, _REGIp, _null_, 100 - _REGI_, _NONE_, _null_, _null_, _REGIi, _null_, _REGIp, _null_, 101 - _REGI_, _NONE_, _null_, _null_, _REGIi, _null_, _REGIp, _null_ 102 - }; 103 - 104 - #endif /* NO_UNDOC_CODE */ 105 111 106 112 #ifdef RE_ENTRANT_CHECKING 107 113 u_char emulating = 0;