Skip to content

static_call: Improve NULL/ret0 handling

Josh Poimboeuf linux-arm-kernel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest11 patches 15 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11static_call: Improve key type abstractioninclude/linux/static_call_types.h kernel/static_call_inline.c tools/include/linux/static_call_types.h+40 -191 reply
1/11static_call: Improve key type abstractioninclude/linux/static_call_types.h kernel/static_call_inline.c tools/include/linux/static_call_types.h+38 -170 replies
2/11static_call: Flip key type union bitinclude/linux/static_call.h include/linux/static_call_types.h tools/include/linux/static_call_types.h+4 -70 replies
2/11static_call: Flip key type union bitinclude/linux/static_call.h include/linux/static_call_types.h kernel/static_call_inline.c +1 more+8 -110 replies
3/11static_call: Remove static_call_mod_init() declarationinclude/linux/static_call.h+0 -10 replies
4/11static_call: Remove static_call.h dependency on cpu.hblock/bio.c include/linux/static_call.h kernel/cgroup/cgroup.c +2 more+16 -90 replies
5/11static_call: Make ARCH_ADD_TRAMP_KEY() genericarch/x86/include/asm/static_call.h include/linux/static_call.h+9 -80 replies
6/11static_call: "EXPORT_STATIC_CALL_TRAMP" -> "EXPORT_STATIC_CALL_RO"arch/x86/events/amd/brs.c arch/x86/include/asm/perf_event.h arch/x86/include/asm/preempt.h +6 more+35 -290 replies
7/11static_call: Reorganize static call headersarch/arm/include/asm/paravirt.h arch/arm64/include/asm/paravirt.h arch/x86/include/asm/paravirt.h +12 more+148 -2760 replies
8/11arm64/static_call: Fix static call CFI violationsarch/Kconfig arch/arm64/include/asm/static_call.h include/linux/static_call.h +4 more+97 -126 replies
9/11static_call: Make NULL static calls consistentarch/arm64/include/asm/static_call.h arch/powerpc/include/asm/static_call.h arch/powerpc/kernel/static_call.c +6 more+57 -634 replies
10/11static_call: Remove static_call_cond()arch/x86/events/core.c arch/x86/include/asm/kvm-x86-ops.h arch/x86/include/asm/kvm-x86-pmu-ops.h +7 more+44 -490 replies
11/11static_call: Remove DEFINE_STATIC_CALL_RET0()arch/arm64/include/asm/static_call.h arch/powerpc/include/asm/static_call.h arch/powerpc/kernel/irq.c +14 more+39 -2004 replies

Reviews trailers per patch

None of the 13 patches has a Reviewed-by or Acked-by.

PatchMark Rutland
1/11
1/11
2/11
2/11
3/11
4/11
5/11
6/11
7/11
8/11T-b
9/11
10/11
11/11

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 v2 00/11] static_call: Improve NULL/ret0 handling

Peter pointed out that v1 had CFI violations on arm64 with CONFIG_CFI_CLANG. Then I realized there are already CFI violations today in the existing code.

So this ended up turning into a complete rewrite of v1.

Highlights include:

- Several cleanups
- Fix arm64 CFI violations
- Make NULL pointer behavior consistent across configs
- Merge NULL and RET0 into a single concept

v1 can be found here:

https://lkml.kernel.org/lkml/[email protected]

Josh Poimboeuf (11):
static_call: Improve key type abstraction
static_call: Flip key type union bit
static_call: Remove static_call_mod_init() declaration
static_call: Remove static_call.h dependency on cpu.h
static_call: Make ARCH_ADD_TRAMP_KEY() generic
static_call: "EXPORT_STATIC_CALL_TRAMP" -> "EXPORT_STATIC_CALL_RO"
static_call: Reorganize static call headers arm64/static_call: Fix static call CFI violations
static_call: Make NULL static calls consistent
static_call: Remove static_call_cond()
static_call: Remove DEFINE_STATIC_CALL_RET0()

 arch/Kconfig                              |   4 +
 arch/arm/include/asm/paravirt.h           |   2 +-
 arch/arm64/include/asm/paravirt.h         |   2 +-
 arch/arm64/include/asm/static_call.h      |  29 ++
 arch/powerpc/include/asm/static_call.h    |   1 -
 arch/powerpc/kernel/irq.c                 |   2 +-
 arch/powerpc/kernel/static_call.c         |   6 +-
 arch/x86/events/amd/brs.c                 |   2 +-
 arch/x86/events/amd/core.c                |   2 +-
 arch/x86/events/core.c                    |  29 +-
 arch/x86/include/asm/kvm-x86-ops.h        |   6 +-
 arch/x86/include/asm/kvm-x86-pmu-ops.h    |   3 +-
 arch/x86/include/asm/kvm_host.h           |   4 +-
 arch/x86/include/asm/paravirt.h           |   2 +-
 arch/x86/include/asm/perf_event.h         |   2 +-
 arch/x86/include/asm/preempt.h            |   6 +-
 arch/x86/include/asm/static_call.h        |  22 +-
 arch/x86/kernel/alternative.c             |   6 -
 arch/x86/kernel/paravirt.c                |   1 +
 arch/x86/kernel/static_call.c             |  89 +-----
 arch/x86/kvm/irq.c                        |   2 +-
 arch/x86/kvm/lapic.c                      |  22 +-
 arch/x86/kvm/pmu.c                        |   4 +-
 arch/x86/kvm/x86.c                        |  28 +-
 block/bio.c                               |   1 +
 include/linux/entry-common.h              |   2 +-
 include/linux/entry-kvm.h                 |   2 +-
 include/linux/kernel.h                    |   4 +-
 include/linux/module.h                    |   2 +-
 include/linux/sched.h                     |   2 +-
 include/linux/static_call.h               | 369 ++++++++++------------
 include/linux/static_call_types.h         |  74 +----
 kernel/Makefile                           |   2 +-
 kernel/cgroup/cgroup.c                    |   1 +
 kernel/events/core.c                      |  15 +-
 kernel/sched/core.c                       |  18 +-
 kernel/static_call.c                      |  13 +
 kernel/static_call_inline.c               |  64 +++-
 security/keys/trusted-keys/trusted_core.c |   2 +-
 sound/soc/intel/avs/trace.c               |   1 +
 tools/include/linux/static_call_types.h   |  74 +----
 41 files changed, 369 insertions(+), 553 deletions(-)
 create mode 100644 arch/arm64/include/asm/static_call.h
Signature · 1 line
2.39.2