diff options
| -rw-r--r-- | arch/s390/include/asm/lowcore.h | 26 | ||||
| -rw-r--r-- | arch/s390/include/asm/smp.h | 2 | ||||
| -rw-r--r-- | arch/s390/kernel/head64.S | 70 | ||||
| -rw-r--r-- | arch/s390/kernel/smp.c | 19 | ||||
| -rw-r--r-- | arch/s390/kvm/kvm-s390.c | 20 | ||||
| -rw-r--r-- | drivers/s390/char/zcore.c | 140 |
6 files changed, 72 insertions, 205 deletions
diff --git a/arch/s390/include/asm/lowcore.h b/arch/s390/include/asm/lowcore.h index c25dfac7dd76..8ed3c745cd07 100644 --- a/arch/s390/include/asm/lowcore.h +++ b/arch/s390/include/asm/lowcore.h | |||
| @@ -144,7 +144,9 @@ void pgm_check_handler(void); | |||
| 144 | void mcck_int_handler(void); | 144 | void mcck_int_handler(void); |
| 145 | void io_int_handler(void); | 145 | void io_int_handler(void); |
| 146 | 146 | ||
| 147 | struct save_area_s390 { | 147 | #ifdef CONFIG_32BIT |
| 148 | |||
| 149 | struct save_area { | ||
| 148 | u32 ext_save; | 150 | u32 ext_save; |
| 149 | u64 timer; | 151 | u64 timer; |
| 150 | u64 clk_cmp; | 152 | u64 clk_cmp; |
| @@ -158,7 +160,11 @@ struct save_area_s390 { | |||
| 158 | u32 ctrl_regs[16]; | 160 | u32 ctrl_regs[16]; |
| 159 | } __attribute__((packed)); | 161 | } __attribute__((packed)); |
| 160 | 162 | ||
| 161 | struct save_area_s390x { | 163 | #define SAVE_AREA_BASE offsetof(struct _lowcore, extended_save_area_addr) |
| 164 | |||
| 165 | #else /* CONFIG_32BIT */ | ||
| 166 | |||
| 167 | struct save_area { | ||
| 162 | u64 fp_regs[16]; | 168 | u64 fp_regs[16]; |
| 163 | u64 gp_regs[16]; | 169 | u64 gp_regs[16]; |
| 164 | u8 psw[16]; | 170 | u8 psw[16]; |
| @@ -174,21 +180,9 @@ struct save_area_s390x { | |||
| 174 | u64 ctrl_regs[16]; | 180 | u64 ctrl_regs[16]; |
| 175 | } __attribute__((packed)); | 181 | } __attribute__((packed)); |
| 176 | 182 | ||
| 177 | union save_area { | 183 | #define SAVE_AREA_BASE offsetof(struct _lowcore, floating_pt_save_area) |
| 178 | struct save_area_s390 s390; | ||
| 179 | struct save_area_s390x s390x; | ||
| 180 | }; | ||
| 181 | |||
| 182 | #define SAVE_AREA_BASE_S390 0xd4 | ||
| 183 | #define SAVE_AREA_BASE_S390X 0x1200 | ||
| 184 | 184 | ||
| 185 | #ifndef __s390x__ | 185 | #endif /* CONFIG_32BIT */ |
| 186 | #define SAVE_AREA_SIZE sizeof(struct save_area_s390) | ||
| 187 | #define SAVE_AREA_BASE SAVE_AREA_BASE_S390 | ||
| 188 | #else | ||
| 189 | #define SAVE_AREA_SIZE sizeof(struct save_area_s390x) | ||
| 190 | #define SAVE_AREA_BASE SAVE_AREA_BASE_S390X | ||
| 191 | #endif | ||
| 192 | 186 | ||
| 193 | #ifndef __s390x__ | 187 | #ifndef __s390x__ |
| 194 | #define LC_ORDER 0 | 188 | #define LC_ORDER 0 |
diff --git a/arch/s390/include/asm/smp.h b/arch/s390/include/asm/smp.h index 2ab1141eeb50..9d2acb0b4847 100644 --- a/arch/s390/include/asm/smp.h +++ b/arch/s390/include/asm/smp.h | |||
| @@ -29,7 +29,7 @@ extern int smp_cpu_polarization[]; | |||
| 29 | extern void arch_send_call_function_single_ipi(int cpu); | 29 | extern void arch_send_call_function_single_ipi(int cpu); |
| 30 | extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); | 30 | extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); |
| 31 | 31 | ||
| 32 | extern union save_area *zfcpdump_save_areas[NR_CPUS + 1]; | 32 | extern struct save_area *zfcpdump_save_areas[NR_CPUS + 1]; |
| 33 | 33 | ||
| 34 | #endif /* CONFIG_SMP */ | 34 | #endif /* CONFIG_SMP */ |
| 35 | 35 | ||
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S index d984a2a380c3..5419aabf8a66 100644 --- a/arch/s390/kernel/head64.S +++ b/arch/s390/kernel/head64.S | |||
| @@ -16,71 +16,9 @@ startup_continue: | |||
| 16 | basr %r13,0 # get base | 16 | basr %r13,0 # get base |
| 17 | .LPG1: sll %r13,1 # remove high order bit | 17 | .LPG1: sll %r13,1 # remove high order bit |
| 18 | srl %r13,1 | 18 | srl %r13,1 |
| 19 | |||
| 20 | #ifdef CONFIG_ZFCPDUMP | ||
| 21 | |||
| 22 | # check if we have been ipled using zfcp dump: | ||
| 23 | |||
| 24 | tm 0xb9,0x01 # test if subchannel is enabled | ||
| 25 | jno .nodump # subchannel disabled | ||
| 26 | l %r1,0xb8 | ||
| 27 | la %r5,.Lipl_schib-.LPG1(%r13) | ||
| 28 | stsch 0(%r5) # get schib of subchannel | ||
| 29 | jne .nodump # schib not available | ||
| 30 | tm 5(%r5),0x01 # devno valid? | ||
| 31 | jno .nodump | ||
| 32 | tm 4(%r5),0x80 # qdio capable device? | ||
| 33 | jno .nodump | ||
| 34 | l %r2,20(%r0) # address of ipl parameter block | ||
| 35 | lhi %r3,0 | ||
| 36 | ic %r3,0x148(%r2) # get opt field | ||
| 37 | chi %r3,0x20 # load with dump? | ||
| 38 | jne .nodump | ||
| 39 | |||
| 40 | # store all prefix registers in case of load with dump: | ||
| 41 | |||
| 42 | la %r7,0 # base register for 0 page | ||
| 43 | la %r8,0 # first cpu | ||
| 44 | l %r11,.Lpref_arr_ptr-.LPG1(%r13) # address of prefix array | ||
| 45 | ahi %r11,4 # skip boot cpu | ||
| 46 | lr %r12,%r11 | ||
| 47 | ahi %r12,(CONFIG_NR_CPUS*4) # end of prefix array | ||
| 48 | stap .Lcurrent_cpu+2-.LPG1(%r13) # store current cpu addr | ||
| 49 | 1: | ||
| 50 | cl %r8,.Lcurrent_cpu-.LPG1(%r13) # is ipl cpu ? | ||
| 51 | je 4f # if yes get next cpu | ||
| 52 | 2: | ||
| 53 | lr %r9,%r7 | ||
| 54 | sigp %r9,%r8,0x9 # stop & store status of cpu | ||
| 55 | brc 8,3f # accepted | ||
| 56 | brc 4,4f # status stored: next cpu | ||
| 57 | brc 2,2b # busy: try again | ||
| 58 | brc 1,4f # not op: next cpu | ||
| 59 | 3: | ||
| 60 | mvc 0(4,%r11),264(%r7) # copy prefix register to prefix array | ||
| 61 | ahi %r11,4 # next element in prefix array | ||
| 62 | clr %r11,%r12 | ||
| 63 | je 5f # no more space in prefix array | ||
| 64 | 4: | ||
| 65 | ahi %r8,1 # next cpu (r8 += 1) | ||
| 66 | chi %r8,MAX_CPU_ADDRESS # is last possible cpu ? | ||
| 67 | jle 1b # jump if not last cpu | ||
| 68 | 5: | ||
| 69 | lhi %r1,2 # mode 2 = esame (dump) | ||
| 70 | j 6f | ||
| 71 | .align 4 | ||
| 72 | .Lipl_schib: | ||
| 73 | .rept 13 | ||
| 74 | .long 0 | ||
| 75 | .endr | ||
| 76 | .nodump: | ||
| 77 | lhi %r1,1 # mode 1 = esame (normal ipl) | ||
| 78 | 6: | ||
| 79 | #else | ||
| 80 | lhi %r1,1 # mode 1 = esame (normal ipl) | ||
| 81 | #endif /* CONFIG_ZFCPDUMP */ | ||
| 82 | mvi __LC_AR_MODE_ID,1 # set esame flag | 19 | mvi __LC_AR_MODE_ID,1 # set esame flag |
| 83 | slr %r0,%r0 # set cpuid to zero | 20 | slr %r0,%r0 # set cpuid to zero |
| 21 | lhi %r1,2 # mode 2 = esame (dump) | ||
| 84 | sigp %r1,%r0,0x12 # switch to esame mode | 22 | sigp %r1,%r0,0x12 # switch to esame mode |
| 85 | sam64 # switch to 64 bit mode | 23 | sam64 # switch to 64 bit mode |
| 86 | llgfr %r13,%r13 # clear high-order half of base reg | 24 | llgfr %r13,%r13 # clear high-order half of base reg |
| @@ -130,12 +68,6 @@ startup_continue: | |||
| 130 | .Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8 | 68 | .Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8 |
| 131 | .Lnop: .long 0x07000700 | 69 | .Lnop: .long 0x07000700 |
| 132 | .Lzero64:.fill 16,4,0x0 | 70 | .Lzero64:.fill 16,4,0x0 |
| 133 | #ifdef CONFIG_ZFCPDUMP | ||
| 134 | .Lcurrent_cpu: | ||
| 135 | .long 0x0 | ||
| 136 | .Lpref_arr_ptr: | ||
| 137 | .long zfcpdump_prefix_array | ||
| 138 | #endif /* CONFIG_ZFCPDUMP */ | ||
| 139 | .Lparmaddr: | 71 | .Lparmaddr: |
| 140 | .quad PARMAREA | 72 | .quad PARMAREA |
| 141 | .align 64 | 73 | .align 64 |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 76a6fdd46c45..384a6846a65e 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
| @@ -248,15 +248,6 @@ EXPORT_SYMBOL(smp_ctl_clear_bit); | |||
| 248 | 248 | ||
| 249 | #ifdef CONFIG_ZFCPDUMP | 249 | #ifdef CONFIG_ZFCPDUMP |
| 250 | 250 | ||
| 251 | /* | ||
| 252 | * zfcpdump_prefix_array holds prefix registers for the following scenario: | ||
| 253 | * 64 bit zfcpdump kernel and 31 bit kernel which is to be dumped. We have to | ||
| 254 | * save its prefix registers, since they get lost, when switching from 31 bit | ||
| 255 | * to 64 bit. | ||
| 256 | */ | ||
| 257 | unsigned int zfcpdump_prefix_array[NR_CPUS + 1] \ | ||
| 258 | __attribute__((__section__(".data"))); | ||
| 259 | |||
| 260 | static void __init smp_get_save_area(unsigned int cpu, unsigned int phy_cpu) | 251 | static void __init smp_get_save_area(unsigned int cpu, unsigned int phy_cpu) |
| 261 | { | 252 | { |
| 262 | if (ipl_info.type != IPL_TYPE_FCP_DUMP) | 253 | if (ipl_info.type != IPL_TYPE_FCP_DUMP) |
| @@ -266,21 +257,17 @@ static void __init smp_get_save_area(unsigned int cpu, unsigned int phy_cpu) | |||
| 266 | "the dump\n", cpu, NR_CPUS - 1); | 257 | "the dump\n", cpu, NR_CPUS - 1); |
| 267 | return; | 258 | return; |
| 268 | } | 259 | } |
| 269 | zfcpdump_save_areas[cpu] = kmalloc(sizeof(union save_area), GFP_KERNEL); | 260 | zfcpdump_save_areas[cpu] = kmalloc(sizeof(struct save_area), GFP_KERNEL); |
| 270 | __cpu_logical_map[CPU_INIT_NO] = (__u16) phy_cpu; | 261 | __cpu_logical_map[CPU_INIT_NO] = (__u16) phy_cpu; |
| 271 | while (signal_processor(CPU_INIT_NO, sigp_stop_and_store_status) == | 262 | while (signal_processor(CPU_INIT_NO, sigp_stop_and_store_status) == |
| 272 | sigp_busy) | 263 | sigp_busy) |
| 273 | cpu_relax(); | 264 | cpu_relax(); |
| 274 | memcpy(zfcpdump_save_areas[cpu], | 265 | memcpy(zfcpdump_save_areas[cpu], |
| 275 | (void *)(unsigned long) store_prefix() + SAVE_AREA_BASE, | 266 | (void *)(unsigned long) store_prefix() + SAVE_AREA_BASE, |
| 276 | SAVE_AREA_SIZE); | 267 | sizeof(struct save_area)); |
| 277 | #ifdef CONFIG_64BIT | ||
| 278 | /* copy original prefix register */ | ||
| 279 | zfcpdump_save_areas[cpu]->s390x.pref_reg = zfcpdump_prefix_array[cpu]; | ||
| 280 | #endif | ||
| 281 | } | 268 | } |
| 282 | 269 | ||
| 283 | union save_area *zfcpdump_save_areas[NR_CPUS + 1]; | 270 | struct save_area *zfcpdump_save_areas[NR_CPUS + 1]; |
| 284 | EXPORT_SYMBOL_GPL(zfcpdump_save_areas); | 271 | EXPORT_SYMBOL_GPL(zfcpdump_save_areas); |
| 285 | 272 | ||
| 286 | #else | 273 | #else |
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index f8bcaefd7d34..70e799eefec9 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
| @@ -603,45 +603,45 @@ int __kvm_s390_vcpu_store_status(struct kvm_vcpu *vcpu, unsigned long addr) | |||
| 603 | } else | 603 | } else |
| 604 | prefix = 0; | 604 | prefix = 0; |
| 605 | 605 | ||
| 606 | if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, fp_regs), | 606 | if (__guestcopy(vcpu, addr + offsetof(struct save_area, fp_regs), |
| 607 | vcpu->arch.guest_fpregs.fprs, 128, prefix)) | 607 | vcpu->arch.guest_fpregs.fprs, 128, prefix)) |
| 608 | return -EFAULT; | 608 | return -EFAULT; |
| 609 | 609 | ||
| 610 | if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, gp_regs), | 610 | if (__guestcopy(vcpu, addr + offsetof(struct save_area, gp_regs), |
| 611 | vcpu->arch.guest_gprs, 128, prefix)) | 611 | vcpu->arch.guest_gprs, 128, prefix)) |
| 612 | return -EFAULT; | 612 | return -EFAULT; |
| 613 | 613 | ||
| 614 | if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, psw), | 614 | if (__guestcopy(vcpu, addr + offsetof(struct save_area, psw), |
| 615 | &vcpu->arch.sie_block->gpsw, 16, prefix)) | 615 | &vcpu->arch.sie_block->gpsw, 16, prefix)) |
| 616 | return -EFAULT; | 616 | return -EFAULT; |
| 617 | 617 | ||
| 618 | if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, pref_reg), | 618 | if (__guestcopy(vcpu, addr + offsetof(struct save_area, pref_reg), |
| 619 | &vcpu->arch.sie_block->prefix, 4, prefix)) | 619 | &vcpu->arch.sie_block->prefix, 4, prefix)) |
| 620 | return -EFAULT; | 620 | return -EFAULT; |
| 621 | 621 | ||
| 622 | if (__guestcopy(vcpu, | 622 | if (__guestcopy(vcpu, |
| 623 | addr + offsetof(struct save_area_s390x, fp_ctrl_reg), | 623 | addr + offsetof(struct save_area, fp_ctrl_reg), |
| 624 | &vcpu->arch.guest_fpregs.fpc, 4, prefix)) | 624 | &vcpu->arch.guest_fpregs.fpc, 4, prefix)) |
| 625 | return -EFAULT; | 625 | return -EFAULT; |
| 626 | 626 | ||
| 627 | if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, tod_reg), | 627 | if (__guestcopy(vcpu, addr + offsetof(struct save_area, tod_reg), |
| 628 | &vcpu->arch.sie_block->todpr, 4, prefix)) | 628 | &vcpu->arch.sie_block->todpr, 4, prefix)) |
| 629 | return -EFAULT; | 629 | return -EFAULT; |
| 630 | 630 | ||
| 631 | if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, timer), | 631 | if (__guestcopy(vcpu, addr + offsetof(struct save_area, timer), |
| 632 | &vcpu->arch.sie_block->cputm, 8, prefix)) | 632 | &vcpu->arch.sie_block->cputm, 8, prefix)) |
| 633 | return -EFAULT; | 633 | return -EFAULT; |
| 634 | 634 | ||
| 635 | if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, clk_cmp), | 635 | if (__guestcopy(vcpu, addr + offsetof(struct save_area, clk_cmp), |
| 636 | &vcpu->arch.sie_block->ckc, 8, prefix)) | 636 | &vcpu->arch.sie_block->ckc, 8, prefix)) |
| 637 | return -EFAULT; | 637 | return -EFAULT; |
| 638 | 638 | ||
| 639 | if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, acc_regs), | 639 | if (__guestcopy(vcpu, addr + offsetof(struct save_area, acc_regs), |
| 640 | &vcpu->arch.guest_acrs, 64, prefix)) | 640 | &vcpu->arch.guest_acrs, 64, prefix)) |
| 641 | return -EFAULT; | 641 | return -EFAULT; |
| 642 | 642 | ||
| 643 | if (__guestcopy(vcpu, | 643 | if (__guestcopy(vcpu, |
| 644 | addr + offsetof(struct save_area_s390x, ctrl_regs), | 644 | addr + offsetof(struct save_area, ctrl_regs), |
| 645 | &vcpu->arch.sie_block->gcr, 128, prefix)) | 645 | &vcpu->arch.sie_block->gcr, 128, prefix)) |
| 646 | return -EFAULT; | 646 | return -EFAULT; |
| 647 | return 0; | 647 | return 0; |
diff --git a/drivers/s390/char/zcore.c b/drivers/s390/char/zcore.c index 82daa3c1dc9c..1d935b2c9bf4 100644 --- a/drivers/s390/char/zcore.c +++ b/drivers/s390/char/zcore.c | |||
| @@ -40,12 +40,12 @@ enum arch_id { | |||
| 40 | /* dump system info */ | 40 | /* dump system info */ |
| 41 | 41 | ||
| 42 | struct sys_info { | 42 | struct sys_info { |
| 43 | enum arch_id arch; | 43 | enum arch_id arch; |
| 44 | unsigned long sa_base; | 44 | unsigned long sa_base; |
| 45 | u32 sa_size; | 45 | u32 sa_size; |
| 46 | int cpu_map[NR_CPUS]; | 46 | int cpu_map[NR_CPUS]; |
| 47 | unsigned long mem_size; | 47 | unsigned long mem_size; |
| 48 | union save_area lc_mask; | 48 | struct save_area lc_mask; |
| 49 | }; | 49 | }; |
| 50 | 50 | ||
| 51 | struct ipib_info { | 51 | struct ipib_info { |
| @@ -183,52 +183,9 @@ static int memcpy_real_user(void __user *dest, unsigned long src, size_t count) | |||
| 183 | return 0; | 183 | return 0; |
| 184 | } | 184 | } |
| 185 | 185 | ||
| 186 | #ifdef __s390x__ | ||
| 187 | /* | ||
| 188 | * Convert s390x (64 bit) cpu info to s390 (32 bit) cpu info | ||
| 189 | */ | ||
| 190 | static void __init s390x_to_s390_regs(union save_area *out, union save_area *in, | ||
| 191 | int cpu) | ||
| 192 | { | ||
| 193 | int i; | ||
| 194 | |||
| 195 | for (i = 0; i < 16; i++) { | ||
| 196 | out->s390.gp_regs[i] = in->s390x.gp_regs[i] & 0x00000000ffffffff; | ||
| 197 | out->s390.acc_regs[i] = in->s390x.acc_regs[i]; | ||
| 198 | out->s390.ctrl_regs[i] = | ||
| 199 | in->s390x.ctrl_regs[i] & 0x00000000ffffffff; | ||
| 200 | } | ||
| 201 | /* locore for 31 bit has only space for fpregs 0,2,4,6 */ | ||
| 202 | out->s390.fp_regs[0] = in->s390x.fp_regs[0]; | ||
| 203 | out->s390.fp_regs[1] = in->s390x.fp_regs[2]; | ||
| 204 | out->s390.fp_regs[2] = in->s390x.fp_regs[4]; | ||
| 205 | out->s390.fp_regs[3] = in->s390x.fp_regs[6]; | ||
| 206 | memcpy(&(out->s390.psw[0]), &(in->s390x.psw[0]), 4); | ||
| 207 | out->s390.psw[1] |= 0x8; /* set bit 12 */ | ||
| 208 | memcpy(&(out->s390.psw[4]),&(in->s390x.psw[12]), 4); | ||
| 209 | out->s390.psw[4] |= 0x80; /* set (31bit) addressing bit */ | ||
| 210 | out->s390.pref_reg = in->s390x.pref_reg; | ||
| 211 | out->s390.timer = in->s390x.timer; | ||
| 212 | out->s390.clk_cmp = in->s390x.clk_cmp; | ||
| 213 | } | ||
| 214 | |||
| 215 | static void __init s390x_to_s390_save_areas(void) | ||
| 216 | { | ||
| 217 | int i = 1; | ||
| 218 | static union save_area tmp; | ||
| 219 | |||
| 220 | while (zfcpdump_save_areas[i]) { | ||
| 221 | s390x_to_s390_regs(&tmp, zfcpdump_save_areas[i], i); | ||
| 222 | memcpy(zfcpdump_save_areas[i], &tmp, sizeof(tmp)); | ||
| 223 | i++; | ||
| 224 | } | ||
| 225 | } | ||
| 226 | |||
| 227 | #endif /* __s390x__ */ | ||
| 228 | |||
| 229 | static int __init init_cpu_info(enum arch_id arch) | 186 | static int __init init_cpu_info(enum arch_id arch) |
| 230 | { | 187 | { |
| 231 | union save_area *sa; | 188 | struct save_area *sa; |
| 232 | 189 | ||
| 233 | /* get info for boot cpu from lowcore, stored in the HSA */ | 190 | /* get info for boot cpu from lowcore, stored in the HSA */ |
| 234 | 191 | ||
| @@ -241,14 +198,6 @@ static int __init init_cpu_info(enum arch_id arch) | |||
| 241 | return -EIO; | 198 | return -EIO; |
| 242 | } | 199 | } |
| 243 | zfcpdump_save_areas[0] = sa; | 200 | zfcpdump_save_areas[0] = sa; |
| 244 | |||
| 245 | #ifdef __s390x__ | ||
| 246 | /* convert s390x regs to s390, if we are dumping an s390 Linux */ | ||
| 247 | |||
| 248 | if (arch == ARCH_S390) | ||
| 249 | s390x_to_s390_save_areas(); | ||
| 250 | #endif | ||
| 251 | |||
| 252 | return 0; | 201 | return 0; |
| 253 | } | 202 | } |
| 254 | 203 | ||
| @@ -289,7 +238,7 @@ static struct zcore_header zcore_header = { | |||
| 289 | .dump_level = 0, | 238 | .dump_level = 0, |
| 290 | .page_size = PAGE_SIZE, | 239 | .page_size = PAGE_SIZE, |
| 291 | .mem_start = 0, | 240 | .mem_start = 0, |
| 292 | #ifdef __s390x__ | 241 | #ifdef CONFIG_64BIT |
| 293 | .build_arch = DUMP_ARCH_S390X, | 242 | .build_arch = DUMP_ARCH_S390X, |
| 294 | #else | 243 | #else |
| 295 | .build_arch = DUMP_ARCH_S390, | 244 | .build_arch = DUMP_ARCH_S390, |
| @@ -340,11 +289,7 @@ static int zcore_add_lc(char __user *buf, unsigned long start, size_t count) | |||
| 340 | unsigned long prefix; | 289 | unsigned long prefix; |
| 341 | unsigned long sa_off, len, buf_off; | 290 | unsigned long sa_off, len, buf_off; |
| 342 | 291 | ||
| 343 | if (sys_info.arch == ARCH_S390) | 292 | prefix = zfcpdump_save_areas[i]->pref_reg; |
| 344 | prefix = zfcpdump_save_areas[i]->s390.pref_reg; | ||
| 345 | else | ||
| 346 | prefix = zfcpdump_save_areas[i]->s390x.pref_reg; | ||
| 347 | |||
| 348 | sa_start = prefix + sys_info.sa_base; | 293 | sa_start = prefix + sys_info.sa_base; |
| 349 | sa_end = prefix + sys_info.sa_base + sys_info.sa_size; | 294 | sa_end = prefix + sys_info.sa_base + sys_info.sa_size; |
| 350 | 295 | ||
| @@ -561,34 +506,39 @@ static const struct file_operations zcore_reipl_fops = { | |||
| 561 | .release = zcore_reipl_release, | 506 | .release = zcore_reipl_release, |
| 562 | }; | 507 | }; |
| 563 | 508 | ||
| 509 | #ifdef CONFIG_32BIT | ||
| 564 | 510 | ||
| 565 | static void __init set_s390_lc_mask(union save_area *map) | 511 | static void __init set_lc_mask(struct save_area *map) |
| 566 | { | 512 | { |
| 567 | memset(&map->s390.ext_save, 0xff, sizeof(map->s390.ext_save)); | 513 | memset(&map->ext_save, 0xff, sizeof(map->ext_save)); |
| 568 | memset(&map->s390.timer, 0xff, sizeof(map->s390.timer)); | 514 | memset(&map->timer, 0xff, sizeof(map->timer)); |
| 569 | memset(&map->s390.clk_cmp, 0xff, sizeof(map->s390.clk_cmp)); | 515 | memset(&map->clk_cmp, 0xff, sizeof(map->clk_cmp)); |
| 570 | memset(&map->s390.psw, 0xff, sizeof(map->s390.psw)); | 516 | memset(&map->psw, 0xff, sizeof(map->psw)); |
| 571 | memset(&map->s390.pref_reg, 0xff, sizeof(map->s390.pref_reg)); | 517 | memset(&map->pref_reg, 0xff, sizeof(map->pref_reg)); |
| 572 | memset(&map->s390.acc_regs, 0xff, sizeof(map->s390.acc_regs)); | 518 | memset(&map->acc_regs, 0xff, sizeof(map->acc_regs)); |
| 573 | memset(&map->s390.fp_regs, 0xff, sizeof(map->s390.fp_regs)); | 519 | memset(&map->fp_regs, 0xff, sizeof(map->fp_regs)); |
| 574 | memset(&map->s390.gp_regs, 0xff, sizeof(map->s390.gp_regs)); | 520 | memset(&map->gp_regs, 0xff, sizeof(map->gp_regs)); |
| 575 | memset(&map->s390.ctrl_regs, 0xff, sizeof(map->s390.ctrl_regs)); | 521 | memset(&map->ctrl_regs, 0xff, sizeof(map->ctrl_regs)); |
| 576 | } | 522 | } |
| 577 | 523 | ||
| 578 | static void __init set_s390x_lc_mask(union save_area *map) | 524 | #else /* CONFIG_32BIT */ |
| 525 | |||
| 526 | static void __init set_lc_mask(struct save_area *map) | ||
| 579 | { | 527 | { |
| 580 | memset(&map->s390x.fp_regs, 0xff, sizeof(map->s390x.fp_regs)); | 528 | memset(&map->fp_regs, 0xff, sizeof(map->fp_regs)); |
| 581 | memset(&map->s390x.gp_regs, 0xff, sizeof(map->s390x.gp_regs)); | 529 | memset(&map->gp_regs, 0xff, sizeof(map->gp_regs)); |
| 582 | memset(&map->s390x.psw, 0xff, sizeof(map->s390x.psw)); | 530 | memset(&map->psw, 0xff, sizeof(map->psw)); |
| 583 | memset(&map->s390x.pref_reg, 0xff, sizeof(map->s390x.pref_reg)); | 531 | memset(&map->pref_reg, 0xff, sizeof(map->pref_reg)); |
| 584 | memset(&map->s390x.fp_ctrl_reg, 0xff, sizeof(map->s390x.fp_ctrl_reg)); | 532 | memset(&map->fp_ctrl_reg, 0xff, sizeof(map->fp_ctrl_reg)); |
| 585 | memset(&map->s390x.tod_reg, 0xff, sizeof(map->s390x.tod_reg)); | 533 | memset(&map->tod_reg, 0xff, sizeof(map->tod_reg)); |
| 586 | memset(&map->s390x.timer, 0xff, sizeof(map->s390x.timer)); | 534 | memset(&map->timer, 0xff, sizeof(map->timer)); |
| 587 | memset(&map->s390x.clk_cmp, 0xff, sizeof(map->s390x.clk_cmp)); | 535 | memset(&map->clk_cmp, 0xff, sizeof(map->clk_cmp)); |
| 588 | memset(&map->s390x.acc_regs, 0xff, sizeof(map->s390x.acc_regs)); | 536 | memset(&map->acc_regs, 0xff, sizeof(map->acc_regs)); |
| 589 | memset(&map->s390x.ctrl_regs, 0xff, sizeof(map->s390x.ctrl_regs)); | 537 | memset(&map->ctrl_regs, 0xff, sizeof(map->ctrl_regs)); |
| 590 | } | 538 | } |
| 591 | 539 | ||
| 540 | #endif /* CONFIG_32BIT */ | ||
| 541 | |||
| 592 | /* | 542 | /* |
| 593 | * Initialize dump globals for a given architecture | 543 | * Initialize dump globals for a given architecture |
| 594 | */ | 544 | */ |
| @@ -599,21 +549,18 @@ static int __init sys_info_init(enum arch_id arch) | |||
| 599 | switch (arch) { | 549 | switch (arch) { |
| 600 | case ARCH_S390X: | 550 | case ARCH_S390X: |
| 601 | pr_alert("DETECTED 'S390X (64 bit) OS'\n"); | 551 | pr_alert("DETECTED 'S390X (64 bit) OS'\n"); |
| 602 | sys_info.sa_base = SAVE_AREA_BASE_S390X; | ||
| 603 | sys_info.sa_size = sizeof(struct save_area_s390x); | ||
| 604 | set_s390x_lc_mask(&sys_info.lc_mask); | ||
| 605 | break; | 552 | break; |
| 606 | case ARCH_S390: | 553 | case ARCH_S390: |
| 607 | pr_alert("DETECTED 'S390 (32 bit) OS'\n"); | 554 | pr_alert("DETECTED 'S390 (32 bit) OS'\n"); |
| 608 | sys_info.sa_base = SAVE_AREA_BASE_S390; | ||
| 609 | sys_info.sa_size = sizeof(struct save_area_s390); | ||
| 610 | set_s390_lc_mask(&sys_info.lc_mask); | ||
| 611 | break; | 555 | break; |
| 612 | default: | 556 | default: |
| 613 | pr_alert("0x%x is an unknown architecture.\n",arch); | 557 | pr_alert("0x%x is an unknown architecture.\n",arch); |
| 614 | return -EINVAL; | 558 | return -EINVAL; |
| 615 | } | 559 | } |
| 560 | sys_info.sa_base = SAVE_AREA_BASE; | ||
| 561 | sys_info.sa_size = sizeof(struct save_area); | ||
| 616 | sys_info.arch = arch; | 562 | sys_info.arch = arch; |
| 563 | set_lc_mask(&sys_info.lc_mask); | ||
| 617 | rc = init_cpu_info(arch); | 564 | rc = init_cpu_info(arch); |
| 618 | if (rc) | 565 | if (rc) |
| 619 | return rc; | 566 | return rc; |
| @@ -741,14 +688,21 @@ static int __init zcore_init(void) | |||
| 741 | if (rc) | 688 | if (rc) |
| 742 | goto fail; | 689 | goto fail; |
| 743 | 690 | ||
| 744 | #ifndef __s390x__ | 691 | #ifdef CONFIG_64BIT |
| 692 | if (arch == ARCH_S390) { | ||
| 693 | pr_alert("The 64-bit dump tool cannot be used for a " | ||
| 694 | "32-bit system\n"); | ||
| 695 | rc = -EINVAL; | ||
| 696 | goto fail; | ||
| 697 | } | ||
| 698 | #else /* CONFIG_64BIT */ | ||
| 745 | if (arch == ARCH_S390X) { | 699 | if (arch == ARCH_S390X) { |
| 746 | pr_alert("The 32-bit dump tool cannot be used for a " | 700 | pr_alert("The 32-bit dump tool cannot be used for a " |
| 747 | "64-bit system\n"); | 701 | "64-bit system\n"); |
| 748 | rc = -EINVAL; | 702 | rc = -EINVAL; |
| 749 | goto fail; | 703 | goto fail; |
| 750 | } | 704 | } |
| 751 | #endif | 705 | #endif /* CONFIG_64BIT */ |
| 752 | 706 | ||
| 753 | rc = sys_info_init(arch); | 707 | rc = sys_info_init(arch); |
| 754 | if (rc) | 708 | if (rc) |
