Re: kexec: Clearing registers just before jumping into purgatory

2013-10-14 Thread Daniel Kiper
On Fri, Oct 11, 2013 at 03:15:38PM -0700, ebied...@xmission.com wrote: Daniel Kiper daniel.ki...@oracle.com writes: On Fri, Oct 11, 2013 at 03:08:43AM -0700, ebied...@xmission.com wrote: Daniel Kiper daniel.ki...@oracle.com writes: [...] What is your opinion in that case? I can see

kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Daniel Kiper
Hi, Could you explain why do you clear all registers just before jumping into purgatory (please look into arch/x86/kernel/relocate_kernel_64.S for more details)? There is no any single word about that. I do not count comment which states what is going on. purgatory on entry does not assume any

Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Eric W. Biederman
Daniel Kiper daniel.ki...@oracle.com writes: Hi, Could you explain why do you clear all registers just before jumping into purgatory (please look into arch/x86/kernel/relocate_kernel_64.S for more details)? There is no any single word about that. I do not count comment which states what is

Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Daniel Kiper
On Fri, Oct 11, 2013 at 03:08:43AM -0700, ebied...@xmission.com wrote: Daniel Kiper daniel.ki...@oracle.com writes: Hi, Could you explain why do you clear all registers just before jumping into purgatory (please look into arch/x86/kernel/relocate_kernel_64.S for more details)? There is

Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Vivek Goyal
On Fri, Oct 11, 2013 at 01:04:55PM +0200, Daniel Kiper wrote: [..] In theory you can swap between to kernels with the preserve_context case. Technically I like the ability but I don't know that it has ever achieved much uptake. I think that this is nice idea too. However, I have not

Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Matthew Garrett
On Fri, Oct 11, 2013 at 08:52:06AM -0400, Vivek Goyal wrote: On Fri, Oct 11, 2013 at 01:04:55PM +0200, Daniel Kiper wrote: [..] In theory you can swap between to kernels with the preserve_context case. Technically I like the ability but I don't know that it has ever achieved much

Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Vivek Goyal
On Fri, Oct 11, 2013 at 04:37:27PM +0100, Matthew Garrett wrote: On Fri, Oct 11, 2013 at 08:52:06AM -0400, Vivek Goyal wrote: On Fri, Oct 11, 2013 at 01:04:55PM +0200, Daniel Kiper wrote: [..] In theory you can swap between to kernels with the preserve_context case. Technically I

Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Matthew Garrett
On Fri, Oct 11, 2013 at 11:44:50AM -0400, Vivek Goyal wrote: Just Curious. How is it useful. IOW, what's your use case of booting a new kernel and then jumping back. I'm kexecing into a kernel with a modified /dev/mem, modifying the original kernel and then jumping back into it. -- Matthew

Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Richard Weinberger
On Fri, Oct 11, 2013 at 5:48 PM, Matthew Garrett mj...@srcf.ucam.org wrote: On Fri, Oct 11, 2013 at 11:44:50AM -0400, Vivek Goyal wrote: Just Curious. How is it useful. IOW, what's your use case of booting a new kernel and then jumping back. I'm kexecing into a kernel with a modified

Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Matthew Garrett
On Fri, Oct 11, 2013 at 06:33:23PM +0200, Richard Weinberger wrote: On Fri, Oct 11, 2013 at 5:48 PM, Matthew Garrett mj...@srcf.ucam.org wrote: On Fri, Oct 11, 2013 at 11:44:50AM -0400, Vivek Goyal wrote: Just Curious. How is it useful. IOW, what's your use case of booting a new kernel

Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Richard Weinberger
On Fri, Oct 11, 2013 at 6:39 PM, Matthew Garrett mj...@srcf.ucam.org wrote: On Fri, Oct 11, 2013 at 06:33:23PM +0200, Richard Weinberger wrote: On Fri, Oct 11, 2013 at 5:48 PM, Matthew Garrett mj...@srcf.ucam.org wrote: On Fri, Oct 11, 2013 at 11:44:50AM -0400, Vivek Goyal wrote: Just

Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Matthew Garrett
On Fri, Oct 11, 2013 at 06:42:36PM +0200, Richard Weinberger wrote: On Fri, Oct 11, 2013 at 6:39 PM, Matthew Garrett mj...@srcf.ucam.org wrote: On Fri, Oct 11, 2013 at 06:33:23PM +0200, Richard Weinberger wrote: On Fri, Oct 11, 2013 at 5:48 PM, Matthew Garrett mj...@srcf.ucam.org wrote:

Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Richard Weinberger
Am 11.10.2013 18:44, schrieb Matthew Garrett: On Fri, Oct 11, 2013 at 06:42:36PM +0200, Richard Weinberger wrote: On Fri, Oct 11, 2013 at 6:39 PM, Matthew Garrett mj...@srcf.ucam.org wrote: On Fri, Oct 11, 2013 at 06:33:23PM +0200, Richard Weinberger wrote: On Fri, Oct 11, 2013 at 5:48 PM,

Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Vivek Goyal
On Fri, Oct 11, 2013 at 05:44:00PM +0100, Matthew Garrett wrote: On Fri, Oct 11, 2013 at 06:42:36PM +0200, Richard Weinberger wrote: On Fri, Oct 11, 2013 at 6:39 PM, Matthew Garrett mj...@srcf.ucam.org wrote: On Fri, Oct 11, 2013 at 06:33:23PM +0200, Richard Weinberger wrote: On Fri,

Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Matthew Garrett
On Fri, Oct 11, 2013 at 12:53:51PM -0400, Vivek Goyal wrote: On Fri, Oct 11, 2013 at 05:44:00PM +0100, Matthew Garrett wrote: I have /dev/mem and a list of addresses I want to modify. Why to boot in a second kernel to modify first kernel's RAM. Why not do it directly from the first kernel

Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Matthew Garrett
On Fri, Oct 11, 2013 at 06:47:19PM +0200, Richard Weinberger wrote: But you still need a magic tool which create you this list. I just read /proc/kallsyms. I'm really not doing anything complicated. If you have a tool which takes two kernel images and create such a delta, fine. Isn't that

Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Richard Weinberger
Am 11.10.2013 18:55, schrieb Matthew Garrett: On Fri, Oct 11, 2013 at 06:47:19PM +0200, Richard Weinberger wrote: But you still need a magic tool which create you this list. I just read /proc/kallsyms. I'm really not doing anything complicated. If you have a tool which takes two kernel

Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Matthew Garrett
On Fri, Oct 11, 2013 at 06:59:41PM +0200, Richard Weinberger wrote: Am 11.10.2013 18:55, schrieb Matthew Garrett: On Fri, Oct 11, 2013 at 06:47:19PM +0200, Richard Weinberger wrote: But you still need a magic tool which create you this list. I just read /proc/kallsyms. I'm really not

Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Eric W. Biederman
Matthew Garrett mj...@srcf.ucam.org writes: On Fri, Oct 11, 2013 at 06:59:41PM +0200, Richard Weinberger wrote: Am 11.10.2013 18:55, schrieb Matthew Garrett: On Fri, Oct 11, 2013 at 06:47:19PM +0200, Richard Weinberger wrote: But you still need a magic tool which create you this list.

Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Matthew Garrett
On Fri, Oct 11, 2013 at 01:44:19PM -0700, Eric W. Biederman wrote: Matthew Garrett mj...@srcf.ucam.org writes: No, I manually look up some addresses from /proc/kallsyms and then modify them in the second kernel. An interesting approach I think most of the rest of us would have just built

Re: kexec: Clearing registers just before jumping into purgatory

2013-10-11 Thread Eric W. Biederman
Daniel Kiper daniel.ki...@oracle.com writes: On Fri, Oct 11, 2013 at 03:08:43AM -0700, ebied...@xmission.com wrote: Daniel Kiper daniel.ki...@oracle.com writes: Hi, Could you explain why do you clear all registers just before jumping into purgatory (please look into