diff options
Diffstat (limited to 'arch/s390/kernel/processor.c')
-rw-r--r-- | arch/s390/kernel/processor.c | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c index 0729f36c2fe3..ecb2d02b02e4 100644 --- a/arch/s390/kernel/processor.c +++ b/arch/s390/kernel/processor.c | |||
@@ -18,24 +18,42 @@ | |||
18 | #include <asm/lowcore.h> | 18 | #include <asm/lowcore.h> |
19 | #include <asm/param.h> | 19 | #include <asm/param.h> |
20 | 20 | ||
21 | static DEFINE_PER_CPU(struct cpuid, cpu_id); | ||
22 | |||
23 | /* | ||
24 | * cpu_init - initializes state that is per-CPU. | ||
25 | */ | ||
26 | void __cpuinit cpu_init(void) | ||
27 | { | ||
28 | struct cpuid *id = &per_cpu(cpu_id, smp_processor_id()); | ||
29 | |||
30 | get_cpu_id(id); | ||
31 | atomic_inc(&init_mm.mm_count); | ||
32 | current->active_mm = &init_mm; | ||
33 | BUG_ON(current->mm); | ||
34 | enter_lazy_tlb(&init_mm, current); | ||
35 | } | ||
36 | |||
37 | /* | ||
38 | * print_cpu_info - print basic information about a cpu | ||
39 | */ | ||
21 | void __cpuinit print_cpu_info(void) | 40 | void __cpuinit print_cpu_info(void) |
22 | { | 41 | { |
42 | struct cpuid *id = &per_cpu(cpu_id, smp_processor_id()); | ||
43 | |||
23 | pr_info("Processor %d started, address %d, identification %06X\n", | 44 | pr_info("Processor %d started, address %d, identification %06X\n", |
24 | S390_lowcore.cpu_nr, S390_lowcore.cpu_addr, | 45 | S390_lowcore.cpu_nr, S390_lowcore.cpu_addr, id->ident); |
25 | S390_lowcore.cpu_id.ident); | ||
26 | } | 46 | } |
27 | 47 | ||
28 | /* | 48 | /* |
29 | * show_cpuinfo - Get information on one CPU for use by procfs. | 49 | * show_cpuinfo - Get information on one CPU for use by procfs. |
30 | */ | 50 | */ |
31 | |||
32 | static int show_cpuinfo(struct seq_file *m, void *v) | 51 | static int show_cpuinfo(struct seq_file *m, void *v) |
33 | { | 52 | { |
34 | static const char *hwcap_str[10] = { | 53 | static const char *hwcap_str[10] = { |
35 | "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", | 54 | "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", |
36 | "edat", "etf3eh", "highgprs" | 55 | "edat", "etf3eh", "highgprs" |
37 | }; | 56 | }; |
38 | struct _lowcore *lc; | ||
39 | unsigned long n = (unsigned long) v - 1; | 57 | unsigned long n = (unsigned long) v - 1; |
40 | int i; | 58 | int i; |
41 | 59 | ||
@@ -55,19 +73,12 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
55 | } | 73 | } |
56 | 74 | ||
57 | if (cpu_online(n)) { | 75 | if (cpu_online(n)) { |
58 | #ifdef CONFIG_SMP | 76 | struct cpuid *id = &per_cpu(cpu_id, n); |
59 | lc = (smp_processor_id() == n) ? | ||
60 | &S390_lowcore : lowcore_ptr[n]; | ||
61 | #else | ||
62 | lc = &S390_lowcore; | ||
63 | #endif | ||
64 | seq_printf(m, "processor %li: " | 77 | seq_printf(m, "processor %li: " |
65 | "version = %02X, " | 78 | "version = %02X, " |
66 | "identification = %06X, " | 79 | "identification = %06X, " |
67 | "machine = %04X\n", | 80 | "machine = %04X\n", |
68 | n, lc->cpu_id.version, | 81 | n, id->version, id->ident, id->machine); |
69 | lc->cpu_id.ident, | ||
70 | lc->cpu_id.machine); | ||
71 | } | 82 | } |
72 | preempt_enable(); | 83 | preempt_enable(); |
73 | return 0; | 84 | return 0; |