All of lore.kernel.org
 help / color / mirror / Atom feed
* MPC5200 does not boot
@ 2016-08-01 22:44 Michal Sojka
  2016-08-02  2:44 ` Benjamin Herrenschmidt
  2016-08-02  5:38 ` Benjamin Herrenschmidt
  0 siblings, 2 replies; 7+ messages in thread
From: Michal Sojka @ 2016-08-01 22:44 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Michael Ellerman, linuxppc-dev

Hi Benjamin,

the following commit causes my MPC5200 not to boot.

    commit 9402c684613163888714df0955fa1f17142b08bf
    Author: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Date:   Tue Jul 5 15:03:41 2016 +1000
     
        powerpc: Factor do_feature_fixup calls
        
        32 and 64-bit do a similar set of calls early on, we move it all to
        a single common function to make the boot code more readable.
        
        Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
        Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

I suspect that the cause will be similar as described in commit
1cd03890ea64795e53f17a94928cca22495acb2a. Unfortunately, I don't have
much time to debug this, but I can easily test patches.

Best regards,
-Michal

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

* Re: MPC5200 does not boot
  2016-08-01 22:44 MPC5200 does not boot Michal Sojka
@ 2016-08-02  2:44 ` Benjamin Herrenschmidt
  2016-08-02  3:16   ` Nicholas Piggin
  2016-08-02  5:38 ` Benjamin Herrenschmidt
  1 sibling, 1 reply; 7+ messages in thread
From: Benjamin Herrenschmidt @ 2016-08-02  2:44 UTC (permalink / raw)
  To: Michal Sojka; +Cc: Michael Ellerman, linuxppc-dev

On Tue, 2016-08-02 at 00:44 +0200, Michal Sojka wrote:
> Hi Benjamin,
> 
> the following commit causes my MPC5200 not to boot.
> 
>     commit 9402c684613163888714df0955fa1f17142b08bf
> >     Author: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>     Date:   Tue Jul 5 15:03:41 2016 +1000
>      
>         powerpc: Factor do_feature_fixup calls
>         
>         32 and 64-bit do a similar set of calls early on, we move it all to
>         a single common function to make the boot code more readable.
>         
>         Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> >         Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> 
> I suspect that the cause will be similar as described in commit
> 1cd03890ea64795e53f17a94928cca22495acb2a. Unfortunately, I don't have
> much time to debug this, but I can easily test patches.

Are you sure of your bisection ? Did you verify that reverting that one
patch fixes it ? Because all this does is move code to a function,
the code is functionally the same and called in the same place...

Cheers,
Ben.

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

* Re: MPC5200 does not boot
  2016-08-02  2:44 ` Benjamin Herrenschmidt
@ 2016-08-02  3:16   ` Nicholas Piggin
  2016-08-02  3:18     ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 7+ messages in thread
From: Nicholas Piggin @ 2016-08-02  3:16 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Michal Sojka, linuxppc-dev

On Tue, 02 Aug 2016 12:44:33 +1000
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> On Tue, 2016-08-02 at 00:44 +0200, Michal Sojka wrote:
> > Hi Benjamin,
> >=20
> > the following commit causes my MPC5200 not to boot.
> >=20
> > =C2=A0=C2=A0=C2=A0=C2=A0commit 9402c684613163888714df0955fa1f17142b08bf=
 =20
> > > =C2=A0=C2=A0=C2=A0=C2=A0Author: Benjamin Herrenschmidt <benh@kernel.c=
rashing.org> =20
> > =C2=A0=C2=A0=C2=A0=C2=A0Date:=C2=A0=C2=A0=C2=A0Tue Jul 5 15:03:41 2016 =
+1000
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0powerpc: Factor do_feat=
ure_fixup calls
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A032 and 64-bit do a simi=
lar set of calls early on, we move it all to
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0a single common functio=
n to make the boot code more readable.
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Signed-off-by: Benjamin=
 Herrenschmidt <benh@kernel.crashing.org> =20
> > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Signed-off-by: Michae=
l Ellerman <mpe@ellerman.id.au> =20
> >=20
> > I suspect that the cause will be similar as described in commit
> > 1cd03890ea64795e53f17a94928cca22495acb2a. Unfortunately, I don't have
> > much time to debug this, but I can easily test patches. =20
>=20
> Are you sure of your bisection ? Did you verify that reverting that one
> patch fixes it ? Because all this does is move code to a function,
> the code is functionally the same and called in the same place...

+	struct cpu_spec *spec =3D *PTRRELOC(&cur_cpu_spec);
+
+	/*
+	 * Apply the CPU-specific and firmware specific fixups to kernel text
+	 * (nop out sections not relevant to this CPU or this firmware).
+	 */
+	do_feature_fixups(spec->cpu_features,
+			  PTRRELOC(&__start___ftr_fixup),
+			  PTRRELOC(&__stop___ftr_fixup));

Shouldn't these be PTRRELOC(spec)->cpu_features ? You are relocating
access to the pointer word, but not the address it contains.
identify_cpu() returns the relocated pointer which is what 32-bit used
to use.

Thanks,
Nick

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

* Re: MPC5200 does not boot
  2016-08-02  3:16   ` Nicholas Piggin
@ 2016-08-02  3:18     ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 7+ messages in thread
From: Benjamin Herrenschmidt @ 2016-08-02  3:18 UTC (permalink / raw)
  To: Nicholas Piggin; +Cc: Michal Sojka, linuxppc-dev

On Tue, 2016-08-02 at 13:16 +1000, Nicholas Piggin wrote:
> 
> Shouldn't these be PTRRELOC(spec)->cpu_features ? You are relocating
> access to the pointer word, but not the address it contains.
> identify_cpu() returns the relocated pointer which is what 32-bit
> used
> to use.

Ah indeed ! Let me check this in qemu and I'll get back to you.

Cheers,
Ben.

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

* Re: MPC5200 does not boot
  2016-08-01 22:44 MPC5200 does not boot Michal Sojka
  2016-08-02  2:44 ` Benjamin Herrenschmidt
@ 2016-08-02  5:38 ` Benjamin Herrenschmidt
  2016-08-02  5:47   ` Michal Sojka
  2016-08-10 10:52   ` Michal Sojka
  1 sibling, 2 replies; 7+ messages in thread
From: Benjamin Herrenschmidt @ 2016-08-02  5:38 UTC (permalink / raw)
  To: Michal Sojka; +Cc: Michael Ellerman, linuxppc-dev

On Tue, 2016-08-02 at 00:44 +0200, Michal Sojka wrote:
> Hi Benjamin,
> 
> the following commit causes my MPC5200 not to boot.
> 
>     commit 9402c684613163888714df0955fa1f17142b08bf
>     Author: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>     Date:   Tue Jul 5 15:03:41 2016 +1000
>      
>         powerpc: Factor do_feature_fixup calls
>         
>         32 and 64-bit do a similar set of calls early on, we move it
> all to
>         a single common function to make the boot code more readable.
>         
>         Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.o
> rg>
>         Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> 
> I suspect that the cause will be similar as described in commit
> 1cd03890ea64795e53f17a94928cca22495acb2a. Unfortunately, I don't have
> much time to debug this, but I can easily test patches.

Does this fixes it for you ?

diff --git a/arch/powerpc/lib/feature-fixups.c b/arch/powerpc/lib/feature-fixups.c
index defb299..fd36e13 100644
--- a/arch/powerpc/lib/feature-fixups.c
+++ b/arch/powerpc/lib/feature-fixups.c
@@ -154,7 +154,7 @@ static void do_final_fixups(void)
 
 void apply_feature_fixups(void)
 {
-	struct cpu_spec *spec = *PTRRELOC(&cur_cpu_spec);
+	struct cpu_spec *spec = PTRRELOC(*PTRRELOC(&cur_cpu_spec));
 
 	/*
 	 * Apply the CPU-specific and firmware specific fixups to kernel text

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

* Re: MPC5200 does not boot
  2016-08-02  5:38 ` Benjamin Herrenschmidt
@ 2016-08-02  5:47   ` Michal Sojka
  2016-08-10 10:52   ` Michal Sojka
  1 sibling, 0 replies; 7+ messages in thread
From: Michal Sojka @ 2016-08-02  5:47 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Michael Ellerman, linuxppc-dev

On Tue, Aug 02 2016, Benjamin Herrenschmidt wrote:
> On Tue, 2016-08-02 at 00:44 +0200, Michal Sojka wrote:
>> Hi Benjamin,
>>=20
>> the following commit causes my MPC5200 not to boot.
>>=20
>> =C2=A0=C2=A0=C2=A0=C2=A0commit 9402c684613163888714df0955fa1f17142b08bf
>
> Does this fixes it for you ?

Yes, it does.

Thanks.
-Michal


> diff --git a/arch/powerpc/lib/feature-fixups.c b/arch/powerpc/lib/feature=
-fixups.c
> index defb299..fd36e13 100644
> --- a/arch/powerpc/lib/feature-fixups.c
> +++ b/arch/powerpc/lib/feature-fixups.c
> @@ -154,7 +154,7 @@ static void do_final_fixups(void)
>=20=20
>  void apply_feature_fixups(void)
>  {
> -	struct cpu_spec *spec =3D *PTRRELOC(&cur_cpu_spec);
> +	struct cpu_spec *spec =3D PTRRELOC(*PTRRELOC(&cur_cpu_spec));
>=20=20
>  	/*
>  	 * Apply the CPU-specific and firmware specific fixups to kernel text

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

* Re: MPC5200 does not boot
  2016-08-02  5:38 ` Benjamin Herrenschmidt
  2016-08-02  5:47   ` Michal Sojka
@ 2016-08-10 10:52   ` Michal Sojka
  1 sibling, 0 replies; 7+ messages in thread
From: Michal Sojka @ 2016-08-10 10:52 UTC (permalink / raw)
  To: Michael Ellerman, Aneesh Kumar K.V; +Cc: linuxppc-dev

Hi all,

my MPC5200 still does not boot even with the fix bellow applied. I dug a
bit into it and now it seems that commit
309b315b6ec686ce050758cc4e29f6ad1125a83f is to blame.

commit 309b315b6ec686ce050758cc4e29f6ad1125a83f
Author: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Date:   Sat Jul 23 14:42:38 2016 +0530

    powerpc: Call jump_label_init() in apply_feature_fixups()
=20=20=20=20
    Call jump_label_init() early so that we can use static keys for CPU and
    MMU feature checks.
=20=20=20=20
    Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

The following summarizes the situation from my point of view:

1) My system does not boot with 9402c684613163888714df0955fa1f17142b08bf
   "powerpc: Factor do_feature_fixup calls"

2) When the fix bellow is applied on top of
   9402c684613163888714df0955fa1f17142b08bf my system boots.

3) My system does not boot 2c0f99516f53911c3f2f81ab3815841e3408f11e
   which is the mainline commit containing the fix below.

4) I bisected the commits between
   9402c684613163888714df0955fa1f17142b08bf and
   2c0f99516f53911c3f2f81ab3815841e3408f11e with manually applying the
   fix bellow and 309b315b6ec686ce050758cc4e29f6ad1125a83f was the first
   bad commit that didn't boot.

Let me know if you need more information.

Thanks.
-Michal

On Tue, Aug 02 2016, Benjamin Herrenschmidt wrote:
> On Tue, 2016-08-02 at 00:44 +0200, Michal Sojka wrote:
>> Hi Benjamin,
>>=20
>> the following commit causes my MPC5200 not to boot.
>>=20
>> =C2=A0=C2=A0=C2=A0=C2=A0commit 9402c684613163888714df0955fa1f17142b08bf
>> =C2=A0=C2=A0=C2=A0=C2=A0Author: Benjamin Herrenschmidt <benh@kernel.cras=
hing.org>
>> =C2=A0=C2=A0=C2=A0=C2=A0Date:=C2=A0=C2=A0=C2=A0Tue Jul 5 15:03:41 2016 +=
1000
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0powerpc: Factor do_featu=
re_fixup calls
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A032 and 64-bit do a simil=
ar set of calls early on, we move it
>> all to
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0a single common function=
 to make the boot code more readable.
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Signed-off-by: Benjamin =
Herrenschmidt <benh@kernel.crashing.o
>> rg>
>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Signed-off-by: Michael E=
llerman <mpe@ellerman.id.au>
>>=20
>> I suspect that the cause will be similar as described in commit
>> 1cd03890ea64795e53f17a94928cca22495acb2a. Unfortunately, I don't have
>> much time to debug this, but I can easily test patches.
>
> Does this fixes it for you ?
>
> diff --git a/arch/powerpc/lib/feature-fixups.c b/arch/powerpc/lib/feature=
-fixups.c
> index defb299..fd36e13 100644
> --- a/arch/powerpc/lib/feature-fixups.c
> +++ b/arch/powerpc/lib/feature-fixups.c
> @@ -154,7 +154,7 @@ static void do_final_fixups(void)
>=20=20
>  void apply_feature_fixups(void)
>  {
> -	struct cpu_spec *spec =3D *PTRRELOC(&cur_cpu_spec);
> +	struct cpu_spec *spec =3D PTRRELOC(*PTRRELOC(&cur_cpu_spec));
>=20=20
>  	/*
>  	 * Apply the CPU-specific and firmware specific fixups to kernel text

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

end of thread, other threads:[~2016-08-10 12:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-01 22:44 MPC5200 does not boot Michal Sojka
2016-08-02  2:44 ` Benjamin Herrenschmidt
2016-08-02  3:16   ` Nicholas Piggin
2016-08-02  3:18     ` Benjamin Herrenschmidt
2016-08-02  5:38 ` Benjamin Herrenschmidt
2016-08-02  5:47   ` Michal Sojka
2016-08-10 10:52   ` Michal Sojka

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.