* kexec: load-preserve-context option on s390
@ 2011-09-26 13:09 Michael Holzheu
2011-09-28 23:51 ` Simon Horman
0 siblings, 1 reply; 7+ messages in thread
From: Michael Holzheu @ 2011-09-26 13:09 UTC (permalink / raw)
To: Simon Horman; +Cc: kexec, Vivek Goyal, ying.huang
Hello Simon,
I think the --load-preserve-context and --load-jump-back-helper kexec
options are not working on s390 because we do not support
CONFIG_KEXEC_JUMP. I assume the same is true also on other
architectures. Correct me, if I am wrong. Unfortunately I did not find
much documentation for that feature.
Wouldn't it be better to print an error message when the options are
used on those architectures?
Michael
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: kexec: load-preserve-context option on s390
2011-09-26 13:09 kexec: load-preserve-context option on s390 Michael Holzheu
@ 2011-09-28 23:51 ` Simon Horman
2011-09-29 13:32 ` Vivek Goyal
0 siblings, 1 reply; 7+ messages in thread
From: Simon Horman @ 2011-09-28 23:51 UTC (permalink / raw)
To: Michael Holzheu; +Cc: kexec, Vivek Goyal, ying.huang
On Mon, Sep 26, 2011 at 03:09:09PM +0200, Michael Holzheu wrote:
> Hello Simon,
>
> I think the --load-preserve-context and --load-jump-back-helper kexec
> options are not working on s390 because we do not support
> CONFIG_KEXEC_JUMP. I assume the same is true also on other
> architectures. Correct me, if I am wrong. Unfortunately I did not find
> much documentation for that feature.
>
> Wouldn't it be better to print an error message when the options are
> used on those architectures?
Ideally it would be nice if kexec-tools could ask the kernel
if KEXEC_JUMP is supported (or enabled?) or not rather than
hardcoding this information into kexec-tools on a per-architecture basis.
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: kexec: load-preserve-context option on s390
2011-09-28 23:51 ` Simon Horman
@ 2011-09-29 13:32 ` Vivek Goyal
2011-09-29 13:38 ` Michael Holzheu
0 siblings, 1 reply; 7+ messages in thread
From: Vivek Goyal @ 2011-09-29 13:32 UTC (permalink / raw)
To: Simon Horman; +Cc: Michael Holzheu, kexec, ying.huang
On Thu, Sep 29, 2011 at 08:51:02AM +0900, Simon Horman wrote:
> On Mon, Sep 26, 2011 at 03:09:09PM +0200, Michael Holzheu wrote:
> > Hello Simon,
> >
> > I think the --load-preserve-context and --load-jump-back-helper kexec
> > options are not working on s390 because we do not support
> > CONFIG_KEXEC_JUMP. I assume the same is true also on other
> > architectures. Correct me, if I am wrong. Unfortunately I did not find
> > much documentation for that feature.
> >
> > Wouldn't it be better to print an error message when the options are
> > used on those architectures?
>
> Ideally it would be nice if kexec-tools could ask the kernel
> if KEXEC_JUMP is supported (or enabled?) or not rather than
> hardcoding this information into kexec-tools on a per-architecture basis.
Shouldn't kexec system call return error if KEXEC_JUMP is not supported
and user asked for it?
Thanks
Vivek
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: kexec: load-preserve-context option on s390
2011-09-29 13:32 ` Vivek Goyal
@ 2011-09-29 13:38 ` Michael Holzheu
2011-09-30 16:06 ` Vivek Goyal
0 siblings, 1 reply; 7+ messages in thread
From: Michael Holzheu @ 2011-09-29 13:38 UTC (permalink / raw)
To: Vivek Goyal; +Cc: Simon Horman, kexec, ying.huang
Hello Vivec,
On Thu, 2011-09-29 at 09:32 -0400, Vivek Goyal wrote:
> On Thu, Sep 29, 2011 at 08:51:02AM +0900, Simon Horman wrote:
> > On Mon, Sep 26, 2011 at 03:09:09PM +0200, Michael Holzheu wrote:
> > > Hello Simon,
> > >
> > > I think the --load-preserve-context and --load-jump-back-helper kexec
> > > options are not working on s390 because we do not support
> > > CONFIG_KEXEC_JUMP. I assume the same is true also on other
> > > architectures. Correct me, if I am wrong. Unfortunately I did not find
> > > much documentation for that feature.
> > >
> > > Wouldn't it be better to print an error message when the options are
> > > used on those architectures?
> >
> > Ideally it would be nice if kexec-tools could ask the kernel
> > if KEXEC_JUMP is supported (or enabled?) or not rather than
> > hardcoding this information into kexec-tools on a per-architecture basis.
>
> Shouldn't kexec system call return error if KEXEC_JUMP is not supported
> and user asked for it?
I think currently not. I assume that we should check the
KEXEC_PRESERVE_CONTEXT flag in the kexec_load system call.
What about the following:
---
kernel/kexec.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -949,6 +949,10 @@ SYSCALL_DEFINE4(kexec_load, unsigned lon
if (!capable(CAP_SYS_BOOT))
return -EPERM;
+#ifndef CONFIG_KEXEC_JUMP
+ if (flags & KEXEC_PRESERVE_CONTEXT)
+ return -EOPNOTSUPP;
+#endif
/*
* Verify we have a legal set of flags
* This leaves us room for future extensions.
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: kexec: load-preserve-context option on s390
2011-09-29 13:38 ` Michael Holzheu
@ 2011-09-30 16:06 ` Vivek Goyal
2011-10-04 14:07 ` Michael Holzheu
0 siblings, 1 reply; 7+ messages in thread
From: Vivek Goyal @ 2011-09-30 16:06 UTC (permalink / raw)
To: Michael Holzheu; +Cc: Simon Horman, kexec, ying.huang
On Thu, Sep 29, 2011 at 03:38:31PM +0200, Michael Holzheu wrote:
> Hello Vivec,
Right spelling is "Vivek" and not "Vivec" :-)
[..]
> > Shouldn't kexec system call return error if KEXEC_JUMP is not supported
> > and user asked for it?
>
> I think currently not. I assume that we should check the
> KEXEC_PRESERVE_CONTEXT flag in the kexec_load system call.
>
Shouldn't following existing code take care of this already?
/*
* Verify we have a legal set of flags
* This leaves us room for future extensions.
*/
if ((flags & KEXEC_FLAGS) != (flags & ~KEXEC_ARCH_MASK))
return -EINVAL;
In include/linux/kexec.h, we have following.
/* List of defined/legal kexec flags */
#ifndef CONFIG_KEXEC_JUMP
#define KEXEC_FLAGS KEXEC_ON_CRASH
#else
#define KEXEC_FLAGS (KEXEC_ON_CRASH | KEXEC_PRESERVE_CONTEXT)
#endif
Not sure why it is not working.
Thanks
Vivek
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: kexec: load-preserve-context option on s390
2011-09-30 16:06 ` Vivek Goyal
@ 2011-10-04 14:07 ` Michael Holzheu
2011-10-04 14:55 ` Vivek Goyal
0 siblings, 1 reply; 7+ messages in thread
From: Michael Holzheu @ 2011-10-04 14:07 UTC (permalink / raw)
To: Vivek Goyal; +Cc: Simon Horman, kexec, ying.huang
Hello Vivek,
On Fri, 2011-09-30 at 12:06 -0400, Vivek Goyal wrote:
> On Thu, Sep 29, 2011 at 03:38:31PM +0200, Michael Holzheu wrote:
> > Hello Vivec,
>
> Right spelling is "Vivek" and not "Vivec" :-)
I know... and I really wanted to avoid that error. But somehow the "c"
is always coming automatically :-)
> [..]
> > > Shouldn't kexec system call return error if KEXEC_JUMP is not supported
> > > and user asked for it?
> >
> > I think currently not. I assume that we should check the
> > KEXEC_PRESERVE_CONTEXT flag in the kexec_load system call.
> >
>
> Shouldn't following existing code take care of this already?
>
> /*
> * Verify we have a legal set of flags
> * This leaves us room for future extensions.
> */
> if ((flags & KEXEC_FLAGS) != (flags & ~KEXEC_ARCH_MASK))
> return -EINVAL;
>
> In include/linux/kexec.h, we have following.
>
> /* List of defined/legal kexec flags */
> #ifndef CONFIG_KEXEC_JUMP
> #define KEXEC_FLAGS KEXEC_ON_CRASH
> #else
> #define KEXEC_FLAGS (KEXEC_ON_CRASH | KEXEC_PRESERVE_CONTEXT)
> #endif
>
> Not sure why it is not working.
Hmmm, actually it is working. I somehow must have overlooked that
before.
When I call kexec with --load-preserve-context - while not really
knowing what I am doing here - I get the following:
# kexec -p /boot/vmlinuz --load-preserve-context --mem-min=0x10000
--mem-max=0x100000000
kexec_load failed: Invalid argument
entry = 0x10000 flags = 160002
nr_segments = 2
segment[0].buf = 0x3fffc989010
segment[0].bufsz = 330600
segment[0].mem = 0x10000
segment[0].memsz = 331000
segment[1].buf = (nil)
segment[1].bufsz = 0
segment[1].mem = 0x341000
segment[1].memsz = 334be000
Perhaps a better error message could help here. But there are several
possible reasons for getting EINVAL from kexec_load(). So probably we
can't say "--load-preserve-context not supported by current kernel"
every time we get EINVAL from kexec_load().
Not sure what to do here. Perhaps we just leave it as it is.
BTW: Is there any good documentation on KEXEC_PRESERVE_CONTEXT?
Michael
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: kexec: load-preserve-context option on s390
2011-10-04 14:07 ` Michael Holzheu
@ 2011-10-04 14:55 ` Vivek Goyal
0 siblings, 0 replies; 7+ messages in thread
From: Vivek Goyal @ 2011-10-04 14:55 UTC (permalink / raw)
To: Michael Holzheu; +Cc: Simon Horman, kexec, ying.huang
On Tue, Oct 04, 2011 at 04:07:06PM +0200, Michael Holzheu wrote:
[..]
> > Not sure why it is not working.
>
> Hmmm, actually it is working. I somehow must have overlooked that
> before.
>
> When I call kexec with --load-preserve-context - while not really
> knowing what I am doing here - I get the following:
>
> # kexec -p /boot/vmlinuz --load-preserve-context --mem-min=0x10000
> --mem-max=0x100000000
>
> kexec_load failed: Invalid argument
> entry = 0x10000 flags = 160002
> nr_segments = 2
> segment[0].buf = 0x3fffc989010
> segment[0].bufsz = 330600
> segment[0].mem = 0x10000
> segment[0].memsz = 331000
> segment[1].buf = (nil)
> segment[1].bufsz = 0
> segment[1].mem = 0x341000
> segment[1].memsz = 334be000
>
> Perhaps a better error message could help here. But there are several
> possible reasons for getting EINVAL from kexec_load(). So probably we
> can't say "--load-preserve-context not supported by current kernel"
> every time we get EINVAL from kexec_load().
>
> Not sure what to do here. Perhaps we just leave it as it is.
I am also not sure what can we do here. There are many cases where -EINVAL
can happen.
>
> BTW: Is there any good documentation on KEXEC_PRESERVE_CONTEXT?
I am not aware of any and really wished there was one
Huang, is there any? Also is anybody using KEXEC_PRESERVE_CONTEXT? I have
not encountered any users yet.
Thanks
Vivek
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-10-04 14:55 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-26 13:09 kexec: load-preserve-context option on s390 Michael Holzheu
2011-09-28 23:51 ` Simon Horman
2011-09-29 13:32 ` Vivek Goyal
2011-09-29 13:38 ` Michael Holzheu
2011-09-30 16:06 ` Vivek Goyal
2011-10-04 14:07 ` Michael Holzheu
2011-10-04 14:55 ` Vivek Goyal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox