Skip to content

Commit

Permalink
[S390] fix s390 assembler code alignments
Browse files Browse the repository at this point in the history
The alignment is missing for various global symbols in s390 assembly code.
With a recent gcc and an instruction like stgrl this can lead to a
specification exception if the instruction uses such a mis-aligned address.

Specify the alignment explicitely and while add it define __ALIGN for s390
and use the ENTRY define to save some lines of code.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Jan Glauber authored and Martin Schwidefsky committed Jul 24, 2011
1 parent 603d1a5 commit 144d634
Show file tree
Hide file tree
Showing 21 changed files with 378 additions and 680 deletions.
4 changes: 2 additions & 2 deletions arch/s390/boot/compressed/head31.S
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
*/

#include <linux/init.h>
#include <linux/linkage.h>
#include <asm/asm-offsets.h>
#include <asm/thread_info.h>
#include <asm/page.h>
#include "sizes.h"

__HEAD
.globl startup_continue
startup_continue:
ENTRY(startup_continue)
basr %r13,0 # get base
.LPG1:
# setup stack
Expand Down
4 changes: 2 additions & 2 deletions arch/s390/boot/compressed/head64.S
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
*/

#include <linux/init.h>
#include <linux/linkage.h>
#include <asm/asm-offsets.h>
#include <asm/thread_info.h>
#include <asm/page.h>
#include "sizes.h"

__HEAD
.globl startup_continue
startup_continue:
ENTRY(startup_continue)
basr %r13,0 # get base
.LPG1:
# setup stack
Expand Down
5 changes: 4 additions & 1 deletion arch/s390/include/asm/linkage.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#ifndef __ASM_LINKAGE_H
#define __ASM_LINKAGE_H

/* Nothing to see here... */
#include <linux/stringify.h>

#define __ALIGN .align 4, 0x07
#define __ALIGN_STR __stringify(__ALIGN)

#endif
25 changes: 13 additions & 12 deletions arch/s390/kernel/base.S
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
* Michael Holzheu <holzheu@de.ibm.com>
*/

#include <linux/linkage.h>
#include <asm/asm-offsets.h>
#include <asm/ptrace.h>

#ifdef CONFIG_64BIT

.globl s390_base_mcck_handler
s390_base_mcck_handler:
ENTRY(s390_base_mcck_handler)
basr %r13,0
0: lg %r15,__LC_PANIC_STACK # load panic stack
aghi %r15,-STACK_FRAME_OVERHEAD
Expand All @@ -26,13 +26,13 @@ s390_base_mcck_handler:
lpswe __LC_MCK_OLD_PSW

.section .bss
.align 8
.globl s390_base_mcck_handler_fn
s390_base_mcck_handler_fn:
.quad 0
.previous

.globl s390_base_ext_handler
s390_base_ext_handler:
ENTRY(s390_base_ext_handler)
stmg %r0,%r15,__LC_SAVE_AREA
basr %r13,0
0: aghi %r15,-STACK_FRAME_OVERHEAD
Expand All @@ -46,13 +46,13 @@ s390_base_ext_handler:
lpswe __LC_EXT_OLD_PSW

.section .bss
.align 8
.globl s390_base_ext_handler_fn
s390_base_ext_handler_fn:
.quad 0
.previous

.globl s390_base_pgm_handler
s390_base_pgm_handler:
ENTRY(s390_base_pgm_handler)
stmg %r0,%r15,__LC_SAVE_AREA
basr %r13,0
0: aghi %r15,-STACK_FRAME_OVERHEAD
Expand All @@ -70,15 +70,15 @@ disabled_wait_psw:
.quad 0x0002000180000000,0x0000000000000000 + s390_base_pgm_handler

.section .bss
.align 8
.globl s390_base_pgm_handler_fn
s390_base_pgm_handler_fn:
.quad 0
.previous

#else /* CONFIG_64BIT */

.globl s390_base_mcck_handler
s390_base_mcck_handler:
ENTRY(s390_base_mcck_handler)
basr %r13,0
0: l %r15,__LC_PANIC_STACK # load panic stack
ahi %r15,-STACK_FRAME_OVERHEAD
Expand All @@ -93,13 +93,13 @@ s390_base_mcck_handler:
2: .long s390_base_mcck_handler_fn

.section .bss
.align 4
.globl s390_base_mcck_handler_fn
s390_base_mcck_handler_fn:
.long 0
.previous

.globl s390_base_ext_handler
s390_base_ext_handler:
ENTRY(s390_base_ext_handler)
stm %r0,%r15,__LC_SAVE_AREA
basr %r13,0
0: ahi %r15,-STACK_FRAME_OVERHEAD
Expand All @@ -115,13 +115,13 @@ s390_base_ext_handler:
2: .long s390_base_ext_handler_fn

.section .bss
.align 4
.globl s390_base_ext_handler_fn
s390_base_ext_handler_fn:
.long 0
.previous

.globl s390_base_pgm_handler
s390_base_pgm_handler:
ENTRY(s390_base_pgm_handler)
stm %r0,%r15,__LC_SAVE_AREA
basr %r13,0
0: ahi %r15,-STACK_FRAME_OVERHEAD
Expand All @@ -142,6 +142,7 @@ disabled_wait_psw:
.long 0x000a0000,0x00000000 + s390_base_pgm_handler

.section .bss
.align 4
.globl s390_base_pgm_handler_fn
s390_base_pgm_handler_fn:
.long 0
Expand Down
Loading

0 comments on commit 144d634

Please sign in to comment.