All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Reif <reif@earthlink.net>
To: sparclinux@vger.kernel.org
Subject: Re: sparc boot failure
Date: Sat, 08 Nov 2008 02:41:12 +0000	[thread overview]
Message-ID: <4914FC48.4080403@earthlink.net> (raw)
In-Reply-To: <49125E98.8070905@earthlink.net>

[-- Attachment #1: Type: text/plain, Size: 3291 bytes --]

Sam Ravnborg wrote:
> On Wed, Nov 05, 2008 at 08:10:30PM -0800, David Miller wrote:
>   
>> From: Robert Reif <reif@earthlink.net>
>> Date: Wed, 05 Nov 2008 22:03:52 -0500
>>
>>     
>>> sparc has failed to boot recently and I bisected it down to this patch:
>>>       
>>  ...
>>     
>>>  sparc: correct section of current_pc()
>>>       
>>  ...
>>     
>>> Reverting this patch gets current git booting again.
>>>       
>> Thanks for tracking this down.  I'll take a look and if I
>> can't figure it out I'll revert.
>>     
>
> The commit looks like this:
> --- a/arch/sparc/kernel/head.S
> +++ b/arch/sparc/kernel/head.S
> @@ -465,6 +465,7 @@ gokernel:
>                 mov     %o7, %g4                ! Save %o7
>
>                 /* Jump to it, and pray... */
> +               __INIT
>  current_pc:
>                 call    1f
>                  nop
>
> So the original code assumed that after executing "mov %o7, %g4"
> it would execute "call 1f".
> But chaning section breaks this assumption and the boot fails.
>
> The code at the label gokernel: all looks like it belongs to __HEAD
> but I do not know about the traptable just above it.
>
> If we ignore the traptable I think the below is the more correct approach:
>
> diff --git a/arch/sparc/kernel/head.S b/arch/sparc/kernel/head.S
> index 2fe2c11..ae479a5 100644
> --- a/arch/sparc/kernel/head.S
> +++ b/arch/sparc/kernel/head.S
> @@ -72,7 +72,7 @@ sun4e_notsup:
>         .align 4
>
>         /* The Sparc trap table, bootloader gives us control at _start. */
> -       .text
> +       __HEAD
>         .globl  start, _stext, _start, __stext
>         .globl  trapbase
>  _start:   /* danger danger */
> @@ -465,7 +465,6 @@ gokernel:
>                 mov     %o7, %g4                ! Save %o7
>
>                 /* Jump to it, and pray... */
> -               __INIT
>  current_pc:
>                 call    1f
>                  nop
>
> [Copy'n'paste so it will not apply - because I do not think it is enough]
> But someone that knows this stuff should fix it.
>
> I checked vmlinux.lds.S and I can see that sparc needs to have
> .head.text added before we can use __HEAD in assembler.
>
> I assume it is something like this:
>
> diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S
> index b1002c6..12d1be0 100644
> --- a/arch/sparc/kernel/vmlinux.lds.S
> +++ b/arch/sparc/kernel/vmlinux.lds.S
> @@ -10,8 +10,11 @@ jiffies = jiffies_64 + 4;
>  SECTIONS
>  {
>  	. = 0x10000 + SIZEOF_HEADERS;
> -	.text 0xf0004000 :
> -	{
> +	.text.head 0xf0004000 : {
> +		_text = .;                      /* Text and read-only data */
> +		*(.text.head)
> +	} : text = 0
> +	.text : {
>  		_text = .;
>  		TEXT_TEXT
>  		SCHED_TEXT
>
>
> With this change we are then less dependent on link orderr which is a good thing.
>
> 	Sam
> --
> To unsubscribe from this list: send the line "unsubscribe sparclinux" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>   
The second patch doesn't compile.  The attached patch does but it 
doesn't boot because the kernel is now too big to load.

The size of vmlinux went from 4632210 to 4946070.

Can we at least revert the original patch so sparc boots and add a 
better patch later?




[-- Attachment #2: head.diff.txt --]
[-- Type: text/plain, Size: 471 bytes --]

diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S
index b1002c6..e7ff0b9 100644
--- a/arch/sparc/kernel/vmlinux.lds.S
+++ b/arch/sparc/kernel/vmlinux.lds.S
@@ -10,8 +10,11 @@ jiffies = jiffies_64 + 4;
 SECTIONS
 {
 	. = 0x10000 + SIZEOF_HEADERS;
-	.text 0xf0004000 :
-	{
+	.text.head 0xf0004000 : {
+		_text = .;                      /* Text and read-only data */
+		*(.text.head)
+	} = 0
+	.text : {
 		_text = .;
 		TEXT_TEXT
 		SCHED_TEXT

  parent reply	other threads:[~2008-11-08  2:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-06  3:03 sparc boot failure Robert Reif
2008-11-06  4:10 ` David Miller
2008-11-06 10:40 ` Frédéric Weisbecker
2008-11-06 11:44 ` Robert Reif
2008-11-06 13:10 ` Frédéric Weisbecker
2008-11-06 21:10 ` Sam Ravnborg
2008-11-08  2:41 ` Robert Reif [this message]
2008-11-08  6:34 ` David Miller
2008-11-08  8:41 ` Sam Ravnborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4914FC48.4080403@earthlink.net \
    --to=reif@earthlink.net \
    --cc=sparclinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.