From: David Lamparter <hidden> Date: 2018-09-20 23:01:13
This is a *partial* revert of "powerpc/85xx: Load all early TLB entries
at once" (d9e1831a420267a7ced708bb259d65b0a3c0344d.)
My dusty old P4080DS just completely fails to boot (no output at all)
without this revert. I have no clue what's going on here, I just
bisected it down and since it looks like an optimization to me I just
reverted it - and voilá, the P4080 boots again.
Cc: Scott Wood <redacted>
Signed-off-by: David Lamparter <redacted>
---
I'm not subscribed to linuxppc-dev, please keep me in Cc:. Also I
contribute to the kernel only very rarely and have no clue how to find
out when the appropriate time in the merge window is to submit things to
linuxppc-dev... my apologies.
---
arch/powerpc/mm/fsl_booke_mmu.c | 3 +-
arch/powerpc/mm/mmu_decl.h | 1 -
arch/powerpc/mm/tlb_nohash_low.S | 63 --------------------------------
3 files changed, 2 insertions(+), 65 deletions(-)
@@ -426,66 +425,4 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_BIG_PHYS)tlbweisyncblr--/*-*LoadmultipleTLBentriesatonce,usinganalternate-space-*trampolinesothatwedon't have to care about whether the same-*TLBentrymapsusbeforeandafter.-*-*r3=firstentrytowrite-*r4=numberofentriestowrite-*r5=temporarytlbentry-*/-_GLOBAL(loadcam_multi)-mflrr8--/*-*SetuptemporaryTLBentrythatisthesameaswhatwe're-*runningfrom,butinAS=1.-*/-bl1f-1:mflrr6-tlbsx0,r8-mfsprr6,SPRN_MAS1-orir6,r6,MAS1_TS-mtsprSPRN_MAS1,r6-mfsprr6,SPRN_MAS0-rlwimir6,r5,MAS0_ESEL_SHIFT,MAS0_ESEL_MASK-mrr7,r5-mtsprSPRN_MAS0,r6-isync-tlbwe-isync--/*SwitchtoAS=1*/-mfmsrr6-orir6,r6,MSR_IS|MSR_DS-mtmsrr6-isync--mrr9,r3-addr10,r3,r4-2:blloadcam_entry-addir9,r9,1-cmpwr9,r10-mrr3,r9-blt2b--/*ReturntoAS=0andclearthetemporaryentry*/-mfmsrr6-rlwinm.r6,r6,0,~(MSR_IS|MSR_DS)-mtmsrr6-isync--lir6,0-mtsprSPRN_MAS1,r6-rlwinmr6,r7,MAS0_ESEL_SHIFT,MAS0_ESEL_MASK-orisr6,r6,MAS0_TLBSEL(1)@h-mtsprSPRN_MAS0,r6-isync-tlbwe-isync--mtlrr8-blr#endif
From: Scott Wood <hidden> Date: 2018-09-21 00:31:37
On Fri, 2018-09-21 at 00:48 +0200, David Lamparter wrote:
This is a *partial* revert of "powerpc/85xx: Load all early TLB entries
at once" (d9e1831a420267a7ced708bb259d65b0a3c0344d.)
My dusty old P4080DS just completely fails to boot (no output at all)
without this revert. I have no clue what's going on here, I just
bisected it down and since it looks like an optimization to me I just
reverted it - and voilá, the P4080 boots again.
It's not an optimization; it was required to get kdump working, at least
for certain choices of crash kernel location. I just tried booting a 32-
bit kernel and did not see this problem -- but I don't have access to a
p4080ds anymore. I tried with qemu e500mc, and also running a 32-bit
kernel on e6500 (needs a tiny change to get past SMP init, since 32-bit
isn't really supported on e6500, but you do get output even without that).
Do you have a JTAG that can be used to find out where it's hanging? If
not, I can try to get early debug working (needs an early IOMMU mapping).
York, can you try booting the latest kernel on p4080ds?
-Scott
From: David Lamparter <hidden> Date: 2018-09-21 01:00:24
On Thu, Sep 20, 2018 at 07:31:33PM -0500, Scott Wood wrote:
On Fri, 2018-09-21 at 00:48 +0200, David Lamparter wrote:
quoted
This is a *partial* revert of "powerpc/85xx: Load all early TLB entries
at once" (d9e1831a420267a7ced708bb259d65b0a3c0344d.)
My dusty old P4080DS just completely fails to boot (no output at all)
without this revert. I have no clue what's going on here, I just
bisected it down and since it looks like an optimization to me I just
reverted it - and voilá, the P4080 boots again.
It's not an optimization; it was required to get kdump working, at least
Oh, my apologies for misunderstanding the code.
for certain choices of crash kernel location. I just tried booting a 32-
bit kernel and did not see this problem -- but I don't have access to a
p4080ds anymore. I tried with qemu e500mc, and also running a 32-bit
kernel on e6500 (needs a tiny change to get past SMP init, since 32-bit
isn't really supported on e6500, but you do get output even without that).
Hrm, maybe I should just make it use the old mechanism under an #ifdef
CONFIG_PPC32? Better to boot and have kdump not work than not boot.
(But obviously finding the actual problem would be best.)
Do you have a JTAG that can be used to find out where it's hanging? If
not, I can try to get early debug working (needs an early IOMMU mapping).
I only have JTAG tools for ARM chips available; hardware wise I could
probably solder up an adapter but software wise I have absoutely no clue
how to fire up a session on anything PPC... I'm a novice openocd user,
that's it.
York, can you try booting the latest kernel on p4080ds?
d9e1831a42 has been around for quite some time, 4.4 already has it. I
was a bit surprised noone has run into this, but then again P4080 is not
exactly the most recent/interesting hardware.
Cheers,
-David
On Fri, 2018-09-21 at 00:48 +0200, David Lamparter wrote:=0A=
quoted
This is a *partial* revert of "powerpc/85xx: Load all early TLB entries=
=0A=
quoted
at once" (d9e1831a420267a7ced708bb259d65b0a3c0344d.)=0A=
=0A=
My dusty old P4080DS just completely fails to boot (no output at all)=0A=
without this revert. I have no clue what's going on here, I just=0A=
bisected it down and since it looks like an optimization to me I just=0A=
reverted it - and voil=E1, the P4080 boots again.=0A=
=0A=
It's not an optimization; it was required to get kdump working, at least=
=0A=
for certain choices of crash kernel location. I just tried booting a 32-=
=0A=
bit kernel and did not see this problem -- but I don't have access to a=
=0A=
p4080ds anymore. I tried with qemu e500mc, and also running a 32-bit=0A=
kernel on e6500 (needs a tiny change to get past SMP init, since 32-bit=
=0A=
isn't really supported on e6500, but you do get output even without that)=
.=0A=
=0A=
Do you have a JTAG that can be used to find out where it's hanging? If=
=0A=
not, I can try to get early debug working (needs an early IOMMU mapping).=
=0A=
=0A=
York, can you try booting the latest kernel on p4080ds?=0A=
=0A=
=0A=
Scott,=0A=
=0A=
I haven't tried P4080DS for a long time. What defconfig do you use for=0A=
this board? I tried latest master branch (commit a27fb6d983c7b5) with=0A=
corenet_basic_defconfig, it didn't boot up. Kernel has an exception very=0A=
early (pc ffffae80).=0A=
=0A=
However, before I claimed the board, someone booted Linux 4.14.71 on=0A=
this board. I need to track down where the image came from.=0A=
=0A=
York=0A=
From: Scott Wood <oss@buserror.net> Date: 2018-09-21 17:49:51
On Fri, 2018-09-21 at 17:40 +0000, York Sun wrote:
On 09/20/2018 05:31 PM, Scott Wood wrote:
quoted
On Fri, 2018-09-21 at 00:48 +0200, David Lamparter wrote:
quoted
This is a *partial* revert of "powerpc/85xx: Load all early TLB entries
at once" (d9e1831a420267a7ced708bb259d65b0a3c0344d.)
My dusty old P4080DS just completely fails to boot (no output at all)
without this revert. I have no clue what's going on here, I just
bisected it down and since it looks like an optimization to me I just
reverted it - and voilá, the P4080 boots again.
It's not an optimization; it was required to get kdump working, at least
for certain choices of crash kernel location. I just tried booting a 32-
bit kernel and did not see this problem -- but I don't have access to a
p4080ds anymore. I tried with qemu e500mc, and also running a 32-bit
kernel on e6500 (needs a tiny change to get past SMP init, since 32-bit
isn't really supported on e6500, but you do get output even without that).
Do you have a JTAG that can be used to find out where it's hanging? If
not, I can try to get early debug working (needs an early IOMMU mapping).
York, can you try booting the latest kernel on p4080ds?
Scott,
I haven't tried P4080DS for a long time. What defconfig do you use for
this board? I tried latest master branch (commit a27fb6d983c7b5) with
corenet_basic_defconfig, it didn't boot up. Kernel has an exception very
early (pc ffffae80).
However, before I claimed the board, someone booted Linux 4.14.71 on
this board. I need to track down where the image came from.
Use corenet32_smp_defconfig
corenet_basic_defconfig is just a fragment used by the makefiles in assembling
the final config.
-Scott
On Fri, 2018-09-21 at 17:40 +0000, York Sun wrote:=0A=
quoted
On 09/20/2018 05:31 PM, Scott Wood wrote:=0A=
quoted
On Fri, 2018-09-21 at 00:48 +0200, David Lamparter wrote:=0A=
quoted
This is a *partial* revert of "powerpc/85xx: Load all early TLB entrie=
s=0A=
quoted
quoted
quoted
at once" (d9e1831a420267a7ced708bb259d65b0a3c0344d.)=0A=
=0A=
My dusty old P4080DS just completely fails to boot (no output at all)=
=0A=
quoted
quoted
quoted
without this revert. I have no clue what's going on here, I just=0A=
bisected it down and since it looks like an optimization to me I just=
=0A=
quoted
quoted
quoted
reverted it - and voil=E1, the P4080 boots again.=0A=
=0A=
It's not an optimization; it was required to get kdump working, at leas=
t=0A=
quoted
quoted
for certain choices of crash kernel location. I just tried booting a 3=
2-=0A=
quoted
quoted
bit kernel and did not see this problem -- but I don't have access to a=
=0A=
quoted
quoted
p4080ds anymore. I tried with qemu e500mc, and also running a 32-bit=
=0A=
quoted
quoted
kernel on e6500 (needs a tiny change to get past SMP init, since 32-bit=
=0A=
quoted
quoted
isn't really supported on e6500, but you do get output even without tha=
t).=0A=
quoted
quoted
=0A=
Do you have a JTAG that can be used to find out where it's hanging? If=
=0A=
quoted
quoted
not, I can try to get early debug working (needs an early IOMMU mapping=
).=0A=
quoted
quoted
=0A=
York, can you try booting the latest kernel on p4080ds?=0A=
=0A=
=0A=
Scott,=0A=
=0A=
I haven't tried P4080DS for a long time. What defconfig do you use for=
=0A=
quoted
this board? I tried latest master branch (commit a27fb6d983c7b5) with=0A=
corenet_basic_defconfig, it didn't boot up. Kernel has an exception very=
=0A=
quoted
early (pc ffffae80).=0A=
=0A=
However, before I claimed the board, someone booted Linux 4.14.71 on=0A=
this board. I need to track down where the image came from.=0A=
=0A=
Use corenet32_smp_defconfig=0A=
=0A=
corenet_basic_defconfig is just a fragment used by the makefiles in assem=
bling=0A=
the final config.=0A=
=0A=
=0A=
Thanks for the instruction. Linux comes up OK with corenet32_smp_defconfig.=
=0A=
=0A=
root@p4080ds:~# uname -a=0A=
Linux p4080ds 4.19.0-rc4-00206-ga27fb6d #1 SMP Fri Sep 21 10:56:36 PDT=0A=
2018 ppc GNU/Linux=0A=
=0A=
York=0A=
=0A=
From: Scott Wood <oss@buserror.net> Date: 2018-09-22 05:47:38
On Fri, Sep 21, 2018 at 03:00:19AM +0200, David Lamparter wrote:
On Thu, Sep 20, 2018 at 07:31:33PM -0500, Scott Wood wrote:
quoted
Do you have a JTAG that can be used to find out where it's hanging? If
not, I can try to get early debug working (needs an early IOMMU mapping).
s/IOMMU mapping/MMU mapping for MMIO/ :-P
I only have JTAG tools for ARM chips available; hardware wise I could
probably solder up an adapter but software wise I have absoutely no clue
how to fire up a session on anything PPC... I'm a novice openocd user,
that's it.
quoted
York, can you try booting the latest kernel on p4080ds?
d9e1831a42 has been around for quite some time, 4.4 already has it. I
was a bit surprised noone has run into this, but then again P4080 is not
exactly the most recent/interesting hardware.
I don't suppose you're running a relocatable kernel at a non-zero
address, and/or are running in an environment that sets
HID0[EN_L2MMU_MHD] (neither standard U-boot nor Linux sets this bit,
though they probably should)? On 32-bit, we're already running in an AS1
trampoline when loadcam_multi() is called, but loadcam_multi() sets up
its own. This happens to not be catastrophic in standard scenarios, but
it does add a duplicate TLB entry, and we return to AS0 sooner than
expected. I think your patch, plus ifdefs to make the change 32-bit
only, is the appropriate fix.
I also got an earlier udbg for e500 working (and happened to decide to
test it with a relocatable kernel); I'll send that out once I've cleaned
it up (or sooner with the extra TLB dumping included if the above doesn't
explain why you're hitting this bug).
-Scott
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2018-09-24 05:15:40
David Lamparter [off-list ref] writes:
This is a *partial* revert of "powerpc/85xx: Load all early TLB entries
at once" (d9e1831a420267a7ced708bb259d65b0a3c0344d.)
My dusty old P4080DS just completely fails to boot (no output at all)
without this revert. I have no clue what's going on here, I just
bisected it down and since it looks like an optimization to me I just
reverted it - and voil=C3=A1, the P4080 boots again.
Cc: Scott Wood <redacted>
Signed-off-by: David Lamparter <redacted>
---
I'm not subscribed to linuxppc-dev, please keep me in Cc:. Also I
contribute to the kernel only very rarely and have no clue how to find
out when the appropriate time in the merge window is to submit things to
linuxppc-dev... my apologies.
Don't worry about the timing of sending patches.
Your patch will be tracked in patchwork, so if it's not a good time
we'll just ignore it until it is a good time :)
cheers
From: David Lamparter <hidden> Date: 2018-10-01 13:55:05
(Sorry about the delay on my end, deadlines ...)
On Fri, Sep 21, 2018 at 06:07:48PM +0000, York Sun wrote:
On 09/21/2018 10:47 AM, Scott Wood wrote:
quoted
On Fri, 2018-09-21 at 17:40 +0000, York Sun wrote:
quoted
On 09/20/2018 05:31 PM, Scott Wood wrote:
quoted
On Fri, 2018-09-21 at 00:48 +0200, David Lamparter wrote:
quoted
My dusty old P4080DS just completely fails to boot (no output at all)
without this revert. I have no clue what's going on here, I just
bisected it down and since it looks like an optimization to me I just
reverted it - and voilá, the P4080 boots again.
It's not an optimization; it was required to get kdump working, at least
for certain choices of crash kernel location.
[...]
quoted
quoted
quoted
York, can you try booting the latest kernel on p4080ds?
[...]
Thanks for the instruction. Linux comes up OK with corenet32_smp_defconfig.
root@p4080ds:~# uname -a
Linux p4080ds 4.19.0-rc4-00206-ga27fb6d #1 SMP Fri Sep 21 10:56:36 PDT
2018 ppc GNU/Linux
Well, shoot. I guess the next likely thing is that I have something
weird enabled in my .config, so I'll try booting corenet32_smp_defconfig
on my P4080DS. (I vaguely think I did that at some point but I can't
swear to it so I'll just retry.) If that doesn't boot, could either of
you provide me with your built uImage so I can exclude toolchain
stupidity?
=> I'll send another mail when I got to try corenet32_smp_defconfig.
Aaaand, during the past week I noticed this is a rev1.0 P4080 chip, which
apparently only exists on some early P4080DS boards - and Freescale even
did a replacement program to get rev2.0 boards out (I guess this one was
sitting in some broom closet.) I don't have access to erratas for this,
I only know the entire QMan/FMan stuff is royally f*cked - no idea
whether the PPC core has issues too.
FWIW, my board is running perfectly stable with that patch I posted and
I'll just carry it locally if it's an issue for this one specific board
I have here. I just don't have sufficient information to tell if that
is indeed the case.
Thanks a lot for your input and help,
-David
From: David Lamparter <hidden> Date: 2018-10-01 14:28:13
On Sat, Sep 22, 2018 at 12:45:16AM -0500, Scott Wood wrote:
I don't suppose you're running a relocatable kernel at a non-zero
# CONFIG_RELOCATABLE is not set
address, and/or are running in an environment that sets
HID0[EN_L2MMU_MHD] (neither standard U-boot nor Linux sets this bit,
It's u-boot v2018.09-rc3; bit "33" / 30 isn't even defined as a
constant, much less touched anywhere. HID0 in u-boot seems to be
0x80000080 aka EMCP | EN_MAS7_UPDATE.
though they probably should)? On 32-bit, we're already running in an AS1
trampoline when loadcam_multi() is called, but loadcam_multi() sets up
its own. This happens to not be catastrophic in standard scenarios, but
it does add a duplicate TLB entry, and we return to AS0 sooner than
expected. I think your patch, plus ifdefs to make the change 32-bit
only, is the appropriate fix.
I'll resend it with ifdefs inserted. Meanwhile, still trying the
default config as mentioned in my previous mail.
I also got an earlier udbg for e500 working (and happened to decide to
test it with a relocatable kernel); I'll send that out once I've cleaned
it up (or sooner with the extra TLB dumping included if the above doesn't
explain why you're hitting this bug).