diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2010-05-17 04:00:00 -0400 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2010-05-17 04:00:15 -0400 |
commit | 94038a99119c171aea27608f81c7ba359de98c4e (patch) | |
tree | f74a84b289eb256f2b0674efb49640733b003b29 /arch/s390 | |
parent | e40152ee1e1c7a63f4777791863215e3faa37a86 (diff) |
[S390] More cleanup for struct _lowcore
Remove cpu_id from lowcore and replace addr_t with __u64.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/include/asm/lowcore.h | 48 | ||||
-rw-r--r-- | arch/s390/kernel/asm-offsets.c | 1 | ||||
-rw-r--r-- | arch/s390/kernel/head.S | 4 | ||||
-rw-r--r-- | arch/s390/kernel/processor.c | 37 | ||||
-rw-r--r-- | arch/s390/kernel/setup.c | 20 |
5 files changed, 52 insertions, 58 deletions
diff --git a/arch/s390/include/asm/lowcore.h b/arch/s390/include/asm/lowcore.h index 05527c040b7a..f7e78c79b8b1 100644 --- a/arch/s390/include/asm/lowcore.h +++ b/arch/s390/include/asm/lowcore.h | |||
@@ -126,16 +126,15 @@ struct _lowcore { | |||
126 | __u32 user_exec_asce; /* 0x02ac */ | 126 | __u32 user_exec_asce; /* 0x02ac */ |
127 | 127 | ||
128 | /* SMP info area */ | 128 | /* SMP info area */ |
129 | struct cpuid cpu_id; /* 0x02b0 */ | 129 | __u32 cpu_nr; /* 0x02b0 */ |
130 | __u32 cpu_nr; /* 0x02b8 */ | 130 | __u32 softirq_pending; /* 0x02b4 */ |
131 | __u32 softirq_pending; /* 0x02bc */ | 131 | __u32 percpu_offset; /* 0x02b8 */ |
132 | __u32 percpu_offset; /* 0x02c0 */ | 132 | __u32 ext_call_fast; /* 0x02bc */ |
133 | __u32 ext_call_fast; /* 0x02c4 */ | 133 | __u64 int_clock; /* 0x02c0 */ |
134 | __u64 int_clock; /* 0x02c8 */ | 134 | __u64 clock_comparator; /* 0x02c8 */ |
135 | __u64 clock_comparator; /* 0x02d0 */ | 135 | __u32 machine_flags; /* 0x02d0 */ |
136 | __u32 machine_flags; /* 0x02d8 */ | 136 | __u32 ftrace_func; /* 0x02d4 */ |
137 | __u32 ftrace_func; /* 0x02dc */ | 137 | __u8 pad_0x02d8[0x0300-0x02d8]; /* 0x02d8 */ |
138 | __u8 pad_0x02e0[0x0300-0x02e0]; /* 0x02e0 */ | ||
139 | 138 | ||
140 | /* Interrupt response block */ | 139 | /* Interrupt response block */ |
141 | __u8 irb[64]; /* 0x0300 */ | 140 | __u8 irb[64]; /* 0x0300 */ |
@@ -189,14 +188,14 @@ struct _lowcore { | |||
189 | __u32 data_exc_code; /* 0x0090 */ | 188 | __u32 data_exc_code; /* 0x0090 */ |
190 | __u16 mon_class_num; /* 0x0094 */ | 189 | __u16 mon_class_num; /* 0x0094 */ |
191 | __u16 per_perc_atmid; /* 0x0096 */ | 190 | __u16 per_perc_atmid; /* 0x0096 */ |
192 | addr_t per_address; /* 0x0098 */ | 191 | __u64 per_address; /* 0x0098 */ |
193 | __u8 exc_access_id; /* 0x00a0 */ | 192 | __u8 exc_access_id; /* 0x00a0 */ |
194 | __u8 per_access_id; /* 0x00a1 */ | 193 | __u8 per_access_id; /* 0x00a1 */ |
195 | __u8 op_access_id; /* 0x00a2 */ | 194 | __u8 op_access_id; /* 0x00a2 */ |
196 | __u8 ar_access_id; /* 0x00a3 */ | 195 | __u8 ar_access_id; /* 0x00a3 */ |
197 | __u8 pad_0x00a4[0x00a8-0x00a4]; /* 0x00a4 */ | 196 | __u8 pad_0x00a4[0x00a8-0x00a4]; /* 0x00a4 */ |
198 | addr_t trans_exc_code; /* 0x00a8 */ | 197 | __u64 trans_exc_code; /* 0x00a8 */ |
199 | addr_t monitor_code; /* 0x00b0 */ | 198 | __u64 monitor_code; /* 0x00b0 */ |
200 | __u16 subchannel_id; /* 0x00b8 */ | 199 | __u16 subchannel_id; /* 0x00b8 */ |
201 | __u16 subchannel_nr; /* 0x00ba */ | 200 | __u16 subchannel_nr; /* 0x00ba */ |
202 | __u32 io_int_parm; /* 0x00bc */ | 201 | __u32 io_int_parm; /* 0x00bc */ |
@@ -207,7 +206,7 @@ struct _lowcore { | |||
207 | __u32 mcck_interruption_code[2]; /* 0x00e8 */ | 206 | __u32 mcck_interruption_code[2]; /* 0x00e8 */ |
208 | __u8 pad_0x00f0[0x00f4-0x00f0]; /* 0x00f0 */ | 207 | __u8 pad_0x00f0[0x00f4-0x00f0]; /* 0x00f0 */ |
209 | __u32 external_damage_code; /* 0x00f4 */ | 208 | __u32 external_damage_code; /* 0x00f4 */ |
210 | addr_t failing_storage_address; /* 0x00f8 */ | 209 | __u64 failing_storage_address; /* 0x00f8 */ |
211 | __u8 pad_0x0100[0x0110-0x0100]; /* 0x0100 */ | 210 | __u8 pad_0x0100[0x0110-0x0100]; /* 0x0100 */ |
212 | __u64 breaking_event_addr; /* 0x0110 */ | 211 | __u64 breaking_event_addr; /* 0x0110 */ |
213 | __u8 pad_0x0118[0x0120-0x0118]; /* 0x0118 */ | 212 | __u8 pad_0x0118[0x0120-0x0118]; /* 0x0118 */ |
@@ -255,17 +254,16 @@ struct _lowcore { | |||
255 | __u64 user_exec_asce; /* 0x0318 */ | 254 | __u64 user_exec_asce; /* 0x0318 */ |
256 | 255 | ||
257 | /* SMP info area */ | 256 | /* SMP info area */ |
258 | struct cpuid cpu_id; /* 0x0320 */ | 257 | __u32 cpu_nr; /* 0x0320 */ |
259 | __u32 cpu_nr; /* 0x0328 */ | 258 | __u32 softirq_pending; /* 0x0324 */ |
260 | __u32 softirq_pending; /* 0x032c */ | 259 | __u64 percpu_offset; /* 0x0328 */ |
261 | __u64 percpu_offset; /* 0x0330 */ | 260 | __u64 ext_call_fast; /* 0x0330 */ |
262 | __u64 ext_call_fast; /* 0x0338 */ | 261 | __u64 int_clock; /* 0x0338 */ |
263 | __u64 int_clock; /* 0x0340 */ | 262 | __u64 clock_comparator; /* 0x0340 */ |
264 | __u64 clock_comparator; /* 0x0348 */ | 263 | __u64 vdso_per_cpu_data; /* 0x0348 */ |
265 | __u64 vdso_per_cpu_data; /* 0x0350 */ | 264 | __u64 machine_flags; /* 0x0350 */ |
266 | __u64 machine_flags; /* 0x0358 */ | 265 | __u64 ftrace_func; /* 0x0358 */ |
267 | __u64 ftrace_func; /* 0x0360 */ | 266 | __u8 pad_0x0368[0x0380-0x0360]; /* 0x0360 */ |
268 | __u8 pad_0x0368[0x0380-0x0368]; /* 0x0368 */ | ||
269 | 267 | ||
270 | /* Interrupt response block. */ | 268 | /* Interrupt response block. */ |
271 | __u8 irb[64]; /* 0x0380 */ | 269 | __u8 irb[64]; /* 0x0380 */ |
diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c index a09408952ed0..32b1ede69858 100644 --- a/arch/s390/kernel/asm-offsets.c +++ b/arch/s390/kernel/asm-offsets.c | |||
@@ -126,7 +126,6 @@ int main(void) | |||
126 | DEFINE(__LC_KERNEL_ASCE, offsetof(struct _lowcore, kernel_asce)); | 126 | DEFINE(__LC_KERNEL_ASCE, offsetof(struct _lowcore, kernel_asce)); |
127 | DEFINE(__LC_USER_ASCE, offsetof(struct _lowcore, user_asce)); | 127 | DEFINE(__LC_USER_ASCE, offsetof(struct _lowcore, user_asce)); |
128 | DEFINE(__LC_USER_EXEC_ASCE, offsetof(struct _lowcore, user_exec_asce)); | 128 | DEFINE(__LC_USER_EXEC_ASCE, offsetof(struct _lowcore, user_exec_asce)); |
129 | DEFINE(__LC_CPUID, offsetof(struct _lowcore, cpu_id)); | ||
130 | DEFINE(__LC_INT_CLOCK, offsetof(struct _lowcore, int_clock)); | 129 | DEFINE(__LC_INT_CLOCK, offsetof(struct _lowcore, int_clock)); |
131 | DEFINE(__LC_MACHINE_FLAGS, offsetof(struct _lowcore, machine_flags)); | 130 | DEFINE(__LC_MACHINE_FLAGS, offsetof(struct _lowcore, machine_flags)); |
132 | DEFINE(__LC_FTRACE_FUNC, offsetof(struct _lowcore, ftrace_func)); | 131 | DEFINE(__LC_FTRACE_FUNC, offsetof(struct _lowcore, ftrace_func)); |
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S index 9d1f76702d47..51838ad42d56 100644 --- a/arch/s390/kernel/head.S +++ b/arch/s390/kernel/head.S | |||
@@ -328,8 +328,8 @@ iplstart: | |||
328 | # | 328 | # |
329 | # reset files in VM reader | 329 | # reset files in VM reader |
330 | # | 330 | # |
331 | stidp __LC_CPUID # store cpuid | 331 | stidp __LC_SAVE_AREA # store cpuid |
332 | tm __LC_CPUID,0xff # running VM ? | 332 | tm __LC_SAVE_AREA,0xff # running VM ? |
333 | bno .Lnoreset | 333 | bno .Lnoreset |
334 | la %r2,.Lreset | 334 | la %r2,.Lreset |
335 | lhi %r3,26 | 335 | lhi %r3,26 |
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; |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 91625f759ccd..6309276516b9 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -113,22 +113,6 @@ static struct resource data_resource = { | |||
113 | }; | 113 | }; |
114 | 114 | ||
115 | /* | 115 | /* |
116 | * cpu_init() initializes state that is per-CPU. | ||
117 | */ | ||
118 | void __cpuinit cpu_init(void) | ||
119 | { | ||
120 | /* | ||
121 | * Store processor id in lowcore (used e.g. in timer_interrupt) | ||
122 | */ | ||
123 | get_cpu_id(&S390_lowcore.cpu_id); | ||
124 | |||
125 | atomic_inc(&init_mm.mm_count); | ||
126 | current->active_mm = &init_mm; | ||
127 | BUG_ON(current->mm); | ||
128 | enter_lazy_tlb(&init_mm, current); | ||
129 | } | ||
130 | |||
131 | /* | ||
132 | * condev= and conmode= setup parameter. | 116 | * condev= and conmode= setup parameter. |
133 | */ | 117 | */ |
134 | 118 | ||
@@ -695,6 +679,7 @@ static void __init setup_hwcaps(void) | |||
695 | static const int stfl_bits[6] = { 0, 2, 7, 17, 19, 21 }; | 679 | static const int stfl_bits[6] = { 0, 2, 7, 17, 19, 21 }; |
696 | unsigned long long facility_list_extended; | 680 | unsigned long long facility_list_extended; |
697 | unsigned int facility_list; | 681 | unsigned int facility_list; |
682 | struct cpuid cpu_id; | ||
698 | int i; | 683 | int i; |
699 | 684 | ||
700 | facility_list = stfl(); | 685 | facility_list = stfl(); |
@@ -756,7 +741,8 @@ static void __init setup_hwcaps(void) | |||
756 | */ | 741 | */ |
757 | elf_hwcap |= HWCAP_S390_HIGH_GPRS; | 742 | elf_hwcap |= HWCAP_S390_HIGH_GPRS; |
758 | 743 | ||
759 | switch (S390_lowcore.cpu_id.machine) { | 744 | get_cpu_id(&cpu_id); |
745 | switch (cpu_id.machine) { | ||
760 | case 0x9672: | 746 | case 0x9672: |
761 | #if !defined(CONFIG_64BIT) | 747 | #if !defined(CONFIG_64BIT) |
762 | default: /* Use "g5" as default for 31 bit kernels. */ | 748 | default: /* Use "g5" as default for 31 bit kernels. */ |