From f08b8414632c9f256e33f0a18104d8d5e103d204 Mon Sep 17 00:00:00 2001 From: Martin Schwidefsky Date: Fri, 23 Oct 2015 09:05:38 +0200 Subject: [PATCH] s390/dump: remove SAVE_AREA_BASE Replace the SAVE_AREA_BASE offset calculations in reipl.S with the assembler constant for the location of each register status area. Use __LC_FPREGS_SAVE_AREA instead of SAVE_AREA_BASE in the three remaining code locations and remove the definition of SAVE_AREA_BASE. Acked-by: Michael Holzheu Signed-off-by: Martin Schwidefsky --- arch/s390/kernel/asm-offsets.c | 1 - arch/s390/kernel/machine_kexec.c | 6 +-- arch/s390/kernel/reipl.S | 65 ++++++++++++++++++-------------- arch/s390/kernel/smp.c | 4 +- drivers/s390/char/zcore.c | 2 +- 5 files changed, 42 insertions(+), 36 deletions(-) diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c index dc6c9c604543..ae7b565b6c4c 100644 --- a/arch/s390/kernel/asm-offsets.c +++ b/arch/s390/kernel/asm-offsets.c @@ -175,7 +175,6 @@ int main(void) /* hardware defined lowcore locations 0x1000 - 0x18ff */ OFFSET(__LC_VX_SAVE_AREA_ADDR, _lowcore, vector_save_area_addr); OFFSET(__LC_EXT_PARAMS2, _lowcore, ext_params2); - OFFSET(SAVE_AREA_BASE, _lowcore, floating_pt_save_area); OFFSET(__LC_FPREGS_SAVE_AREA, _lowcore, floating_pt_save_area); OFFSET(__LC_GPREGS_SAVE_AREA, _lowcore, gpregs_save_area); OFFSET(__LC_PSW_SAVE_AREA, _lowcore, psw_save_area); diff --git a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_kexec.c index 991b16819b97..bf2cd699556f 100644 --- a/arch/s390/kernel/machine_kexec.c +++ b/arch/s390/kernel/machine_kexec.c @@ -44,11 +44,11 @@ static void setup_regs(void) int cpu, this_cpu; /* setup_regs is called with the prefix register = 0 */ - sa_0 = (struct save_area *) SAVE_AREA_BASE; + sa_0 = (struct save_area *) __LC_FPREGS_SAVE_AREA; /* Get status of this CPU out of absolute zero */ prefix = (unsigned long) S390_lowcore.prefixreg_save_area; - sa = (struct save_area *)(prefix + SAVE_AREA_BASE); + sa = (struct save_area *)(prefix + __LC_FPREGS_SAVE_AREA); memcpy(sa, sa_0, sizeof(struct save_area)); if (MACHINE_HAS_VX) { struct _lowcore *lc = (struct _lowcore *) prefix; @@ -63,7 +63,7 @@ static void setup_regs(void) if (smp_store_status(cpu)) continue; prefix = (unsigned long) S390_lowcore.prefixreg_save_area; - sa = (struct save_area *)(prefix + SAVE_AREA_BASE); + sa = (struct save_area *)(prefix + __LC_FPREGS_SAVE_AREA); memcpy(sa, sa_0, sizeof(struct save_area)); } } diff --git a/arch/s390/kernel/reipl.S b/arch/s390/kernel/reipl.S index 52aab0bd84f8..b75a521e4fab 100644 --- a/arch/s390/kernel/reipl.S +++ b/arch/s390/kernel/reipl.S @@ -19,49 +19,56 @@ ENTRY(store_status) /* Save register one and load save area base */ stg %r1,__LC_SAVE_AREA_RESTART - lghi %r1,SAVE_AREA_BASE /* General purpose registers */ - stmg %r0,%r15,__LC_GPREGS_SAVE_AREA-SAVE_AREA_BASE(%r1) - lg %r2,__LC_SAVE_AREA_RESTART - stg %r2,__LC_GPREGS_SAVE_AREA-SAVE_AREA_BASE+8(%r1) + lghi %r1,__LC_GPREGS_SAVE_AREA + stmg %r0,%r15,0(%r1) + mvc 8(8,%r1),__LC_SAVE_AREA_RESTART /* Control registers */ - stctg %c0,%c15,__LC_CREGS_SAVE_AREA-SAVE_AREA_BASE(%r1) + lghi %r1,__LC_CREGS_SAVE_AREA + stctg %c0,%c15,0(%r1) /* Access registers */ - stam %a0,%a15,__LC_AREGS_SAVE_AREA-SAVE_AREA_BASE(%r1) + lghi %r1,__LC_AREGS_SAVE_AREA + stam %a0,%a15,0(%r1) /* Floating point registers */ - std %f0, 0x00 + __LC_FPREGS_SAVE_AREA-SAVE_AREA_BASE(%r1) - std %f1, 0x08 + __LC_FPREGS_SAVE_AREA-SAVE_AREA_BASE(%r1) - std %f2, 0x10 + __LC_FPREGS_SAVE_AREA-SAVE_AREA_BASE(%r1) - std %f3, 0x18 + __LC_FPREGS_SAVE_AREA-SAVE_AREA_BASE(%r1) - std %f4, 0x20 + __LC_FPREGS_SAVE_AREA-SAVE_AREA_BASE(%r1) - std %f5, 0x28 + __LC_FPREGS_SAVE_AREA-SAVE_AREA_BASE(%r1) - std %f6, 0x30 + __LC_FPREGS_SAVE_AREA-SAVE_AREA_BASE(%r1) - std %f7, 0x38 + __LC_FPREGS_SAVE_AREA-SAVE_AREA_BASE(%r1) - std %f8, 0x40 + __LC_FPREGS_SAVE_AREA-SAVE_AREA_BASE(%r1) - std %f9, 0x48 + __LC_FPREGS_SAVE_AREA-SAVE_AREA_BASE(%r1) - std %f10,0x50 + __LC_FPREGS_SAVE_AREA-SAVE_AREA_BASE(%r1) - std %f11,0x58 + __LC_FPREGS_SAVE_AREA-SAVE_AREA_BASE(%r1) - std %f12,0x60 + __LC_FPREGS_SAVE_AREA-SAVE_AREA_BASE(%r1) - std %f13,0x68 + __LC_FPREGS_SAVE_AREA-SAVE_AREA_BASE(%r1) - std %f14,0x70 + __LC_FPREGS_SAVE_AREA-SAVE_AREA_BASE(%r1) - std %f15,0x78 + __LC_FPREGS_SAVE_AREA-SAVE_AREA_BASE(%r1) + lghi %r1,__LC_FPREGS_SAVE_AREA + std %f0, 0x00(%r1) + std %f1, 0x08(%r1) + std %f2, 0x10(%r1) + std %f3, 0x18(%r1) + std %f4, 0x20(%r1) + std %f5, 0x28(%r1) + std %f6, 0x30(%r1) + std %f7, 0x38(%r1) + std %f8, 0x40(%r1) + std %f9, 0x48(%r1) + std %f10,0x50(%r1) + std %f11,0x58(%r1) + std %f12,0x60(%r1) + std %f13,0x68(%r1) + std %f14,0x70(%r1) + std %f15,0x78(%r1) /* Floating point control register */ - stfpc __LC_FP_CREG_SAVE_AREA-SAVE_AREA_BASE(%r1) + lghi %r1,__LC_FP_CREG_SAVE_AREA + stfpc 0(%r1) /* CPU timer */ - stpt __LC_CPU_TIMER_SAVE_AREA-SAVE_AREA_BASE(%r1) + lghi %r1,__LC_CPU_TIMER_SAVE_AREA + stpt 0(%r1) /* Saved prefix register */ + lghi %r1,__LC_PREFIX_SAVE_AREA larl %r2,dump_prefix_page - mvc __LC_PREFIX_SAVE_AREA-SAVE_AREA_BASE(4,%r1),0(%r2) + mvc 0(4,%r1),0(%r2) /* Clock comparator - seven bytes */ + lghi %r1,__LC_CLOCK_COMP_SAVE_AREA larl %r2,.Lclkcmp stckc 0(%r2) - mvc __LC_CLOCK_COMP_SAVE_AREA-SAVE_AREA_BASE + 1(7,%r1),1(%r2) + mvc 1(7,%r1),1(%r2) /* Program status word */ + lghi %r1,__LC_PSW_SAVE_AREA epsw %r2,%r3 - st %r2,__LC_PSW_SAVE_AREA-SAVE_AREA_BASE + 0(%r1) - st %r3,__LC_PSW_SAVE_AREA-SAVE_AREA_BASE + 4(%r1) + st %r2,0(%r1) + st %r3,4(%r1) larl %r2,store_status - stg %r2,__LC_PSW_SAVE_AREA-SAVE_AREA_BASE + 8(%r1) + stg %r2,8(%r1) br %r14 .section .bss diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 5e04acdc6290..d49a8cb404c2 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -546,7 +546,7 @@ static void __init __smp_store_cpu_state(struct save_area_ext *sa_ext, if (is_boot_cpu) { /* Copy the registers of the boot CPU. */ - copy_oldmem_kernel(&sa_ext->sa, (void *) SAVE_AREA_BASE, + copy_oldmem_kernel(&sa_ext->sa, (void *) __LC_FPREGS_SAVE_AREA, sizeof(sa_ext->sa)); if (MACHINE_HAS_VX) save_vx_regs_safe(sa_ext->vx_regs); @@ -554,7 +554,7 @@ static void __init __smp_store_cpu_state(struct save_area_ext *sa_ext, } /* Get the registers of a non-boot cpu. */ __pcpu_sigp_relax(address, SIGP_STOP_AND_STORE_STATUS, 0, NULL); - memcpy_real(&sa_ext->sa, lc + SAVE_AREA_BASE, sizeof(sa_ext->sa)); + memcpy_real(&sa_ext->sa, lc + __LC_FPREGS_SAVE_AREA, sizeof(sa_ext->sa)); if (!MACHINE_HAS_VX) return; /* Get the VX registers */ diff --git a/drivers/s390/char/zcore.c b/drivers/s390/char/zcore.c index 7d94c696c38b..087da775c359 100644 --- a/drivers/s390/char/zcore.c +++ b/drivers/s390/char/zcore.c @@ -124,7 +124,7 @@ static int __init init_cpu_info(void) sa_ext = dump_save_areas.areas[0]; if (!sa_ext) return -ENOMEM; - if (memcpy_hsa_kernel(&sa_ext->sa, SAVE_AREA_BASE, + if (memcpy_hsa_kernel(&sa_ext->sa, __LC_FPREGS_SAVE_AREA, sizeof(struct save_area)) < 0) { TRACE("could not copy from HSA\n"); return -EIO;