Skip to content

Commit

Permalink
bpf, x64: Remove unnecessary check on existence of SSE2
Browse files Browse the repository at this point in the history
SSE2 and hence lfence are architectural in x86-64 and no need to check
whether they're supported in CPU. SSE2's CPUID flag is still set to
maintain backward compatibility with older code or code shared with x86,
but bpf_jit_comp.c is compiled under x86-64 exclusively so the check is
redundant.

Signed-off-by: Jie Meng <jmeng@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: KP Singh <kpsingh@kernel.org>
Link: https://lore.kernel.org/bpf/20221005170039.3936894-1-jmeng@fb.com
  • Loading branch information
Jie Meng authored and borkmann committed Oct 7, 2022
1 parent 1d2d941 commit 2e30960
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/x86/net/bpf_jit_comp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1226,8 +1226,7 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image, u8 *rw_image

/* speculation barrier */
case BPF_ST | BPF_NOSPEC:
if (boot_cpu_has(X86_FEATURE_XMM2))
EMIT_LFENCE();
EMIT_LFENCE();
break;

/* ST: *(u8*)(dst_reg + off) = imm */
Expand Down

0 comments on commit 2e30960

Please sign in to comment.