linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* 4.8.0-rc1: Invalid memory access at $SRR0: 0140f86c  $SRR1: 00003030
@ 2016-08-09  5:19 Christian Kujau
  2016-08-09  9:06 ` Christian Kujau
  0 siblings, 1 reply; 14+ messages in thread
From: Christian Kujau @ 2016-08-09  5:19 UTC (permalink / raw)
  To: linuxppc-dev

Hi,

while trying to upgrade this PowerBook G4 from 4.7-rc7 to 4.8-rc1, it's 
unable to boot the Yaboot (v1.3.16 from Debian/stable) boot loader:

================================================================
copying OF device tree...
Building dt strings...
Building dt stucture...
Device tree strings 0x01e72000 -> 0x01e73615
Device tree struct  0x01e74000 -> 0x01e7e000
Quiescing Open Firmware...
Bootng Linux via __start()...

Invalid memory access at $SRR0: 0140f86c  $SRR1: 00003030

Apple PowerBook6,8 4.9.0f0 BootROM built on 01/10/05 at 10:39:14
[...]

 ok
0:> _
================================================================

Going back to 4.7-rc7 (w/o installing Yaboot again) works just fine. The 
config is mostly the same (used "make oldconfig" from 4.7), but I've said 
YES to CONFIG_SLAB_FREELIST_RANDOM - could this be causing the boot 
failure? Full .config and screen shot: http://nerdbynature.de/bits/4.8.0-rc1/

Thanks,
Christian.
-- 
BOFH excuse #319:

Your computer hasn't been returning all the bits it gets from the Internet.

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

* Re: 4.8.0-rc1: Invalid memory access at $SRR0: 0140f86c $SRR1: 00003030
  2016-08-09  5:19 4.8.0-rc1: Invalid memory access at $SRR0: 0140f86c $SRR1: 00003030 Christian Kujau
@ 2016-08-09  9:06 ` Christian Kujau
  2016-08-09 11:52   ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 14+ messages in thread
From: Christian Kujau @ 2016-08-09  9:06 UTC (permalink / raw)
  To: linuxppc-dev

On Mon, 8 Aug 2016, Christian Kujau wrote:
> while trying to upgrade this PowerBook G4 from 4.7-rc7 to 4.8-rc1, it's 
> unable to boot the Yaboot (v1.3.16 from Debian/stable) boot loader:
> 
> ================================================================
> copying OF device tree...
> Building dt strings...
> Building dt stucture...
> Device tree strings 0x01e72000 -> 0x01e73615
> Device tree struct  0x01e74000 -> 0x01e7e000
> Quiescing Open Firmware...
> Bootng Linux via __start()...
> 
> Invalid memory access at $SRR0: 0140f86c  $SRR1: 00003030
> 
> Apple PowerBook6,8 4.9.0f0 BootROM built on 01/10/05 at 10:39:14
> [...]
> 
>  ok
> 0:> _
> ================================================================
> 
> Going back to 4.7-rc7 (w/o installing Yaboot again) works just fine. The 
> config is mostly the same (used "make oldconfig" from 4.7), but I've said 
> YES to CONFIG_SLAB_FREELIST_RANDOM - could this be causing the boot 
> failure? Full .config and screen shot: http://nerdbynature.de/bits/4.8.0-rc1/

A git-bisect led me to:

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

But I'm unable to revert just this patch:

$ git revert 9402c684613163888714df0955fa1f17142b08bf
error: could not revert 9402c68... powerpc: Factor do_feature_fixup calls
hint: after resolving the conflicts, mark the corrected paths

The bisect-log:

=========================================
$ git bisect log
git bisect start '--' 'arch/powerpc'
# good: [523d939ef98fd712632d93a5a2b588e477a7565e] Linux 4.7
git bisect good 523d939ef98fd712632d93a5a2b588e477a7565e
# bad: [29b4817d4018df78086157ea3a55c1d9424a7cfc] Linux 4.8-rc1
git bisect bad 29b4817d4018df78086157ea3a55c1d9424a7cfc
# bad: [3808a88985b4f5f5e947c364debce4441a380fb8] powerpc: Move FW feature probing out of pseries probe()
git bisect bad 3808a88985b4f5f5e947c364debce4441a380fb8
# good: [a203658b5ed37c11e5016d3fbbbab9ce018c1b78] powerpc/opal: Wake up kopald polling thread before waiting for events
git bisect good a203658b5ed37c11e5016d3fbbbab9ce018c1b78
# good: [0dfffb48cecd8f84c6e649baee9bacd9be925734] powerpc/powernv: abstraction for saving SPRs before entering deep idle states
git bisect good 0dfffb48cecd8f84c6e649baee9bacd9be925734
# good: [66c570f545e056babdd9510595ce762dcedadd71] powerpc/mm: use _raw variant of page table accessors
git bisect good 66c570f545e056babdd9510595ce762dcedadd71
# good: [c2ca9f6b4cc4c45eb598b24b8b06beee668052d5] powerpc/powernv: Fix pci-cxl.c build when CONFIG_MODULES=n
git bisect good c2ca9f6b4cc4c45eb598b24b8b06beee668052d5
# good: [4c91bd6eeabb004f283db8a6854b134e2a2de1bc] powerpc: Merge the RELOCATABLE config entries for ppc32 and ppc64
git bisect good 4c91bd6eeabb004f283db8a6854b134e2a2de1bc
# bad: [c4bd6cb87c9e28a7d9f4a97db5a06cc538eb5e48] powerpc: Move 64-bit feature fixup earlier
git bisect bad c4bd6cb87c9e28a7d9f4a97db5a06cc538eb5e48
# bad: [9402c684613163888714df0955fa1f17142b08bf] powerpc: Factor do_feature_fixup calls
git bisect bad 9402c684613163888714df0955fa1f17142b08bf
# good: [27d1149667352772240655b65372a4294f992ea7] powerpc/32: Remove RELOCATABLE_PPC32
git bisect good 27d1149667352772240655b65372a4294f992ea7
# first bad commit: [9402c684613163888714df0955fa1f17142b08bf] powerpc: Factor do_feature_fixup calls
=========================================


HTH,
Christian.
-- 
BOFH excuse #409:

The vulcan-death-grip ping has been applied.

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

* Re: 4.8.0-rc1: Invalid memory access at $SRR0: 0140f86c $SRR1: 00003030
  2016-08-09  9:06 ` Christian Kujau
@ 2016-08-09 11:52   ` Benjamin Herrenschmidt
  2016-08-10  1:39     ` Christian Kujau
  2016-08-10  4:58     ` Michael Ellerman
  0 siblings, 2 replies; 14+ messages in thread
From: Benjamin Herrenschmidt @ 2016-08-09 11:52 UTC (permalink / raw)
  To: Christian Kujau, linuxppc-dev

On Tue, 2016-08-09 at 02:06 -0700, Christian Kujau wrote:
> On Mon, 8 Aug 2016, Christian Kujau wrote:
> > 
> > while trying to upgrade this PowerBook G4 from 4.7-rc7 to 4.8-rc1,
> > it's 
> > unable to boot the Yaboot (v1.3.16 from Debian/stable) boot loader:

There should already be a fix for that:

http://patchwork.ozlabs.org/patch/654560/

It should be in Michael's tree if not already in Linus.

Cheers,
Ben.

> > ================================================================
> > copying OF device tree...
> > Building dt strings...
> > Building dt stucture...
> > Device tree strings 0x01e72000 -> 0x01e73615
> > Device tree struct  0x01e74000 -> 0x01e7e000
> > Quiescing Open Firmware...
> > Bootng Linux via __start()...
> > 
> > Invalid memory access at $SRR0: 0140f86c  $SRR1: 00003030
> > 
> > Apple PowerBook6,8 4.9.0f0 BootROM built on 01/10/05 at 10:39:14
> > [...]
> > 
> >  ok
> > 0:> _
> > ================================================================
> > 
> > Going back to 4.7-rc7 (w/o installing Yaboot again) works just
> > fine. The 
> > config is mostly the same (used "make oldconfig" from 4.7), but
> > I've said 
> > YES to CONFIG_SLAB_FREELIST_RANDOM - could this be causing the
> > boot 
> > failure? Full .config and screen shot: http://nerdbynature.de/bits/
> > 4.8.0-rc1/
> 
> A git-bisect led me to:
> 
> =========================================
> 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>
> =========================================
> 
> But I'm unable to revert just this patch:
> 
> $ git revert 9402c684613163888714df0955fa1f17142b08bf
> error: could not revert 9402c68... powerpc: Factor do_feature_fixup
> calls
> hint: after resolving the conflicts, mark the corrected paths
> 
> The bisect-log:
> 
> =========================================
> $ git bisect log
> git bisect start '--' 'arch/powerpc'
> # good: [523d939ef98fd712632d93a5a2b588e477a7565e] Linux 4.7
> git bisect good 523d939ef98fd712632d93a5a2b588e477a7565e
> # bad: [29b4817d4018df78086157ea3a55c1d9424a7cfc] Linux 4.8-rc1
> git bisect bad 29b4817d4018df78086157ea3a55c1d9424a7cfc
> # bad: [3808a88985b4f5f5e947c364debce4441a380fb8] powerpc: Move FW
> feature probing out of pseries probe()
> git bisect bad 3808a88985b4f5f5e947c364debce4441a380fb8
> # good: [a203658b5ed37c11e5016d3fbbbab9ce018c1b78] powerpc/opal: Wake
> up kopald polling thread before waiting for events
> git bisect good a203658b5ed37c11e5016d3fbbbab9ce018c1b78
> # good: [0dfffb48cecd8f84c6e649baee9bacd9be925734] powerpc/powernv:
> abstraction for saving SPRs before entering deep idle states
> git bisect good 0dfffb48cecd8f84c6e649baee9bacd9be925734
> # good: [66c570f545e056babdd9510595ce762dcedadd71] powerpc/mm: use
> _raw variant of page table accessors
> git bisect good 66c570f545e056babdd9510595ce762dcedadd71
> # good: [c2ca9f6b4cc4c45eb598b24b8b06beee668052d5] powerpc/powernv:
> Fix pci-cxl.c build when CONFIG_MODULES=n
> git bisect good c2ca9f6b4cc4c45eb598b24b8b06beee668052d5
> # good: [4c91bd6eeabb004f283db8a6854b134e2a2de1bc] powerpc: Merge the
> RELOCATABLE config entries for ppc32 and ppc64
> git bisect good 4c91bd6eeabb004f283db8a6854b134e2a2de1bc
> # bad: [c4bd6cb87c9e28a7d9f4a97db5a06cc538eb5e48] powerpc: Move 64-
> bit feature fixup earlier
> git bisect bad c4bd6cb87c9e28a7d9f4a97db5a06cc538eb5e48
> # bad: [9402c684613163888714df0955fa1f17142b08bf] powerpc: Factor
> do_feature_fixup calls
> git bisect bad 9402c684613163888714df0955fa1f17142b08bf
> # good: [27d1149667352772240655b65372a4294f992ea7] powerpc/32: Remove
> RELOCATABLE_PPC32
> git bisect good 27d1149667352772240655b65372a4294f992ea7
> # first bad commit: [9402c684613163888714df0955fa1f17142b08bf]
> powerpc: Factor do_feature_fixup calls
> =========================================
> 
> 
> HTH,
> Christian.

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

* Re: 4.8.0-rc1: Invalid memory access at $SRR0: 0140f86c $SRR1: 00003030
  2016-08-09 11:52   ` Benjamin Herrenschmidt
@ 2016-08-10  1:39     ` Christian Kujau
  2016-08-10  4:58     ` Michael Ellerman
  1 sibling, 0 replies; 14+ messages in thread
From: Christian Kujau @ 2016-08-10  1:39 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Michael Ellerman; +Cc: linuxppc-dev

On Tue, 9 Aug 2016, Benjamin Herrenschmidt wrote:
> On Tue, 2016-08-09 at 02:06 -0700, Christian Kujau wrote:
> > On Mon, 8 Aug 2016, Christian Kujau wrote:
> > > 
> > > while trying to upgrade this PowerBook G4 from 4.7-rc7 to 4.8-rc1,
> > > it's 
> > > unable to boot the Yaboot (v1.3.16 from Debian/stable) boot loader:
> 
> There should already be a fix for that:
> http://patchwork.ozlabs.org/patch/654560/

2c0f99516f539 ("powerpc/32: Fix early access to cpu_spec relocation") is 
in mainline, but my machine is still unable to boot, same error, different address:

 > Invalid memory access at $SRR0: 0121686c $SRR1: 00003030 

Happy to test more patches :-)

Christian.

> It should be in Michael's tree if not already in Linus.
> 
> Cheers,
> Ben.
> 
> > > ================================================================
> > > copying OF device tree...
> > > Building dt strings...
> > > Building dt stucture...
> > > Device tree strings 0x01e72000 -> 0x01e73615
> > > Device tree struct  0x01e74000 -> 0x01e7e000
> > > Quiescing Open Firmware...
> > > Bootng Linux via __start()...
> > > 
> > > Invalid memory access at $SRR0: 0140f86c  $SRR1: 00003030
> > > 
> > > Apple PowerBook6,8 4.9.0f0 BootROM built on 01/10/05 at 10:39:14
> > > [...]
> > > 
> > >  ok
> > > 0:> _
> > > ================================================================
> > > 
> > > Going back to 4.7-rc7 (w/o installing Yaboot again) works just
> > > fine. The 
> > > config is mostly the same (used "make oldconfig" from 4.7), but
> > > I've said 
> > > YES to CONFIG_SLAB_FREELIST_RANDOM - could this be causing the
> > > boot 
> > > failure? Full .config and screen shot: http://nerdbynature.de/bits/
> > > 4.8.0-rc1/
> > 
> > A git-bisect led me to:
> > 
> > =========================================
> > 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>
> > =========================================
> > 
> > But I'm unable to revert just this patch:
> > 
> > $ git revert 9402c684613163888714df0955fa1f17142b08bf
> > error: could not revert 9402c68... powerpc: Factor do_feature_fixup
> > calls
> > hint: after resolving the conflicts, mark the corrected paths
> > 
> > The bisect-log:
> > 
> > =========================================
> > $ git bisect log
> > git bisect start '--' 'arch/powerpc'
> > # good: [523d939ef98fd712632d93a5a2b588e477a7565e] Linux 4.7
> > git bisect good 523d939ef98fd712632d93a5a2b588e477a7565e
> > # bad: [29b4817d4018df78086157ea3a55c1d9424a7cfc] Linux 4.8-rc1
> > git bisect bad 29b4817d4018df78086157ea3a55c1d9424a7cfc
> > # bad: [3808a88985b4f5f5e947c364debce4441a380fb8] powerpc: Move FW
> > feature probing out of pseries probe()
> > git bisect bad 3808a88985b4f5f5e947c364debce4441a380fb8
> > # good: [a203658b5ed37c11e5016d3fbbbab9ce018c1b78] powerpc/opal: Wake
> > up kopald polling thread before waiting for events
> > git bisect good a203658b5ed37c11e5016d3fbbbab9ce018c1b78
> > # good: [0dfffb48cecd8f84c6e649baee9bacd9be925734] powerpc/powernv:
> > abstraction for saving SPRs before entering deep idle states
> > git bisect good 0dfffb48cecd8f84c6e649baee9bacd9be925734
> > # good: [66c570f545e056babdd9510595ce762dcedadd71] powerpc/mm: use
> > _raw variant of page table accessors
> > git bisect good 66c570f545e056babdd9510595ce762dcedadd71
> > # good: [c2ca9f6b4cc4c45eb598b24b8b06beee668052d5] powerpc/powernv:
> > Fix pci-cxl.c build when CONFIG_MODULES=n
> > git bisect good c2ca9f6b4cc4c45eb598b24b8b06beee668052d5
> > # good: [4c91bd6eeabb004f283db8a6854b134e2a2de1bc] powerpc: Merge the
> > RELOCATABLE config entries for ppc32 and ppc64
> > git bisect good 4c91bd6eeabb004f283db8a6854b134e2a2de1bc
> > # bad: [c4bd6cb87c9e28a7d9f4a97db5a06cc538eb5e48] powerpc: Move 64-
> > bit feature fixup earlier
> > git bisect bad c4bd6cb87c9e28a7d9f4a97db5a06cc538eb5e48
> > # bad: [9402c684613163888714df0955fa1f17142b08bf] powerpc: Factor
> > do_feature_fixup calls
> > git bisect bad 9402c684613163888714df0955fa1f17142b08bf
> > # good: [27d1149667352772240655b65372a4294f992ea7] powerpc/32: Remove
> > RELOCATABLE_PPC32
> > git bisect good 27d1149667352772240655b65372a4294f992ea7
> > # first bad commit: [9402c684613163888714df0955fa1f17142b08bf]
> > powerpc: Factor do_feature_fixup calls
> > =========================================
> > 
> > 
> > HTH,
> > Christian.
> 

-- 
BOFH excuse #62:

need to wrap system in aluminum foil to fix problem

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

* Re: 4.8.0-rc1: Invalid memory access at $SRR0: 0140f86c $SRR1: 00003030
  2016-08-09 11:52   ` Benjamin Herrenschmidt
  2016-08-10  1:39     ` Christian Kujau
@ 2016-08-10  4:58     ` Michael Ellerman
  2016-08-10  5:25       ` Christian Kujau
  2016-08-10  7:18       ` 4.8.0-rc1: Invalid memory access at $SRR0: 0140f86c $SRR1: 00003030 Benjamin Herrenschmidt
  1 sibling, 2 replies; 14+ messages in thread
From: Michael Ellerman @ 2016-08-10  4:58 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Christian Kujau, linuxppc-dev

Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:

> On Tue, 2016-08-09 at 02:06 -0700, Christian Kujau wrote:
>> On Mon, 8 Aug 2016, Christian Kujau wrote:
>> >=20
>> > while trying to upgrade this PowerBook G4 from 4.7-rc7 to 4.8-rc1,
>> > it's=C2=A0
>> > unable to boot the Yaboot (v1.3.16 from Debian/stable) boot loader:
>
> There should already be a fix for that:
>
> http://patchwork.ozlabs.org/patch/654560/
>
> It should be in Michael's tree if not already in Linus.

That fix is in rc1, so this must be a different bug.

cheers

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

* Re: 4.8.0-rc1: Invalid memory access at $SRR0: 0140f86c $SRR1: 00003030
  2016-08-10  4:58     ` Michael Ellerman
@ 2016-08-10  5:25       ` Christian Kujau
  2016-08-10  7:02         ` Michael Ellerman
  2016-08-10  7:18       ` 4.8.0-rc1: Invalid memory access at $SRR0: 0140f86c $SRR1: 00003030 Benjamin Herrenschmidt
  1 sibling, 1 reply; 14+ messages in thread
From: Christian Kujau @ 2016-08-10  5:25 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: Benjamin Herrenschmidt, linuxppc-dev

On Wed, 10 Aug 2016, Michael Ellerman wrote:
> Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:
> > On Tue, 2016-08-09 at 02:06 -0700, Christian Kujau wrote:
> >> On Mon, 8 Aug 2016, Christian Kujau wrote:
> >> > 
> >> > while trying to upgrade this PowerBook G4 from 4.7-rc7 to 4.8-rc1,
> >> > it's 
> >> > unable to boot the Yaboot (v1.3.16 from Debian/stable) boot loader:
> >
> > There should already be a fix for that:
> >
> > http://patchwork.ozlabs.org/patch/654560/
> >
> > It should be in Michael's tree if not already in Linus.
> 
> That fix is in rc1, so this must be a different bug.

Does the git bisect help?

https://lists.ozlabs.org/pipermail/linuxppc-dev/2016-August/147278.html

Thanks,
Christian.
-- 
BOFH excuse #8:

static buildup

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

* Re: 4.8.0-rc1: Invalid memory access at $SRR0: 0140f86c $SRR1: 00003030
  2016-08-10  5:25       ` Christian Kujau
@ 2016-08-10  7:02         ` Michael Ellerman
  2016-08-10  7:27           ` [PATCH] powerpc: Fix crash during static key init on ppc32 Benjamin Herrenschmidt
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Ellerman @ 2016-08-10  7:02 UTC (permalink / raw)
  To: Christian Kujau; +Cc: Benjamin Herrenschmidt, linuxppc-dev

Christian Kujau <lists@nerdbynature.de> writes:

> On Wed, 10 Aug 2016, Michael Ellerman wrote:
>> Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:
>> > On Tue, 2016-08-09 at 02:06 -0700, Christian Kujau wrote:
>> >> On Mon, 8 Aug 2016, Christian Kujau wrote:
>> >> >=20
>> >> > while trying to upgrade this PowerBook G4 from 4.7-rc7 to 4.8-rc1,
>> >> > it's=C2=A0
>> >> > unable to boot the Yaboot (v1.3.16 from Debian/stable) boot loader:
>> >
>> > There should already be a fix for that:
>> >
>> > http://patchwork.ozlabs.org/patch/654560/
>> >
>> > It should be in Michael's tree if not already in Linus.
>>=20
>> That fix is in rc1, so this must be a different bug.
>
> Does the git bisect help?

No it doesn't sorry.

Because as soon as you bisected prior to that fix, you would have been
hitting the bug fixed by that commit.

To make the bisect work you need to try and apply the above fix at every
stage with patch. If the point you're bisecting already has the fix then
obviously you don't need to apply it again. You then build the kernel,
test it, and unapply the patch before doing git bisect good/bad.

eg.

$ git bisect start
$ git bisect good xxx
$ git bisect bad yyy
<checks out some version>
$ git show 2c0f99516f53 | patch -p1
$ make
... test kernel ....
$ git reset --hard
$ git bisect good/bad
...

cheers

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

* Re: 4.8.0-rc1: Invalid memory access at $SRR0: 0140f86c $SRR1: 00003030
  2016-08-10  4:58     ` Michael Ellerman
  2016-08-10  5:25       ` Christian Kujau
@ 2016-08-10  7:18       ` Benjamin Herrenschmidt
  2016-08-10  9:33         ` Michael Ellerman
  1 sibling, 1 reply; 14+ messages in thread
From: Benjamin Herrenschmidt @ 2016-08-10  7:18 UTC (permalink / raw)
  To: Michael Ellerman, Christian Kujau, linuxppc-dev

On Wed, 2016-08-10 at 14:58 +1000, Michael Ellerman wrote:
> Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:
> 
> > 
> > On Tue, 2016-08-09 at 02:06 -0700, Christian Kujau wrote:
> > > 
> > > On Mon, 8 Aug 2016, Christian Kujau wrote:
> > > > 
> > > > 
> > > > while trying to upgrade this PowerBook G4 from 4.7-rc7 to 4.8-
> > > > rc1,
> > > > it's 
> > > > unable to boot the Yaboot (v1.3.16 from Debian/stable) boot
> > > > loader:
> > 
> > There should already be a fix for that:
> > 
> > http://patchwork.ozlabs.org/patch/654560/
> > 
> > It should be in Michael's tree if not already in Linus.
> 
> That fix is in rc1, so this must be a different bug.

It's all the jump label cruft that landed in apply_feature_fixups()

You can't call random call there. On ppc32, it's running in that
weirdo environment where the kernel isn't running at its linked
address and we need to manually RELOC() everything.

I'm moving them to a separate init call, patch on its way...

Cheers,
Ben.

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

* [PATCH] powerpc: Fix crash during static key init on ppc32
  2016-08-10  7:02         ` Michael Ellerman
@ 2016-08-10  7:27           ` Benjamin Herrenschmidt
  2016-08-10  8:17             ` Christian Kujau
  2016-08-11 11:16             ` Michael Ellerman
  0 siblings, 2 replies; 14+ messages in thread
From: Benjamin Herrenschmidt @ 2016-08-10  7:27 UTC (permalink / raw)
  To: Michael Ellerman, Christian Kujau; +Cc: linuxppc-dev

We cannot do those initializations from apply_feature_fixups() as
this function runs in a very restricted environment in 32-bit where
the kernel isn't running at its linked address and the PTRRELOC()
macro must be used for any global accesss.

Instead, split them into a separtate steup_feature_keys() function
which is called in a more suitable spot on ppc32.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

diff --git a/arch/powerpc/include/asm/feature-fixups.h b/arch/powerpc/include/asm/feature-fixups.h
index 57fec8a..ddf54f5 100644
--- a/arch/powerpc/include/asm/feature-fixups.h
+++ b/arch/powerpc/include/asm/feature-fixups.h
@@ -186,6 +186,7 @@ label##3:					       	\
 
 #ifndef __ASSEMBLY__
 void apply_feature_fixups(void);
+void setup_feature_keys(void);
 #endif
 
 #endif /* __ASM_POWERPC_FEATURE_FIXUPS_H */
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index c3e861d..9a2ae96 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -102,6 +102,9 @@ extern unsigned int memset_nocache_branch; /* Insn to be replaced by NOP */
 
 notrace void __init machine_init(u64 dt_ptr)
 {
+	/* Configure static keys first */
+	setup_feature_keys();
+
 	/* Enable early debugging if any specified (see udbg.h) */
 	udbg_early_init();
 
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index eafb9a7..7ac8e6e 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -300,6 +300,7 @@ void __init early_setup(unsigned long dt_ptr)
 
 	/* Apply all the dynamic patching */
 	apply_feature_fixups();
+	setup_feature_keys();
 
 	/* Initialize the hash table or TLB handling */
 	early_init_mmu();
diff --git a/arch/powerpc/lib/feature-fixups.c b/arch/powerpc/lib/feature-fixups.c
index 74145f0..043415f 100644
--- a/arch/powerpc/lib/feature-fixups.c
+++ b/arch/powerpc/lib/feature-fixups.c
@@ -188,7 +188,10 @@ void __init apply_feature_fixups(void)
 			  &__start___fw_ftr_fixup, &__stop___fw_ftr_fixup);
 #endif
 	do_final_fixups();
+}
 
+void __init setup_feature_keys(void)
+{
 	/*
 	 * Initialise jump label. This causes all the cpu/mmu_has_feature()
 	 * checks to take on their correct polarity based on the current set of

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

* Re: [PATCH] powerpc: Fix crash during static key init on ppc32
  2016-08-10  7:27           ` [PATCH] powerpc: Fix crash during static key init on ppc32 Benjamin Herrenschmidt
@ 2016-08-10  8:17             ` Christian Kujau
  2016-08-10  8:52               ` Gabriel Paubert
  2016-08-11 11:16             ` Michael Ellerman
  1 sibling, 1 reply; 14+ messages in thread
From: Christian Kujau @ 2016-08-10  8:17 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Michael Ellerman, linuxppc-dev

On Wed, 10 Aug 2016, Benjamin Herrenschmidt wrote:
> We cannot do those initializations from apply_feature_fixups() as
> this function runs in a very restricted environment in 32-bit where
> the kernel isn't running at its linked address and the PTRRELOC()
> macro must be used for any global accesss.
> 
> Instead, split them into a separtate steup_feature_keys() function
> which is called in a more suitable spot on ppc32.

Wow, cool. With that applied (on top of mainline from some minutes ago), 
this PowerPC G4 boots again. Thanks!

  Tested-by: Christian Kujau <lists@nerdbynature.de>

@Michael: thanks for the git-bisect tutorial, although I'm glad that I was 
able to skip it this time.

Christian.

> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> 
> diff --git a/arch/powerpc/include/asm/feature-fixups.h b/arch/powerpc/include/asm/feature-fixups.h
> index 57fec8a..ddf54f5 100644
> --- a/arch/powerpc/include/asm/feature-fixups.h
> +++ b/arch/powerpc/include/asm/feature-fixups.h
> @@ -186,6 +186,7 @@ label##3:					       	\
>  
>  #ifndef __ASSEMBLY__
>  void apply_feature_fixups(void);
> +void setup_feature_keys(void);
>  #endif
>  
>  #endif /* __ASM_POWERPC_FEATURE_FIXUPS_H */
> diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
> index c3e861d..9a2ae96 100644
> --- a/arch/powerpc/kernel/setup_32.c
> +++ b/arch/powerpc/kernel/setup_32.c
> @@ -102,6 +102,9 @@ extern unsigned int memset_nocache_branch; /* Insn to be replaced by NOP */
>  
>  notrace void __init machine_init(u64 dt_ptr)
>  {
> +	/* Configure static keys first */
> +	setup_feature_keys();
> +
>  	/* Enable early debugging if any specified (see udbg.h) */
>  	udbg_early_init();
>  
> diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
> index eafb9a7..7ac8e6e 100644
> --- a/arch/powerpc/kernel/setup_64.c
> +++ b/arch/powerpc/kernel/setup_64.c
> @@ -300,6 +300,7 @@ void __init early_setup(unsigned long dt_ptr)
>  
>  	/* Apply all the dynamic patching */
>  	apply_feature_fixups();
> +	setup_feature_keys();
>  
>  	/* Initialize the hash table or TLB handling */
>  	early_init_mmu();
> diff --git a/arch/powerpc/lib/feature-fixups.c b/arch/powerpc/lib/feature-fixups.c
> index 74145f0..043415f 100644
> --- a/arch/powerpc/lib/feature-fixups.c
> +++ b/arch/powerpc/lib/feature-fixups.c
> @@ -188,7 +188,10 @@ void __init apply_feature_fixups(void)
>  			  &__start___fw_ftr_fixup, &__stop___fw_ftr_fixup);
>  #endif
>  	do_final_fixups();
> +}
>  
> +void __init setup_feature_keys(void)
> +{
>  	/*
>  	 * Initialise jump label. This causes all the cpu/mmu_has_feature()
>  	 * checks to take on their correct polarity based on the current set of
> 

-- 
BOFH excuse #135:

You put the disk in upside down.

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

* Re: [PATCH] powerpc: Fix crash during static key init on ppc32
  2016-08-10  8:17             ` Christian Kujau
@ 2016-08-10  8:52               ` Gabriel Paubert
  2016-08-11  0:25                 ` Christian Kujau
  0 siblings, 1 reply; 14+ messages in thread
From: Gabriel Paubert @ 2016-08-10  8:52 UTC (permalink / raw)
  To: Christian Kujau; +Cc: Benjamin Herrenschmidt, linuxppc-dev

On Wed, Aug 10, 2016 at 01:17:55AM -0700, Christian Kujau wrote:
> On Wed, 10 Aug 2016, Benjamin Herrenschmidt wrote:
> > We cannot do those initializations from apply_feature_fixups() as
> > this function runs in a very restricted environment in 32-bit where
> > the kernel isn't running at its linked address and the PTRRELOC()
> > macro must be used for any global accesss.
> > 
> > Instead, split them into a separtate steup_feature_keys() function
> > which is called in a more suitable spot on ppc32.
> 
> Wow, cool. With that applied (on top of mainline from some minutes ago), 
> this PowerPC G4 boots again. Thanks!

Just a question, does sleep work on your PowerBook? 

It has been broken for several releases of the kernel on mine, but I've not
had time to investigate it and it might also be a distro/systemd issue.

    Regards,
    Gabriel

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

* Re: 4.8.0-rc1: Invalid memory access at $SRR0: 0140f86c $SRR1: 00003030
  2016-08-10  7:18       ` 4.8.0-rc1: Invalid memory access at $SRR0: 0140f86c $SRR1: 00003030 Benjamin Herrenschmidt
@ 2016-08-10  9:33         ` Michael Ellerman
  0 siblings, 0 replies; 14+ messages in thread
From: Michael Ellerman @ 2016-08-10  9:33 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Christian Kujau, linuxppc-dev

Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:
> It's all the jump label cruft that landed in=C2=A0apply_feature_fixups()
>
> You can't call random call there. On ppc32, it's running in that
> weirdo environment where the kernel isn't running at its linked
> address and we need to manually RELOC() everything.

Crud. My qemu-mac99 boot test should have caught it, but of course
pmac32 defconfig doesn't enable JUMP_LABEL >:E

> I'm moving them to a separate init call, patch on its way...

Thanks.

cheers

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

* Re: [PATCH] powerpc: Fix crash during static key init on ppc32
  2016-08-10  8:52               ` Gabriel Paubert
@ 2016-08-11  0:25                 ` Christian Kujau
  0 siblings, 0 replies; 14+ messages in thread
From: Christian Kujau @ 2016-08-11  0:25 UTC (permalink / raw)
  To: Gabriel Paubert; +Cc: Benjamin Herrenschmidt, linuxppc-dev

On Wed, 10 Aug 2016, Gabriel Paubert wrote:
> Just a question, does sleep work on your PowerBook? 

Oh, this PowerBook is on 24/7, it's a small home server and I don't think 
I ever used any sleep or hibernation modes on this machine. Sorry :\

C.
-- 
BOFH excuse #145:

Flat tire on station wagon with tapes.  ("Never underestimate the bandwidth of a station wagon full of tapes hurling down the highway" Andrew S. Tannenbaum)

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

* Re: powerpc: Fix crash during static key init on ppc32
  2016-08-10  7:27           ` [PATCH] powerpc: Fix crash during static key init on ppc32 Benjamin Herrenschmidt
  2016-08-10  8:17             ` Christian Kujau
@ 2016-08-11 11:16             ` Michael Ellerman
  1 sibling, 0 replies; 14+ messages in thread
From: Michael Ellerman @ 2016-08-11 11:16 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Christian Kujau; +Cc: linuxppc-dev

On Wed, 2016-10-08 at 07:27:34 UTC, Benjamin Herrenschmidt wrote:
> We cannot do those initializations from apply_feature_fixups() as
> this function runs in a very restricted environment in 32-bit where
> the kernel isn't running at its linked address and the PTRRELOC()
> macro must be used for any global accesss.
> 
> Instead, split them into a separtate steup_feature_keys() function
> which is called in a more suitable spot on ppc32.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/97f6e0cc35026a2a09147a6da6

cheers

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

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

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-09  5:19 4.8.0-rc1: Invalid memory access at $SRR0: 0140f86c $SRR1: 00003030 Christian Kujau
2016-08-09  9:06 ` Christian Kujau
2016-08-09 11:52   ` Benjamin Herrenschmidt
2016-08-10  1:39     ` Christian Kujau
2016-08-10  4:58     ` Michael Ellerman
2016-08-10  5:25       ` Christian Kujau
2016-08-10  7:02         ` Michael Ellerman
2016-08-10  7:27           ` [PATCH] powerpc: Fix crash during static key init on ppc32 Benjamin Herrenschmidt
2016-08-10  8:17             ` Christian Kujau
2016-08-10  8:52               ` Gabriel Paubert
2016-08-11  0:25                 ` Christian Kujau
2016-08-11 11:16             ` Michael Ellerman
2016-08-10  7:18       ` 4.8.0-rc1: Invalid memory access at $SRR0: 0140f86c $SRR1: 00003030 Benjamin Herrenschmidt
2016-08-10  9:33         ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).