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 <[email protected]>
This commit is contained in:
Martin Schwidefsky 2015-10-29 10:59:15 +01:00
commit 1a2c5840ac
5 changed files with 145 additions and 198 deletions

View file

@ -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;
}