mirror of
https://github.com/torvalds/linux.git
synced 2026-11-26 16:33:17 +00:00
On certain MIPS32 devices, the ftrace tracer "function_graph" uses __lshrdi3() during the capturing of trace data. ftrace then attempts to trace __lshrdi3() which leads to infinite recursion and a stack overflow. Fix this by marking __lshrdi3() as notrace. Mark the other compiler intrinsics as notrace in case the compiler decides to use them in the ftrace path. Signed-off-by: Harvey Hunt <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]> # 4.2.x- Patchwork: https://patchwork.linux-mips.org/patch/13354/ Signed-off-by: Ralf Baechle <[email protected]>
28 lines
443 B
C
28 lines
443 B
C
#include <linux/module.h>
|
|
|
|
#include "libgcc.h"
|
|
|
|
word_type notrace __cmpdi2(long long a, long long b)
|
|
{
|
|
const DWunion au = {
|
|
.ll = a
|
|
};
|
|
const DWunion bu = {
|
|
.ll = b
|
|
};
|
|
|
|
if (au.s.high < bu.s.high)
|
|
return 0;
|
|
else if (au.s.high > bu.s.high)
|
|
return 2;
|
|
|
|
if ((unsigned int) au.s.low < (unsigned int) bu.s.low)
|
|
return 0;
|
|
else if ((unsigned int) au.s.low > (unsigned int) bu.s.low)
|
|
return 2;
|
|
|
|
return 1;
|
|
}
|
|
|
|
EXPORT_SYMBOL(__cmpdi2);
|