make kcmp own config entry
cover make kcmp own config entry
Hi guys, kcmp syscall (according to git log) is being wired up for a number of architectures other than x86 (where it was developed initially). But the main Makefile which controling its compilation is still x86 dependant.
Thus I think kcmp may deserve own config entry unrelated to arch type it is being compiled for. In case if some particular arch doesn't support it ENOSYS should be returned. This small set also wires up kcmp for ARM.
Please take a look, thanks!
Cyrill
PATCH 1/2 kcmp: Make it to depend on CONFIG_KCMP
An embedded and charset-unspecified text was scrubbed...
Name: kcmp-config
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130219/c46debdc/attachment.ksh>
Re: [patch 1/2] kcmp: Make it to depend on CONFIG_KCMP
Quoted 11 lines · Cyrill Gorcunov
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 onCONFIG_KCMPoption.
Re: [patch 1/2] kcmp: Make it to depend on CONFIG_KCMP
In reply to Cyrill Gorcunovinit/Kconfig config FHANDLE · line 284
Quoted 9 lines · Cyrill Gorcunov
init/Kconfig +3
-0@@ -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 n
Previously, kcmp was enabled with CONFIG_CHECKPOINT_RESTORE. Maybe change it to 'default CHECKPOINT_RESTORE', so that make oldconfig does the right thing?
Michal
Re: [patch 1/2] kcmp: Make it to depend on CONFIG_KCMP
Quoted 7 lines · Michal Marek
Quoted 6 lines · Cyrill Gorcunov
init/Kconfig +0
-0@@ -279,6 +279,15 @@ config FHANDLE get renamed. Enables open_by_handle_at(2) and name_to_handle_at(2) syscalls.
Quoted 7 lines
init/Kconfig config FHANDLE · line 284
Quoted 3 lines
init/Kconfig +3
-0+config KCMP + bool "kcmp syscall" + default nPreviously, kcmp was enabled with
CONFIG_CHECKPOINT_RESTORE. Maybe change it to 'defaultCHECKPOINT_RESTORE', so that make oldconfig does the right thing?
Yes, thanks, good point! I've been adviced that make it obj-y by default may be a good option as well, not sure.
---
From: Cyrill Gorcunov <[email protected]>
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.
--- init/Kconfig | 9 +++++++++ kernel/Makefile | 4 +--- 2 files changed, 10 insertions(+), 3 deletions(-)
init/Kconfig +9 -0
@@ -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 N. + config AUDIT bool "Auditing support" depends on NET
kernel/Makefile +1 -3
@@ -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
Re: [patch 1/2] kcmp: Make it to depend on CONFIG_KCMP
init/Kconfig config FHANDLE · line 290
Quoted 3 lines · Cyrill Gorcunov
init/Kconfig +3
-0+ + If unsure, say N. +
Wrong advice. In this particular case, Y is the safe alternative.
-hpa
Signature · 2 lines
H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.
Re: [patch 1/2] kcmp: Make it to depend on CONFIG_KCMP
Quoted 6 lines · H. Peter Anvin
Review
Quoted 3 lines · Cyrill Gorcunov
(quoted diff) +3
-0+ + If unsure, say N. +Wrong advice. In this particular case, Y is the safe alternative.
---
From: Cyrill Gorcunov <[email protected]>
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
--- init/Kconfig | 9 +++++++++ kernel/Makefile | 4 +--- 2 files changed, 10 insertions(+), 3 deletions(-)
init/Kconfig +9 -0
@@ -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
kernel/Makefile +1 -3
@@ -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
Re: [patch 1/2] kcmp: Make it to depend on CONFIG_KCMP
Quoted 37 lines · On Tue, 19 Feb 2013 22:28:38 +0400 Cyrill Gorcunov <[email protected]> wrote:
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 onCONFIG_KCMPoption....
init/Kconfig +9
-0@@ -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 NETIndex: linux-2.6.git/kernel/Makefile
===================================================================
kernel/Makefile endif · line 31
Quoted 10 lines
kernel/Makefile +1
-3@@ -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
This permits people to select kcmp with CONFIG_CHECKPOINT_RESTORE=n. Is there any point in doing that?
What would be wrong with just doing
obj-$(CONFIG_CHECKPOINT_RESTORE) += kcmp.o
?
Re: [patch 1/2] kcmp: Make it to depend on CONFIG_KCMP
Quoted 19 lines · Andrew Morton
Quoted 5 lines
Index: linux-2.6.git/kernel/Makefile
===================================================================kernel/Makefile endif · line 31
Quoted 10 lines
kernel/Makefile +1
-3@@ -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.oThis permits people to select kcmp with
CONFIG_CHECKPOINT_RESTORE=n. Is there any point in doing that?
Quoted 4 lines
What would be wrong with just doing
obj-$(CONFIG_CHECKPOINT_RESTORE) += kcmp.o
The real question is if there are any potential use cases of kcmp() outside checkpoint/restore. It is actually a very general facility.
-hpa
Signature · 2 lines
H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.
Re: [patch 1/2] kcmp: Make it to depend on CONFIG_KCMP
Quoted 11 lines · H. Peter Anvin
Quoted 8 lines
This permits people to select kcmp with
CONFIG_CHECKPOINT_RESTORE=n. Is there any point in doing that?What would be wrong with just doing
obj-$(CONFIG_CHECKPOINT_RESTORE) += kcmp.oThe real question is if there are any potential use cases of
kcmp()outside checkpoint/restore. It is actually a very general facility.
As far as I remember Eric was pointing to such potential use at early time when kcmp being only started developing (I'm trying to find this email in archive, if only my memory doesn't betray me and it was about something else ;) Nevertheless, one may write utility to output statistics on shared "resource" used by a task (don't know if it's that useful since we use kcmp for c/r sake, but still).
Re: [patch 1/2] kcmp: Make it to depend on CONFIG_KCMP
In reply to Andrew MortonQuoted 19 lines · Andrew Morton
Quoted 5 lines
Index: linux-2.6.git/kernel/Makefile
===================================================================kernel/Makefile endif · line 31
Quoted 10 lines
kernel/Makefile +1
-3@@ -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.oThis permits people to select kcmp with
CONFIG_CHECKPOINT_RESTORE=n. Is there any point in doing that?
Quoted 3 lines
What would be wrong with just doing
obj-$(CONFIG_CHECKPOINT_RESTORE) += kcmp.o
I think this syscall is usefull even without c/r stuff. That's why I made it with separate config option.
Re: [patch 1/2] kcmp: Make it to depend on CONFIG_KCMP
Quoted 20 lines · On Wed, 20 Feb 2013 01:54:32 +0400 Cyrill Gorcunov <[email protected]> wrote:
Quoted 19 lines · Andrew Morton
Quoted 5 lines
Index: linux-2.6.git/kernel/Makefile
===================================================================kernel/Makefile endif · line 31
Quoted 10 lines
kernel/Makefile +1
-3@@ -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.oThis permits people to select kcmp with
CONFIG_CHECKPOINT_RESTORE=n. Is there any point in doing that?
Quoted 6 lines
Quoted 3 lines
What would be wrong with just doing
obj-$(CONFIG_CHECKPOINT_RESTORE) += kcmp.oI think this syscall is usefull even without c/r stuff. That's why I made it with separate config option.
hm, OK.
But the patch also permits CONFIG_CHECKPOINT_RESTORE=y, CONFIG_KCMP=n which surely isn't something which CRIU wants to support?
Re: [patch 1/2] kcmp: Make it to depend on CONFIG_KCMP
Quoted 8 lines · Andrew Morton
Quoted 3 lines
I think this syscall is usefull even without c/r stuff. That's why I made it with separate config option.
hm, OK.
But the patch also permits
CONFIG_CHECKPOINT_RESTORE=y,CONFIG_KCMP=nwhich surely isn't something which CRIU wants to support?
Hmm, yes from one pov this feature is useful for out-of-c/r user, from another pov -- we will have to ask users to turn on additional CONFIG entries (which i'm sure not set by default in wide range of distros). Thus it seems less paiful way is either make it obj-(CHECKPOINT_RESTORE) as you proposed, or obj-y by default. The last can't be undone, so I'll prepare the patch for obj-(CHECKPOINT_RESTORE) I think.
Re: [patch 1/2] kcmp: Make it to depend on CONFIG_KCMP
Quoted 10 lines · Cyrill Gorcunov
Quoted 8 lines · Andrew Morton
Quoted 3 lines
I think this syscall is usefull even without c/r stuff. That's why I made it with separate config option.
hm, OK.
But the patch also permits
CONFIG_CHECKPOINT_RESTORE=y,CONFIG_KCMP=nwhich surely isn't something which CRIU wants to support?
Quoted 6 lines
Hmm, yes from one pov this feature is useful for out-of-c/r user, from another pov -- we will have to ask users to turn on additional CONFIG entries (which i'm sure not set by default in wide range of distros). Thus it seems less paiful way is either make it obj-(CHECKPOINT_RESTORE) as you proposed, or obj-y by default. The last can't be undone, so I'll prepare the patch for obj-(CHECKPOINT_RESTORE) I think.
Here is update. Peter, does it look good for you too?
---
From: Cyrill Gorcunov <[email protected]>
Subject: kcmp: Make it to depend on CHECKPOINT_RESTORE
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 CHECKPOINT_RESTORE option.
--- kernel/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
kernel/Makefile +1 -3
@@ -25,9 +25,7 @@ endif obj-y += sched/ obj-y += power/ -ifeq ($(CONFIG_CHECKPOINT_RESTORE),y) -obj-$(CONFIG_X86) += kcmp.o -endif +obj-$(CHECKPOINT_RESTORE) += kcmp.o obj-$(CONFIG_FREEZER) += freezer.o obj-$(CONFIG_PROFILING) += profile.o obj-$(CONFIG_STACKTRACE) += stacktrace.o
Re: [patch 1/2] kcmp: Make it to depend on CONFIG_KCMP
Quoted 2 lines · Cyrill Gorcunov
Here is update. Peter, does it look good for you too?
Sigh, -ENOTQUILTREFRESHED, sorry
---
From: Cyrill Gorcunov <[email protected]>
Subject: kcmp: Make it to depend on CHECKPOINT_RESTORE
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 CHECKPOINT_RESTORE option.
--- kernel/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
kernel/Makefile +1 -3
@@ -25,9 +25,7 @@ endif obj-y += sched/ obj-y += power/ -ifeq ($(CONFIG_CHECKPOINT_RESTORE),y) -obj-$(CONFIG_X86) += kcmp.o -endif +obj-$(CONFIG_CHECKPOINT_RESTORE) += kcmp.o obj-$(CONFIG_FREEZER) += freezer.o obj-$(CONFIG_PROFILING) += profile.o obj-$(CONFIG_STACKTRACE) += stacktrace.o
Re: [patch 1/2] kcmp: Make it to depend on CONFIG_KCMP
In reply to Cyrill GorcunovQuoted 10 lines · Cyrill Gorcunov
Quoted 8 lines · Andrew Morton
Quoted 3 lines
I think this syscall is usefull even without c/r stuff. That's why I made it with separate config option.
hm, OK.
But the patch also permits
CONFIG_CHECKPOINT_RESTORE=y,CONFIG_KCMP=nwhich surely isn't something which CRIU wants to support?
Quoted 7 lines
Hmm, yes from one pov this feature is useful for out-of-c/r user, from another pov -- we will have to ask users to turn on additional CONFIG entries (which i'm sure not set by default in wide range of distros). Thus it seems less paiful way is either make it obj-(CHECKPOINT_RESTORE) as you proposed, or obj-y by default. The last can't be undone, so I'll prepare the patch for obj-(CHECKPOINT_RESTORE) I think.
Well, that's what dependencies are for.
Either way we might just want to wait for such a use case to appear, I don't know.
-hpa
Signature · 2 lines
H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.
PATCH 2/2 arm: Wire up kcmp syscall
In reply to Cyrill GorcunovAn embedded and charset-unspecified text was scrubbed...
Name: kcmp-arm
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130219/6c9f35b9/attachment.ksh>
Re: [patch 2/2] arm: Wire up kcmp syscall
quilt eat original header, here is the former, sorry for incovenience.
---
From: Alexander Kartashov <[email protected]>
Subject: arm: Wire up kcmp syscall
--- arch/arm/include/uapi/asm/unistd.h | 2 +- arch/arm/kernel/calls.S | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/include/uapi/asm/unistd.h +1 -1
@@ -404,7 +404,7 @@#define __NR_setns (__NR_SYSCALL_BASE+375)#define __NR_process_vm_readv (__NR_SYSCALL_BASE+376)#define __NR_process_vm_writev (__NR_SYSCALL_BASE+377) -/* 378 for kcmp */ +#define __NR_kcmp (__NR_SYSCALL_BASE+378)#define __NR_finit_module (__NR_SYSCALL_BASE+379)/*
arch/arm/kernel/calls.S +1 -1
@@ -387,7 +387,7 @@ /* 375 */ CALL(sys_setns) CALL(sys_process_vm_readv) CALL(sys_process_vm_writev) - CALL(sys_ni_syscall) /* reserved for sys_kcmp */ + CALL(sys_kcmp) CALL(sys_finit_module) #ifndef syscalls_counted .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
PATCH 2/2 arm: Wire up kcmp syscall
Quoted 5 lines · Cyrill Gorcunov
From: Alexander Kartashov <[email protected]>
Subject: arm: Wire up kcmp syscallSigned-off-by Alexander Kartashov <[email protected]>Cc Russell King <[email protected]>
Ping? Guys is there any change to get it reviewed/acked/nacked? Sorry for nagging but this syscall is quite important for c/r functionality on arm machine.
Re: [patch 2/2] arm: Wire up kcmp syscall
In reply to Cyrill GorcunovQuoted 5 lines · On Tue, 19 Feb 2013 11:07:03 +0400 Cyrill Gorcunov <[email protected]> wrote:
From: Alexander Kartashov <[email protected]>
Subject: arm: Wire up kcmp syscallSigned-off-by Alexander Kartashov <[email protected]>Cc Russell King <[email protected]>
This should have had signed-off-by:you, as you were on the patch's delivery path.
Re: [patch 2/2] arm: Wire up kcmp syscall
Quoted 11 lines · Andrew Morton
Quoted 5 lines · On Tue, 19 Feb 2013 11:07:03 +0400 Cyrill Gorcunov <[email protected]> wrote:
From: Alexander Kartashov <[email protected]>
Subject: arm: Wire up kcmp syscallSigned-off-by Alexander Kartashov <[email protected]>Cc Russell King <[email protected]>This should have had signed-off-by:you, as you were on the patch's delivery path.
Ouch, sorry Andrew! Thanks!
Arnd Bergmann
Acked-byRe: [patch 2/2] arm: Wire up kcmp syscall
In reply to Cyrill GorcunovQuoted 5 lines · Cyrill Gorcunov
From: Alexander Kartashov <[email protected]>
Subject: arm: Wire up kcmp syscallSigned-off-by Alexander Kartashov <[email protected]>Cc Russell King <[email protected]>
Looks uncontroversial since the number is already reserved and there is a cond_syscall() line, which means it does not even depend on patch 1.
Russell, are you picking this one up?