diff options
-rw-r--r-- | arch/s390/include/asm/lowcore.h | 15 | ||||
-rw-r--r-- | arch/s390/include/asm/processor.h | 16 | ||||
-rw-r--r-- | arch/s390/include/asm/smp.h | 7 | ||||
-rw-r--r-- | arch/s390/kernel/processor.c | 69 | ||||
-rw-r--r-- | arch/s390/kernel/setup.c | 10 | ||||
-rw-r--r-- | arch/s390/kernel/smp.c | 8 | ||||
-rw-r--r-- | drivers/s390/cio/css.c | 2 |
7 files changed, 52 insertions, 75 deletions
diff --git a/arch/s390/include/asm/lowcore.h b/arch/s390/include/asm/lowcore.h index f94386ece0d3..ad543c11826d 100644 --- a/arch/s390/include/asm/lowcore.h +++ b/arch/s390/include/asm/lowcore.h | |||
@@ -80,7 +80,6 @@ | |||
80 | #define __LC_USER_ASCE 0xC50 | 80 | #define __LC_USER_ASCE 0xC50 |
81 | #define __LC_PANIC_STACK 0xC54 | 81 | #define __LC_PANIC_STACK 0xC54 |
82 | #define __LC_CPUID 0xC60 | 82 | #define __LC_CPUID 0xC60 |
83 | #define __LC_CPUADDR 0xC68 | ||
84 | #define __LC_IPLDEV 0xC7C | 83 | #define __LC_IPLDEV 0xC7C |
85 | #define __LC_CURRENT 0xC90 | 84 | #define __LC_CURRENT 0xC90 |
86 | #define __LC_INT_CLOCK 0xC98 | 85 | #define __LC_INT_CLOCK 0xC98 |
@@ -102,7 +101,6 @@ | |||
102 | #define __LC_USER_ASCE 0xD60 | 101 | #define __LC_USER_ASCE 0xD60 |
103 | #define __LC_PANIC_STACK 0xD68 | 102 | #define __LC_PANIC_STACK 0xD68 |
104 | #define __LC_CPUID 0xD80 | 103 | #define __LC_CPUID 0xD80 |
105 | #define __LC_CPUADDR 0xD88 | ||
106 | #define __LC_IPLDEV 0xDB8 | 104 | #define __LC_IPLDEV 0xDB8 |
107 | #define __LC_CURRENT 0xDD8 | 105 | #define __LC_CURRENT 0xDD8 |
108 | #define __LC_INT_CLOCK 0xDE8 | 106 | #define __LC_INT_CLOCK 0xDE8 |
@@ -273,8 +271,10 @@ struct _lowcore | |||
273 | __u32 user_exec_asce; /* 0xc58 */ | 271 | __u32 user_exec_asce; /* 0xc58 */ |
274 | __u8 pad10[0xc60-0xc5c]; /* 0xc5c */ | 272 | __u8 pad10[0xc60-0xc5c]; /* 0xc5c */ |
275 | /* entry.S sensitive area start */ | 273 | /* entry.S sensitive area start */ |
276 | struct cpuinfo_S390 cpu_data; /* 0xc60 */ | 274 | cpuid_t cpu_id; /* 0xc60 */ |
277 | __u32 ipl_device; /* 0xc7c */ | 275 | __u32 cpu_nr; /* 0xc68 */ |
276 | __u32 ipl_device; /* 0xc6c */ | ||
277 | __u8 pad_0xc70[0xc80-0xc70]; /* 0xc70 */ | ||
278 | /* entry.S sensitive area end */ | 278 | /* entry.S sensitive area end */ |
279 | 279 | ||
280 | /* SMP info area: defined by DJB */ | 280 | /* SMP info area: defined by DJB */ |
@@ -366,9 +366,10 @@ struct _lowcore | |||
366 | __u64 user_exec_asce; /* 0xd70 */ | 366 | __u64 user_exec_asce; /* 0xd70 */ |
367 | __u8 pad10[0xd80-0xd78]; /* 0xd78 */ | 367 | __u8 pad10[0xd80-0xd78]; /* 0xd78 */ |
368 | /* entry.S sensitive area start */ | 368 | /* entry.S sensitive area start */ |
369 | struct cpuinfo_S390 cpu_data; /* 0xd80 */ | 369 | cpuid_t cpu_id; /* 0xd80 */ |
370 | __u32 ipl_device; /* 0xdb8 */ | 370 | __u32 cpu_nr; /* 0xd88 */ |
371 | __u32 pad11; /* 0xdbc */ | 371 | __u32 ipl_device; /* 0xd8c */ |
372 | __u8 pad_0xd90[0xdc0-0xd90]; /* 0xd90 */ | ||
372 | /* entry.S sensitive area end */ | 373 | /* entry.S sensitive area end */ |
373 | 374 | ||
374 | /* SMP info area: defined by DJB */ | 375 | /* SMP info area: defined by DJB */ |
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h index db4523fe38ac..61862b3ac794 100644 --- a/arch/s390/include/asm/processor.h +++ b/arch/s390/include/asm/processor.h | |||
@@ -42,22 +42,8 @@ static inline void get_cpu_id(cpuid_t *ptr) | |||
42 | asm volatile("stidp 0(%1)" : "=m" (*ptr) : "a" (ptr)); | 42 | asm volatile("stidp 0(%1)" : "=m" (*ptr) : "a" (ptr)); |
43 | } | 43 | } |
44 | 44 | ||
45 | struct cpuinfo_S390 | ||
46 | { | ||
47 | cpuid_t cpu_id; | ||
48 | __u16 cpu_addr; | ||
49 | __u16 cpu_nr; | ||
50 | unsigned long loops_per_jiffy; | ||
51 | unsigned long *pgd_quick; | ||
52 | #ifdef __s390x__ | ||
53 | unsigned long *pmd_quick; | ||
54 | #endif /* __s390x__ */ | ||
55 | unsigned long *pte_quick; | ||
56 | unsigned long pgtable_cache_sz; | ||
57 | }; | ||
58 | |||
59 | extern void s390_adjust_jiffies(void); | 45 | extern void s390_adjust_jiffies(void); |
60 | extern void print_cpu_info(struct cpuinfo_S390 *); | 46 | extern void print_cpu_info(void); |
61 | extern int get_cpu_capability(unsigned int *); | 47 | extern int get_cpu_capability(unsigned int *); |
62 | 48 | ||
63 | /* | 49 | /* |
diff --git a/arch/s390/include/asm/smp.h b/arch/s390/include/asm/smp.h index 024b91e06239..2009158a4502 100644 --- a/arch/s390/include/asm/smp.h +++ b/arch/s390/include/asm/smp.h | |||
@@ -50,12 +50,7 @@ extern void machine_power_off_smp(void); | |||
50 | 50 | ||
51 | #define PROC_CHANGE_PENALTY 20 /* Schedule penalty */ | 51 | #define PROC_CHANGE_PENALTY 20 /* Schedule penalty */ |
52 | 52 | ||
53 | #define raw_smp_processor_id() (S390_lowcore.cpu_data.cpu_nr) | 53 | #define raw_smp_processor_id() (S390_lowcore.cpu_nr) |
54 | |||
55 | static inline __u16 hard_smp_processor_id(void) | ||
56 | { | ||
57 | return stap(); | ||
58 | } | ||
59 | 54 | ||
60 | /* | 55 | /* |
61 | * returns 1 if cpu is in stopped/check stopped state or not operational | 56 | * returns 1 if cpu is in stopped/check stopped state or not operational |
diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c index 82c1872cfe80..423da1bd42a4 100644 --- a/arch/s390/kernel/processor.c +++ b/arch/s390/kernel/processor.c | |||
@@ -18,10 +18,11 @@ | |||
18 | #include <asm/lowcore.h> | 18 | #include <asm/lowcore.h> |
19 | #include <asm/param.h> | 19 | #include <asm/param.h> |
20 | 20 | ||
21 | void __cpuinit print_cpu_info(struct cpuinfo_S390 *cpuinfo) | 21 | void __cpuinit print_cpu_info(void) |
22 | { | 22 | { |
23 | pr_info("Processor %d started, address %d, identification %06X\n", | 23 | pr_info("Processor %d started, address %d, identification %06X\n", |
24 | cpuinfo->cpu_nr, cpuinfo->cpu_addr, cpuinfo->cpu_id.ident); | 24 | S390_lowcore.cpu_nr, S390_lowcore.cpu_addr, |
25 | S390_lowcore.cpu_id.ident); | ||
25 | } | 26 | } |
26 | 27 | ||
27 | /* | 28 | /* |
@@ -34,44 +35,42 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
34 | "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", | 35 | "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", |
35 | "edat" | 36 | "edat" |
36 | }; | 37 | }; |
37 | struct cpuinfo_S390 *cpuinfo; | 38 | struct _lowcore *lc; |
38 | unsigned long n = (unsigned long) v - 1; | 39 | unsigned long n = (unsigned long) v - 1; |
39 | int i; | 40 | int i; |
40 | 41 | ||
41 | s390_adjust_jiffies(); | 42 | s390_adjust_jiffies(); |
42 | preempt_disable(); | 43 | preempt_disable(); |
43 | if (!n) { | 44 | if (!n) { |
44 | seq_printf(m, "vendor_id : IBM/S390\n" | 45 | seq_printf(m, "vendor_id : IBM/S390\n" |
45 | "# processors : %i\n" | 46 | "# processors : %i\n" |
46 | "bogomips per cpu: %lu.%02lu\n", | 47 | "bogomips per cpu: %lu.%02lu\n", |
47 | num_online_cpus(), loops_per_jiffy/(500000/HZ), | 48 | num_online_cpus(), loops_per_jiffy/(500000/HZ), |
48 | (loops_per_jiffy/(5000/HZ))%100); | 49 | (loops_per_jiffy/(5000/HZ))%100); |
49 | seq_puts(m, "features\t: "); | 50 | seq_puts(m, "features\t: "); |
50 | for (i = 0; i < 8; i++) | 51 | for (i = 0; i < 8; i++) |
51 | if (hwcap_str[i] && (elf_hwcap & (1UL << i))) | 52 | if (hwcap_str[i] && (elf_hwcap & (1UL << i))) |
52 | seq_printf(m, "%s ", hwcap_str[i]); | 53 | seq_printf(m, "%s ", hwcap_str[i]); |
53 | seq_puts(m, "\n"); | 54 | seq_puts(m, "\n"); |
54 | } | 55 | } |
55 | 56 | ||
56 | if (cpu_online(n)) { | 57 | if (cpu_online(n)) { |
57 | #ifdef CONFIG_SMP | 58 | #ifdef CONFIG_SMP |
58 | if (smp_processor_id() == n) | 59 | lc = (smp_processor_id() == n) ? |
59 | cpuinfo = &S390_lowcore.cpu_data; | 60 | &S390_lowcore : lowcore_ptr[n]; |
60 | else | ||
61 | cpuinfo = &lowcore_ptr[n]->cpu_data; | ||
62 | #else | 61 | #else |
63 | cpuinfo = &S390_lowcore.cpu_data; | 62 | lc = &S390_lowcore; |
64 | #endif | 63 | #endif |
65 | seq_printf(m, "processor %li: " | 64 | seq_printf(m, "processor %li: " |
66 | "version = %02X, " | 65 | "version = %02X, " |
67 | "identification = %06X, " | 66 | "identification = %06X, " |
68 | "machine = %04X\n", | 67 | "machine = %04X\n", |
69 | n, cpuinfo->cpu_id.version, | 68 | n, lc->cpu_id.version, |
70 | cpuinfo->cpu_id.ident, | 69 | lc->cpu_id.ident, |
71 | cpuinfo->cpu_id.machine); | 70 | lc->cpu_id.machine); |
72 | } | 71 | } |
73 | preempt_enable(); | 72 | preempt_enable(); |
74 | return 0; | 73 | return 0; |
75 | } | 74 | } |
76 | 75 | ||
77 | static void *c_start(struct seq_file *m, loff_t *pos) | 76 | static void *c_start(struct seq_file *m, loff_t *pos) |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index dd3c51736270..9c8853f21bb2 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -121,13 +121,10 @@ static struct resource data_resource = { | |||
121 | */ | 121 | */ |
122 | void __cpuinit cpu_init(void) | 122 | void __cpuinit cpu_init(void) |
123 | { | 123 | { |
124 | int addr = hard_smp_processor_id(); | ||
125 | |||
126 | /* | 124 | /* |
127 | * Store processor id in lowcore (used e.g. in timer_interrupt) | 125 | * Store processor id in lowcore (used e.g. in timer_interrupt) |
128 | */ | 126 | */ |
129 | get_cpu_id(&S390_lowcore.cpu_data.cpu_id); | 127 | get_cpu_id(&S390_lowcore.cpu_id); |
130 | S390_lowcore.cpu_data.cpu_addr = addr; | ||
131 | 128 | ||
132 | /* | 129 | /* |
133 | * Force FPU initialization: | 130 | * Force FPU initialization: |
@@ -686,7 +683,6 @@ setup_memory(void) | |||
686 | static void __init setup_hwcaps(void) | 683 | static void __init setup_hwcaps(void) |
687 | { | 684 | { |
688 | static const int stfl_bits[6] = { 0, 2, 7, 17, 19, 21 }; | 685 | static const int stfl_bits[6] = { 0, 2, 7, 17, 19, 21 }; |
689 | struct cpuinfo_S390 *cpuinfo = &S390_lowcore.cpu_data; | ||
690 | unsigned long long facility_list_extended; | 686 | unsigned long long facility_list_extended; |
691 | unsigned int facility_list; | 687 | unsigned int facility_list; |
692 | int i; | 688 | int i; |
@@ -732,7 +728,7 @@ static void __init setup_hwcaps(void) | |||
732 | if (MACHINE_HAS_HPAGE) | 728 | if (MACHINE_HAS_HPAGE) |
733 | elf_hwcap |= 1UL << 7; | 729 | elf_hwcap |= 1UL << 7; |
734 | 730 | ||
735 | switch (cpuinfo->cpu_id.machine) { | 731 | switch (S390_lowcore.cpu_id.machine) { |
736 | case 0x9672: | 732 | case 0x9672: |
737 | #if !defined(CONFIG_64BIT) | 733 | #if !defined(CONFIG_64BIT) |
738 | default: /* Use "g5" as default for 31 bit kernels. */ | 734 | default: /* Use "g5" as default for 31 bit kernels. */ |
@@ -825,7 +821,7 @@ setup_arch(char **cmdline_p) | |||
825 | setup_lowcore(); | 821 | setup_lowcore(); |
826 | 822 | ||
827 | cpu_init(); | 823 | cpu_init(); |
828 | __cpu_logical_map[0] = S390_lowcore.cpu_data.cpu_addr; | 824 | __cpu_logical_map[0] = stap(); |
829 | s390_init_cpu_topology(); | 825 | s390_init_cpu_topology(); |
830 | 826 | ||
831 | /* | 827 | /* |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index a8858634dd05..b167f74d94cd 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -372,7 +372,7 @@ static void __init smp_detect_cpus(void) | |||
372 | 372 | ||
373 | c_cpus = 1; | 373 | c_cpus = 1; |
374 | s_cpus = 0; | 374 | s_cpus = 0; |
375 | boot_cpu_addr = S390_lowcore.cpu_data.cpu_addr; | 375 | boot_cpu_addr = __cpu_logical_map[0]; |
376 | info = kmalloc(sizeof(*info), GFP_KERNEL); | 376 | info = kmalloc(sizeof(*info), GFP_KERNEL); |
377 | if (!info) | 377 | if (!info) |
378 | panic("smp_detect_cpus failed to allocate memory\n"); | 378 | panic("smp_detect_cpus failed to allocate memory\n"); |
@@ -446,7 +446,7 @@ int __cpuinit start_secondary(void *cpuvoid) | |||
446 | /* Switch on interrupts */ | 446 | /* Switch on interrupts */ |
447 | local_irq_enable(); | 447 | local_irq_enable(); |
448 | /* Print info about this processor */ | 448 | /* Print info about this processor */ |
449 | print_cpu_info(&S390_lowcore.cpu_data); | 449 | print_cpu_info(); |
450 | /* cpu_idle will call schedule for us */ | 450 | /* cpu_idle will call schedule for us */ |
451 | cpu_idle(); | 451 | cpu_idle(); |
452 | return 0; | 452 | return 0; |
@@ -564,7 +564,7 @@ int __cpuinit __cpu_up(unsigned int cpu) | |||
564 | : : "a" (&cpu_lowcore->access_regs_save_area) : "memory"); | 564 | : : "a" (&cpu_lowcore->access_regs_save_area) : "memory"); |
565 | cpu_lowcore->percpu_offset = __per_cpu_offset[cpu]; | 565 | cpu_lowcore->percpu_offset = __per_cpu_offset[cpu]; |
566 | cpu_lowcore->current_task = (unsigned long) idle; | 566 | cpu_lowcore->current_task = (unsigned long) idle; |
567 | cpu_lowcore->cpu_data.cpu_nr = cpu; | 567 | cpu_lowcore->cpu_nr = cpu; |
568 | cpu_lowcore->kernel_asce = S390_lowcore.kernel_asce; | 568 | cpu_lowcore->kernel_asce = S390_lowcore.kernel_asce; |
569 | cpu_lowcore->ipl_device = S390_lowcore.ipl_device; | 569 | cpu_lowcore->ipl_device = S390_lowcore.ipl_device; |
570 | eieio(); | 570 | eieio(); |
@@ -656,7 +656,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
656 | /* request the 0x1201 emergency signal external interrupt */ | 656 | /* request the 0x1201 emergency signal external interrupt */ |
657 | if (register_external_interrupt(0x1201, do_ext_call_interrupt) != 0) | 657 | if (register_external_interrupt(0x1201, do_ext_call_interrupt) != 0) |
658 | panic("Couldn't request external interrupt 0x1201"); | 658 | panic("Couldn't request external interrupt 0x1201"); |
659 | print_cpu_info(&S390_lowcore.cpu_data); | 659 | print_cpu_info(); |
660 | 660 | ||
661 | /* Reallocate current lowcore, but keep its contents. */ | 661 | /* Reallocate current lowcore, but keep its contents. */ |
662 | lc_order = sizeof(long) == 8 ? 1 : 0; | 662 | lc_order = sizeof(long) == 8 ? 1 : 0; |
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 8446d15e4485..dcd0e48918da 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c | |||
@@ -655,7 +655,7 @@ css_generate_pgid(struct channel_subsystem *css, u32 tod_high) | |||
655 | css->global_pgid.pgid_high.ext_cssid.cssid = css->cssid; | 655 | css->global_pgid.pgid_high.ext_cssid.cssid = css->cssid; |
656 | } else { | 656 | } else { |
657 | #ifdef CONFIG_SMP | 657 | #ifdef CONFIG_SMP |
658 | css->global_pgid.pgid_high.cpu_addr = hard_smp_processor_id(); | 658 | css->global_pgid.pgid_high.cpu_addr = stap(); |
659 | #else | 659 | #else |
660 | css->global_pgid.pgid_high.cpu_addr = 0; | 660 | css->global_pgid.pgid_high.cpu_addr = 0; |
661 | #endif | 661 | #endif |