Hi,
Here are a few minor fixups and enhancements for kexec support.
Patch 3 and 4 that add preprocessor macros for the kimage list flags are
ones that I use in the arm64 kexec support I am working on, so it would
be nice for those to go in.
Please consider.
-Geoff
The following changes since commit 7d1311b93e58ed55f3a31cc8f94c4b8fe988a2b9:
Linux 3.17-rc1 (2014-08-16 10:40:26 -0600)
are available in the git repository at:
git://git.linaro.org/people/geoff.levand/linux-kexec.git for-kexec
for you to fetch changes up to dc3c63e69815e00dce5454bd50e2991e9ea33f64:
powerpc/kexec: Use global IND_FLAGS macro (2014-08-22 11:15:18 -0700)
----------------------------------------------------------------
Geoff Levand (5):
kexec: Fix make headers_check
kexec: Simplify conditional
kexec: Add bit definitions for kimage entry flags
kexec: Add IND_FLAGS macro
powerpc/kexec: Use global IND_FLAGS macro
arch/powerpc/kernel/machine_kexec_64.c | 2 --
include/linux/kexec.h | 20 ++++++++++++++++----
include/uapi/linux/kexec.h | 6 ------
kernel/kexec.c | 17 ++++++++++-------
4 files changed, 26 insertions(+), 19 deletions(-)
--
1.9.1
Simplify the code around one of the conditionals in the kexec_load
syscall routine.
The original code was confusing with a redundant check on KEXEC_ON_CRASH
and comments outside of the conditional block. This change switches the
order of the conditional check, and cleans up the comments for the
conditional. There is no functional change to the code.
Signed-off-by: Geoff Levand <geoff@infradead.org>
---
kernel/kexec.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
@@ -1282,19 +1282,22 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,if(nr_segments>0){unsignedlongi;-/* Loading another kernel to reboot into */-if((flags&KEXEC_ON_CRASH)==0)-result=kimage_alloc_init(&image,entry,nr_segments,-segments,flags);-/* Loading another kernel to switch to if this one crashes */-elseif(flags&KEXEC_ON_CRASH){-/* Free any current crash dump kernel before+if(flags&KEXEC_ON_CRASH){+/*+*Loadinganotherkerneltoswitchtoifthisone+*crashes.Freeanycurrentcrashdumpkernelbefore*wecorruptit.*/+kimage_free(xchg(&kexec_crash_image,NULL));result=kimage_alloc_init(&image,entry,nr_segments,segments,flags);crash_map_reserved_pages();+}else{+/* Loading another kernel to reboot into. */++result=kimage_alloc_init(&image,entry,nr_segments,+segments,flags);}if(result)gotoout;
linux/kexec.h now defines an IND_FLAGS macro. Remove the local powerpc
definition and use the generic one.
Signed-off-by: Geoff Levand <geoff@infradead.org>
---
arch/powerpc/kernel/machine_kexec_64.c | 2 --
1 file changed, 2 deletions(-)
Define new kexec preprocessor macros IND_*_BIT that define the bit position of
the kimage entry flags. Change the existing IND_* flag macros to be defined as
bit shifts of the corresponding IND_*_BIT macros. Also wrap all C language code
in kexec.h with #if !defined(__ASSEMBLY__) so assembly files can include kexec.h
to get the IND_* and IND_*_BIT macros.
Some CPU instruction sets have tests for bit position which are convenient in
implementing routines that operate on the kimage entry list. The addition of
these bit position macros in a common location will avoid duplicate definitions
and the chance that changes to the IND_* flags will not be propagated to
assembly files.
Signed-off-by: Geoff Levand <geoff@infradead.org>
---
include/linux/kexec.h | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
Add a new kexec preprocessor macro IND_FLAGS, which is the bitwise OR of
all the possible kexec IND_ kimage_entry indirection flags.
Having this macro allows for simplified code in the prosessing of the
kexec kimage_entry items.
Signed-off-by: Geoff Levand <geoff@infradead.org>
---
include/linux/kexec.h | 1 +
1 file changed, 1 insertion(+)
Remove the unneded declaration for a kexec_load() routine.
Fixes errors like these when running 'make headers_check':
include/uapi/linux/kexec.h: userspace cannot reference function or variable defined in the kernel
Signed-off-by: Geoff Levand <geoff@infradead.org>
---
include/uapi/linux/kexec.h | 6 ------
1 file changed, 6 deletions(-)
@@ -55,12 +55,6 @@ struct kexec_segment {size_tmemsz;};-/* Load a new kernel image as described by the kexec_segment array-*consistingofpassednumberofsegmentsattheentry-pointaddress.-*Theflagsallowdifferentuseagetypes.-*/-externintkexec_load(void*,size_t,structkexec_segment*,-unsignedlongint);#endif /* __KERNEL__ */#endif /* _UAPILINUX_KEXEC_H */
On Fri, Aug 22, 2014 at 06:39:47PM +0000, Geoff Levand wrote:
Hi,
Here are a few minor fixups and enhancements for kexec support.
Patch 3 and 4 that add preprocessor macros for the kimage list flags are
ones that I use in the arm64 kexec support I am working on, so it would
be nice for those to go in.
Please consider.
Hi Geoff,
Does arm64 has secureboot? If yes, then it might make sense to
enable the new syscall kexec_file_load() on arm64 instead of trying
to make old syscall work first.
Thanks
Vivek
-Geoff
The following changes since commit 7d1311b93e58ed55f3a31cc8f94c4b8fe988a2b9:
Linux 3.17-rc1 (2014-08-16 10:40:26 -0600)
are available in the git repository at:
git://git.linaro.org/people/geoff.levand/linux-kexec.git for-kexec
for you to fetch changes up to dc3c63e69815e00dce5454bd50e2991e9ea33f64:
powerpc/kexec: Use global IND_FLAGS macro (2014-08-22 11:15:18 -0700)
----------------------------------------------------------------
Geoff Levand (5):
kexec: Fix make headers_check
kexec: Simplify conditional
kexec: Add bit definitions for kimage entry flags
kexec: Add IND_FLAGS macro
powerpc/kexec: Use global IND_FLAGS macro
arch/powerpc/kernel/machine_kexec_64.c | 2 --
include/linux/kexec.h | 20 ++++++++++++++++----
include/uapi/linux/kexec.h | 6 ------
kernel/kexec.c | 17 ++++++++++-------
4 files changed, 26 insertions(+), 19 deletions(-)
--
1.9.1
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
On Fri, Aug 22, 2014 at 06:39:47PM +0000, Geoff Levand wrote:
Remove the unneded declaration for a kexec_load() routine.
Fixes errors like these when running 'make headers_check':
include/uapi/linux/kexec.h: userspace cannot reference function or variable defined in the kernel
Signed-off-by: Geoff Levand <geoff@infradead.org>
I think Paul Bolle tried to remove this in the past and maximilian
had objections.
http://lists.infradead.org/pipermail/kexec/2014-January/010902.html
I can't see that how exporting kernel prototype helps here. kexec-tools
seems to be using syscall(__NR_kexec_load) directly for non-xen case. So
I would be fine with removing this definition. Just trying to make sure
that it does not break any other library or users of this declaration.
Thanks
Vivek
@@ -55,12 +55,6 @@ struct kexec_segment {size_tmemsz;};-/* Load a new kernel image as described by the kexec_segment array-*consistingofpassednumberofsegmentsattheentry-pointaddress.-*Theflagsallowdifferentuseagetypes.-*/-externintkexec_load(void*,size_t,structkexec_segment*,-unsignedlongint);#endif /* __KERNEL__ */#endif /* _UAPILINUX_KEXEC_H */
--
1.9.1
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
On Fri, Aug 22, 2014 at 06:39:47PM +0000, Geoff Levand wrote:
Simplify the code around one of the conditionals in the kexec_load
syscall routine.
The original code was confusing with a redundant check on KEXEC_ON_CRASH
and comments outside of the conditional block. This change switches the
order of the conditional check, and cleans up the comments for the
conditional. There is no functional change to the code.
Signed-off-by: Geoff Levand <geoff@infradead.org>
This is simple reorganization.
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Vivek
@@ -1282,19 +1282,22 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,if(nr_segments>0){unsignedlongi;-/* Loading another kernel to reboot into */-if((flags&KEXEC_ON_CRASH)==0)-result=kimage_alloc_init(&image,entry,nr_segments,-segments,flags);-/* Loading another kernel to switch to if this one crashes */-elseif(flags&KEXEC_ON_CRASH){-/* Free any current crash dump kernel before+if(flags&KEXEC_ON_CRASH){+/*+*Loadinganotherkerneltoswitchtoifthisone+*crashes.Freeanycurrentcrashdumpkernelbefore*wecorruptit.*/+kimage_free(xchg(&kexec_crash_image,NULL));result=kimage_alloc_init(&image,entry,nr_segments,segments,flags);crash_map_reserved_pages();+}else{+/* Loading another kernel to reboot into. */++result=kimage_alloc_init(&image,entry,nr_segments,+segments,flags);}if(result)gotoout;
--
1.9.1
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
On Fri, Aug 22, 2014 at 06:39:47PM +0000, Geoff Levand wrote:
Define new kexec preprocessor macros IND_*_BIT that define the bit position of
the kimage entry flags. Change the existing IND_* flag macros to be defined as
bit shifts of the corresponding IND_*_BIT macros. Also wrap all C language code
in kexec.h with #if !defined(__ASSEMBLY__) so assembly files can include kexec.h
to get the IND_* and IND_*_BIT macros.
Some CPU instruction sets have tests for bit position which are convenient in
implementing routines that operate on the kimage entry list. The addition of
these bit position macros in a common location will avoid duplicate definitions
and the chance that changes to the IND_* flags will not be propagated to
assembly files.
Signed-off-by: Geoff Levand <geoff@infradead.org>
Looks good to me.
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Vivek
On Fri, Aug 22, 2014 at 06:39:47PM +0000, Geoff Levand wrote:
Add a new kexec preprocessor macro IND_FLAGS, which is the bitwise OR of
all the possible kexec IND_ kimage_entry indirection flags.
Having this macro allows for simplified code in the prosessing of the
kexec kimage_entry items.
Signed-off-by: Geoff Levand <geoff@infradead.org>
From: Dave Young <hidden> Date: 2014-08-26 07:41:11
On 08/25/14 at 12:59pm, Vivek Goyal wrote:
On Fri, Aug 22, 2014 at 06:39:47PM +0000, Geoff Levand wrote:
quoted
Hi,
Here are a few minor fixups and enhancements for kexec support.
Patch 3 and 4 that add preprocessor macros for the kimage list flags are
ones that I use in the arm64 kexec support I am working on, so it would
be nice for those to go in.
Please consider.
Hi Geoff,
Does arm64 has secureboot? If yes, then it might make sense to
enable the new syscall kexec_file_load() on arm64 instead of trying
to make old syscall work first.
It will save efforts for efi support as well, for the in-kernel loader we do not
necessary to save the efi physical addresses or runtime ranges to sysfs and
passing them to 2nd kernel, we can just copy them in kernel.
Thanks
Dave
Hi Vivek,
On Mon, 2014-08-25 at 12:59 -0400, Vivek Goyal wrote:
Does arm64 has secureboot? If yes, then it might make sense to
enable the new syscall kexec_file_load() on arm64 instead of trying
to make old syscall work first.
Yes, arm64 should support secureboot, but I have not looked into it.
When do you expect syscall kexec_file_load to get merged? I won't wait
until then to push my current kexec work.
-Geoff
On Tue, Aug 26, 2014 at 05:33:28PM -0700, Geoff Levand wrote:
Hi Vivek,
On Mon, 2014-08-25 at 12:59 -0400, Vivek Goyal wrote:
quoted
Does arm64 has secureboot? If yes, then it might make sense to
enable the new syscall kexec_file_load() on arm64 instead of trying
to make old syscall work first.
Yes, arm64 should support secureboot, but I have not looked into it.
When do you expect syscall kexec_file_load to get merged? I won't wait
until then to push my current kexec work.
From: Paul Bolle <hidden> Date: 2014-08-30 12:52:32
[Added Peter Anvin.]
On Mon, 2014-08-25 at 13:22 -0400, Vivek Goyal wrote:
On Fri, Aug 22, 2014 at 06:39:47PM +0000, Geoff Levand wrote:
quoted
Remove the unneded declaration for a kexec_load() routine.
Fixes errors like these when running 'make headers_check':
include/uapi/linux/kexec.h: userspace cannot reference function or variable defined in the kernel
Signed-off-by: Geoff Levand <geoff@infradead.org>
kexec-tools
seems to be using syscall(__NR_kexec_load) directly for non-xen case. So
I would be fine with removing this definition. Just trying to make sure
that it does not break any other library or users of this declaration.
Obviously, this can only break compiling those libraries, or other
users. It can't break already compiled binaries. Besides I don't think
those libraries, etc actually exist. Maximilian mentioned klibc in
January, but I wasn't able to find a version of klibc that cared about
this prototype. No one pointed me at a version that does (or any other
library, etc., for that matter).
(If we do decide to keep this prototype, we should special case this
prototype in headers_check.pl just to silence the build.)
The above can be summarized like this:
Acked-by: Paul Bolle [off-list ref]
Paul Bolle
From: Paul Bolle <hidden> Date: 2014-10-06 14:12:17
Hi Geoff,
On Sat, 2014-08-30 at 14:47 +0200, Paul Bolle wrote:
[Added Peter Anvin.]
On Mon, 2014-08-25 at 13:22 -0400, Vivek Goyal wrote:
quoted
On Fri, Aug 22, 2014 at 06:39:47PM +0000, Geoff Levand wrote:
quoted
Remove the unneded declaration for a kexec_load() routine.
Fixes errors like these when running 'make headers_check':
include/uapi/linux/kexec.h: userspace cannot reference function or variable defined in the kernel
Signed-off-by: Geoff Levand <geoff@infradead.org>
kexec-tools
seems to be using syscall(__NR_kexec_load) directly for non-xen case. So
I would be fine with removing this definition. Just trying to make sure
that it does not break any other library or users of this declaration.
Obviously, this can only break compiling those libraries, or other
users. It can't break already compiled binaries. Besides I don't think
those libraries, etc actually exist. Maximilian mentioned klibc in
January, but I wasn't able to find a version of klibc that cared about
this prototype. No one pointed me at a version that does (or any other
library, etc., for that matter).
(If we do decide to keep this prototype, we should special case this
prototype in headers_check.pl just to silence the build.)
The above can be summarized like this:
Acked-by: Paul Bolle [off-list ref]
It seems not much happened after I added my Acked-by. I assume you still
want to get this merged. Is that correct?
Paul Bolle
Hi,
On Mon, 2014-10-06 at 16:12 +0200, Paul Bolle wrote:
On Sat, 2014-08-30 at 14:47 +0200, Paul Bolle wrote:
quoted
[Added Peter Anvin.]
On Mon, 2014-08-25 at 13:22 -0400, Vivek Goyal wrote:
quoted
On Fri, Aug 22, 2014 at 06:39:47PM +0000, Geoff Levand wrote:
quoted
Remove the unneded declaration for a kexec_load() routine.
Fixes errors like these when running 'make headers_check':
include/uapi/linux/kexec.h: userspace cannot reference function or variable defined in the kernel
Signed-off-by: Geoff Levand <geoff@infradead.org>
kexec-tools
seems to be using syscall(__NR_kexec_load) directly for non-xen case. So
I would be fine with removing this definition. Just trying to make sure
that it does not break any other library or users of this declaration.
Obviously, this can only break compiling those libraries, or other
users. It can't break already compiled binaries. Besides I don't think
those libraries, etc actually exist. Maximilian mentioned klibc in
January, but I wasn't able to find a version of klibc that cared about
this prototype. No one pointed me at a version that does (or any other
library, etc., for that matter).
(If we do decide to keep this prototype, we should special case this
prototype in headers_check.pl just to silence the build.)
The above can be summarized like this:
Acked-by: Paul Bolle [off-list ref]
It seems not much happened after I added my Acked-by. I assume you still
want to get this merged. Is that correct?
Yes, I think we concluded there are no real users of this kexec_load()
ptototype, and so it can be removed.
-Geoff
From: "H. Peter Anvin" <hpa@zytor.com> Date: 2014-10-06 17:45:24
On 08/30/2014 05:47 AM, Paul Bolle wrote:
Obviously, this can only break compiling those libraries, or other
users. It can't break already compiled binaries. Besides I don't think
those libraries, etc actually exist. Maximilian mentioned klibc in
January, but I wasn't able to find a version of klibc that cared about
this prototype. No one pointed me at a version that does (or any other
library, etc., for that matter).
... and that would be a klibc bug and we'd just fix it.
-hpa
From: Paul Bolle <hidden> Date: 2014-10-06 18:21:51
On Mon, 2014-10-06 at 10:34 -0700, Geoff Levand wrote:
On Mon, 2014-10-06 at 16:12 +0200, Paul Bolle wrote:
quoted
It seems not much happened after I added my Acked-by. I assume you still
want to get this merged. Is that correct?
Yes, I think we concluded there are no real users of this kexec_load()
ptototype, and so it can be removed.
What would be the quickest way to get this finally resolved? Who's in
charge of this stuff? Would resending your patch, with my Ack added,
speed up things? The vain side of my personality does think it would
help.
Paul Bolle
On Mon, 2014-10-06 at 20:21 +0200, Paul Bolle wrote:
On Mon, 2014-10-06 at 10:34 -0700, Geoff Levand wrote:
quoted
On Mon, 2014-10-06 at 16:12 +0200, Paul Bolle wrote:
quoted
It seems not much happened after I added my Acked-by. I assume you still
want to get this merged. Is that correct?
Yes, I think we concluded there are no real users of this kexec_load()
ptototype, and so it can be removed.
What would be the quickest way to get this finally resolved? Who's in
charge of this stuff? Would resending your patch, with my Ack added,
speed up things? The vain side of my personality does think it would
help.
I'll prepare a V2 set of the this series with the various acks and ask
Andrew to merge it.
-Geoff
Simplify the code around one of the conditionals in the kexec_load
syscall routine.
The original code was confusing with a redundant check on KEXEC_ON_CRASH
and comments outside of the conditional block. This change switches the
order of the conditional check, and cleans up the comments for the
conditional. There is no functional change to the code.
Signed-off-by: Geoff Levand <geoff@infradead.org>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
---
kernel/kexec.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
@@ -1288,19 +1288,22 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,if(nr_segments>0){unsignedlongi;-/* Loading another kernel to reboot into */-if((flags&KEXEC_ON_CRASH)==0)-result=kimage_alloc_init(&image,entry,nr_segments,-segments,flags);-/* Loading another kernel to switch to if this one crashes */-elseif(flags&KEXEC_ON_CRASH){-/* Free any current crash dump kernel before+if(flags&KEXEC_ON_CRASH){+/*+*Loadinganotherkerneltoswitchtoifthisone+*crashes.Freeanycurrentcrashdumpkernelbefore*wecorruptit.*/+kimage_free(xchg(&kexec_crash_image,NULL));result=kimage_alloc_init(&image,entry,nr_segments,segments,flags);crash_map_reserved_pages();+}else{+/* Loading another kernel to reboot into. */++result=kimage_alloc_init(&image,entry,nr_segments,+segments,flags);}if(result)gotoout;
Hi Andrew,
This series is basically a re-send of my kexec fix-up patches I sent out back
in August. Everyone who commented seemed to think these changes were OK, but
there doesn't seem to be a kexec maintainer to pick these up. Could you take
them through your mm tree?
Please let us know.
-Geoff
V2 changes:
o Collected various Acked-by's.
The following changes since commit bfe01a5ba2490f299e1d2d5508cbbbadd897bbe9:
Linux 3.17 (2014-10-05 12:23:04 -0700)
are available in the git repository at:
git://git.linaro.org/people/geoff.levand/linux-kexec.git for-kexec
for you to fetch changes up to adf97d602657c72f6ee59aefe5d51149159a3e99:
powerpc/kexec: Use global IND_FLAGS macro (2014-10-06 17:06:26 -0700)
----------------------------------------------------------------
Geoff Levand (5):
kexec: Fix make headers_check
kexec: Simplify conditional
kexec: Add bit definitions for kimage entry flags
kexec: Add IND_FLAGS macro
powerpc/kexec: Use global IND_FLAGS macro
arch/powerpc/kernel/machine_kexec_64.c | 2 --
include/linux/kexec.h | 20 ++++++++++++++++----
include/uapi/linux/kexec.h | 6 ------
kernel/kexec.c | 17 ++++++++++-------
4 files changed, 26 insertions(+), 19 deletions(-)
--
1.9.1
Remove the unneded declaration for a kexec_load() routine.
Fixes errors like these when running 'make headers_check':
include/uapi/linux/kexec.h: userspace cannot reference function or variable defined in the kernel
Signed-off-by: Geoff Levand <geoff@infradead.org>
Acked-by: Paul Bolle <redacted>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
---
include/uapi/linux/kexec.h | 6 ------
1 file changed, 6 deletions(-)
@@ -55,12 +55,6 @@ struct kexec_segment {size_tmemsz;};-/* Load a new kernel image as described by the kexec_segment array-*consistingofpassednumberofsegmentsattheentry-pointaddress.-*Theflagsallowdifferentuseagetypes.-*/-externintkexec_load(void*,size_t,structkexec_segment*,-unsignedlongint);#endif /* __KERNEL__ */#endif /* _UAPILINUX_KEXEC_H */
linux/kexec.h now defines an IND_FLAGS macro. Remove the local powerpc
definition and use the generic one.
Signed-off-by: Geoff Levand <geoff@infradead.org>
---
arch/powerpc/kernel/machine_kexec_64.c | 2 --
1 file changed, 2 deletions(-)
Add a new kexec preprocessor macro IND_FLAGS, which is the bitwise OR of
all the possible kexec IND_ kimage_entry indirection flags.
Having this macro allows for simplified code in the prosessing of the
kexec kimage_entry items.
Signed-off-by: Geoff Levand <geoff@infradead.org>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
---
include/linux/kexec.h | 1 +
1 file changed, 1 insertion(+)
Define new kexec preprocessor macros IND_*_BIT that define the bit position of
the kimage entry flags. Change the existing IND_* flag macros to be defined as
bit shifts of the corresponding IND_*_BIT macros. Also wrap all C language code
in kexec.h with #if !defined(__ASSEMBLY__) so assembly files can include kexec.h
to get the IND_* and IND_*_BIT macros.
Some CPU instruction sets have tests for bit position which are convenient in
implementing routines that operate on the kimage entry list. The addition of
these bit position macros in a common location will avoid duplicate definitions
and the chance that changes to the IND_* flags will not be propagated to
assembly files.
Signed-off-by: Geoff Levand <geoff@infradead.org>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
---
include/linux/kexec.h | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
On Tue, Oct 07, 2014 at 12:21:30AM +0000, Geoff Levand wrote:
linux/kexec.h now defines an IND_FLAGS macro. Remove the local powerpc
definition and use the generic one.
Signed-off-by: Geoff Levand <geoff@infradead.org>
I think this patch should be merged in previous patch. I guess after
applying patch4, series might not be compilable as there are two
definitions of IND_FLAGS now.
Thanks
Vivek
Add a new kexec preprocessor macro IND_FLAGS, which is the bitwise OR of
all the possible kexec IND_ kimage_entry indirection flags. Having this
macro allows for simplified code in the prosessing of the kexec
kimage_entry items. Also, remove the local powerpc definition and use
the generic one.
Signed-off-by: Geoff Levand <geoff@infradead.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
---
Add a new kexec preprocessor macro IND_FLAGS, which is the bitwise OR of
all the possible kexec IND_ kimage_entry indirection flags. Having this
macro allows for simplified code in the processing of the kexec
kimage_entry items. Also, remove the local powerpc definition and use
the generic one.
Signed-off-by: Geoff Levand <geoff@infradead.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
---
Hi Ben,
Could you give your ack on this, then I'll try to get it
merged with my other kexec patches.
Thanks.
-Geoff
arch/powerpc/kernel/machine_kexec_64.c | 2 --
include/linux/kexec.h | 1 +
2 files changed, 1 insertion(+), 2 deletions(-)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2014-11-12 23:07:30
On Wed, 2014-11-12 at 11:29 -0800, Geoff Levand wrote:
Add a new kexec preprocessor macro IND_FLAGS, which is the bitwise OR of
all the possible kexec IND_ kimage_entry indirection flags. Having this
macro allows for simplified code in the processing of the kexec
kimage_entry items. Also, remove the local powerpc definition and use
the generic one.
Signed-off-by: Geoff Levand <geoff@infradead.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
quoted hunk
Acked-by: Vivek Goyal <vgoyal@redhat.com>
---
Hi Ben,
Could you give your ack on this, then I'll try to get it
merged with my other kexec patches.
Thanks.
-Geoff
arch/powerpc/kernel/machine_kexec_64.c | 2 --
include/linux/kexec.h | 1 +
2 files changed, 1 insertion(+), 2 deletions(-)
Define new kexec preprocessor macros IND_*_BIT that define the bit position of
the kimage entry flags. Change the existing IND_* flag macros to be defined as
bit shifts of the corresponding IND_*_BIT macros. Also wrap all C language code
in kexec.h with #if !defined(__ASSEMBLY__) so assembly files can include kexec.h
to get the IND_* and IND_*_BIT macros.
Some CPU instruction sets have tests for bit position which are convenient in
implementing routines that operate on the kimage entry list. The addition of
these bit position macros in a common location will avoid duplicate definitions
and the chance that changes to the IND_* flags will not be propagated to
assembly files.
Signed-off-by: Geoff Levand <geoff@infradead.org>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
---
include/linux/kexec.h | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
Simplify the code around one of the conditionals in the kexec_load
syscall routine.
The original code was confusing with a redundant check on KEXEC_ON_CRASH
and comments outside of the conditional block. This change switches the
order of the conditional check, and cleans up the comments for the
conditional. There is no functional change to the code.
Signed-off-by: Geoff Levand <geoff@infradead.org>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
---
kernel/kexec.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
@@ -1288,19 +1288,22 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,if(nr_segments>0){unsignedlongi;-/* Loading another kernel to reboot into */-if((flags&KEXEC_ON_CRASH)==0)-result=kimage_alloc_init(&image,entry,nr_segments,-segments,flags);-/* Loading another kernel to switch to if this one crashes */-elseif(flags&KEXEC_ON_CRASH){-/* Free any current crash dump kernel before+if(flags&KEXEC_ON_CRASH){+/*+*Loadinganotherkerneltoswitchtoifthisone+*crashes.Freeanycurrentcrashdumpkernelbefore*wecorruptit.*/+kimage_free(xchg(&kexec_crash_image,NULL));result=kimage_alloc_init(&image,entry,nr_segments,segments,flags);crash_map_reserved_pages();+}else{+/* Loading another kernel to reboot into. */++result=kimage_alloc_init(&image,entry,nr_segments,+segments,flags);}if(result)gotoout;
Remove the unneded declaration for a kexec_load() routine.
Fixes errors like these when running 'make headers_check':
include/uapi/linux/kexec.h: userspace cannot reference function or variable defined in the kernel
Signed-off-by: Geoff Levand <geoff@infradead.org>
Acked-by: Paul Bolle <redacted>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
---
include/uapi/linux/kexec.h | 6 ------
1 file changed, 6 deletions(-)
@@ -55,12 +55,6 @@ struct kexec_segment {size_tmemsz;};-/* Load a new kernel image as described by the kexec_segment array-*consistingofpassednumberofsegmentsattheentry-pointaddress.-*Theflagsallowdifferentuseagetypes.-*/-externintkexec_load(void*,size_t,structkexec_segment*,-unsignedlongint);#endif /* __KERNEL__ */#endif /* _UAPILINUX_KEXEC_H */
Add a new kexec preprocessor macro IND_FLAGS, which is the bitwise OR of
all the possible kexec IND_ kimage_entry indirection flags. Having this
macro allows for simplified code in the prosessing of the kexec
kimage_entry items. Also, remove the local powerpc definition and use
the generic one.
Signed-off-by: Geoff Levand <geoff@infradead.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
---
arch/powerpc/kernel/machine_kexec_64.c | 2 --
include/linux/kexec.h | 1 +
2 files changed, 1 insertion(+), 2 deletions(-)
Hi Andrew,
This is essentially a resend of my patch set from October with the exception
of folding the last two patches of that series into the final patch here.
The patches here have been in review since first posted in August, and have
been acked by one or two kexec developers. Could you merge them through your
mm tree? Thanks.
-Geoff
The following changes since commit 206c5f60a3d902bc4b56dab2de3e88de5eb06108:
Linux 3.18-rc4 (2014-11-09 14:55:29 -0800)
are available in the git repository at:
git://git.linaro.org/people/geoff.levand/linux-kexec.git for-kexec
for you to fetch changes up to 916ef4b8abaa4202ea43731b9cd3f8e0ea95f05b:
kexec: Add IND_FLAGS macro (2014-11-12 15:27:54 -0800)
----------------------------------------------------------------
Geoff Levand (4):
kexec: Fix make headers_check
kexec: Simplify conditional
kexec: Add bit definitions for kimage entry flags
kexec: Add IND_FLAGS macro
arch/powerpc/kernel/machine_kexec_64.c | 2 --
include/linux/kexec.h | 20 ++++++++++++++++----
include/uapi/linux/kexec.h | 6 ------
kernel/kexec.c | 17 ++++++++++-------
4 files changed, 26 insertions(+), 19 deletions(-)
--
1.9.1