netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] bpf,x64: implement jump padding in jit
@ 2021-01-14  9:54 Gary Lin
  2021-01-14  9:54 ` [PATCH v3 1/3] bpf,x64: pad NOPs to make images converge more easily Gary Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Gary Lin @ 2021-01-14  9:54 UTC (permalink / raw)
  To: netdev, bpf, Alexei Starovoitov, Daniel Borkmann
  Cc: Eric Dumazet, Andrii Nakryiko, andreas.taschner

This patch series implements jump padding to x64 jit to cover some
corner cases that used to consume more than 20 jit passes and caused
failure.

v3:
  - Copy the instructions of prologue separately or the size calculation
    of the first BPF instruction would include the prologue.
  - Replace WARN_ONCE() with pr_err() and EFAULT
  - Use MAX_PASSES in the for loop condition check
  - Remove the "padded" flag from x64_jit_data. For the extra pass of
    subprogs, padding is always enabled since it won't hurt the images
    that converge without padding.
v2:
  - Simplify the sample code in the commit description and provide the
    jit code
  - Check the expected padding bytes with WARN_ONCE
  - Move the 'padded' flag to 'struct x64_jit_data'
  - Remove the EXPECTED_FAIL flag from bpf_fill_maxinsns11() in test_bpf
  - Add 2 verifier tests

Gary Lin (3):
  bpf,x64: pad NOPs to make images converge more easily
  test_bpf: remove EXPECTED_FAIL flag from bpf_fill_maxinsns11
  selftests/bpf: Add verifier test for x64 jit jump padding

 arch/x86/net/bpf_jit_comp.c                 | 86 +++++++++++++++------
 lib/test_bpf.c                              |  7 +-
 tools/testing/selftests/bpf/test_verifier.c | 43 +++++++++++
 tools/testing/selftests/bpf/verifier/jit.c  | 16 ++++
 4 files changed, 122 insertions(+), 30 deletions(-)

-- 
2.29.2



Gary Lin (3):
  bpf,x64: pad NOPs to make images converge more easily
  test_bpf: remove EXPECTED_FAIL flag from bpf_fill_maxinsns11
  selftests/bpf: Add verifier test for x64 jit jump padding

 arch/x86/net/bpf_jit_comp.c                 | 103 ++++++++++++++------
 lib/test_bpf.c                              |   7 +-
 tools/testing/selftests/bpf/test_verifier.c |  43 ++++++++
 tools/testing/selftests/bpf/verifier/jit.c  |  16 +++
 4 files changed, 135 insertions(+), 34 deletions(-)

-- 
2.29.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-01-18  1:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-14  9:54 [PATCH v3 0/3] bpf,x64: implement jump padding in jit Gary Lin
2021-01-14  9:54 ` [PATCH v3 1/3] bpf,x64: pad NOPs to make images converge more easily Gary Lin
2021-01-15  6:37   ` Alexei Starovoitov
2021-01-15  9:41     ` Gary Lin
2021-01-15 16:04       ` Alexei Starovoitov
2021-01-18  1:51         ` Gary Lin
2021-01-14  9:54 ` [PATCH v3 2/3] test_bpf: remove EXPECTED_FAIL flag from bpf_fill_maxinsns11 Gary Lin
2021-01-14  9:54 ` [PATCH v3 3/3] selftests/bpf: Add verifier test for x64 jit jump padding Gary Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).