* RTL9300 (mips) fails to boot with commit d4a7f2510ff4 ("vmlinux.lds.h: Adjust symbol ordering in text output section")
@ 2024-11-22 1:58 Chris Packham
2024-11-22 2:29 ` Chris Packham
0 siblings, 1 reply; 7+ messages in thread
From: Chris Packham @ 2024-11-22 1:58 UTC (permalink / raw)
To: Rong Xu, Han Yao Yeo (atg), Thomas Bogendoerfer, Masahiro Gotoh
Cc: linux-mips, linux-kernel
Hi Rong,
I was just trying some of my in-flight changes against linux-next and
found that my RTL9300* based board no longer boots (nothing on the
serial console after U-Boot hands off to the kernel).
A bisect between Linus's tree and linux-next/master points to commit
d4a7f2510ff4 ("vmlinux.lds.h: Adjust symbol ordering in text output
section"). A build on d4a7f2510ff4^ boots successfully. That series is
well beyond my area of knowledge, there may be something that the MIPS
SoCs are doing (or not doing) that is being affected by the sections moving.
Thanks,
Chris
[*] - The RTL9300 is a Realtek Ethernet Switch with integrated MIPS SoC.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RTL9300 (mips) fails to boot with commit d4a7f2510ff4 ("vmlinux.lds.h: Adjust symbol ordering in text output section")
2024-11-22 1:58 RTL9300 (mips) fails to boot with commit d4a7f2510ff4 ("vmlinux.lds.h: Adjust symbol ordering in text output section") Chris Packham
@ 2024-11-22 2:29 ` Chris Packham
2024-11-22 5:02 ` Rong Xu
0 siblings, 1 reply; 7+ messages in thread
From: Chris Packham @ 2024-11-22 2:29 UTC (permalink / raw)
To: Rong Xu, Han Yao Yeo (atg), Thomas Bogendoerfer, Masahiro Gotoh
Cc: linux-mips, linux-kernel
On 22/11/24 14:58, Chris Packham wrote:
> Hi Rong,
>
> I was just trying some of my in-flight changes against linux-next and
> found that my RTL9300* based board no longer boots (nothing on the
> serial console after U-Boot hands off to the kernel).
>
> A bisect between Linus's tree and linux-next/master points to commit
> d4a7f2510ff4 ("vmlinux.lds.h: Adjust symbol ordering in text output
> section"). A build on d4a7f2510ff4^ boots successfully. That series is
> well beyond my area of knowledge, there may be something that the MIPS
> SoCs are doing (or not doing) that is being affected by the sections
> moving.
Based on the sparc change that accompanied this commit the following
does seem to restore working order for me:
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index d575f945d422..e90b0f68290c 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -62,6 +62,8 @@ SECTIONS
_text = .; /* Text and read-only data */
_stext = .;
.text : {
+ /* Match text section symbols in head.S first */
+ *head.o(.text)
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
No idea if that's appropriate
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RTL9300 (mips) fails to boot with commit d4a7f2510ff4 ("vmlinux.lds.h: Adjust symbol ordering in text output section")
2024-11-22 2:29 ` Chris Packham
@ 2024-11-22 5:02 ` Rong Xu
2024-11-24 20:40 ` Chris Packham
0 siblings, 1 reply; 7+ messages in thread
From: Rong Xu @ 2024-11-22 5:02 UTC (permalink / raw)
To: Chris Packham
Cc: Han Yao Yeo (atg),
Thomas Bogendoerfer, Masahiro Gotoh, linux-mips, linux-kernel
Does the following patch fix your issue?
https://lore.kernel.org/lkml/CAK7LNAQSpM2hh2=Wgribb92nHF5_peRb+gxdO1Bt1MkeL8N+hw@mail.gmail.com/t/
Masahiro Yamada already applied the patch to kbuild-tree.
I also proposed a similar fix as yours. But we believe the above patch
should also work (and probably is better).
Please try and let us know.
Thanks!
-Rong
On Thu, Nov 21, 2024 at 6:29 PM Chris Packham
<chris.packham@alliedtelesis.co.nz> wrote:
>
>
> On 22/11/24 14:58, Chris Packham wrote:
> > Hi Rong,
> >
> > I was just trying some of my in-flight changes against linux-next and
> > found that my RTL9300* based board no longer boots (nothing on the
> > serial console after U-Boot hands off to the kernel).
> >
> > A bisect between Linus's tree and linux-next/master points to commit
> > d4a7f2510ff4 ("vmlinux.lds.h: Adjust symbol ordering in text output
> > section"). A build on d4a7f2510ff4^ boots successfully. That series is
> > well beyond my area of knowledge, there may be something that the MIPS
> > SoCs are doing (or not doing) that is being affected by the sections
> > moving.
>
> Based on the sparc change that accompanied this commit the following
> does seem to restore working order for me:
>
> diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
> index d575f945d422..e90b0f68290c 100644
> --- a/arch/mips/kernel/vmlinux.lds.S
> +++ b/arch/mips/kernel/vmlinux.lds.S
> @@ -62,6 +62,8 @@ SECTIONS
> _text = .; /* Text and read-only data */
> _stext = .;
> .text : {
> + /* Match text section symbols in head.S first */
> + *head.o(.text)
> TEXT_TEXT
> SCHED_TEXT
> LOCK_TEXT
>
> No idea if that's appropriate
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RTL9300 (mips) fails to boot with commit d4a7f2510ff4 ("vmlinux.lds.h: Adjust symbol ordering in text output section")
2024-11-22 5:02 ` Rong Xu
@ 2024-11-24 20:40 ` Chris Packham
2024-11-25 18:48 ` Rong Xu
0 siblings, 1 reply; 7+ messages in thread
From: Chris Packham @ 2024-11-24 20:40 UTC (permalink / raw)
To: Rong Xu
Cc: Han Yao Yeo (atg),
Thomas Bogendoerfer, Masahiro Gotoh, linux-mips, linux-kernel
Hi Rong,
On 22/11/24 18:02, Rong Xu wrote:
> Does the following patch fix your issue?
> https://lore.kernel.org/lkml/CAK7LNAQSpM2hh2=Wgribb92nHF5_peRb+gxdO1Bt1MkeL8N+hw@mail.gmail.com/t/
>
> Masahiro Yamada already applied the patch to kbuild-tree.
>
> I also proposed a similar fix as yours. But we believe the above patch
> should also work (and probably is better).
>
> Please try and let us know.
Looks like linux-next already has that patch and no it doesn't fix my
issue. For the record here's the start of my System.map
$ head System.map
ffffffff80100000 T __split_text_end
ffffffff80100000 T __split_text_start
ffffffff80100000 T __unlikely_text_start
ffffffff80100000 T _stext
ffffffff80100000 T _text
ffffffff80100000 t run_init_process
ffffffff80100138 t try_to_run_init_process
ffffffff8010018c t put_page
ffffffff801001d0 t nr_blocks.isra.0
ffffffff80100208 T ack_bad_irq
It does look like whatever is supposed to put head.o first isn't kicking
in for me.
>
> Thanks!
>
> -Rong
>
> On Thu, Nov 21, 2024 at 6:29 PM Chris Packham
> <chris.packham@alliedtelesis.co.nz> wrote:
>>
>> On 22/11/24 14:58, Chris Packham wrote:
>>> Hi Rong,
>>>
>>> I was just trying some of my in-flight changes against linux-next and
>>> found that my RTL9300* based board no longer boots (nothing on the
>>> serial console after U-Boot hands off to the kernel).
>>>
>>> A bisect between Linus's tree and linux-next/master points to commit
>>> d4a7f2510ff4 ("vmlinux.lds.h: Adjust symbol ordering in text output
>>> section"). A build on d4a7f2510ff4^ boots successfully. That series is
>>> well beyond my area of knowledge, there may be something that the MIPS
>>> SoCs are doing (or not doing) that is being affected by the sections
>>> moving.
>> Based on the sparc change that accompanied this commit the following
>> does seem to restore working order for me:
>>
>> diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
>> index d575f945d422..e90b0f68290c 100644
>> --- a/arch/mips/kernel/vmlinux.lds.S
>> +++ b/arch/mips/kernel/vmlinux.lds.S
>> @@ -62,6 +62,8 @@ SECTIONS
>> _text = .; /* Text and read-only data */
>> _stext = .;
>> .text : {
>> + /* Match text section symbols in head.S first */
>> + *head.o(.text)
>> TEXT_TEXT
>> SCHED_TEXT
>> LOCK_TEXT
>>
>> No idea if that's appropriate
>>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RTL9300 (mips) fails to boot with commit d4a7f2510ff4 ("vmlinux.lds.h: Adjust symbol ordering in text output section")
2024-11-24 20:40 ` Chris Packham
@ 2024-11-25 18:48 ` Rong Xu
2024-11-25 19:26 ` Chris Packham
0 siblings, 1 reply; 7+ messages in thread
From: Rong Xu @ 2024-11-25 18:48 UTC (permalink / raw)
To: Chris Packham
Cc: Han Yao Yeo (atg),
Thomas Bogendoerfer, Masahiro Gotoh, linux-mips, linux-kernel
Thanks for confirming this! It looks like we do need to put all
symbols from head.o before any other symbols.
To be clear, the patch I mentioned was not trying to do that -- it
just makes sure the _stext is in the right places.
I'll draft a patch for this.
On Sun, Nov 24, 2024 at 12:40 PM Chris Packham
<Chris.Packham@alliedtelesis.co.nz> wrote:
>
> Hi Rong,
>
> On 22/11/24 18:02, Rong Xu wrote:
> > Does the following patch fix your issue?
> > https://lore.kernel.org/lkml/CAK7LNAQSpM2hh2=Wgribb92nHF5_peRb+gxdO1Bt1MkeL8N+hw@mail.gmail.com/t/
> >
> > Masahiro Yamada already applied the patch to kbuild-tree.
> >
> > I also proposed a similar fix as yours. But we believe the above patch
> > should also work (and probably is better).
> >
> > Please try and let us know.
>
> Looks like linux-next already has that patch and no it doesn't fix my
> issue. For the record here's the start of my System.map
>
> $ head System.map
> ffffffff80100000 T __split_text_end
> ffffffff80100000 T __split_text_start
> ffffffff80100000 T __unlikely_text_start
> ffffffff80100000 T _stext
> ffffffff80100000 T _text
> ffffffff80100000 t run_init_process
> ffffffff80100138 t try_to_run_init_process
> ffffffff8010018c t put_page
> ffffffff801001d0 t nr_blocks.isra.0
> ffffffff80100208 T ack_bad_irq
>
> It does look like whatever is supposed to put head.o first isn't kicking
> in for me.
>
> >
> > Thanks!
> >
> > -Rong
> >
> > On Thu, Nov 21, 2024 at 6:29 PM Chris Packham
> > <chris.packham@alliedtelesis.co.nz> wrote:
> >>
> >> On 22/11/24 14:58, Chris Packham wrote:
> >>> Hi Rong,
> >>>
> >>> I was just trying some of my in-flight changes against linux-next and
> >>> found that my RTL9300* based board no longer boots (nothing on the
> >>> serial console after U-Boot hands off to the kernel).
> >>>
> >>> A bisect between Linus's tree and linux-next/master points to commit
> >>> d4a7f2510ff4 ("vmlinux.lds.h: Adjust symbol ordering in text output
> >>> section"). A build on d4a7f2510ff4^ boots successfully. That series is
> >>> well beyond my area of knowledge, there may be something that the MIPS
> >>> SoCs are doing (or not doing) that is being affected by the sections
> >>> moving.
> >> Based on the sparc change that accompanied this commit the following
> >> does seem to restore working order for me:
> >>
> >> diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
> >> index d575f945d422..e90b0f68290c 100644
> >> --- a/arch/mips/kernel/vmlinux.lds.S
> >> +++ b/arch/mips/kernel/vmlinux.lds.S
> >> @@ -62,6 +62,8 @@ SECTIONS
> >> _text = .; /* Text and read-only data */
> >> _stext = .;
> >> .text : {
> >> + /* Match text section symbols in head.S first */
> >> + *head.o(.text)
> >> TEXT_TEXT
> >> SCHED_TEXT
> >> LOCK_TEXT
> >>
> >> No idea if that's appropriate
> >>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RTL9300 (mips) fails to boot with commit d4a7f2510ff4 ("vmlinux.lds.h: Adjust symbol ordering in text output section")
2024-11-25 18:48 ` Rong Xu
@ 2024-11-25 19:26 ` Chris Packham
2024-11-25 23:20 ` Rong Xu
0 siblings, 1 reply; 7+ messages in thread
From: Chris Packham @ 2024-11-25 19:26 UTC (permalink / raw)
To: Rong Xu
Cc: Han Yao Yeo (atg),
Thomas Bogendoerfer, Masahiro Gotoh, linux-mips, linux-kernel
On 26/11/24 07:48, Rong Xu wrote:
> Thanks for confirming this! It looks like we do need to put all
> symbols from head.o before any other symbols.
> To be clear, the patch I mentioned was not trying to do that -- it
> just makes sure the _stext is in the right places.
Looking at other architectures it may just be a matter of adding __HEAD
to an appropriate place in arch/mips/kernel/head.S and HEAD_TEXT_SECTION
to arch/mips/kernel/vmlinux.lds.S. It might even be possible to drop
mips from scripts/head-object-list.txt.
> I'll draft a patch for this.
I can give any patch a quick test on my setup.
>
> On Sun, Nov 24, 2024 at 12:40 PM Chris Packham
> <Chris.Packham@alliedtelesis.co.nz> wrote:
>> Hi Rong,
>>
>> On 22/11/24 18:02, Rong Xu wrote:
>>> Does the following patch fix your issue?
>>> https://lore.kernel.org/lkml/CAK7LNAQSpM2hh2=Wgribb92nHF5_peRb+gxdO1Bt1MkeL8N+hw@mail.gmail.com/t/
>>>
>>> Masahiro Yamada already applied the patch to kbuild-tree.
>>>
>>> I also proposed a similar fix as yours. But we believe the above patch
>>> should also work (and probably is better).
>>>
>>> Please try and let us know.
>> Looks like linux-next already has that patch and no it doesn't fix my
>> issue. For the record here's the start of my System.map
>>
>> $ head System.map
>> ffffffff80100000 T __split_text_end
>> ffffffff80100000 T __split_text_start
>> ffffffff80100000 T __unlikely_text_start
>> ffffffff80100000 T _stext
>> ffffffff80100000 T _text
>> ffffffff80100000 t run_init_process
>> ffffffff80100138 t try_to_run_init_process
>> ffffffff8010018c t put_page
>> ffffffff801001d0 t nr_blocks.isra.0
>> ffffffff80100208 T ack_bad_irq
>>
>> It does look like whatever is supposed to put head.o first isn't kicking
>> in for me.
>>
>>> Thanks!
>>>
>>> -Rong
>>>
>>> On Thu, Nov 21, 2024 at 6:29 PM Chris Packham
>>> <chris.packham@alliedtelesis.co.nz> wrote:
>>>> On 22/11/24 14:58, Chris Packham wrote:
>>>>> Hi Rong,
>>>>>
>>>>> I was just trying some of my in-flight changes against linux-next and
>>>>> found that my RTL9300* based board no longer boots (nothing on the
>>>>> serial console after U-Boot hands off to the kernel).
>>>>>
>>>>> A bisect between Linus's tree and linux-next/master points to commit
>>>>> d4a7f2510ff4 ("vmlinux.lds.h: Adjust symbol ordering in text output
>>>>> section"). A build on d4a7f2510ff4^ boots successfully. That series is
>>>>> well beyond my area of knowledge, there may be something that the MIPS
>>>>> SoCs are doing (or not doing) that is being affected by the sections
>>>>> moving.
>>>> Based on the sparc change that accompanied this commit the following
>>>> does seem to restore working order for me:
>>>>
>>>> diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
>>>> index d575f945d422..e90b0f68290c 100644
>>>> --- a/arch/mips/kernel/vmlinux.lds.S
>>>> +++ b/arch/mips/kernel/vmlinux.lds.S
>>>> @@ -62,6 +62,8 @@ SECTIONS
>>>> _text = .; /* Text and read-only data */
>>>> _stext = .;
>>>> .text : {
>>>> + /* Match text section symbols in head.S first */
>>>> + *head.o(.text)
>>>> TEXT_TEXT
>>>> SCHED_TEXT
>>>> LOCK_TEXT
>>>>
>>>> No idea if that's appropriate
>>>>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: RTL9300 (mips) fails to boot with commit d4a7f2510ff4 ("vmlinux.lds.h: Adjust symbol ordering in text output section")
2024-11-25 19:26 ` Chris Packham
@ 2024-11-25 23:20 ` Rong Xu
0 siblings, 0 replies; 7+ messages in thread
From: Rong Xu @ 2024-11-25 23:20 UTC (permalink / raw)
To: Chris Packham
Cc: Han Yao Yeo (atg),
Thomas Bogendoerfer, Masahiro Gotoh, linux-mips, linux-kernel
I sent out a patch using the __HEAD method. Compared to the
"*head.o(.text)", this only places
__kernel_entry at the beginning of the text section, and leaves others
reordered by the linker script.
I think it should work. Chris: Could you test it?
Thanks,
-Rong
On Mon, Nov 25, 2024 at 11:26 AM Chris Packham
<chris.packham@alliedtelesis.co.nz> wrote:
>
>
> On 26/11/24 07:48, Rong Xu wrote:
> > Thanks for confirming this! It looks like we do need to put all
> > symbols from head.o before any other symbols.
> > To be clear, the patch I mentioned was not trying to do that -- it
> > just makes sure the _stext is in the right places.
> Looking at other architectures it may just be a matter of adding __HEAD
> to an appropriate place in arch/mips/kernel/head.S and HEAD_TEXT_SECTION
> to arch/mips/kernel/vmlinux.lds.S. It might even be possible to drop
> mips from scripts/head-object-list.txt.
>
> > I'll draft a patch for this.
>
> I can give any patch a quick test on my setup.
>
> >
> > On Sun, Nov 24, 2024 at 12:40 PM Chris Packham
> > <Chris.Packham@alliedtelesis.co.nz> wrote:
> >> Hi Rong,
> >>
> >> On 22/11/24 18:02, Rong Xu wrote:
> >>> Does the following patch fix your issue?
> >>> https://lore.kernel.org/lkml/CAK7LNAQSpM2hh2=Wgribb92nHF5_peRb+gxdO1Bt1MkeL8N+hw@mail.gmail.com/t/
> >>>
> >>> Masahiro Yamada already applied the patch to kbuild-tree.
> >>>
> >>> I also proposed a similar fix as yours. But we believe the above patch
> >>> should also work (and probably is better).
> >>>
> >>> Please try and let us know.
> >> Looks like linux-next already has that patch and no it doesn't fix my
> >> issue. For the record here's the start of my System.map
> >>
> >> $ head System.map
> >> ffffffff80100000 T __split_text_end
> >> ffffffff80100000 T __split_text_start
> >> ffffffff80100000 T __unlikely_text_start
> >> ffffffff80100000 T _stext
> >> ffffffff80100000 T _text
> >> ffffffff80100000 t run_init_process
> >> ffffffff80100138 t try_to_run_init_process
> >> ffffffff8010018c t put_page
> >> ffffffff801001d0 t nr_blocks.isra.0
> >> ffffffff80100208 T ack_bad_irq
> >>
> >> It does look like whatever is supposed to put head.o first isn't kicking
> >> in for me.
> >>
> >>> Thanks!
> >>>
> >>> -Rong
> >>>
> >>> On Thu, Nov 21, 2024 at 6:29 PM Chris Packham
> >>> <chris.packham@alliedtelesis.co.nz> wrote:
> >>>> On 22/11/24 14:58, Chris Packham wrote:
> >>>>> Hi Rong,
> >>>>>
> >>>>> I was just trying some of my in-flight changes against linux-next and
> >>>>> found that my RTL9300* based board no longer boots (nothing on the
> >>>>> serial console after U-Boot hands off to the kernel).
> >>>>>
> >>>>> A bisect between Linus's tree and linux-next/master points to commit
> >>>>> d4a7f2510ff4 ("vmlinux.lds.h: Adjust symbol ordering in text output
> >>>>> section"). A build on d4a7f2510ff4^ boots successfully. That series is
> >>>>> well beyond my area of knowledge, there may be something that the MIPS
> >>>>> SoCs are doing (or not doing) that is being affected by the sections
> >>>>> moving.
> >>>> Based on the sparc change that accompanied this commit the following
> >>>> does seem to restore working order for me:
> >>>>
> >>>> diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
> >>>> index d575f945d422..e90b0f68290c 100644
> >>>> --- a/arch/mips/kernel/vmlinux.lds.S
> >>>> +++ b/arch/mips/kernel/vmlinux.lds.S
> >>>> @@ -62,6 +62,8 @@ SECTIONS
> >>>> _text = .; /* Text and read-only data */
> >>>> _stext = .;
> >>>> .text : {
> >>>> + /* Match text section symbols in head.S first */
> >>>> + *head.o(.text)
> >>>> TEXT_TEXT
> >>>> SCHED_TEXT
> >>>> LOCK_TEXT
> >>>>
> >>>> No idea if that's appropriate
> >>>>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-11-25 23:21 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-22 1:58 RTL9300 (mips) fails to boot with commit d4a7f2510ff4 ("vmlinux.lds.h: Adjust symbol ordering in text output section") Chris Packham
2024-11-22 2:29 ` Chris Packham
2024-11-22 5:02 ` Rong Xu
2024-11-24 20:40 ` Chris Packham
2024-11-25 18:48 ` Rong Xu
2024-11-25 19:26 ` Chris Packham
2024-11-25 23:20 ` Rong Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®