Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: Simon Horman <horms@verge.net.au>
Cc: kexec@lists.infradead.org,
	Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] purgatory/arch/ppc64: Reset primary cpu endian to big-endian
Date: Wed, 9 Sep 2015 21:07:39 +1000	[thread overview]
Message-ID: <20150909210739.419a4f72@kryten> (raw)
In-Reply-To: <20150902010251.GC30886@verge.net.au>

Hi Horms,

> > 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.
> > 
> > This mirrors commit 150b14e7 in kexec-lite.
> > 
> > Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
> 
> I would value a review from one of the PPC folks.

Looks good to me. You can add:

Acked-by: Anton Blanchard <anton@samba.org>

Anton

> > ---
> >  purgatory/arch/ppc64/v2wrap.S | 12 +++++++++---
> >  1 file changed, 9 insertions(+), 3 deletions(-)
> > 
> > diff --git a/purgatory/arch/ppc64/v2wrap.S
> > b/purgatory/arch/ppc64/v2wrap.S index dc5034f..179ade9 100644
> > --- a/purgatory/arch/ppc64/v2wrap.S
> > +++ b/purgatory/arch/ppc64/v2wrap.S
> > @@ -114,10 +114,16 @@ master:
> >  	LOADADDR(6,run_at_load) # the load flag
> >  	lwz	7,0(6)		# possibly patched by
> > kexec-elf-ppc64 stw	7,0x5c(4)	# and patch it into the
> > kernel
> > -	li	5,0		# r5 will be 0 for kernel
> > -	mtctr	4		# prepare branch too
> >  	mr      3,16            # restore dt address
> >  
> > +	mtsrr0	4		# prepare branch to
> > +
> > +	mfmsr	5
> > +	clrrdi	5,5,1		# clear MSR_LE
> > +	mtsrr1	5
> > +
> > +	li	5,0		# r5 will be 0 for kernel
> > +
> >  				# skip cache flush, do we care?
> >  
> > -	bctr			# start kernel
> > +	rfid			# update MSR and start kernel
> > -- 
> > 2.5.0
> > 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

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

      parent reply	other threads:[~2015-09-09 11:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-21  2:51 [PATCH] purgatory/arch/ppc64: Reset primary cpu endian to big-endian Samuel Mendoza-Jonas
2015-09-02  1:02 ` Simon Horman
2015-09-03  5:18   ` Michael Ellerman
2015-09-04  9:47     ` Simon Horman
2015-09-09 11:07   ` Anton Blanchard [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=20150909210739.419a4f72@kryten \
    --to=anton@samba.org \
    --cc=horms@verge.net.au \
    --cc=kexec@lists.infradead.org \
    --cc=linuxppc-dev@lists.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox