aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorMichael Holzheu <holzheu@linux.vnet.ibm.com>2013-10-11 04:29:23 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-10-24 11:17:04 -0400
commit5895294274bee046bcfdbb72f8998e2b14e26426 (patch)
tree0bb6d75ac4ebe0a661cb5d5bc6d206a9782e2edd /drivers/s390
parent05e0baaf9ba5a2d173c026530154388f0d2da72c (diff)
s390: Remove zfcpdump NR_CPUS dependency
Currently zfpcdump can only collect registers for up to CONFIG_NR_CPUS CPUss. This dependency is not necessary. So remove it by dynamically allocating the save area array. Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com> Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/char/zcore.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/s390/char/zcore.c b/drivers/s390/char/zcore.c
index 794820a123d0..ffb1fcf0bf5b 100644
--- a/drivers/s390/char/zcore.c
+++ b/drivers/s390/char/zcore.c
@@ -151,7 +151,7 @@ static int __init init_cpu_info(enum arch_id arch)
151 151
152 /* get info for boot cpu from lowcore, stored in the HSA */ 152 /* get info for boot cpu from lowcore, stored in the HSA */
153 153
154 sa = kmalloc(sizeof(*sa), GFP_KERNEL); 154 sa = dump_save_area_create(0);
155 if (!sa) 155 if (!sa)
156 return -ENOMEM; 156 return -ENOMEM;
157 if (memcpy_hsa_kernel(sa, sys_info.sa_base, sys_info.sa_size) < 0) { 157 if (memcpy_hsa_kernel(sa, sys_info.sa_base, sys_info.sa_size) < 0) {
@@ -159,7 +159,6 @@ static int __init init_cpu_info(enum arch_id arch)
159 kfree(sa); 159 kfree(sa);
160 return -EIO; 160 return -EIO;
161 } 161 }
162 zfcpdump_save_areas[0] = sa;
163 return 0; 162 return 0;
164} 163}
165 164
@@ -246,24 +245,25 @@ static int copy_lc(void __user *buf, void *sa, int sa_off, int len)
246static int zcore_add_lc(char __user *buf, unsigned long start, size_t count) 245static int zcore_add_lc(char __user *buf, unsigned long start, size_t count)
247{ 246{
248 unsigned long end; 247 unsigned long end;
249 int i = 0; 248 int i;
250 249
251 if (count == 0) 250 if (count == 0)
252 return 0; 251 return 0;
253 252
254 end = start + count; 253 end = start + count;
255 while (zfcpdump_save_areas[i]) { 254 for (i = 0; i < dump_save_areas.count; i++) {
256 unsigned long cp_start, cp_end; /* copy range */ 255 unsigned long cp_start, cp_end; /* copy range */
257 unsigned long sa_start, sa_end; /* save area range */ 256 unsigned long sa_start, sa_end; /* save area range */
258 unsigned long prefix; 257 unsigned long prefix;
259 unsigned long sa_off, len, buf_off; 258 unsigned long sa_off, len, buf_off;
259 struct save_area *save_area = dump_save_areas.areas[i];
260 260
261 prefix = zfcpdump_save_areas[i]->pref_reg; 261 prefix = save_area->pref_reg;
262 sa_start = prefix + sys_info.sa_base; 262 sa_start = prefix + sys_info.sa_base;
263 sa_end = prefix + sys_info.sa_base + sys_info.sa_size; 263 sa_end = prefix + sys_info.sa_base + sys_info.sa_size;
264 264
265 if ((end < sa_start) || (start > sa_end)) 265 if ((end < sa_start) || (start > sa_end))
266 goto next; 266 continue;
267 cp_start = max(start, sa_start); 267 cp_start = max(start, sa_start);
268 cp_end = min(end, sa_end); 268 cp_end = min(end, sa_end);
269 269
@@ -272,10 +272,8 @@ static int zcore_add_lc(char __user *buf, unsigned long start, size_t count)
272 len = cp_end - cp_start; 272 len = cp_end - cp_start;
273 273
274 TRACE("copy_lc for: %lx\n", start); 274 TRACE("copy_lc for: %lx\n", start);
275 if (copy_lc(buf + buf_off, zfcpdump_save_areas[i], sa_off, len)) 275 if (copy_lc(buf + buf_off, save_area, sa_off, len))
276 return -EFAULT; 276 return -EFAULT;
277next:
278 i++;
279 } 277 }
280 return 0; 278 return 0;
281} 279}
@@ -637,8 +635,8 @@ static void __init zcore_header_init(int arch, struct zcore_header *hdr,
637 hdr->num_pages = mem_size / PAGE_SIZE; 635 hdr->num_pages = mem_size / PAGE_SIZE;
638 hdr->tod = get_tod_clock(); 636 hdr->tod = get_tod_clock();
639 get_cpu_id(&hdr->cpu_id); 637 get_cpu_id(&hdr->cpu_id);
640 for (i = 0; zfcpdump_save_areas[i]; i++) { 638 for (i = 0; i < dump_save_areas.count; i++) {
641 prefix = zfcpdump_save_areas[i]->pref_reg; 639 prefix = dump_save_areas.areas[i]->pref_reg;
642 hdr->real_cpu_cnt++; 640 hdr->real_cpu_cnt++;
643 if (!prefix) 641 if (!prefix)
644 continue; 642 continue;