diff options
author | George Guo <[email protected]> | 2023-03-28 15:13:35 +0800 |
---|---|---|
committer | Daniel Borkmann <[email protected]> | 2023-03-28 10:34:52 +0200 |
commit | a6f6a95f25803500079513780d11a911ce551d76 (patch) | |
tree | ddf07e3d8f459d0ba83dfbb6d3a1c7413b598000 /tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | |
parent | 580031ff9952b7dbf48dedba6b56a100ae002bef (diff) |
LoongArch, bpf: Fix jit to skip speculation barrier opcode
Just skip the opcode(BPF_ST | BPF_NOSPEC) in the BPF JIT instead of
failing to JIT the entire program, given LoongArch currently has no
couterpart of a speculation barrier instruction. To verify the issue,
use the ltp testcase as shown below.
Also, Wang says:
I can confirm there's currently no speculation barrier equivalent
on LonogArch. (Loongson says there are builtin mitigations for
Spectre-V1 and V2 on their chips, and AFAIK efforts to port the
exploits to mips/LoongArch have all failed a few years ago.)
Without this patch:
$ ./bpf_prog02
[...]
bpf_common.c:123: TBROK: Failed verification: ??? (524)
[...]
Summary:
passed 0
failed 0
broken 1
skipped 0
warnings 0
With this patch:
$ ./bpf_prog02
[...]
Summary:
passed 0
failed 0
broken 0
skipped 0
warnings 0
Fixes: 5dc615520c4d ("LoongArch: Add BPF JIT support")
Signed-off-by: George Guo <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: WANG Xuerui <[email protected]>
Cc: Tiezhu Yang <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py')
0 files changed, 0 insertions, 0 deletions