Skip to content

riscv: switch to relative extable and other improvements

Jisheng Zhang bpf linux-kbuild linux-riscv lkml netdev oe-kbuild-all 4 versions – In review

Get series with b4
b4 am 20211118192130.48b8f04c@xhacker

Versions newest first · linked by author and title

  1. v4 Latest12 patches 10 repliesIn review
  2. v32 patches 1 replySuperseded
  3. v22 patches 5 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches1 replySuperseded

Changes in v4 from the cover letter

- collect Reviewed-by tag for patch2 and patch3
- add patch1 to remove unused macro
- add patches to remove anonymous out-of-line fixups

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12riscv: remove unused __cmpxchg_user() macroarch/riscv/include/asm/uaccess.h+0 -750 replies
2/12riscv: consolidate __ex_table constructionarch/riscv/include/asm/futex.h arch/riscv/include/asm/uaccess.h+15 -270 replies
3/12riscv: switch to relative exception tablesarch/riscv/include/asm/Kbuild arch/riscv/include/asm/extable.h arch/riscv/include/asm/uaccess.h +4 more+46 -71 reply
4/12riscv: bpf: move rv_bpf_fixup_exception signature to extable.harch/riscv/include/asm/extable.h arch/riscv/mm/extable.c arch/riscv/net/bpf_jit_comp64.c+12 -80 replies
5/12riscv: extable: make fixup_exception() return boolarch/riscv/include/asm/extable.h arch/riscv/mm/extable.c arch/riscv/net/bpf_jit_comp64.c+10 -100 replies
6/12riscv: extable: use `ex` for `exception_table_entry`arch/riscv/mm/extable.c+5 -50 replies
7/12riscv: lib: uaccess: fold fixups into bodyarch/riscv/lib/uaccess.S+11 -110 replies
8/12riscv: extable: consolidate definitionsarch/riscv/include/asm/asm-extable.h arch/riscv/include/asm/futex.h arch/riscv/include/asm/uaccess.h +1 more+37 -100 replies
9/12riscv: extable: add `type` and `data` fieldsarch/riscv/include/asm/asm-extable.h arch/riscv/include/asm/extable.h arch/riscv/kernel/vmlinux.lds.S +3 more+59 -195 replies
10/12riscv: add gpr-num.harch/riscv/include/asm/gpr-num.h+77 -00 replies
11/12riscv: extable: add a dedicated uaccess handlerarch/riscv/include/asm/asm-extable.h arch/riscv/include/asm/futex.h arch/riscv/include/asm/uaccess.h +1 more+78 -694 replies
12/12riscv: vmlinux.lds.S|vmlinux-xip.lds.S: remove `.fixup` sectionarch/riscv/kernel/vmlinux-xip.lds.S arch/riscv/kernel/vmlinux.lds.S+0 -20 replies

Reviews trailers per patch

3 of 12 patches have a Reviewed-by or Acked-by.

PatchKefeng WangTong Tiangen
1/12
2/12R-b
3/12R-b R-b
4/12
5/12
6/12
7/12
8/12
9/12R-b
10/12
11/12
12/12

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

Read the v4 thread

Cover letter [PATCH v4 0/12] riscv: switch to relative extable and other improvements

From: Jisheng Zhang <[email protected]>

Similar as other architectures such as arm64, x86 and so on, use offsets relative to the exception table entry values rather than absolute addresses for both the exception locationand the fixup. And recently, arm64 and x86 remove anonymous out-of-line fixups, we want to acchieve the same result.

patch1 remove unused macro.

patch2 consolidates the __ex_table construction, it's a great code clean up even w/o the 2nd patch.

patch3 swith to relative extable.

The remaining patches are inspired by arm64 version. They remove the anonymous out-of-line fixups for risv.

Since v3:
- collect Reviewed-by tag for patch2 and patch3
- add patch1 to remove unused macro
- add patches to remove anonymous out-of-line fixups

Since v2:
- directly check R_RISCV_SUB32 in __ex_table instead of adding addend_riscv_rela()

Since v1:
- fix build error for NOMMU case, thank [email protected]

Jisheng Zhang (12):
riscv: remove unused __cmpxchg_user() macro
riscv: consolidate __ex_table construction
riscv: switch to relative exception tables
riscv: bpf: move rv_bpf_fixup_exception signature to extable.h
riscv: extable: make fixup_exception() return bool
riscv: extable: use ex for exception_table_entry
riscv: lib: uaccess: fold fixups into body
riscv: extable: consolidate definitions
riscv: extable: add type and data fields
riscv: add gpr-num.h
riscv: extable: add a dedicated uaccess handler
riscv: vmlinux.lds.S|vmlinux-xip.lds.S: remove .fixup section

 arch/riscv/include/asm/Kbuild        |   1 -
 arch/riscv/include/asm/asm-extable.h |  65 +++++++++++
 arch/riscv/include/asm/extable.h     |  48 ++++++++
 arch/riscv/include/asm/futex.h       |  30 ++---
 arch/riscv/include/asm/gpr-num.h     |  77 +++++++++++++
 arch/riscv/include/asm/uaccess.h     | 162 ++++-----------------------
 arch/riscv/kernel/vmlinux-xip.lds.S  |   1 -
 arch/riscv/kernel/vmlinux.lds.S      |   3 +-
 arch/riscv/lib/uaccess.S             |  28 +++--
 arch/riscv/mm/extable.c              |  66 ++++++++---
 arch/riscv/net/bpf_jit_comp64.c      |   9 +-
 scripts/mod/modpost.c                |  15 +++
 scripts/sorttable.c                  |   4 +-
 13 files changed, 308 insertions(+), 201 deletions(-)
 create mode 100644 arch/riscv/include/asm/asm-extable.h
 create mode 100644 arch/riscv/include/asm/extable.h
 create mode 100644 arch/riscv/include/asm/gpr-num.h
Signature · 8 lines
2.33.0



_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv