Skip to content

Commit

Permalink
Revert "x86/cpufeature: Guard asm_volatile_goto usage for BPF compila…
Browse files Browse the repository at this point in the history
…tion"

This reverts commit b1ae32d.
  • Loading branch information
ramosian-glider committed Jul 9, 2018
1 parent 20ed060 commit c7c70af
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
15 changes: 0 additions & 15 deletions arch/x86/include/asm/cpufeature.h
Expand Up @@ -140,20 +140,6 @@ extern void clear_cpu_cap(struct cpuinfo_x86 *c, unsigned int bit);

#define setup_force_cpu_bug(bit) setup_force_cpu_cap(bit)

#if defined(__clang__) && !defined(CC_HAVE_ASM_GOTO)

/*
* Workaround for the sake of BPF compilation which utilizes kernel
* headers, but clang does not support ASM GOTO and fails the build.
*/
#ifndef __BPF_TRACING__
#warning "Compiler lacks ASM_GOTO support. Add -D __BPF_TRACING__ to your compiler arguments"
#endif

#define static_cpu_has(bit) boot_cpu_has(bit)

#else

/*
* Static testing of CPU features. Used the same as boot_cpu_has().
* These will statically patch the target code for additional
Expand Down Expand Up @@ -209,7 +195,6 @@ static __always_inline __pure bool _static_cpu_has(u16 bit)
boot_cpu_has(bit) : \
_static_cpu_has(bit) \
)
#endif

#define cpu_has_bug(c, bit) cpu_has(c, (bit))
#define set_cpu_bug(c, bit) set_cpu_cap(c, (bit))
Expand Down
2 changes: 1 addition & 1 deletion samples/bpf/Makefile
Expand Up @@ -251,7 +251,7 @@ $(obj)/%.o: $(src)/%.c
@echo " CLANG-bpf " $@
$(Q)$(CLANG) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) -I$(obj) \
-I$(srctree)/tools/testing/selftests/bpf/ \
-D__KERNEL__ -D__BPF_TRACING__ -Wno-unused-value -Wno-pointer-sign \
-D__KERNEL__ -Wno-unused-value -Wno-pointer-sign \
-D__TARGET_ARCH_$(ARCH) -Wno-compare-distinct-pointer-types \
-Wno-gnu-variable-sized-type-not-at-end \
-Wno-address-of-packed-member -Wno-tautological-compare \
Expand Down

0 comments on commit c7c70af

Please sign in to comment.