From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753975Ab3BJKcx (ORCPT ); Sun, 10 Feb 2013 05:32:53 -0500 Received: from mail-la0-f54.google.com ([209.85.215.54]:51860 "EHLO mail-la0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751480Ab3BJKcv (ORCPT ); Sun, 10 Feb 2013 05:32:51 -0500 MIME-Version: 1.0 In-Reply-To: <1359714465-6297-2-git-send-email-zhong@linux.vnet.ibm.com> References: <1359714465-6297-1-git-send-email-zhong@linux.vnet.ibm.com> <1359714465-6297-2-git-send-email-zhong@linux.vnet.ibm.com> Date: Sun, 10 Feb 2013 11:32:49 +0100 Message-ID: Subject: Re: [RFC PATCH 1/5] powerpc: Syscall hooks for context tracking subsystem From: Frederic Weisbecker To: Li Zhong Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, paulmck@linux.vnet.ibm.com, benh@kernel.crashing.org, paulus@samba.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2013/2/1 Li Zhong : > This is the syscall slow path hooks for context tracking subsystem, > corresponding to > [PATCH] x86: Syscall hooks for userspace RCU extended QS > commit bf5a3c13b939813d28ce26c01425054c740d6731 > > TIF_MEMDIE is moved to the second 16-bits (with value 17), as it seems there > is no asm code using it. TIF_NOHZ is added to _TIF_SYCALL_T_OR_A, so it is > better for it to be in the same 16 bits with others in the group, so in the > asm code, andi. with this group could work. > > Signed-off-by: Li Zhong Looks good. Thanks. Acked-by: Frederic Weisbecker > --- > arch/powerpc/include/asm/thread_info.h | 7 +++++-- > arch/powerpc/kernel/ptrace.c | 5 +++++ > 2 files changed, 10 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h > index 406b7b9..414a261 100644 > --- a/arch/powerpc/include/asm/thread_info.h > +++ b/arch/powerpc/include/asm/thread_info.h > @@ -97,7 +97,7 @@ static inline struct thread_info *current_thread_info(void) > #define TIF_PERFMON_CTXSW 6 /* perfmon needs ctxsw calls */ > #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ > #define TIF_SINGLESTEP 8 /* singlestepping active */ > -#define TIF_MEMDIE 9 /* is terminating due to OOM killer */ > +#define TIF_NOHZ 9 /* in adaptive nohz mode */ > #define TIF_SECCOMP 10 /* secure computing */ > #define TIF_RESTOREALL 11 /* Restore all regs (implies NOERROR) */ > #define TIF_NOERROR 12 /* Force successful syscall return */ > @@ -106,6 +106,7 @@ static inline struct thread_info *current_thread_info(void) > #define TIF_SYSCALL_TRACEPOINT 15 /* syscall tracepoint instrumentation */ > #define TIF_EMULATE_STACK_STORE 16 /* Is an instruction emulation > for stack store? */ > +#define TIF_MEMDIE 17 /* is terminating due to OOM killer */ > > /* as above, but as bit values */ > #define _TIF_SYSCALL_TRACE (1< @@ -124,8 +125,10 @@ static inline struct thread_info *current_thread_info(void) > #define _TIF_UPROBE (1< #define _TIF_SYSCALL_TRACEPOINT (1< #define _TIF_EMULATE_STACK_STORE (1< +#define _TIF_NOHZ (1< #define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \ > - _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT) > + _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT | \ > + _TIF_NOHZ) > > #define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \ > _TIF_NOTIFY_RESUME | _TIF_UPROBE) > diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c > index c497000..62238dd 100644 > --- a/arch/powerpc/kernel/ptrace.c > +++ b/arch/powerpc/kernel/ptrace.c > @@ -32,6 +32,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -1745,6 +1746,8 @@ long do_syscall_trace_enter(struct pt_regs *regs) > { > long ret = 0; > > + user_exit(); > + > secure_computing_strict(regs->gpr[0]); > > if (test_thread_flag(TIF_SYSCALL_TRACE) && > @@ -1789,4 +1792,6 @@ void do_syscall_trace_leave(struct pt_regs *regs) > step = test_thread_flag(TIF_SINGLESTEP); > if (step || test_thread_flag(TIF_SYSCALL_TRACE)) > tracehook_report_syscall_exit(regs, step); > + > + user_enter(); > } > -- > 1.7.9.5 > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com [209.85.217.173]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id B09652C0095 for ; Sun, 10 Feb 2013 21:32:55 +1100 (EST) Received: by mail-lb0-f173.google.com with SMTP id gf7so3939715lbb.4 for ; Sun, 10 Feb 2013 02:32:50 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1359714465-6297-2-git-send-email-zhong@linux.vnet.ibm.com> References: <1359714465-6297-1-git-send-email-zhong@linux.vnet.ibm.com> <1359714465-6297-2-git-send-email-zhong@linux.vnet.ibm.com> Date: Sun, 10 Feb 2013 11:32:49 +0100 Message-ID: Subject: Re: [RFC PATCH 1/5] powerpc: Syscall hooks for context tracking subsystem From: Frederic Weisbecker To: Li Zhong Content-Type: text/plain; charset=ISO-8859-1 Cc: paulmck@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, paulus@samba.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 2013/2/1 Li Zhong : > This is the syscall slow path hooks for context tracking subsystem, > corresponding to > [PATCH] x86: Syscall hooks for userspace RCU extended QS > commit bf5a3c13b939813d28ce26c01425054c740d6731 > > TIF_MEMDIE is moved to the second 16-bits (with value 17), as it seems there > is no asm code using it. TIF_NOHZ is added to _TIF_SYCALL_T_OR_A, so it is > better for it to be in the same 16 bits with others in the group, so in the > asm code, andi. with this group could work. > > Signed-off-by: Li Zhong Looks good. Thanks. Acked-by: Frederic Weisbecker > --- > arch/powerpc/include/asm/thread_info.h | 7 +++++-- > arch/powerpc/kernel/ptrace.c | 5 +++++ > 2 files changed, 10 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h > index 406b7b9..414a261 100644 > --- a/arch/powerpc/include/asm/thread_info.h > +++ b/arch/powerpc/include/asm/thread_info.h > @@ -97,7 +97,7 @@ static inline struct thread_info *current_thread_info(void) > #define TIF_PERFMON_CTXSW 6 /* perfmon needs ctxsw calls */ > #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ > #define TIF_SINGLESTEP 8 /* singlestepping active */ > -#define TIF_MEMDIE 9 /* is terminating due to OOM killer */ > +#define TIF_NOHZ 9 /* in adaptive nohz mode */ > #define TIF_SECCOMP 10 /* secure computing */ > #define TIF_RESTOREALL 11 /* Restore all regs (implies NOERROR) */ > #define TIF_NOERROR 12 /* Force successful syscall return */ > @@ -106,6 +106,7 @@ static inline struct thread_info *current_thread_info(void) > #define TIF_SYSCALL_TRACEPOINT 15 /* syscall tracepoint instrumentation */ > #define TIF_EMULATE_STACK_STORE 16 /* Is an instruction emulation > for stack store? */ > +#define TIF_MEMDIE 17 /* is terminating due to OOM killer */ > > /* as above, but as bit values */ > #define _TIF_SYSCALL_TRACE (1< @@ -124,8 +125,10 @@ static inline struct thread_info *current_thread_info(void) > #define _TIF_UPROBE (1< #define _TIF_SYSCALL_TRACEPOINT (1< #define _TIF_EMULATE_STACK_STORE (1< +#define _TIF_NOHZ (1< #define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \ > - _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT) > + _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT | \ > + _TIF_NOHZ) > > #define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \ > _TIF_NOTIFY_RESUME | _TIF_UPROBE) > diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c > index c497000..62238dd 100644 > --- a/arch/powerpc/kernel/ptrace.c > +++ b/arch/powerpc/kernel/ptrace.c > @@ -32,6 +32,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -1745,6 +1746,8 @@ long do_syscall_trace_enter(struct pt_regs *regs) > { > long ret = 0; > > + user_exit(); > + > secure_computing_strict(regs->gpr[0]); > > if (test_thread_flag(TIF_SYSCALL_TRACE) && > @@ -1789,4 +1792,6 @@ void do_syscall_trace_leave(struct pt_regs *regs) > step = test_thread_flag(TIF_SINGLESTEP); > if (step || test_thread_flag(TIF_SYSCALL_TRACE)) > tracehook_report_syscall_exit(regs, step); > + > + user_enter(); > } > -- > 1.7.9.5 >