[lkml]   [2013]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: kexec: Clearing registers just before jumping into purgatory
On Fri, Oct 11, 2013 at 03:15:38PM -0700, wrote:
> Daniel Kiper <> writes:
> > On Fri, Oct 11, 2013 at 03:08:43AM -0700, wrote:
> >> Daniel Kiper <> writes:


> > What is your opinion in that case?
> I can see documenting the registers other than the stack pointer
> as undefined. (A stack pointer is needed to implement PIC code).
> For the implementation I recommend setting these registers to known
> values. The issue is that your implementation will not change much and
> if you don't set the registers to known values someone may develop a
> dependency on what you happen to have those registers set to.
> It is easier to force a fixed value into a register that isn't hard to
> maintain into your registers than to discover when you make a change
> that there is some odd client that depends on some value that just
> happened to be in your register, and that your necessary change is now
> made 10x harder by a client you can't afford to break that depends on a
> bug in the previous implementation.
> So yes I strongly recommend setting the registers to a 0 in this case.

Thank you for this explanation. I think that it is worth to add relevant
comment to arch/x86/kernel/relocate_kernel_*.S and purgatory entry.
I will try to prepare something when we work out nice thing for Xen.


 \ /
  Last update: 2013-10-14 20:41    [W:0.108 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site