Skip to content

Commit

Permalink
compiler-intel: fix wrong compiler barrier() macro
Browse files Browse the repository at this point in the history
Cleanup commit 73679e5 ("compiler-intel.h: Remove duplicate
definition") removed the double definition of __memory_barrier()
intrinsics.

However, in doing so, it also removed the preceding #undef barrier by
accident, meaning, the actual barrier() macro from compiler-gcc.h with
inline asm is still in place as __GNUC__ is provided.

Subsequently, barrier() can never be defined as __memory_barrier() from
compiler.h since it already has a definition in place and if we trust
the comment in compiler-intel.h, ecc doesn't support gcc specific asm
statements.

I don't have an ecc at hand (unsure if that's still used in the field?)
and only found this by accident during code review, a revert of that
cleanup would be simplest option.

Fixes: 73679e5 ("compiler-intel.h: Remove duplicate definition")
Signed-off-by: Daniel Borkmann <[email protected]>
Reviewed-by: Pranith Kumar <[email protected]>
Cc: Pranith Kumar <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: mancha security <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
borkmann authored and torvalds committed Jun 26, 2015
1 parent cb984d1 commit b86a50c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/linux/compiler-intel.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
/* Intel ECC compiler doesn't support gcc specific asm stmts.
* It uses intrinsics to do the equivalent things.
*/
#undef barrier
#undef barrier_data
#undef RELOC_HIDE
#undef OPTIMIZER_HIDE_VAR

#define barrier() __memory_barrier()
#define barrier_data(ptr) barrier()

#define RELOC_HIDE(ptr, off) \
Expand Down

0 comments on commit b86a50c

Please sign in to comment.