aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2010-02-26 16:37:32 -0500
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2010-02-26 16:37:30 -0500
commitf64ca21714f114a78b6c19ceabc7745b29913efc (patch)
treeef01f90c3c0547c37f6259de2fe274a3a47e082a /arch
parent987bcdacb18a3adc2a48d85c9b005069c2f4dd7b (diff)
[S390] zfcpdump: remove cross arch dump support
Remove support to be able to dump 31 bit systems with a 64 bit dumper. This is mostly useless since no distro ships 31 bit kernels together with a 64 bit dumper. We also get rid of a bit of hacky code. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/include/asm/lowcore.h26
-rw-r--r--arch/s390/include/asm/smp.h2
-rw-r--r--arch/s390/kernel/head64.S70
-rw-r--r--arch/s390/kernel/smp.c19
-rw-r--r--arch/s390/kvm/kvm-s390.c20
5 files changed, 25 insertions, 112 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);
144void mcck_int_handler(void); 144void mcck_int_handler(void);
145void io_int_handler(void); 145void io_int_handler(void);
146 146
147struct save_area_s390 { 147#ifdef CONFIG_32BIT
148
149struct 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
161struct save_area_s390x { 163#define SAVE_AREA_BASE offsetof(struct _lowcore, extended_save_area_addr)
164
165#else /* CONFIG_32BIT */
166
167struct 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
177union 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[];
29extern void arch_send_call_function_single_ipi(int cpu); 29extern void arch_send_call_function_single_ipi(int cpu);
30extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); 30extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
31 31
32extern union save_area *zfcpdump_save_areas[NR_CPUS + 1]; 32extern 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
491:
50 cl %r8,.Lcurrent_cpu-.LPG1(%r13) # is ipl cpu ?
51 je 4f # if yes get next cpu
522:
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
593:
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
644:
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
685:
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)
786:
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 */
257unsigned int zfcpdump_prefix_array[NR_CPUS + 1] \
258 __attribute__((__section__(".data")));
259
260static void __init smp_get_save_area(unsigned int cpu, unsigned int phy_cpu) 251static 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
283union save_area *zfcpdump_save_areas[NR_CPUS + 1]; 270struct save_area *zfcpdump_save_areas[NR_CPUS + 1];
284EXPORT_SYMBOL_GPL(zfcpdump_save_areas); 271EXPORT_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;