All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Cc: <anton@samba.org>, <linuxppc-dev@ozlabs.org>
Subject: Re: [kexec-lite PATCH V2] trampoline: Reset primary cpu endian to big-endian
Date: Tue, 7 Jul 2015 22:37:16 -0500	[thread overview]
Message-ID: <1436326636.2658.68.camel@freescale.com> (raw)
In-Reply-To: <1436326178-17021-1-git-send-email-sam.mj@au1.ibm.com>

On Wed, 2015-07-08 at 13:29 +1000, Samuel Mendoza-Jonas wrote:
> Older big-endian ppc64 kernels don't include the FIXUP_ENDIAN check,
> meaning if we kexec from a little-endian kernel the target kernel will
> fail to boot.
> Returning to big-endian before we enter the target kernel ensures that
> the target kernel can boot whether or not it includes FIXUP_ENDIAN.
> 
> Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
> ---
> V2: As suggested by Anton take advantage of the rfid call and switch off
> MSR_LE and branch to the target kernel in the same step.
> 
>  kexec_trampoline.S | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/kexec_trampoline.S b/kexec_trampoline.S
> index a3eb314..3751112 100644
> --- a/kexec_trampoline.S
> +++ b/kexec_trampoline.S
> @@ -88,8 +88,15 @@ start:
>  
>       li      r5,0
>  
> -     mtctr   r4
> -     bctr
> +     mtsrr0  r4
> +
> +     mfmsr   r5
> +     clrrdi  r5,r5,1         /* Clear MSR_LE */
> +     mtsrr1  r5
> +
> +     li      r5,0
> +
> +     rfid

Is kexec-lite meant to be specific to book3s-64?  The README just says "A 
simple kexec for flattened device tree platforms" and I see a __powerpc64__ 
ifdef in kexec_trampoline.S (but not in the above patch)...

-Scott

  reply	other threads:[~2015-07-08  3:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-08  3:29 [kexec-lite PATCH V2] trampoline: Reset primary cpu endian to big-endian Samuel Mendoza-Jonas
2015-07-08  3:37 ` Scott Wood [this message]
2015-07-08  3:49   ` Samuel Mendoza-Jonas
2015-10-06 22:40     ` Scott Wood
2015-07-08 10:10   ` Anton Blanchard

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=1436326636.2658.68.camel@freescale.com \
    --to=scottwood@freescale.com \
    --cc=anton@samba.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=sam.mj@au1.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.