lkml.org 
[lkml]   [2013]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: kexec: Clearing registers just before jumping into purgatory
Daniel Kiper <daniel.kiper@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 going on. purgatory on entry does
> not assume any value in registers. Are you going to use that feature
> for something in the future (e.g. to differentiate between callers
> and/or Linux versions if it be needed)?

It has been a long time now, but as I recall the reason was to just
have things well defined and to make certain that we were not
accidentially exporting anything except the stack pointer for
applications to depend upon.

0/NULL is a good choice because if you are expecting pointer for some
strange reason interesting things happen.

purgatory is definitely not the only target and the C version of
purgatory was actually written well after kexec came into existence.

Is there any particular reason why you are asking?

> By the way, interestingly it is not done if preserve_context is in
> force.

Something different is done, and all of the registers should be
preserved from the when the return to Linux.

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.

Eric



\
 
 \ /
  Last update: 2013-10-11 12:21    [W:0.093 / U:4.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site