linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/11] syscall/tracing: compat syscall support
@ 2016-10-11 10:42 Marcin Nowakowski
  2016-10-11 10:42 ` [PATCH v3 01/11] tracing/syscalls: remove syscall_nr from syscall metadata Marcin Nowakowski
                   ` (10 more replies)
  0 siblings, 11 replies; 22+ messages in thread
From: Marcin Nowakowski @ 2016-10-11 10:42 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-api-u79uwXL29TY76Z2rM5mHXA, luto-kltTT9wpgjJwATOyAt5JVQ,
	rostedt-nx8X9YLhiw1AfugRpC6u6w, Marcin Nowakowski

This patchset adds support syscall event tracing for compat syscalls.

Second patchset revision has received very little response - so I'm hoping
to get either acks from syscall/trace and arch maintainers or more feedback
on what else needs to be changed.

Patch 1 removes the unnecessary syscall_nr field from syscall metadata,
which was one of the obstacles for adding proper support for compat syscalls.

Patch 2 adds a method to distinguish handling of syscalls for compat tasks
if an arch requires that. In disussions about an earlier version of these
patches (http://marc.info/?l=linux-mips&m=147259973128606&w=2) it was suggested
to use audit arch for detecting syscall type. After analysing the code
for various arches it seemed to me that this would add an unnecessary
complexity (as would require extra APIs to enumerate and map all audit
arch types) and I've just simply used compat task status to determine call
type. I cannot see any added value from using the audit arch type in this
context.

Patch 3 add compat syscall metadata - this is mostly a copy of a set of macros
for generating metadata for standard syscalls.

Further patches add arch-specific methods required for differentiating between
standard and compat syscalls as well as for finding syscall addresses from
inside syscall tables.

I have tried to keep the tracing system working for bisections - and most
things work as previously until arch-specific patch is applied. The only
exception here is x86 which had extra methods to prevent incorrect syscall
reporting for compat tasks - this may happen after patch 2 is applied and 
without x86/tracing patch.

version 3:
- rebase on top of linux-next-20161011
- tile: change in_compat_syscall to is_compat_task (suggested and signed-off by
        Chris Metcalf)

Marcin Nowakowski (11):
  tracing/syscalls: remove syscall_nr from syscall metadata
  tracing/syscalls: add handling for compat tasks
  tracing/syscalls: add compat syscall metadata
  syscall/tracing: allow arch to override syscall_get_nr for ftrace
  x86/tracing: fix compat syscall handling
  s390/tracing: fix compat syscall handling
  arm64/tracing: fix compat syscall handling
  powerpc/tracing: fix compat syscall handling
  tile/tracing: fix compat syscall handling
  sparc/tracing: fix compat syscall handling
  parisc/tracing: fix compat syscall handling

 arch/arm64/include/asm/ftrace.h   |  12 +-
 arch/arm64/include/asm/unistd.h   |   1 +
 arch/arm64/kernel/Makefile        |   1 +
 arch/arm64/kernel/ftrace.c        |  16 +++
 arch/mips/kernel/ftrace.c         |   4 +-
 arch/parisc/include/asm/ftrace.h  |  10 ++
 arch/parisc/kernel/Makefile       |   1 +
 arch/parisc/kernel/ftrace.c       |  15 +++
 arch/powerpc/include/asm/ftrace.h |  26 +++-
 arch/powerpc/kernel/ftrace.c      |   6 +-
 arch/s390/include/asm/ftrace.h    |  11 ++
 arch/s390/include/asm/syscall.h   |   1 +
 arch/s390/kernel/Makefile         |   1 +
 arch/s390/kernel/ftrace.c         |  12 ++
 arch/sparc/include/asm/ftrace.h   |  10 ++
 arch/sparc/kernel/Makefile        |   1 +
 arch/sparc/kernel/ftrace.c        |  14 ++
 arch/tile/include/asm/ftrace.h    |  10 ++
 arch/tile/kernel/Makefile         |   1 +
 arch/tile/kernel/ftrace.c         |  13 ++
 arch/x86/include/asm/ftrace.h     |  14 +-
 arch/x86/include/asm/syscall.h    |   9 ++
 arch/x86/kernel/ftrace.c          |  15 +++
 include/linux/compat.h            |  74 +++++++++++
 include/linux/ftrace.h            |   2 +-
 include/linux/syscalls.h          |   1 -
 include/trace/syscall.h           |   2 -
 kernel/trace/trace.h              |  17 ++-
 kernel/trace/trace_syscalls.c     | 260 +++++++++++++++++++++++---------------
 29 files changed, 421 insertions(+), 139 deletions(-)

-- 
2.7.4

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

end of thread, other threads:[~2016-10-13  9:33 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-11 10:42 [PATCH v3 00/11] syscall/tracing: compat syscall support Marcin Nowakowski
2016-10-11 10:42 ` [PATCH v3 01/11] tracing/syscalls: remove syscall_nr from syscall metadata Marcin Nowakowski
2016-10-11 10:42 ` [PATCH v3 02/11] tracing/syscalls: add handling for compat tasks Marcin Nowakowski
2016-10-11 10:42 ` [PATCH v3 03/11] tracing/syscalls: add compat syscall metadata Marcin Nowakowski
     [not found]   ` <1476182576-15247-4-git-send-email-marcin.nowakowski-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2016-10-12  8:50     ` Michael Ellerman
     [not found]       ` <8737k254tc.fsf-W0DJWXSxmBNbyGPkN3NxC2scP1bn1w/D@public.gmane.org>
2016-10-12 13:09         ` Marcin Nowakowski
2016-10-13  9:33           ` Michael Ellerman
2016-10-11 10:42 ` [PATCH v3 04/11] syscall/tracing: allow arch to override syscall_get_nr for ftrace Marcin Nowakowski
2016-10-11 10:42 ` [PATCH v3 05/11] x86/tracing: fix compat syscall handling Marcin Nowakowski
     [not found]   ` <1476182576-15247-6-git-send-email-marcin.nowakowski-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2016-10-12 13:53     ` Thomas Gleixner
2016-10-13  6:32       ` Marcin Nowakowski
2016-10-11 10:42 ` [PATCH v3 06/11] s390/tracing: " Marcin Nowakowski
2016-10-11 10:42 ` [PATCH v3 07/11] arm64/tracing: " Marcin Nowakowski
2016-10-11 13:36   ` Will Deacon
     [not found]     ` <20161011133623.GE9532-5wv7dgnIgG8@public.gmane.org>
2016-10-12  7:07       ` Marcin Nowakowski
2016-10-12 10:04         ` Will Deacon
2016-10-11 10:42 ` [PATCH v3 08/11] powerpc/tracing: " Marcin Nowakowski
     [not found]   ` <1476182576-15247-9-git-send-email-marcin.nowakowski-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2016-10-12  9:59     ` Michael Ellerman
2016-10-12 13:10       ` Marcin Nowakowski
2016-10-11 10:42 ` [PATCH v3 09/11] tile/tracing: " Marcin Nowakowski
2016-10-11 10:42 ` [PATCH v3 10/11] sparc/tracing: " Marcin Nowakowski
     [not found] ` <1476182576-15247-1-git-send-email-marcin.nowakowski-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2016-10-11 10:42   ` [PATCH v3 11/11] parisc/tracing: " Marcin Nowakowski

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