Skip to contentSkip to conversation

drop superfluous .align 16

PATCH In review Helge Deller 3 participants 5 messages Jul 8, 2008 – Jul 9, 2008 PA-RISC architecture

lore
Share & tools
lore

Helge Deller

author maintainer
#0 lore raw

PATCH 1/1 drop superfluous .align 16

This .align 16 is misplaced and should be in front of the ENTRY(lws_lock_start). Works because of pure luck since we have a .align PAGE_SIZE before it instead.

arch/parisc/kernel/syscall.S +0 -1
@@ -640,7 +640,6 @@ END(sys_call_table64)
 	.align	PAGE_SIZE
 ENTRY(lws_lock_start)
 	/* lws locks */
-	.align 16
 	.rept 16
 	/* Keep locks aligned at 16-bytes */
 	.word 1
#1 lore raw
Quoted 2 lines · Helge Deller

This .align 16 is misplaced and should be in front of the ENTRY(lws_lock_start). Works because of pure luck since we have a .align PAGE_SIZE before it instead.

This is not true, the .align 16 aligns almost any object in the subsection including .word.

However, it is superfluous since we have a .align PAGE_SIZE, but I was probably being safe in the event that someone put an object before lws_lock_start.

arch/parisc/kernel/syscall.S END(sys_call_table64) · line 645

Quoted 12 lines
arch/parisc/kernel/syscall.S +0 -1
@@ -640,7 +640,6 @@ END(sys_call_table64)
       .align  PAGE_SIZE
 ENTRY(lws_lock_start)
       /* lws locks */
-       .align 16
       .rept 16
       /* Keep locks aligned at 16-bytes */
       .word 1

Cheers,
Carlos.

author maintainer
#2 lore raw
Quoted 6 lines · Carlos O'Donell
Quoted 2 lines · Helge Deller

This .align 16 is misplaced and should be in front of the ENTRY(lws_lock_start). Works because of pure luck since we have a .align PAGE_SIZE before it instead.

This is not true, the .align 16 aligns almost any object in the subsection including .word.

Sure, but it does not take care of lws_lock_start itself.

Quoted 3 lines

However, it is superfluous since we have a .align PAGE_SIZE, but I was probably being safe in the event that someone put an object before lws_lock_start.

What I mean is, that the lws_lock_start label should start at 16byte boundary, right? (it is due to the .align PAGE_SIZE).
Now, if e.g. the .word555 (see below) would be in there, then
lws_lock_start would be at PAGE_SIZE+4, while the .word1 would start at PAGE_SIZE+16, which is wrong for accessing the lws_lock_start variables, where the first entry should be "1".

Example:
.align PAGE_SIZE
.word 5555 <<<- think this would be here.
ENTRY(lws_lock_start)

      /* lws locks */
     .align 16
     .rept 16
     /* Keep locks aligned at 16-bytes */
     .word 1

So, I still think it would be better to remove the .align16, or alternatively to move it in front of ENTRY(lws_lock_start) [to be on the safe side].

Am I really that wrong?

Helge

Quoted 15 lines

arch/parisc/kernel/syscall.S END(sys_call_table64) · line 645

Quoted 12 lines
arch/parisc/kernel/syscall.S +0 -1
@@ -640,7 +640,6 @@ END(sys_call_table64)
       .align  PAGE_SIZE
 ENTRY(lws_lock_start)
       /* lws locks */
-       .align 16
       .rept 16
       /* Keep locks aligned at 16-bytes */
       .word 1

Cheers,
Carlos.

#3 lore raw
Quoted 5 lines · Helge Deller

So, I still think it would be better to remove the .align16, or alternatively to move it in front of ENTRY(lws_lock_start) [to be on the safe side].

Am I really that wrong?

No, you are absolutely right. I forgot the locks are referenced via lws_lock_start, and the symbol needs to be aligned. Sorry, I thought there was another symbol elsewhere.

Cheers,
Carlos.

#4 lore raw
Quoted 10 lines · Helge Deller
Quoted 5 lines

So, I still think it would be better to remove the .align16, or alternatively to move it in front of ENTRY(lws_lock_start) [to be on the safe side].

Am I really that wrong?

No, you are absolutely right. I forgot the locks are referenced via lws_lock_start, and the symbol needs to be aligned. Sorry, I thought there was another symbol elsewhere.

This would be clearer if there was an ENTRY_ALIGNED macro (e.g., ENTRY_ALIGNED(lws_lock_start, 16)). It's probably overkill though.

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)