public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 5/6] s390: .align 4096 statements in head.S
@ 2006-07-18 11:56 Martin Schwidefsky
  2006-07-18 12:43 ` linux-os (Dick Johnson)
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Schwidefsky @ 2006-07-18 11:56 UTC (permalink / raw)
  To: linux-kernel, heiko.carstens

From: Heiko Carstens <heiko.carstens@de.ibm.com>

[S390] .align 4096 statements in head.S

SLES9 binutils don't like .align 4096 statements in head.S. Work around this
by using .org statements.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---

 arch/s390/kernel/head31.S |    4 ++--
 arch/s390/kernel/head64.S |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff -urpN linux-2.6/arch/s390/kernel/head31.S linux-2.6-patched/arch/s390/kernel/head31.S
--- linux-2.6/arch/s390/kernel/head31.S	2006-07-18 13:40:23.000000000 +0200
+++ linux-2.6-patched/arch/s390/kernel/head31.S	2006-07-18 13:40:46.000000000 +0200
@@ -273,7 +273,7 @@ startup_continue:
 .Lbss_end:  .long _end
 .Lparmaddr: .long PARMAREA
 .Lsccbaddr: .long .Lsccb
-	.align	4096
+	.org	0x12000
 .Lsccb:
 	.hword	0x1000			# length, one page
 	.byte	0x00,0x00,0x00
@@ -290,7 +290,7 @@ startup_continue:
 .Lscpincr2:
 	.quad	0x00
 	.fill	3984,1,0
-	.align	4096
+	.org	0x13000
 
 #ifdef CONFIG_SHARED_KERNEL
 	.org	0x100000
diff -urpN linux-2.6/arch/s390/kernel/head64.S linux-2.6-patched/arch/s390/kernel/head64.S
--- linux-2.6/arch/s390/kernel/head64.S	2006-07-18 13:40:23.000000000 +0200
+++ linux-2.6-patched/arch/s390/kernel/head64.S	2006-07-18 13:40:46.000000000 +0200
@@ -268,7 +268,7 @@ startup_continue:
 .Lparmaddr:
 	.quad	PARMAREA
 
-	.align 4096
+	.org	0x12000
 .Lsccb:
 	.hword 0x1000			# length, one page
 	.byte 0x00,0x00,0x00
@@ -285,7 +285,7 @@ startup_continue:
 .Lscpincr2:
 	.quad 0x00
 	.fill 3984,1,0
-	.align 4096
+	.org	0x13000
 
 #ifdef CONFIG_SHARED_KERNEL
 	.org   0x100000

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

* Re: [patch 5/6] s390: .align 4096 statements in head.S
  2006-07-18 11:56 [patch 5/6] s390: .align 4096 statements in head.S Martin Schwidefsky
@ 2006-07-18 12:43 ` linux-os (Dick Johnson)
  2006-07-18 12:51   ` Martin Schwidefsky
  0 siblings, 1 reply; 5+ messages in thread
From: linux-os (Dick Johnson) @ 2006-07-18 12:43 UTC (permalink / raw)
  To: Martin Schwidefsky; +Cc: linux-kernel, heiko.carstens


On Tue, 18 Jul 2006, Martin Schwidefsky wrote:

> From: Heiko Carstens <heiko.carstens@de.ibm.com>
>
> [S390] .align 4096 statements in head.S
>
> SLES9 binutils don't like .align 4096 statements in head.S. Work around this
> by using .org statements.
>
> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
> ---
>
> arch/s390/kernel/head31.S |    4 ++--
> arch/s390/kernel/head64.S |    4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff -urpN linux-2.6/arch/s390/kernel/head31.S linux-2.6-patched/arch/s390/kernel/head31.S
> --- linux-2.6/arch/s390/kernel/head31.S	2006-07-18 13:40:23.000000000 +0200
> +++ linux-2.6-patched/arch/s390/kernel/head31.S	2006-07-18 13:40:46.000000000 +0200
> @@ -273,7 +273,7 @@ startup_continue:
> .Lbss_end:  .long _end
> .Lparmaddr: .long PARMAREA
> .Lsccbaddr: .long .Lsccb
> -	.align	4096
> +	.org	0x12000
> .Lsccb:
> 	.hword	0x1000			# length, one page
> 	.byte	0x00,0x00,0x00
> @@ -290,7 +290,7 @@ startup_continue:
> .Lscpincr2:
> 	.quad	0x00
> 	.fill	3984,1,0
> -	.align	4096
> +	.org	0x13000
>
> #ifdef CONFIG_SHARED_KERNEL
> 	.org	0x100000
> diff -urpN linux-2.6/arch/s390/kernel/head64.S linux-2.6-patched/arch/s390/kernel/head64.S
> --- linux-2.6/arch/s390/kernel/head64.S	2006-07-18 13:40:23.000000000 +0200
> +++ linux-2.6-patched/arch/s390/kernel/head64.S	2006-07-18 13:40:46.000000000 +0200
> @@ -268,7 +268,7 @@ startup_continue:
> .Lparmaddr:
> 	.quad	PARMAREA
>
> -	.align 4096
> +	.org	0x12000
> .Lsccb:
> 	.hword 0x1000			# length, one page
> 	.byte 0x00,0x00,0x00
> @@ -285,7 +285,7 @@ startup_continue:
> .Lscpincr2:
> 	.quad 0x00
> 	.fill 3984,1,0
> -	.align 4096
> +	.org	0x13000
>
> #ifdef CONFIG_SHARED_KERNEL
> 	.org   0x100000
> -

Hardcoading like that can cause hard to find errors. It looks like
you wrote something in 'C' and tried to use its assembly code. You
should know that you don't need ".fill" if you have correctly allocated
data.

The following will align objects on a 0x1000 boundary:

.section	.data
foo:	.word	0
.org	(. + 0x1000) & -0x1000
bar:	.word	0
.org	(. + 0x1000) & -0x1000
xxx:	.word	0
.org	(. + 0x1000) & -0x1000
yyy:	.word	0
.end

The 'gas' assembler is very powerful and even allows macros:

.macro	ALIGN val
.org	(. + \val) & -\val
.endm

.section	.data
foo:	.word	0
ALIGN	0x1000
bar:	.word	0
ALIGN	0x1000
xxx:	.word	0
ALIGN	0x1000
yyy:	.word	0
ALIGN	0x1000
qqq:	.word	0
.end

This generates:
Disassembly of section .data:

00000000 <foo>:
 	...
00001000 <bar>:
 	...
00002000 <xxx>:
 	...
00003000 <yyy>:
 	...
00004000 <qqq>:
 	...

Note the alignment.


You might want to use this kind of construction because it will
eliminate alignment errors. If you add something that's out-of-range
'gas' will generate an error (like attempt of a negative origin).

Cheers,
Dick Johnson
Penguin : Linux version 2.6.16.24 on an i686 machine (5592.63 BogoMips).
New book: http://www.AbominableFirebug.com/
_
\x1a\x04

****************************************************************
The information transmitted in this message is confidential and may be privileged.  Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited.  If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@analogic.com - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.

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

* Re: [patch 5/6] s390: .align 4096 statements in head.S
  2006-07-18 12:43 ` linux-os (Dick Johnson)
@ 2006-07-18 12:51   ` Martin Schwidefsky
  2006-07-18 13:33     ` linux-os (Dick Johnson)
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Schwidefsky @ 2006-07-18 12:51 UTC (permalink / raw)
  To: linux-os (Dick Johnson); +Cc: linux-kernel, heiko.carstens

On Tue, 2006-07-18 at 08:43 -0400, linux-os (Dick Johnson) wrote:
> Hardcoading like that can cause hard to find errors. It looks like
> you wrote something in 'C' and tried to use its assembly code. You
> should know that you don't need ".fill" if you have correctly
> allocated
> data.

Huh ?!? We are talking about head.S here. That is pure assembler, no C
anywhere. It is the startup code of the kernel, and we do want to
control where things end up.

-- 
blue skies,
  Martin.

Martin Schwidefsky
Linux for zSeries Development & Services
IBM Deutschland Entwicklung GmbH

"Reality continues to ruin my life." - Calvin.



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

* Re: [patch 5/6] s390: .align 4096 statements in head.S
  2006-07-18 12:51   ` Martin Schwidefsky
@ 2006-07-18 13:33     ` linux-os (Dick Johnson)
  2006-07-18 14:10       ` Martin Schwidefsky
  0 siblings, 1 reply; 5+ messages in thread
From: linux-os (Dick Johnson) @ 2006-07-18 13:33 UTC (permalink / raw)
  To: Martin Schwidefsky; +Cc: linux-kernel, heiko.carstens


On Tue, 18 Jul 2006, Martin Schwidefsky wrote:

> On Tue, 2006-07-18 at 08:43 -0400, linux-os (Dick Johnson) wrote:
>> Hardcoading like that can cause hard to find errors. It looks like
>> you wrote something in 'C' and tried to use its assembly code. You
>> should know that you don't need ".fill" if you have correctly
>> allocated
>> data.
>
> Huh ?!? We are talking about head.S here. That is pure assembler, no C
> anywhere. It is the startup code of the kernel, and we do want to
> control where things end up.
>
> --
> blue skies,
>  Martin.
>
> Martin Schwidefsky
> Linux for zSeries Development & Services
> IBM Deutschland Entwicklung GmbH

Yes, I know exactly what I am saying and I mentioned the reference
to 'C' because the ".Labels" start with ".L" as 'C' does it. Humans
generally use human-readable names.

If you BOTHERED to read the rest of the email, I instructed one
how to use the assembler 'gas' so I certainly know that it is not
'C'. Thank you.


Cheers,
Dick Johnson
Penguin : Linux version 2.6.16.24 on an i686 machine (5592.63 BogoMips).
New book: http://www.AbominableFirebug.com/
_
\x1a\x04

****************************************************************
The information transmitted in this message is confidential and may be privileged.  Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited.  If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@analogic.com - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.

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

* Re: [patch 5/6] s390: .align 4096 statements in head.S
  2006-07-18 13:33     ` linux-os (Dick Johnson)
@ 2006-07-18 14:10       ` Martin Schwidefsky
  0 siblings, 0 replies; 5+ messages in thread
From: Martin Schwidefsky @ 2006-07-18 14:10 UTC (permalink / raw)
  To: linux-os (Dick Johnson); +Cc: linux-kernel, heiko.carstens

On Tue, 2006-07-18 at 09:33 -0400, linux-os (Dick Johnson) wrote:
> >> It looks like
> >> you wrote something in 'C' and tried to use its assembly code.
> Yes, I know exactly what I am saying and I mentioned the reference
> to 'C' because the ".Labels" start with ".L" as 'C' does it. Humans
> generally use human-readable names.

You postulated that we have converted some C code and tried to use the
resulting assembly code. We did not. Do not make assumptions.

> If you BOTHERED to read the rest of the email, I instructed one
> how to use the assembler 'gas' so I certainly know that it is not
> 'C'. Thank you.

Thank you very much for your kind instruction how to use the assembler.
The .fill statements are there for the definition of the SCCB that finds
out about the memory size of the machine. An SCCB has a peculiar format,
to make it independent of the location the .fill statements do make
sense, even if they fill up with zeroes.

-- 
blue skies,
  Martin.

Martin Schwidefsky
Linux for zSeries Development & Services
IBM Deutschland Entwicklung GmbH

"Reality continues to ruin my life." - Calvin.



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

end of thread, other threads:[~2006-07-18 14:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-18 11:56 [patch 5/6] s390: .align 4096 statements in head.S Martin Schwidefsky
2006-07-18 12:43 ` linux-os (Dick Johnson)
2006-07-18 12:51   ` Martin Schwidefsky
2006-07-18 13:33     ` linux-os (Dick Johnson)
2006-07-18 14:10       ` Martin Schwidefsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox