You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In __WARN_FLAGS, we had two asm statements (abbreviated):
asm("ud2");
asm volatile (".pushsection .discard.reachable");
These pair of statements are used to trigger an exception, but then help
objtool understand that for warnings, control flow will be restored
immediately afterwards.
The problem is that volatile is not a compiler barrier and no clobbers
are specified to prevent instructions from subsequent statements from
being scheduled by compiler before the second asm statement. This can
lead to instructions from subsequent statements being emitted by the
compiler before the second asm statement.
Providing a scheduling model such as via -march= options enables the
compiler to better schedule instructions with known latencies to hide
latencies from data hazards versus inline asm statements in which
latencies are not estimated.
If an instruction gets scheduled by the compiler between the two asm
statements, then objtool will think that it is not reachable, producing
a warning.
To prevent instructions from being scheduled in between the two asm
statements, merge them.
Signed-off-by: Nick Desaulniers <[email protected]>
0 commit comments