diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2016-06-28 08:40:07 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2016-07-31 05:27:59 -0400 |
commit | 06ed5512a26347f7b570295c68d48f0369bdb754 (patch) | |
tree | 7e14780c7bd5074a658198652c257c16674f95f8 /arch/s390/kernel/als.c | |
parent | be2412c247c16c0ea4dd3293e8046e1b383c3bb6 (diff) |
s390/als: print machine type on facility mismatch
If we have a facility mismatch the kernel only emits a warning that
the processor is not recent enough and stops operating. This doesn't
give us a lot of an idea of what actually went wrong.
As a first step print the machine type in addition.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Reviewed-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/als.c')
-rw-r--r-- | arch/s390/kernel/als.c | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/arch/s390/kernel/als.c b/arch/s390/kernel/als.c index f96a577972c4..0eff858c2434 100644 --- a/arch/s390/kernel/als.c +++ b/arch/s390/kernel/als.c | |||
@@ -19,6 +19,38 @@ | |||
19 | 19 | ||
20 | static unsigned long als[] __initdata = { FACILITIES_ALS }; | 20 | static unsigned long als[] __initdata = { FACILITIES_ALS }; |
21 | 21 | ||
22 | static void __init u16_to_hex(char *str, u16 val) | ||
23 | { | ||
24 | int i, num; | ||
25 | |||
26 | for (i = 1; i <= 4; i++) { | ||
27 | num = (val >> (16 - 4 * i)) & 0xf; | ||
28 | if (num >= 10) | ||
29 | num += 7; | ||
30 | *str++ = '0' + num; | ||
31 | } | ||
32 | *str = '\0'; | ||
33 | } | ||
34 | |||
35 | static void __init print_machine_type(void) | ||
36 | { | ||
37 | static char mach_str[80] __initdata = "Detected machine-type number: "; | ||
38 | char type_str[5]; | ||
39 | struct cpuid id; | ||
40 | |||
41 | get_cpu_id(&id); | ||
42 | u16_to_hex(type_str, id.machine); | ||
43 | strcat(mach_str, type_str); | ||
44 | _sclp_print_early(mach_str); | ||
45 | } | ||
46 | |||
47 | static void __init facility_mismatch(void) | ||
48 | { | ||
49 | _sclp_print_early("The Linux kernel requires more recent processor hardware"); | ||
50 | print_machine_type(); | ||
51 | disabled_wait(0x8badcccc); | ||
52 | } | ||
53 | |||
22 | void __init verify_facilities(void) | 54 | void __init verify_facilities(void) |
23 | { | 55 | { |
24 | int i; | 56 | int i; |
@@ -38,9 +70,7 @@ void __init verify_facilities(void) | |||
38 | : "memory", "cc"); | 70 | : "memory", "cc"); |
39 | } | 71 | } |
40 | for (i = 0; i < ARRAY_SIZE(als); i++) { | 72 | for (i = 0; i < ARRAY_SIZE(als); i++) { |
41 | if ((S390_lowcore.stfle_fac_list[i] & als[i]) == als[i]) | 73 | if ((S390_lowcore.stfle_fac_list[i] & als[i]) != als[i]) |
42 | continue; | 74 | facility_mismatch(); |
43 | _sclp_print_early("The Linux kernel requires more recent processor hardware"); | ||
44 | disabled_wait(0x8badcccc); | ||
45 | } | 75 | } |
46 | } | 76 | } |