Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x86: bug.h: merge asm in __WARN_FLAGS
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 <ndesaulniers@google.com>
- Loading branch information