Skip to content

Commit

Permalink
x86/fpu/math-emu: Add ENDPROC to functions
Browse files Browse the repository at this point in the history
Functions in math-emu are annotated as ENTRY() symbols, but their
ends are not annotated at all. But these are standard functions
called from C, with proper stack register update etc.

Omitting the ends means:

  * the annotations are not paired and we cannot deal with such functions
    e.g. in objtool

  * the symbols are not marked as functions in the object file

  * there are no sizes of the functions in the object file

So fix this by adding ENDPROC() to each such case in math-emu.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
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/20170824080624.7768-1-jslaby@suse.cz
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Jiri Slaby authored and Ingo Molnar committed Aug 29, 2017
1 parent 9e085ce commit bd6be57
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions arch/x86/math-emu/div_Xsig.S
Original file line number Diff line number Diff line change
Expand Up @@ -363,3 +363,4 @@ L_bugged_2:
pop %ebx
jmp L_exit
#endif /* PARANOID */
ENDPROC(div_Xsig)
2 changes: 1 addition & 1 deletion arch/x86/math-emu/div_small.S
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ ENTRY(FPU_div_small)

leave
ret

ENDPROC(FPU_div_small)
4 changes: 3 additions & 1 deletion arch/x86/math-emu/mul_Xsig.S
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ ENTRY(mul32_Xsig)
popl %esi
leave
ret
ENDPROC(mul32_Xsig)


ENTRY(mul64_Xsig)
Expand Down Expand Up @@ -114,6 +115,7 @@ ENTRY(mul64_Xsig)
popl %esi
leave
ret
ENDPROC(mul64_Xsig)



Expand Down Expand Up @@ -173,4 +175,4 @@ ENTRY(mul_Xsig_Xsig)
popl %esi
leave
ret

ENDPROC(mul_Xsig_Xsig)
1 change: 1 addition & 0 deletions arch/x86/math-emu/polynom_Xsig.S
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,4 @@ L_accum_done:
popl %esi
leave
ret
ENDPROC(polynomial_Xsig)
2 changes: 2 additions & 0 deletions arch/x86/math-emu/reg_norm.S
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ L_overflow:
call arith_overflow
pop %ebx
jmp L_exit
ENDPROC(FPU_normalize)



Expand Down Expand Up @@ -145,3 +146,4 @@ L_exit_nuo_zero:
popl %ebx
leave
ret
ENDPROC(FPU_normalize_nuo)
2 changes: 2 additions & 0 deletions arch/x86/math-emu/reg_round.S
Original file line number Diff line number Diff line change
Expand Up @@ -706,3 +706,5 @@ L_exception_exit:
mov $-1,%eax
jmp fpu_reg_round_special_exit
#endif /* PARANOID */

ENDPROC(FPU_round)
1 change: 1 addition & 0 deletions arch/x86/math-emu/reg_u_add.S
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,4 @@ L_exit:
leave
ret
#endif /* PARANOID */
ENDPROC(FPU_u_add)
2 changes: 2 additions & 0 deletions arch/x86/math-emu/reg_u_div.S
Original file line number Diff line number Diff line change
Expand Up @@ -469,3 +469,5 @@ L_exit:
leave
ret
#endif /* PARANOID */

ENDPROC(FPU_u_div)
1 change: 1 addition & 0 deletions arch/x86/math-emu/reg_u_mul.S
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,4 @@ L_exit:
ret
#endif /* PARANOID */

ENDPROC(FPU_u_mul)
1 change: 1 addition & 0 deletions arch/x86/math-emu/reg_u_sub.S
Original file line number Diff line number Diff line change
Expand Up @@ -270,3 +270,4 @@ L_exit:
popl %esi
leave
ret
ENDPROC(FPU_u_sub)
4 changes: 2 additions & 2 deletions arch/x86/math-emu/round_Xsig.S
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ L_exit:
popl %ebx
leave
ret

ENDPROC(round_Xsig)



Expand Down Expand Up @@ -138,4 +138,4 @@ L_n_exit:
popl %ebx
leave
ret

ENDPROC(norm_Xsig)
1 change: 1 addition & 0 deletions arch/x86/math-emu/shr_Xsig.S
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,4 @@ L_more_than_95:
popl %esi
leave
ret
ENDPROC(shr_Xsig)
2 changes: 2 additions & 0 deletions arch/x86/math-emu/wm_shrx.S
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ L_more_than_95:
popl %esi
leave
ret
ENDPROC(FPU_shrx)


/*---------------------------------------------------------------------------+
Expand Down Expand Up @@ -202,3 +203,4 @@ Ls_more_than_95:
popl %esi
leave
ret
ENDPROC(FPU_shrxs)
1 change: 1 addition & 0 deletions arch/x86/math-emu/wm_sqrt.S
Original file line number Diff line number Diff line change
Expand Up @@ -468,3 +468,4 @@ sqrt_more_prec_large:
/* Our estimate is too large */
movl $0x7fffff00,%eax
jmp sqrt_round_result
ENDPROC(wm_sqrt)

0 comments on commit bd6be57

Please sign in to comment.