Skip to content

bpf, parisc: Add support for BPF_SDIV and BPF_SMOD in the parisc JITs

Nicholas Dudar bpf linux-parisc lkml 2 versions – Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 1 replyApplied 2/2
  2. v12 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- Rebase on current bpf-next; no code changes.
- Add Helge's Acked-by and Tested-by to both patches.

Patches in v2 All 2 applied

#Subject and filesSizeRepliesApplied
1/2bpf, parisc: Add support for BPF_SDIV and BPF_SMOD in the parisc64 JITarch/parisc/net/bpf_jit.h arch/parisc/net/bpf_jit_comp64.c arch/parisc/net/bpf_jit_core.c+42 -90 repliesApplied
2/2bpf, parisc: Add support for BPF_SDIV and BPF_SMOD in the parisc32 JITarch/parisc/net/bpf_jit_comp32.c+19 -101 replyApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchHelge Deller
1/2A-b T-b
2/2A-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH bpf-next v2 0/2] bpf, parisc: Add support for BPF_SDIV and BPF_SMOD in the parisc JITs

The parisc BPF JITs emit unsigned divide and remainder for signed BPF_DIV and BPF_MOD (off == 1), so neither implements signed BPF_SDIV and BPF_SMOD. Negative operands therefore produce unsigned results.

Patch 1 adds signed support to the parisc64 JIT and shared signed 64-bit helpers. Patch 2 adds support to the parisc32 JIT, using those helpers for ALU64 and the signed millicode routines for ALU32.

The original series was tested with test_bpf under QEMU on both JITs:
the signed division and remainder cases fail before and pass after. Helge has also tested the series on physical machines and QEMU. For this rebase, both JITs and test_bpf.o build with W=1. The source changes are unchanged from v1; no new runtime run is claimed for v2.

Changes in v2:
- Rebase on current bpf-next; no code changes.
- Add Helge's Acked-by and Tested-by to both patches.

v1: https://lore.kernel.org/bpf/[email protected]/

Nicholas Dudar (2):
bpf, parisc: Add support for BPF_SDIV and BPF_SMOD in the parisc64 JIT bpf, parisc: Add support for BPF_SDIV and BPF_SMOD in the parisc32 JIT

 arch/parisc/net/bpf_jit.h        |  2 ++
 arch/parisc/net/bpf_jit_comp32.c | 29 +++++++++++++++++---------
 arch/parisc/net/bpf_jit_comp64.c | 35 ++++++++++++++++++++++++--------
 arch/parisc/net/bpf_jit_core.c   | 14 +++++++++++++
 4 files changed, 61 insertions(+), 19 deletions(-)

base-commit: 5ef40d69b38a93bc9951dadb1a15c85c597e1a40