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>
This commit is contained in:

committed by
Martin Schwidefsky

parent
05e0baaf9b
commit
5895294274
@@ -22,6 +22,32 @@
|
||||
#define PTR_SUB(x, y) (((char *) (x)) - ((unsigned long) (y)))
|
||||
#define PTR_DIFF(x, y) ((unsigned long)(((char *) (x)) - ((unsigned long) (y))))
|
||||
|
||||
struct dump_save_areas dump_save_areas;
|
||||
|
||||
/*
|
||||
* Allocate and add a save area for a CPU
|
||||
*/
|
||||
struct save_area *dump_save_area_create(int cpu)
|
||||
{
|
||||
struct save_area **save_areas, *save_area;
|
||||
|
||||
save_area = kmalloc(sizeof(*save_area), GFP_KERNEL);
|
||||
if (!save_area)
|
||||
return NULL;
|
||||
if (cpu + 1 > dump_save_areas.count) {
|
||||
dump_save_areas.count = cpu + 1;
|
||||
save_areas = krealloc(dump_save_areas.areas,
|
||||
dump_save_areas.count * sizeof(void *),
|
||||
GFP_KERNEL | __GFP_ZERO);
|
||||
if (!save_areas) {
|
||||
kfree(save_area);
|
||||
return NULL;
|
||||
}
|
||||
dump_save_areas.areas = save_areas;
|
||||
}
|
||||
dump_save_areas.areas[cpu] = save_area;
|
||||
return save_area;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return physical address for virtual address
|
||||
@@ -450,8 +476,8 @@ static int get_cpu_cnt(void)
|
||||
{
|
||||
int i, cpus = 0;
|
||||
|
||||
for (i = 0; zfcpdump_save_areas[i]; i++) {
|
||||
if (zfcpdump_save_areas[i]->pref_reg == 0)
|
||||
for (i = 0; i < dump_save_areas.count; i++) {
|
||||
if (dump_save_areas.areas[i]->pref_reg == 0)
|
||||
continue;
|
||||
cpus++;
|
||||
}
|
||||
@@ -522,8 +548,8 @@ static void *notes_init(Elf64_Phdr *phdr, void *ptr, u64 notes_offset)
|
||||
|
||||
ptr = nt_prpsinfo(ptr);
|
||||
|
||||
for (i = 0; zfcpdump_save_areas[i]; i++) {
|
||||
sa = zfcpdump_save_areas[i];
|
||||
for (i = 0; i < dump_save_areas.count; i++) {
|
||||
sa = dump_save_areas.areas[i];
|
||||
if (sa->pref_reg == 0)
|
||||
continue;
|
||||
ptr = fill_cpu_elf_notes(ptr, sa);
|
||||
|
Reference in New Issue
Block a user