From 1a2c5840acf9f657c9b580d4ee12a4c9db3429cb Mon Sep 17 00:00:00 2001 From: Martin Schwidefsky Date: Thu, 29 Oct 2015 10:59:15 +0100 Subject: s390/dump: cleanup CPU save area handling Introduce save_area_alloc(), save_area_boot_cpu(), save_area_add_regs() and save_area_add_vxrs to deal with storing the CPU state in case of a system dump. Remove struct save_area and save_area_ext, and create a new struct save_area as a local definition to arch/s390/kernel/crash_dump.c. Copy each individual field from the hardware status area to the save area, storing the minimum of required data. Signed-off-by: Martin Schwidefsky --- drivers/s390/char/zcore.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'drivers/s390/char/zcore.c') diff --git a/drivers/s390/char/zcore.c b/drivers/s390/char/zcore.c index bed191a39c5b..5043ecfa1fbc 100644 --- a/drivers/s390/char/zcore.c +++ b/drivers/s390/char/zcore.c @@ -117,18 +117,17 @@ int memcpy_hsa_kernel(void *dest, unsigned long src, size_t count) static int __init init_cpu_info(void) { - struct save_area_ext *sa_ext; + struct save_area *sa; /* get info for boot cpu from lowcore, stored in the HSA */ - - sa_ext = dump_save_areas.areas[0]; - if (!sa_ext) + sa = save_area_boot_cpu(); + if (!sa) return -ENOMEM; - if (memcpy_hsa_kernel(&sa_ext->sa, __LC_FPREGS_SAVE_AREA, - sizeof(struct save_area)) < 0) { + if (memcpy_hsa_kernel(hsa_buf, __LC_FPREGS_SAVE_AREA, 512) < 0) { TRACE("could not copy from HSA\n"); return -EIO; } + save_area_add_regs(sa, hsa_buf); /* vx registers are saved in smp.c */ return 0; } -- cgit v1.2.3