Subject: [patch 1/2] kcmp: Make it to depend on CONFIG_KCMP

From: [email-masked] (Cyrill Gorcunov)
Date: Tue, 19 Feb 2013 22:28:38 +0400

On Tue, Feb 19, 2013 at 09:53:47AM -0800, H. Peter Anvin wrote:
> On 02/19/2013 01:31 AM, Cyrill Gorcunov wrote:
> >+
> >+	  If unsure, say N.
> >+
> 
> Wrong advice.  In this particular case, Y is the safe alternative.
---
From: Cyrill Gorcunov <[email-masked]>
Subject: kcmp: Make it to depend on CONFIG_KCMP

Since kcmp syscall has been implemented (initially on
x86 architecture) a number of other archs wire it up
as well: xtensa, sparc, sh, s390, mips, microblaze,
m68k (not taking into account those who uses
<asm-generic/unistd.h> for syscall numbers
definitions).

But the Makefile, which turns kcmp.o generation on
still depends on former config-x86. Thus get rid
of this limitation and make kcmp.o depend on CONFIG_KCMP
option.

v2:
 - As Michal pointed the old configs might already use of
   CHECKPOINT_RESTORE, so make "default" accordingly.
 - Advice Y if unsure

Signed-off-by: Cyrill Gorcunov <[email-masked]>
Cc: KOSAKI Motohiro <[email-masked]>
Cc: "Eric W. Biederman" <[email-masked]>
Cc: Pavel Emelyanov <[email-masked]>
Cc: Andrey Vagin <[email-masked]>
Cc: Ingo Molnar <[email-masked]>
Cc: H. Peter Anvin <[email-masked]>
Cc: Thomas Gleixner <[email-masked]>
Cc: Glauber Costa <[email-masked]>
Cc: Andi Kleen <[email-masked]>
Cc: Tejun Heo <[email-masked]>
Cc: Matt Helsley <[email-masked]>
Cc: Pekka Enberg <[email-masked]>
Cc: Eric Dumazet <[email-masked]>
Cc: Vasiliy Kulikov <[email-masked]>
Cc: Alexey Dobriyan <[email-masked]>
Cc: Valdis.Kletnieks at vt.edu
Cc: Michal Marek <[email-masked]>
Cc: Frederic Weisbecker <[email-masked]>
Cc: Andrew Morton <[email-masked]>
---
 init/Kconfig    |    9 +++++++++
 kernel/Makefile |    4 +---
 2 files changed, 10 insertions(+), 3 deletions(-)

Index: linux-2.6.git/init/Kconfig
===================================================================
--- linux-2.6.git.orig/init/Kconfig
+++ linux-2.6.git/init/Kconfig
@@ -279,6 +279,15 @@ config FHANDLE
 	  get renamed. Enables open_by_handle_at(2) and name_to_handle_at(2)
 	  syscalls.
 
+config KCMP
+	bool "kcmp syscall"
+	default CHECKPOINT_RESTORE
+	help
+	  If you say Y here, a user level program will be able to use
+	  kcmp(2) syscall.
+
+	  If unsure, say Y.
+
 config AUDIT
 	bool "Auditing support"
 	depends on NET
Index: linux-2.6.git/kernel/Makefile
===================================================================
--- linux-2.6.git.orig/kernel/Makefile
+++ linux-2.6.git/kernel/Makefile
@@ -25,9 +25,7 @@ endif
 obj-y += sched/
 obj-y += power/
 
-ifeq ($(CONFIG_CHECKPOINT_RESTORE),y)
-obj-$(CONFIG_X86) += kcmp.o
-endif
+obj-$(CONFIG_KCMP) += kcmp.o
 obj-$(CONFIG_FREEZER) += freezer.o
 obj-$(CONFIG_PROFILING) += profile.o
 obj-$(CONFIG_STACKTRACE) += stacktrace.o