linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 0/7] ARM: kprobes: enable OPTPROBES for ARM 32.
@ 2014-10-22 11:31 Wang Nan
  2014-10-22 11:31 ` [PATCH v6 1/7] ARM: kprobes: replace 'union decode_action' to 'struct decode_action' Wang Nan
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Wang Nan @ 2014-10-22 11:31 UTC (permalink / raw)
  To: linux-arm-kernel

Previous 5 version of ARM OPTPROBES patches are unable to deal with
stack storing instructions correctly. V5 patches disallow optimizing
every protential stack store instructions based on pessimistic
assumption. Which, as Tixy comments, 'excludes the main use of
kprobes'. (https://lkml.org/lkml/2014/8/29/117 )

The main obstacle which prevents us from computing stack requirement is
the missing of per-instruction decoder in probes_decode_insn() and its
friends. Only part of instructions have their decoders (and not in
each case).

In this patch series, I propose 'checker', which allows us define
functions for each type of instruction, extract more information.  Stack
consumption computing is an example. Checker can be further employed to
determine whether one instruction is possible to execute directy in
optimized kprobe. I'd like to expand current checker framework by
chaining checkers together. After that, I believe most of ARM
instructions can be executed directly like x86, kprobe performace can be
improved.

The first 3 patches introduces checker. After that, patch 4/7 checks
stack requirement for probed instructions. Patches 5/7 - 7/7 are similar
to patch v5, except:

 1. As Tixy proposed, unoptimized probes are also suffer from stack
    problem (https://lkml.org/lkml/2014/9/1/548 ). Commit d30a0c8b saves
    64 bytes for them, but for instruction use register addressing (like
    'str r0, [sp, r1]'), 64 bytes are unsafe. Patch 5/7 prohibit such
    probing according to stack information collected by checker.

 2. In patch 7/7, stack protection code now is generated according to
    the instruction be optimized.

 3. In patch 7/7, kprobes-opt.c is renamed to kprobes-opt-arm.c due to
    it only deal with ARM case.

 4. Bug in v5 is fixed.

Wang Nan (7):
  ARM: kprobes: replace 'union decode_action' to 'struct decode_action'
  ARM: kprobes: seprates load and store actions
  ARM: kprobes: introduces checker
  ARM: kprobes: collects stack consumption for store instructions
  ARM: kprobes: disallow probing stack consuming instructions
  kprobes: copy ainsn after alloc aggr kprobe
  ARM: kprobes: enable OPTPROBES for ARM 32

 arch/arm/Kconfig                     |   1 +
 arch/arm/include/asm/kprobes.h       |  26 ++++
 arch/arm/include/asm/probes.h        |   1 +
 arch/arm/kernel/Makefile             |   3 +-
 arch/arm/kernel/kprobes-arm.c        |  12 +-
 arch/arm/kernel/kprobes-opt-arm.c    | 285 +++++++++++++++++++++++++++++++++++
 arch/arm/kernel/kprobes-test-arm.c   |  17 ++-
 arch/arm/kernel/kprobes-test-thumb.c |  13 ++
 arch/arm/kernel/kprobes-thumb.c      |  24 +--
 arch/arm/kernel/kprobes.c            |  10 +-
 arch/arm/kernel/kprobes.h            |   8 +-
 arch/arm/kernel/probes-arm.c         |  32 +++-
 arch/arm/kernel/probes-arm.h         |  15 +-
 arch/arm/kernel/probes-thumb.c       | 152 ++++++++++++++++---
 arch/arm/kernel/probes-thumb.h       |  31 +++-
 arch/arm/kernel/probes.c             |  76 +++++++++-
 arch/arm/kernel/probes.h             |  27 +++-
 arch/arm/kernel/uprobes-arm.c        |  12 +-
 arch/arm/kernel/uprobes.h            |   2 +-
 kernel/kprobes.c                     |   6 +
 20 files changed, 679 insertions(+), 74 deletions(-)
 create mode 100644 arch/arm/kernel/kprobes-opt-arm.c

-- 
1.8.4

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

end of thread, other threads:[~2014-10-28 10:58 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-22 11:31 [PATCH v6 0/7] ARM: kprobes: enable OPTPROBES for ARM 32 Wang Nan
2014-10-22 11:31 ` [PATCH v6 1/7] ARM: kprobes: replace 'union decode_action' to 'struct decode_action' Wang Nan
2014-10-22 11:32 ` [PATCH v6 2/7] ARM: kprobes: seprates load and store actions Wang Nan
2014-10-22 11:32 ` [PATCH v6 3/7] ARM: kprobes: introduces checker Wang Nan
2014-10-22 11:32 ` [PATCH v6 4/7] ARM: kprobes: collects stack consumption for store instructions Wang Nan
2014-10-22 11:32 ` [PATCH v6 5/7] ARM: kprobes: disallow probing stack consuming instructions Wang Nan
2014-10-22 11:32 ` [PATCH v6 6/7] kprobes: copy ainsn after alloc aggr kprobe Wang Nan
2014-10-22 11:32 ` [PATCH v6 7/7] ARM: kprobes: enable OPTPROBES for ARM 32 Wang Nan
2014-10-24  0:52 ` [PATCH v6 0/7] " Masami Hiramatsu
2014-10-24  9:02   ` Jon Medhurst (Tixy)
2014-10-25  9:49     ` Wang Nan
2014-10-27 17:17       ` Jon Medhurst (Tixy)
2014-10-28 10:58         ` Jon Medhurst (Tixy)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).