linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Baron <jbaron@redhat.com>
To: fweisbec@gmail.com, mingo@elte.hu, rostedt@goodmis.org
Cc: linux-kernel@vger.kernel.org, laijs@cn.fujitsu.com,
	lizf@cn.fujitsu.com, hpa@zytor.com, tglx@linutronix.de,
	mhiramat@redhat.com, heiko.carstens@de.ibm.com,
	benh@kernel.crashing.org, davem@davemloft.net,
	lethal@linux-sh.org, schwidefsky@de.ibm.com,
	brueckner@linux.vnet.ibm.com, tony.luck@intel.com
Subject: Re: [PATCH 15/14] compat_syscalls: introduce CONFIG_COMPAT_FTRACE_SYSCALLS
Date: Thu, 18 Mar 2010 14:22:39 -0400	[thread overview]
Message-ID: <20100318182238.GA2661@redhat.com> (raw)
In-Reply-To: <cover.1268749695.git.jbaron@redhat.com>

move the logic for enabling compat syscalls to common arch/Kconfig, where
config_compat_ftrace_syscalls depends on CONFIG_COMPAT, CONFIG_FTRACE_SYSCALLS,
and a per-arch CONFIG_HAVE_COMPAT_FTRACE_SYSCALLS. In this way arches that
want to add support for compat syscalls, can request it via selecting
HAVE_COMPAT_FTRACE_SYSCALLS in their respective arch Kconfig files.

Signed-off-by: Jason Baron <jbaron@redhat.com>
---
 arch/Kconfig                   |    7 +++++++
 arch/x86/Kconfig               |    1 +
 arch/x86/include/asm/syscall.h |    4 ----
 arch/x86/kernel/ftrace.c       |    2 +-
 include/linux/syscalls.h       |    2 +-
 kernel/trace/trace_syscalls.c  |    2 +-
 6 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index e0ad3ca..0aca622 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -153,4 +153,11 @@ config HAVE_HW_BREAKPOINT
 config HAVE_USER_RETURN_NOTIFIER
 	bool
 
+config HAVE_COMPAT_FTRACE_SYSCALLS
+	bool
+
+config COMPAT_FTRACE_SYSCALLS
+	def_bool y
+	depends on COMPAT && FTRACE_SYSCALLS && HAVE_COMPAT_FTRACE_SYSCALLS
+
 source "kernel/gcov/Kconfig"
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 6de8f35..4083c0f 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -40,6 +40,7 @@ config X86
 	select HAVE_FUNCTION_TRACE_MCOUNT_TEST
 	select HAVE_FTRACE_NMI_ENTER if DYNAMIC_FTRACE
 	select HAVE_SYSCALL_TRACEPOINTS
+	select HAVE_COMPAT_FTRACE_SYSCALLS
 	select HAVE_KVM
 	select HAVE_ARCH_KGDB
 	select HAVE_ARCH_TRACEHOOK
diff --git a/arch/x86/include/asm/syscall.h b/arch/x86/include/asm/syscall.h
index 4e462cc..f734812 100644
--- a/arch/x86/include/asm/syscall.h
+++ b/arch/x86/include/asm/syscall.h
@@ -16,10 +16,6 @@
 #include <linux/sched.h>
 #include <linux/err.h>
 
-#if defined(CONFIG_COMPAT) && defined(CONFIG_FTRACE_SYSCALLS)
- #define __HAVE_ARCH_FTRACE_COMPAT_SYSCALLS
-#endif
-
 extern const unsigned long sys_call_table[];
 extern const unsigned long *ia32_sys_call_table;
 
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 4b36a0b..662343b 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -512,7 +512,7 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
 }
 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
 
-#ifdef __HAVE_ARCH_FTRACE_COMPAT_SYSCALLS
+#ifdef CONFIG_COMPAT_FTRACE_SYSCALLS
 unsigned long __init arch_compat_syscall_addr(int nr)
 {
 	return (unsigned long)(&ia32_sys_call_table)[nr];
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 2361d9a..cf230a6 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -235,7 +235,7 @@ struct perf_event_attr;
 #define COMPAT_SYSCALL_DEFINE5(name, ...) COMPAT_SYSCALL_DEFINEx(5, compat_sys_##name, name, __VA_ARGS__)
 #define COMPAT_SYSCALL_DEFINE6(name, ...) COMPAT_SYSCALL_DEFINEx(6, compat_sys_##name, name, __VA_ARGS__)
 
-#ifdef CONFIG_FTRACE_SYSCALLS
+#ifdef CONFIG_COMPAT_FTRACE_SYSCALLS
 #define COMPAT_SYSCALL_DEFINEx(x, syscall, sname, ...)			\
 	static const char *types_compat_sys_##sname[] = {		\
 		__SC_STR_TDECL##x(__VA_ARGS__)				\
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
index 3f88b8e..6db3794 100644
--- a/kernel/trace/trace_syscalls.c
+++ b/kernel/trace/trace_syscalls.c
@@ -439,7 +439,7 @@ int __init init_ftrace_syscalls(void)
 		meta->syscall_nr = i;
 		syscalls_metadata[i] = meta;
 	}
-#ifdef __HAVE_ARCH_FTRACE_COMPAT_SYSCALLS
+#ifdef CONFIG_COMPAT_FTRACE_SYSCALLS
 	if (NR_syscalls_compat) {
 		int match;
 		struct ftrace_event_call *ftrace_event;
-- 
1.6.5.1


  parent reply	other threads:[~2010-03-18 18:23 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-16 17:46 [PATCH 00/14] tracing: add compat syscall support v3 Jason Baron
2010-03-16 17:46 ` [PATCH 01/14] x86: add NR_syscalls_compat, make ia32 syscall table visible Jason Baron
2010-03-16 17:46 ` [PATCH 02/14] x86: add arch_compat_syscall_addr() Jason Baron
2010-03-17 19:11   ` Frederic Weisbecker
2010-03-16 17:46 ` [PATCH 03/14] compat: have generic is_compat_task for !CONFIG_COMPAT Jason Baron
2010-03-16 17:46 ` [PATCH 04/14] tracing: remove syscall bitmaps in preparation for compat support Jason Baron
2010-03-16 17:46 ` [PATCH 05/14] tracing: move __start_ftrace_events and __stop_ftrace_events to header file Jason Baron
2010-03-16 17:46 ` [PATCH 06/14] tracing: add tracing support for compat syscalls Jason Baron
2010-03-20  6:12   ` Frederic Weisbecker
2010-03-22 20:21     ` Jason Baron
2010-03-27  4:40       ` Frederic Weisbecker
2010-03-16 17:46 ` [PATCH 07/14] syscalls: add ARCH_COMPAT_SYSCALL_DEFINE() Jason Baron
2010-03-18 18:29   ` [PATCH 07/14 re-post] " Jason Baron
2010-03-27  4:56     ` Frederic Weisbecker
2010-05-24  7:05   ` [PATCH 07/14] " Ian Munsie
2010-05-24 20:26     ` Jason Baron
2010-03-16 17:46 ` [PATCH 08/14] x86, compat: convert ia32 layer to use Jason Baron
2010-03-16 17:46 ` [PATCH 09/14] syscalls: add new COMPAT_SYSCALL_DEFINE#N() macro Jason Baron
2010-03-16 17:46 ` [PATCH 10/14] compat: convert to use COMPAT_SYSCALL_DEFINE#N() Jason Baron
2010-03-16 17:47 ` [PATCH 11/14] compat: convert fs compat to use COMPAT_SYSCALL_DEFINE#N() macros Jason Baron
2010-03-16 17:47 ` [PATCH 12/14] tags: recognize compat syscalls Jason Baron
2010-03-16 17:47 ` [PATCH 13/14] cleanup: remove arg from TRACE_SYS_ENTER_PROFILE_INIT() macro Jason Baron
2010-03-16 17:47 ` [PATCH 14/14] tracing: make a "compat_syscalls" tracing subsys Jason Baron
2010-03-18 18:22 ` Jason Baron [this message]
2010-03-27  5:00 ` [PATCH 00/14] tracing: add compat syscall support v3 Frederic Weisbecker
2010-05-21  9:40 ` Ian Munsie
2010-05-21 13:24   ` Jason Baron
2010-05-21 13:31     ` Frederic Weisbecker
2010-06-17  7:39     ` Ian Munsie
2010-06-17  7:46       ` Frederic Weisbecker
2010-06-17 15:39       ` Jason Baron

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=20100318182238.GA2661@redhat.com \
    --to=jbaron@redhat.com \
    --cc=benh@kernel.crashing.org \
    --cc=brueckner@linux.vnet.ibm.com \
    --cc=davem@davemloft.net \
    --cc=fweisbec@gmail.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=hpa@zytor.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mhiramat@redhat.com \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    /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).