Skip to content

powerpc: Cleanup use of 'struct ppc_inst'

Christophe Leroy linuxppc-dev lkml 2 versions – Applied

Status from this message: Applied to powerpc/next.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest12 patches 12 repliesApplied
  2. v112 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- Temporarily don't use get_op() and don't include asm/disassemble.h in asm/inst.h because it exhibits a conflict for function get_ra() with drivers/staging/rtl8723bs/include/wifi.h
- Fix a create_branch() in ftrace and take copy_inst_from_kernel_nofault() into account

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/12powerpc/inst: Fix sparse detection on get_user_instr()arch/powerpc/include/asm/inst.h+6 -10 replies
2/12powerpc/inst: Reduce casts in get_user_instr()arch/powerpc/include/asm/inst.h+3 -40 replies
3/12powerpc/inst: Improve readability of get_user_instr() and friendsarch/powerpc/include/asm/inst.h+6 -100 replies
4/12powerpc/inst: Avoid pointer dereferencing in ppc_inst_equal()arch/powerpc/include/asm/inst.h+9 -101 reply
5/12powerpc: Do not dereference code as 'struct ppc_inst' (uprobe, code-patching, feature-fixups)arch/powerpc/kernel/uprobes.c arch/powerpc/lib/code-patching.c arch/powerpc/lib/feature-fixups.c+6 -61 reply
6/12powerpc/lib/code-patching: Make instr_is_branch_to_addr() staticarch/powerpc/include/asm/code-patching.h arch/powerpc/lib/code-patching.c+9 -101 reply
7/12powerpc/lib/code-patching: Don't use struct 'ppc_inst' for runnable code in tests.arch/powerpc/lib/code-patching.c+53 -421 reply
8/12powerpc: Don't use 'struct ppc_inst' to reference instruction locationarch/powerpc/include/asm/code-patching.h arch/powerpc/include/asm/inst.h arch/powerpc/include/asm/uprobes.h +17 more+160 -1712 replies
9/12powerpc/inst: Refactor PPC32 and PPC64 versionsarch/powerpc/include/asm/inst.h+13 -361 reply
10/12powerpc/optprobes: Minimise castsarch/powerpc/kernel/optprobes.c+11 -120 replies
11/12powerpc/optprobes: Compact code source a bit.arch/powerpc/kernel/optprobes.c+11 -220 replies
12/12powerpc/optprobes: use PPC_RAW_ macrosarch/powerpc/include/asm/ppc-opcode.h arch/powerpc/kernel/optprobes.c+12 -380 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 00/12] powerpc: Cleanup use of 'struct ppc_inst'

This series is a cleanup of the use of 'struct ppc_inst'.

A confusion is made between internal representation of powerpc instructions with 'struct ppc_inst' and in-memory code which is and will always be an array of 'unsigned int'.

This series cleans it up.

First patch is fixing detection of missing '__user' flag by sparse when using get_user_instr().

Last part of the series does some source code cleanup in optprobes, it is put at the ends of this series because of clashes with the 'struct ppc_inst' cleanups.

Changes in v2:
- Temporarily don't use get_op() and don't include asm/disassemble.h in asm/inst.h because it exhibits a conflict for function get_ra() with drivers/staging/rtl8723bs/include/wifi.h
- Fix a create_branch() in ftrace and take copy_inst_from_kernel_nofault() into account

Christophe Leroy (12):
powerpc/inst: Fix sparse detection on get_user_instr() powerpc/inst: Reduce casts in get_user_instr() powerpc/inst: Improve readability of get_user_instr() and friends powerpc/inst: Avoid pointer dereferencing in ppc_inst_equal()
powerpc: Do not dereference code as 'struct ppc_inst' (uprobe,
code-patching, feature-fixups)
powerpc/lib/code-patching: Make instr_is_branch_to_addr() static powerpc/lib/code-patching: Don't use struct 'ppc_inst' for runnable
code in tests.
powerpc: Don't use 'struct ppc_inst' to reference instruction location powerpc/inst: Refactor PPC32 and PPC64 versions powerpc/optprobes: Minimise casts
powerpc/optprobes: Compact code source a bit. powerpc/optprobes: use PPC_RAW_ macros

 arch/powerpc/include/asm/code-patching.h  |  23 ++-
 arch/powerpc/include/asm/inst.h           |  92 +++++-------
 arch/powerpc/include/asm/ppc-opcode.h     |  11 +-
 arch/powerpc/include/asm/uprobes.h        |   4 +-
 arch/powerpc/kernel/crash_dump.c          |   4 +-
 arch/powerpc/kernel/epapr_paravirt.c      |   4 +-
 arch/powerpc/kernel/jump_label.c          |   2 +-
 arch/powerpc/kernel/kgdb.c                |   6 +-
 arch/powerpc/kernel/kprobes.c             |  17 ++-
 arch/powerpc/kernel/mce_power.c           |   2 +-
 arch/powerpc/kernel/optprobes.c           | 124 +++++-----------
 arch/powerpc/kernel/setup_32.c            |   2 +-
 arch/powerpc/kernel/trace/ftrace.c        |  33 +++--
 arch/powerpc/kernel/uprobes.c             |   6 +-
 arch/powerpc/lib/code-patching.c          | 165 ++++++++++++----------
 arch/powerpc/lib/feature-fixups.c         |  98 ++++++-------
 arch/powerpc/mm/maccess.c                 |   4 +-
 arch/powerpc/perf/core-book3s.c           |   4 +-
 arch/powerpc/platforms/86xx/mpc86xx_smp.c |   2 +-
 arch/powerpc/platforms/powermac/smp.c     |   4 +-
 arch/powerpc/xmon/xmon.c                  |  10 +-
 21 files changed, 277 insertions(+), 340 deletions(-)
Signature · 1 line
2.25.0