aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2008-12-25 07:39:19 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-12-25 07:39:12 -0500
commite37f50e1811d68170e4d58a087cf634b2bf1cef9 (patch)
tree49296845bd5e651ca7ec70f1dedca6db8deedb66 /arch/s390
parentb3b59d3339c907b1dec3ce19f62b2a7f120d142d (diff)
[S390] Add processor type march=z10 and a processor type safety check.
This patch adds the code generation option for IBM System z10 and adds a check in head[31,64].S to prevents the execution of a kernel compiled for a new processor type on an old machine. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/Kconfig8
-rw-r--r--arch/s390/Makefile1
-rw-r--r--arch/s390/kernel/head.S49
-rw-r--r--arch/s390/kernel/head31.S27
-rw-r--r--arch/s390/kernel/head64.S23
5 files changed, 61 insertions, 47 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index e6efc1277b04..7a18d2380e2c 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -230,6 +230,14 @@ config MARCH_Z9_109
230 Class (z9 BC). The kernel will be slightly faster but will not 230 Class (z9 BC). The kernel will be slightly faster but will not
231 work on older machines such as the z990, z890, z900, and z800. 231 work on older machines such as the z990, z890, z900, and z800.
232 232
233config MARCH_Z10
234 bool "IBM System z10"
235 help
236 Select this to enable optimizations for IBM System z10. The
237 kernel will be slightly faster but will not work on older
238 machines such as the z990, z890, z900, z800, z9-109, z9-ec
239 and z9-bc.
240
233endchoice 241endchoice
234 242
235config PACK_STACK 243config PACK_STACK
diff --git a/arch/s390/Makefile b/arch/s390/Makefile
index 792a4e7743ce..578c61f15a4b 100644
--- a/arch/s390/Makefile
+++ b/arch/s390/Makefile
@@ -34,6 +34,7 @@ cflags-$(CONFIG_MARCH_G5) += $(call cc-option,-march=g5)
34cflags-$(CONFIG_MARCH_Z900) += $(call cc-option,-march=z900) 34cflags-$(CONFIG_MARCH_Z900) += $(call cc-option,-march=z900)
35cflags-$(CONFIG_MARCH_Z990) += $(call cc-option,-march=z990) 35cflags-$(CONFIG_MARCH_Z990) += $(call cc-option,-march=z990)
36cflags-$(CONFIG_MARCH_Z9_109) += $(call cc-option,-march=z9-109) 36cflags-$(CONFIG_MARCH_Z9_109) += $(call cc-option,-march=z9-109)
37cflags-$(CONFIG_MARCH_Z10) += $(call cc-option,-march=z10)
37 38
38#KBUILD_IMAGE is necessary for make rpm 39#KBUILD_IMAGE is necessary for make rpm
39KBUILD_IMAGE :=arch/s390/boot/image 40KBUILD_IMAGE :=arch/s390/boot/image
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S
index 83477c7dc743..ec7e35f6055b 100644
--- a/arch/s390/kernel/head.S
+++ b/arch/s390/kernel/head.S
@@ -461,6 +461,55 @@ start:
461 .byte 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7 461 .byte 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7
462 .byte 0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff 462 .byte 0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff
463 463
464#
465# startup-code at 0x10000, running in absolute addressing mode
466# this is called either by the ipl loader or directly by PSW restart
467# or linload or SALIPL
468#
469 .org 0x10000
470startup:basr %r13,0 # get base
471.LPG0:
472
473#ifndef CONFIG_MARCH_G5
474 # check processor version against MARCH_{G5,Z900,Z990,Z9_109,Z10}
475 stidp __LC_CPUID # store cpuid
476 lhi %r0,(3f-2f) / 2
477 la %r1,2f-.LPG0(%r13)
4780: clc __LC_CPUID+4(2),0(%r1)
479 jne 3f
480 lpsw 1f-.LPG0(13) # machine type not good enough, crash
481 .align 16
4821: .long 0x000a0000,0x00000000
4832:
484#if defined(CONFIG_MARCH_Z10)
485 .short 0x9672, 0x2064, 0x2066, 0x2084, 0x2086, 0x2094, 0x2096
486#elif defined(CONFIG_MARCH_Z9_109)
487 .short 0x9672, 0x2064, 0x2066, 0x2084, 0x2086
488#elif defined(CONFIG_MARCH_Z990)
489 .short 0x9672, 0x2064, 0x2066
490#elif defined(CONFIG_MARCH_Z900)
491 .short 0x9672
492#endif
4933: la %r1,2(%r1)
494 brct %r0,0b
495#endif
496
497 l %r13,0f-.LPG0(%r13)
498 b 0(%r13)
4990: .long startup_continue
500
501#
502# params at 10400 (setup.h)
503#
504 .org PARMAREA
505 .long 0,0 # IPL_DEVICE
506 .long 0,0 # INITRD_START
507 .long 0,0 # INITRD_SIZE
508
509 .org COMMAND_LINE
510 .byte "root=/dev/ram0 ro"
511 .byte 0
512
464#ifdef CONFIG_64BIT 513#ifdef CONFIG_64BIT
465#include "head64.S" 514#include "head64.S"
466#else 515#else
diff --git a/arch/s390/kernel/head31.S b/arch/s390/kernel/head31.S
index a816e2de32b9..7add8454773b 100644
--- a/arch/s390/kernel/head31.S
+++ b/arch/s390/kernel/head31.S
@@ -10,34 +10,13 @@
10 * 10 *
11 */ 11 */
12 12
13#
14# startup-code at 0x10000, running in absolute addressing mode
15# this is called either by the ipl loader or directly by PSW restart
16# or linload or SALIPL
17#
18 .org 0x10000
19startup:basr %r13,0 # get base
20.LPG0: l %r13,0f-.LPG0(%r13)
21 b 0(%r13)
220: .long startup_continue
23
24#
25# params at 10400 (setup.h)
26#
27 .org PARMAREA
28 .long 0,0 # IPL_DEVICE
29 .long 0,0 # INITRD_START
30 .long 0,0 # INITRD_SIZE
31
32 .org COMMAND_LINE
33 .byte "root=/dev/ram0 ro"
34 .byte 0
35
36 .org 0x11000 13 .org 0x11000
37 14
38startup_continue: 15startup_continue:
39 basr %r13,0 # get base 16 basr %r13,0 # get base
40.LPG1: mvi __LC_AR_MODE_ID,0 # set ESA flag (mode 0) 17.LPG1:
18
19 mvi __LC_AR_MODE_ID,0 # set ESA flag (mode 0)
41 lctl %c0,%c15,.Lctl-.LPG1(%r13) # load control registers 20 lctl %c0,%c15,.Lctl-.LPG1(%r13) # load control registers
42 l %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area 21 l %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area
43 # move IPL device to lowcore 22 # move IPL device to lowcore
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
index 1d06961e87b3..b1a8ceb522b1 100644
--- a/arch/s390/kernel/head64.S
+++ b/arch/s390/kernel/head64.S
@@ -10,29 +10,6 @@
10 * 10 *
11 */ 11 */
12 12
13#
14# startup-code at 0x10000, running in absolute addressing mode
15# this is called either by the ipl loader or directly by PSW restart
16# or linload or SALIPL
17#
18 .org 0x10000
19startup:basr %r13,0 # get base
20.LPG0: l %r13,0f-.LPG0(%r13)
21 b 0(%r13)
220: .long startup_continue
23
24#
25# params at 10400 (setup.h)
26#
27 .org PARMAREA
28 .quad 0 # IPL_DEVICE
29 .quad 0 # INITRD_START
30 .quad 0 # INITRD_SIZE
31
32 .org COMMAND_LINE
33 .byte "root=/dev/ram0 ro"
34 .byte 0
35
36 .org 0x11000 13 .org 0x11000
37 14
38startup_continue: 15startup_continue: