diff options
-rw-r--r-- | arch/s390/include/asm/topology.h | 2 | ||||
-rw-r--r-- | arch/s390/kernel/sysinfo.c | 34 | ||||
-rw-r--r-- | arch/s390/kernel/topology.c | 3 |
3 files changed, 36 insertions, 3 deletions
diff --git a/arch/s390/include/asm/topology.h b/arch/s390/include/asm/topology.h index 051107a2c5e2..c5338834ddbd 100644 --- a/arch/s390/include/asm/topology.h +++ b/arch/s390/include/asm/topology.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _ASM_S390_TOPOLOGY_H | 2 | #define _ASM_S390_TOPOLOGY_H |
3 | 3 | ||
4 | #include <linux/cpumask.h> | 4 | #include <linux/cpumask.h> |
5 | #include <asm/sysinfo.h> | ||
5 | 6 | ||
6 | extern unsigned char cpu_core_id[NR_CPUS]; | 7 | extern unsigned char cpu_core_id[NR_CPUS]; |
7 | extern cpumask_t cpu_core_map[NR_CPUS]; | 8 | extern cpumask_t cpu_core_map[NR_CPUS]; |
@@ -32,6 +33,7 @@ static inline const struct cpumask *cpu_book_mask(unsigned int cpu) | |||
32 | 33 | ||
33 | int topology_set_cpu_management(int fc); | 34 | int topology_set_cpu_management(int fc); |
34 | void topology_schedule_update(void); | 35 | void topology_schedule_update(void); |
36 | void store_topology(struct sysinfo_15_1_x *info); | ||
35 | 37 | ||
36 | #define POLARIZATION_UNKNWN (-1) | 38 | #define POLARIZATION_UNKNWN (-1) |
37 | #define POLARIZATION_HRZ (0) | 39 | #define POLARIZATION_HRZ (0) |
diff --git a/arch/s390/kernel/sysinfo.c b/arch/s390/kernel/sysinfo.c index a91274b4eb8f..f04d93aa48ec 100644 --- a/arch/s390/kernel/sysinfo.c +++ b/arch/s390/kernel/sysinfo.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <asm/ebcdic.h> | 15 | #include <asm/ebcdic.h> |
16 | #include <asm/sysinfo.h> | 16 | #include <asm/sysinfo.h> |
17 | #include <asm/cpcmd.h> | 17 | #include <asm/cpcmd.h> |
18 | #include <asm/topology.h> | ||
18 | 19 | ||
19 | /* Sigh, math-emu. Don't ask. */ | 20 | /* Sigh, math-emu. Don't ask. */ |
20 | #include <asm/sfp-util.h> | 21 | #include <asm/sfp-util.h> |
@@ -84,6 +85,35 @@ static int stsi_1_1_1(struct sysinfo_1_1_1 *info, char *page, int len) | |||
84 | return len; | 85 | return len; |
85 | } | 86 | } |
86 | 87 | ||
88 | static int stsi_15_1_x(struct sysinfo_15_1_x *info, char *page, int len) | ||
89 | { | ||
90 | static int max_mnest; | ||
91 | int i, rc; | ||
92 | |||
93 | len += sprintf(page + len, "\n"); | ||
94 | if (!MACHINE_HAS_TOPOLOGY) | ||
95 | return len; | ||
96 | if (max_mnest) { | ||
97 | stsi(info, 15, 1, max_mnest); | ||
98 | } else { | ||
99 | for (max_mnest = 6; max_mnest > 1; max_mnest--) { | ||
100 | rc = stsi(info, 15, 1, max_mnest); | ||
101 | if (rc != -ENOSYS) | ||
102 | break; | ||
103 | } | ||
104 | } | ||
105 | len += sprintf(page + len, "CPU Topology HW: "); | ||
106 | for (i = 0; i < TOPOLOGY_NR_MAG; i++) | ||
107 | len += sprintf(page + len, " %d", info->mag[i]); | ||
108 | len += sprintf(page + len, "\n"); | ||
109 | store_topology(info); | ||
110 | len += sprintf(page + len, "CPU Topology SW: "); | ||
111 | for (i = 0; i < TOPOLOGY_NR_MAG; i++) | ||
112 | len += sprintf(page + len, " %d", info->mag[i]); | ||
113 | len += sprintf(page + len, "\n"); | ||
114 | return len; | ||
115 | } | ||
116 | |||
87 | static int stsi_1_2_2(struct sysinfo_1_2_2 *info, char *page, int len) | 117 | static int stsi_1_2_2(struct sysinfo_1_2_2 *info, char *page, int len) |
88 | { | 118 | { |
89 | struct sysinfo_1_2_2_extension *ext; | 119 | struct sysinfo_1_2_2_extension *ext; |
@@ -94,7 +124,6 @@ static int stsi_1_2_2(struct sysinfo_1_2_2 *info, char *page, int len) | |||
94 | ext = (struct sysinfo_1_2_2_extension *) | 124 | ext = (struct sysinfo_1_2_2_extension *) |
95 | ((unsigned long) info + info->acc_offset); | 125 | ((unsigned long) info + info->acc_offset); |
96 | 126 | ||
97 | len += sprintf(page + len, "\n"); | ||
98 | len += sprintf(page + len, "CPUs Total: %d\n", | 127 | len += sprintf(page + len, "CPUs Total: %d\n", |
99 | info->cpus_total); | 128 | info->cpus_total); |
100 | len += sprintf(page + len, "CPUs Configured: %d\n", | 129 | len += sprintf(page + len, "CPUs Configured: %d\n", |
@@ -224,6 +253,9 @@ static int proc_read_sysinfo(char *page, char **start, | |||
224 | len = stsi_1_1_1((struct sysinfo_1_1_1 *) info, page, len); | 253 | len = stsi_1_1_1((struct sysinfo_1_1_1 *) info, page, len); |
225 | 254 | ||
226 | if (level >= 1) | 255 | if (level >= 1) |
256 | len = stsi_15_1_x((struct sysinfo_15_1_x *) info, page, len); | ||
257 | |||
258 | if (level >= 1) | ||
227 | len = stsi_1_2_2((struct sysinfo_1_2_2 *) info, page, len); | 259 | len = stsi_1_2_2((struct sysinfo_1_2_2 *) info, page, len); |
228 | 260 | ||
229 | if (level >= 2) | 261 | if (level >= 2) |
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c index ffea01e63218..a9dee9048ee5 100644 --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/cpuset.h> | 18 | #include <linux/cpuset.h> |
19 | #include <asm/delay.h> | 19 | #include <asm/delay.h> |
20 | #include <asm/s390_ext.h> | 20 | #include <asm/s390_ext.h> |
21 | #include <asm/sysinfo.h> | ||
22 | 21 | ||
23 | #define PTF_HORIZONTAL (0UL) | 22 | #define PTF_HORIZONTAL (0UL) |
24 | #define PTF_VERTICAL (1UL) | 23 | #define PTF_VERTICAL (1UL) |
@@ -215,7 +214,7 @@ static void update_cpu_core_map(void) | |||
215 | spin_unlock_irqrestore(&topology_lock, flags); | 214 | spin_unlock_irqrestore(&topology_lock, flags); |
216 | } | 215 | } |
217 | 216 | ||
218 | static void store_topology(struct tl_info *info) | 217 | void store_topology(struct sysinfo_15_1_x *info) |
219 | { | 218 | { |
220 | #ifdef CONFIG_SCHED_BOOK | 219 | #ifdef CONFIG_SCHED_BOOK |
221 | int rc; | 220 | int rc; |