All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] purgatory/arch/ppc64: Reset primary cpu endian to big-endian
@ 2015-08-21  2:51 Samuel Mendoza-Jonas
  2015-09-02  1:02   ` Simon Horman
  0 siblings, 1 reply; 9+ messages in thread
From: Samuel Mendoza-Jonas @ 2015-08-21  2:51 UTC (permalink / raw)
  To: kexec; +Cc: mpe, horms, Samuel Mendoza-Jonas

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>
---
 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


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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] purgatory/arch/ppc64: Reset primary cpu endian to big-endian
  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
  0 siblings, 0 replies; 9+ messages in thread
From: Simon Horman @ 2015-09-02  1:02 UTC (permalink / raw)
  To: Samuel Mendoza-Jonas; +Cc: kexec, mpe, linuxppc-dev

[CC linuxppc-dev]

On Fri, Aug 21, 2015 at 12:51:16PM +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.
> 
> 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.

> ---
>  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
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] purgatory/arch/ppc64: Reset primary cpu endian to big-endian
@ 2015-09-02  1:02   ` Simon Horman
  0 siblings, 0 replies; 9+ messages in thread
From: Simon Horman @ 2015-09-02  1:02 UTC (permalink / raw)
  To: Samuel Mendoza-Jonas; +Cc: mpe, kexec, linuxppc-dev

[CC linuxppc-dev]

On Fri, Aug 21, 2015 at 12:51:16PM +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.
> 
> 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.

> ---
>  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
> 

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] purgatory/arch/ppc64: Reset primary cpu endian to big-endian
  2015-09-02  1:02   ` Simon Horman
@ 2015-09-03  5:18     ` Michael Ellerman
  -1 siblings, 0 replies; 9+ messages in thread
From: Michael Ellerman @ 2015-09-03  5:18 UTC (permalink / raw)
  To: Simon Horman; +Cc: Samuel Mendoza-Jonas, kexec, linuxppc-dev

On Wed, 2015-09-02 at 10:02 +0900, Simon Horman wrote:
> [CC linuxppc-dev]
> 
> On Fri, Aug 21, 2015 at 12:51:16PM +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.
> > 
> > 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.

The diff looks good to me, and I've also tested it, so take your pick:

Tested-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>

cheers

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] purgatory/arch/ppc64: Reset primary cpu endian to big-endian
@ 2015-09-03  5:18     ` Michael Ellerman
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Ellerman @ 2015-09-03  5:18 UTC (permalink / raw)
  To: Simon Horman; +Cc: kexec, Samuel Mendoza-Jonas, linuxppc-dev

On Wed, 2015-09-02 at 10:02 +0900, Simon Horman wrote:
> [CC linuxppc-dev]
> 
> On Fri, Aug 21, 2015 at 12:51:16PM +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.
> > 
> > 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.

The diff looks good to me, and I've also tested it, so take your pick:

Tested-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>

cheers



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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] purgatory/arch/ppc64: Reset primary cpu endian to big-endian
  2015-09-03  5:18     ` Michael Ellerman
@ 2015-09-04  9:47       ` Simon Horman
  -1 siblings, 0 replies; 9+ messages in thread
From: Simon Horman @ 2015-09-04  9:47 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: Samuel Mendoza-Jonas, kexec, linuxppc-dev

On Thu, Sep 03, 2015 at 03:18:02PM +1000, Michael Ellerman wrote:
> On Wed, 2015-09-02 at 10:02 +0900, Simon Horman wrote:
> > [CC linuxppc-dev]
> > 
> > On Fri, Aug 21, 2015 at 12:51:16PM +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.
> > > 
> > > 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.
> 
> The diff looks good to me, and I've also tested it, so take your pick:
> 
> Tested-by: Michael Ellerman <mpe@ellerman.id.au>
> Acked-by: Michael Ellerman <mpe@ellerman.id.au>

Thanks, I took the latter.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] purgatory/arch/ppc64: Reset primary cpu endian to big-endian
@ 2015-09-04  9:47       ` Simon Horman
  0 siblings, 0 replies; 9+ messages in thread
From: Simon Horman @ 2015-09-04  9:47 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: kexec, Samuel Mendoza-Jonas, linuxppc-dev

On Thu, Sep 03, 2015 at 03:18:02PM +1000, Michael Ellerman wrote:
> On Wed, 2015-09-02 at 10:02 +0900, Simon Horman wrote:
> > [CC linuxppc-dev]
> > 
> > On Fri, Aug 21, 2015 at 12:51:16PM +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.
> > > 
> > > 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.
> 
> The diff looks good to me, and I've also tested it, so take your pick:
> 
> Tested-by: Michael Ellerman <mpe@ellerman.id.au>
> Acked-by: Michael Ellerman <mpe@ellerman.id.au>

Thanks, I took the latter.

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] purgatory/arch/ppc64: Reset primary cpu endian to big-endian
  2015-09-02  1:02   ` Simon Horman
@ 2015-09-09 11:07     ` Anton Blanchard
  -1 siblings, 0 replies; 9+ messages in thread
From: Anton Blanchard @ 2015-09-09 11:07 UTC (permalink / raw)
  To: Simon Horman; +Cc: Samuel Mendoza-Jonas, kexec, linuxppc-dev

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] purgatory/arch/ppc64: Reset primary cpu endian to big-endian
@ 2015-09-09 11:07     ` Anton Blanchard
  0 siblings, 0 replies; 9+ messages in thread
From: Anton Blanchard @ 2015-09-09 11:07 UTC (permalink / raw)
  To: Simon Horman; +Cc: kexec, Samuel Mendoza-Jonas, linuxppc-dev

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-09-09 11:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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-02  1:02   ` Simon Horman
2015-09-03  5:18   ` Michael Ellerman
2015-09-03  5:18     ` Michael Ellerman
2015-09-04  9:47     ` Simon Horman
2015-09-04  9:47       ` Simon Horman
2015-09-09 11:07   ` Anton Blanchard
2015-09-09 11:07     ` Anton Blanchard

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.