public inbox for kexec@lists.infradead.org
 help / color / mirror / Atom feed
From: Daniel Kiper <daniel.kiper@oracle.com>
To: ebiederm@xmission.com
Cc: keir@xen.org, keescook@chromium.org, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org, xen-devel@lists.xen.org,
	hbabu@us.ibm.com, david.vrabel@citrix.com, jbeulich@suse.com,
	hpa@linux.intel.com, vgoyal@redhat.com
Subject: Re: kexec: Clearing registers just before jumping into purgatory
Date: Mon, 14 Oct 2013 20:24:15 +0200	[thread overview]
Message-ID: <20131014182415.GF3626@debian70-amd64.local.net-space.pl> (raw)
In-Reply-To: <877gdjbgj9.fsf@xmission.com>

On Fri, Oct 11, 2013 at 03:15:38PM -0700, ebiederm@xmission.com wrote:
> Daniel Kiper <daniel.kiper@oracle.com> writes:
>
> > On Fri, Oct 11, 2013 at 03:08:43AM -0700, ebiederm@xmission.com wrote:
> >> Daniel Kiper <daniel.kiper@oracle.com> 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.

Daniel

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

      reply	other threads:[~2013-10-14 18:25 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-11  9:28 kexec: Clearing registers just before jumping into purgatory Daniel Kiper
2013-10-11 10:08 ` Eric W. Biederman
2013-10-11 11:04   ` Daniel Kiper
2013-10-11 12:52     ` Vivek Goyal
2013-10-11 15:37       ` Matthew Garrett
2013-10-11 15:44         ` Vivek Goyal
2013-10-11 15:48           ` Matthew Garrett
2013-10-11 16:33             ` Richard Weinberger
2013-10-11 16:39               ` Matthew Garrett
2013-10-11 16:42                 ` Richard Weinberger
2013-10-11 16:44                   ` Matthew Garrett
2013-10-11 16:47                     ` Richard Weinberger
2013-10-11 16:55                       ` Matthew Garrett
2013-10-11 16:59                         ` Richard Weinberger
2013-10-11 17:01                           ` Matthew Garrett
2013-10-11 20:44                             ` Eric W. Biederman
2013-10-11 20:50                               ` Matthew Garrett
2013-10-11 16:53                     ` Vivek Goyal
2013-10-11 16:56                       ` Matthew Garrett
2013-10-11 22:15     ` Eric W. Biederman
2013-10-14 18:24       ` Daniel Kiper [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131014182415.GF3626@debian70-amd64.local.net-space.pl \
    --to=daniel.kiper@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=ebiederm@xmission.com \
    --cc=hbabu@us.ibm.com \
    --cc=hpa@linux.intel.com \
    --cc=jbeulich@suse.com \
    --cc=keescook@chromium.org \
    --cc=keir@xen.org \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vgoyal@redhat.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox