linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/12] powerpc: Cleanup use of 'struct ppc_inst'
@ 2021-05-20 13:50 Christophe Leroy
  2021-05-20 13:50 ` [PATCH v2 01/12] powerpc/inst: Fix sparse detection on get_user_instr() Christophe Leroy
                   ` (14 more replies)
  0 siblings, 15 replies; 25+ messages in thread
From: Christophe Leroy @ 2021-05-20 13:50 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	naveen.n.rao, jniethe5
  Cc: linux-kernel, linuxppc-dev

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(-)

-- 
2.25.0


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

end of thread, other threads:[~2021-06-18  4:23 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20 13:50 [PATCH v2 00/12] powerpc: Cleanup use of 'struct ppc_inst' Christophe Leroy
2021-05-20 13:50 ` [PATCH v2 01/12] powerpc/inst: Fix sparse detection on get_user_instr() Christophe Leroy
2021-05-20 13:50 ` [PATCH v2 02/12] powerpc/inst: Reduce casts in get_user_instr() Christophe Leroy
2021-05-20 13:50 ` [PATCH v2 03/12] powerpc/inst: Improve readability of get_user_instr() and friends Christophe Leroy
2021-05-20 13:50 ` [PATCH v2 04/12] powerpc/inst: Avoid pointer dereferencing in ppc_inst_equal() Christophe Leroy
2021-06-15  3:38   ` Jordan Niethe
2021-05-20 13:50 ` [PATCH v2 05/12] powerpc: Do not dereference code as 'struct ppc_inst' (uprobe, code-patching, feature-fixups) Christophe Leroy
2021-06-15  3:41   ` Jordan Niethe
2021-05-20 13:50 ` [PATCH v2 06/12] powerpc/lib/code-patching: Make instr_is_branch_to_addr() static Christophe Leroy
2021-06-15  3:42   ` Jordan Niethe
2021-05-20 13:50 ` [PATCH v2 07/12] powerpc/lib/code-patching: Don't use struct 'ppc_inst' for runnable code in tests Christophe Leroy
2021-06-15  3:42   ` Jordan Niethe
2021-05-20 13:50 ` [PATCH v2 08/12] powerpc: Don't use 'struct ppc_inst' to reference instruction location Christophe Leroy
2021-06-15  2:01   ` Michael Ellerman
2021-06-15  3:47     ` Jordan Niethe
2021-05-20 13:50 ` [PATCH v2 09/12] powerpc/inst: Refactor PPC32 and PPC64 versions Christophe Leroy
2021-06-15  3:48   ` Jordan Niethe
2021-05-20 13:50 ` [PATCH v2 10/12] powerpc/optprobes: Minimise casts Christophe Leroy
2021-05-20 13:50 ` [PATCH v2 11/12] powerpc/optprobes: Compact code source a bit Christophe Leroy
2021-05-20 13:50 ` [PATCH v2 12/12] powerpc/optprobes: use PPC_RAW_ macros Christophe Leroy
2021-06-08 12:46 ` [PATCH v2 00/12] powerpc: Cleanup use of 'struct ppc_inst' Christophe Leroy
2021-06-15  7:18 ` Michael Ellerman
2021-06-15  7:24   ` Christophe Leroy
2021-06-16 13:05     ` Michael Ellerman
2021-06-18  3:51 ` Michael Ellerman

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox