diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-06-12 04:26:23 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-06-12 04:27:30 -0400 |
commit | 8c4caa4fbfc18aa50d9d682f502303a8e0d72726 (patch) | |
tree | 7316383146558c99a6b5bd1d6766c58eab81513f | |
parent | ce58ae6f7f6bdd48c87472ff830a6d586ff076b2 (diff) |
[S390] use facility list for cpu type safety check
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | arch/s390/include/asm/lowcore.h | 1 | ||||
-rw-r--r-- | arch/s390/kernel/head.S | 49 |
2 files changed, 35 insertions, 15 deletions
diff --git a/arch/s390/include/asm/lowcore.h b/arch/s390/include/asm/lowcore.h index 3aeca492b147..713fe9fb1fcc 100644 --- a/arch/s390/include/asm/lowcore.h +++ b/arch/s390/include/asm/lowcore.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #define __LC_SUBCHANNEL_NR 0x00ba | 30 | #define __LC_SUBCHANNEL_NR 0x00ba |
31 | #define __LC_IO_INT_PARM 0x00bc | 31 | #define __LC_IO_INT_PARM 0x00bc |
32 | #define __LC_IO_INT_WORD 0x00c0 | 32 | #define __LC_IO_INT_WORD 0x00c0 |
33 | #define __LC_STFL_FAC_LIST 0x00c8 | ||
33 | #define __LC_MCCK_CODE 0x00e8 | 34 | #define __LC_MCCK_CODE 0x00e8 |
34 | 35 | ||
35 | #define __LC_DUMP_REIPL 0x0e00 | 36 | #define __LC_DUMP_REIPL 0x0e00 |
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S index 22596d70fc2e..bf8cf1caeffc 100644 --- a/arch/s390/kernel/head.S +++ b/arch/s390/kernel/head.S | |||
@@ -479,27 +479,46 @@ startup:basr %r13,0 # get base | |||
479 | mvc __LC_LAST_UPDATE_TIMER(8),6f-.LPG0(%r13) | 479 | mvc __LC_LAST_UPDATE_TIMER(8),6f-.LPG0(%r13) |
480 | mvc __LC_EXIT_TIMER(8),5f-.LPG0(%r13) | 480 | mvc __LC_EXIT_TIMER(8),5f-.LPG0(%r13) |
481 | #ifndef CONFIG_MARCH_G5 | 481 | #ifndef CONFIG_MARCH_G5 |
482 | # check processor version against MARCH_{G5,Z900,Z990,Z9_109,Z10} | 482 | # check capabilities against MARCH_{G5,Z900,Z990,Z9_109,Z10} |
483 | stidp __LC_CPUID # store cpuid | 483 | xc __LC_STFL_FAC_LIST(8),__LC_STFL_FAC_LIST |
484 | lhi %r0,(3f-2f) / 2 | 484 | stfl __LC_STFL_FAC_LIST # store facility list |
485 | la %r1,2f-.LPG0(%r13) | 485 | tm __LC_STFL_FAC_LIST,0x01 # stfle available ? |
486 | 0: clc __LC_CPUID+4(2),0(%r1) | 486 | jz 0f |
487 | jne 3f | 487 | la %r0,0 |
488 | lpsw 1f-.LPG0(13) # machine type not good enough, crash | 488 | .insn s,0xb2b00000,__LC_STFL_FAC_LIST # store facility list extended |
489 | 0: l %r0,__LC_STFL_FAC_LIST | ||
490 | n %r0,2f+8-.LPG0(%r13) | ||
491 | cl %r0,2f+8-.LPG0(%r13) | ||
492 | jne 1f | ||
493 | l %r0,__LC_STFL_FAC_LIST+4 | ||
494 | n %r0,2f+12-.LPG0(%r13) | ||
495 | cl %r0,2f+12-.LPG0(%r13) | ||
496 | je 3f | ||
497 | 1: lpsw 2f-.LPG0(13) # machine type not good enough, crash | ||
489 | .align 16 | 498 | .align 16 |
490 | 1: .long 0x000a0000,0x00000000 | 499 | 2: .long 0x000a0000,0x8badcccc |
491 | 2: | 500 | #if defined(CONFIG_64BIT) |
501 | #if defined(CONFIG_MARCH_Z10) | ||
502 | .long 0xc100efe3, 0xf0680000 | ||
503 | #elif defined(CONFIG_MARCH_Z9_109) | ||
504 | .long 0xc100efc3, 0x00000000 | ||
505 | #elif defined(CONFIG_MARCH_Z990) | ||
506 | .long 0xc0002000, 0x00000000 | ||
507 | #elif defined(CONFIG_MARCH_Z900) | ||
508 | .long 0xc0000000, 0x00000000 | ||
509 | #endif | ||
510 | #else | ||
492 | #if defined(CONFIG_MARCH_Z10) | 511 | #if defined(CONFIG_MARCH_Z10) |
493 | .short 0x9672, 0x2064, 0x2066, 0x2084, 0x2086, 0x2094, 0x2096 | 512 | .long 0x8100c880, 0x00000000 |
494 | #elif defined(CONFIG_MARCH_Z9_109) | 513 | #elif defined(CONFIG_MARCH_Z9_109) |
495 | .short 0x9672, 0x2064, 0x2066, 0x2084, 0x2086 | 514 | .long 0x8100c880, 0x00000000 |
496 | #elif defined(CONFIG_MARCH_Z990) | 515 | #elif defined(CONFIG_MARCH_Z990) |
497 | .short 0x9672, 0x2064, 0x2066 | 516 | .long 0x80002000, 0x00000000 |
498 | #elif defined(CONFIG_MARCH_Z900) | 517 | #elif defined(CONFIG_MARCH_Z900) |
499 | .short 0x9672 | 518 | .long 0x80000000, 0x00000000 |
519 | #endif | ||
500 | #endif | 520 | #endif |
501 | 3: la %r1,2(%r1) | 521 | 3: |
502 | brct %r0,0b | ||
503 | #endif | 522 | #endif |
504 | 523 | ||
505 | l %r13,4f-.LPG0(%r13) | 524 | l %r13,4f-.LPG0(%r13) |