Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1459640
| From | Andy Lutomirski <luto@amacapital.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v14 06/14] arch/x86: enable task isolation functionality |
| Date | 2016-08-10 21:20 +0200 |
| Message-ID | <s4HcK-NR-35@gated-at.bofh.it> (permalink) |
| References | <s4lYB-3WM-3@gated-at.bofh.it> <s4lYC-3WM-19@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Aug 9, 2016 11:30 PM, "Chris Metcalf" <cmetcalf@mellanox.com> wrote:
>
> In exit_to_usermode_loop(), call task_isolation_ready() for
> TIF_TASK_ISOLATION tasks when we are checking the thread-info flags,
> and after we've handled the other work, call task_isolation_enter()
> for such tasks.
>
> In syscall_trace_enter_phase1(), we add the necessary support for
> reporting syscalls for task-isolation processes.
>
> We add strict reporting for the kernel exception types that do
> not result in signals, namely non-signalling page faults and
> non-signalling MPX fixups.
>
> Tested-by: Christoph Lameter <cl@linux.com>
> Signed-off-by: Chris Metcalf <cmetcalf@mellanox.com>
> ---
> arch/x86/Kconfig | 1 +
> arch/x86/entry/common.c | 20 +++++++++++++++++++-
> arch/x86/include/asm/thread_info.h | 2 ++
> arch/x86/kernel/smp.c | 2 ++
> arch/x86/kernel/traps.c | 3 +++
> arch/x86/mm/fault.c | 5 +++++
> 6 files changed, 32 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 5c6e7471b732..10b2c0567dad 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -89,6 +89,7 @@ config X86
> select HAVE_ARCH_MMAP_RND_COMPAT_BITS if MMU && COMPAT
> select HAVE_ARCH_SECCOMP_FILTER
> select HAVE_ARCH_SOFT_DIRTY if X86_64
> + select HAVE_ARCH_TASK_ISOLATION
> select HAVE_ARCH_TRACEHOOK
> select HAVE_ARCH_TRANSPARENT_HUGEPAGE
> select HAVE_EBPF_JIT if X86_64
> diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
> index 1433f6b4607d..5c1b9fc89bf2 100644
> --- a/arch/x86/entry/common.c
> +++ b/arch/x86/entry/common.c
> @@ -21,6 +21,7 @@
> #include <linux/context_tracking.h>
> #include <linux/user-return-notifier.h>
> #include <linux/uprobes.h>
> +#include <linux/isolation.h>
>
> #include <asm/desc.h>
> #include <asm/traps.h>
> @@ -91,6 +92,15 @@ static long syscall_trace_enter(struct pt_regs *regs)
> if (emulated)
> return -1L;
>
> + /* In isolation mode, we may prevent the syscall from running. */
> + if (work & _TIF_TASK_ISOLATION) {
> + if (task_isolation_syscall(regs->orig_ax) == -1) {
> + regs->orig_ax = -1;
> + return 0;
> + }
> + work &= ~_TIF_TASK_ISOLATION;
> + }
> +
What is this? It's not mentioned in the changelog. It seems
nonsensical to me. If nothing else, you forgot to update regs->ax,
but I don't even know what you're trying to do.
> #ifdef CONFIG_SECCOMP
> /*
> * Do seccomp after ptrace, to catch any tracer changes.
> @@ -136,7 +146,7 @@ static long syscall_trace_enter(struct pt_regs *regs)
>
> #define EXIT_TO_USERMODE_LOOP_FLAGS \
> (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_UPROBE | \
> - _TIF_NEED_RESCHED | _TIF_USER_RETURN_NOTIFY)
> + _TIF_NEED_RESCHED | _TIF_USER_RETURN_NOTIFY | _TIF_TASK_ISOLATION)
>
Where are you updating the conditions to force use of the slow path?
(That's _TIF_ALLWORK_MASK.)
--Andy
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v14 00/14] support "task_isolation" mode Chris Metcalf <cmetcalf@mellanox.com> - 2016-08-09 22:40 +0200
[PATCH v14 06/14] arch/x86: enable task isolation functionality Chris Metcalf <cmetcalf@mellanox.com> - 2016-08-09 22:40 +0200
Re: [PATCH v14 06/14] arch/x86: enable task isolation functionality Andy Lutomirski <luto@amacapital.net> - 2016-08-10 21:20 +0200
Re: [PATCH v14 06/14] arch/x86: enable task isolation functionality Andy Lutomirski <luto@amacapital.net> - 2016-08-10 22:10 +0200
Re: [PATCH v14 06/14] arch/x86: enable task isolation functionality Andy Lutomirski <luto@amacapital.net> - 2016-08-10 21:20 +0200
[PATCH v14 10/14] arm, tile: turn off timer tick for oneshot_stopped state Chris Metcalf <cmetcalf@mellanox.com> - 2016-08-09 22:40 +0200
[PATCH v14 02/14] vmstat: add vmstat_idle function Chris Metcalf <cmetcalf@mellanox.com> - 2016-08-09 22:40 +0200
[PATCH v14 08/14] arch/arm64: enable task isolation functionality Chris Metcalf <cmetcalf@mellanox.com> - 2016-08-09 22:40 +0200
[PATCH v14 05/14] task_isolation: track asynchronous interrupts Chris Metcalf <cmetcalf@mellanox.com> - 2016-08-09 22:40 +0200
[PATCH v14 09/14] arch/tile: enable task isolation functionality Chris Metcalf <cmetcalf@mellanox.com> - 2016-08-09 22:40 +0200
[PATCH v14 04/14] task_isolation: add initial support Chris Metcalf <cmetcalf@mellanox.com> - 2016-08-09 22:40 +0200
Re: [PATCH v14 04/14] task_isolation: add initial support Frederic Weisbecker <fweisbec@gmail.com> - 2016-08-11 20:20 +0200
Re: [PATCH v14 04/14] task_isolation: add initial support Christoph Lameter <cl@linux.com> - 2016-08-11 21:00 +0200
[PATCH v14 07/14] arm64: factor work_pending state machine to C Chris Metcalf <cmetcalf@mellanox.com> - 2016-08-09 22:40 +0200
csiph-web