linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <krisman@collabora.com>
To: tglx@linutronix.de
Cc: mingo@redhat.com, keescook@chromium.org, arnd@arndb.de,
	luto@amacapital.net, wad@chromium.org, rostedt@goodmis.org,
	paul@paul-moore.com, eparis@redhat.com, oleg@redhat.com,
	linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
	x86@kernel.org, Gabriel Krisman Bertazi <krisman@collabora.com>,
	kernel@collabora.com
Subject: [PATCH 00/10] Migrate syscall entry/exit work to SYSCALL_WORK flagset
Date: Fri, 13 Nov 2020 22:29:07 -0500	[thread overview]
Message-ID: <20201114032917.1205658-1-krisman@collabora.com> (raw)

Thomas,

This a refactor work moving the work done by features like seccomp,
ptrace, audit and tracepoints out of the TI flags.  The reasons are:

   1) Scarcity of TI flags in x86 32-bit.

   2) TI flags are defined by the architecture, while these features are
   arch-independent.

   3) Community resistance in merging new architecture-independent
   features as TI flags.

The design exposes a new field in struct thread_info that is read at
syscall_trace_enter and syscall_work_exit in place of the ti flags.
No functional changes is expected from this patchset.  The design and
organization of this patchset achieves the following goals:

  1) SYSCALL_WORK flags are architecture-independent

  2) Architectures that are not using the generic entry code can
  continue to use TI flags transparently and be converted later.

  3) Architectures that migrate to the generic entry code are forced to
  use the new design.

  4) x86, since it supports the generic code, is migrated in this
  patchset.

The transparent usage of TIF or SYSCALL_WORK flags is achieved through
some macros.  Any code outside of the generic entry code is converted to
use the flags only through the accessors.

The patchset has some transition helpers, in an attempt to simplify the
patches converting each of the subsystems separately.  I believe this
simplifies the review while making the tree bisectable.

I tested this by running each of the features in x86.  Other
architectures were compile tested only.

This is based on top of tip/master.

A tree with the patches applies can be pulled from

  https://gitlab.collabora.com/krisman/linux.git -b x86/tif-cleanup-v1

Please, if possible, consider queueing this for the 5.11 merge window,
as this is blocking the Syscall User Dispatch work that has been on the
list for a while.

Gabriel Krisman Bertazi (10):
  x86: Expose syscall_work field in thread_info
  kernel: entry: Expose helpers to migrate TIF to SYSCALL_WORK flags
  kernel: entry: Wire up syscall_work in common entry code
  seccomp: Migrate to use SYSCALL_WORK flag
  tracepoints: Migrate to use SYSCALL_WORK flag
  ptrace: Migrate to use SYSCALL_TRACE flag
  ptrace: Migrate TIF_SYSCALL_EMU to use SYSCALL_WORK flag
  audit: Migrate to use SYSCALL_WORK flag
  kernel: entry: Drop usage of TIF flags in the generic syscall code
  x86: Reclaim unused x86 TI flags

 arch/x86/include/asm/thread_info.h | 11 +-----
 include/asm-generic/syscall.h      | 14 ++++----
 include/linux/entry-common.h       | 44 ++++++++---------------
 include/linux/seccomp.h            |  2 +-
 include/linux/thread_info.h        | 57 ++++++++++++++++++++++++++++++
 include/linux/tracehook.h          |  6 ++--
 include/trace/syscall.h            |  6 ++--
 kernel/auditsc.c                   |  4 +--
 kernel/entry/common.c              | 45 +++++++++++------------
 kernel/fork.c                      |  8 ++---
 kernel/ptrace.c                    | 16 ++++-----
 kernel/seccomp.c                   |  6 ++--
 kernel/trace/trace_events.c        |  2 +-
 kernel/tracepoint.c                |  4 +--
 14 files changed, 130 insertions(+), 95 deletions(-)

-- 
2.29.2


             reply	other threads:[~2020-11-14  3:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-14  3:29 Gabriel Krisman Bertazi [this message]
2020-11-14  3:29 ` [PATCH 01/10] x86: Expose syscall_work field in thread_info Gabriel Krisman Bertazi
2020-11-14  3:29 ` [PATCH 02/10] kernel: entry: Expose helpers to migrate TIF to SYSCALL_WORK flags Gabriel Krisman Bertazi
2020-11-14 11:22   ` Christoph Hellwig
2020-11-15 18:28     ` Thomas Gleixner
2020-11-14  3:29 ` [PATCH 03/10] kernel: entry: Wire up syscall_work in common entry code Gabriel Krisman Bertazi
2020-11-15 18:38   ` Thomas Gleixner
2020-11-14  3:29 ` [PATCH 04/10] seccomp: Migrate to use SYSCALL_WORK flag Gabriel Krisman Bertazi
2020-11-15 18:35   ` Thomas Gleixner
2020-11-14  3:29 ` [PATCH 05/10] tracepoints: " Gabriel Krisman Bertazi
2020-11-15 18:41   ` Thomas Gleixner
2020-11-14  3:29 ` [PATCH 06/10] ptrace: Migrate to use SYSCALL_TRACE flag Gabriel Krisman Bertazi
2020-11-14  3:29 ` [PATCH 07/10] ptrace: Migrate TIF_SYSCALL_EMU to use SYSCALL_WORK flag Gabriel Krisman Bertazi
2020-11-14  3:29 ` [PATCH 08/10] audit: Migrate " Gabriel Krisman Bertazi
2020-11-14  3:29 ` [PATCH 09/10] kernel: entry: Drop usage of TIF flags in the generic syscall code Gabriel Krisman Bertazi
2020-11-14  3:29 ` [PATCH 10/10] x86: Reclaim unused x86 TI flags Gabriel Krisman Bertazi
2020-11-15 18:50 ` [PATCH 00/10] Migrate syscall entry/exit work to SYSCALL_WORK flagset Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201114032917.1205658-1-krisman@collabora.com \
    --to=krisman@collabora.com \
    --cc=arnd@arndb.de \
    --cc=eparis@redhat.com \
    --cc=keescook@chromium.org \
    --cc=kernel@collabora.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@redhat.com \
    --cc=oleg@redhat.com \
    --cc=paul@paul-moore.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=wad@chromium.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).