Skip to content

Commit f64ca21

Browse files
heicarstMartin Schwidefsky
authored andcommitted
[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>
1 parent 987bcda commit f64ca21

6 files changed

Lines changed: 72 additions & 205 deletions

File tree

‎arch/s390/include/asm/lowcore.h‎

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ void pgm_check_handler(void);
144144
void mcck_int_handler(void);
145145
void io_int_handler(void);
146146

147-
struct save_area_s390 {
147+
#ifdef CONFIG_32BIT
148+
149+
struct save_area {
148150
u32 ext_save;
149151
u64 timer;
150152
u64 clk_cmp;
@@ -158,7 +160,11 @@ struct save_area_s390 {
158160
u32 ctrl_regs[16];
159161
} __attribute__((packed));
160162

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 {
162168
u64 fp_regs[16];
163169
u64 gp_regs[16];
164170
u8 psw[16];
@@ -174,21 +180,9 @@ struct save_area_s390x {
174180
u64 ctrl_regs[16];
175181
} __attribute__((packed));
176182

177-
union 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
183+
#define SAVE_AREA_BASE offsetof(struct _lowcore, floating_pt_save_area)
184184

185-
#ifndef __s390x__
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
185+
#endif /* CONFIG_32BIT */
192186

193187
#ifndef __s390x__
194188
#define LC_ORDER 0

‎arch/s390/include/asm/smp.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ extern int smp_cpu_polarization[];
2929
extern void arch_send_call_function_single_ipi(int cpu);
3030
extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
3131

32-
extern union save_area *zfcpdump_save_areas[NR_CPUS + 1];
32+
extern struct save_area *zfcpdump_save_areas[NR_CPUS + 1];
3333

3434
#endif /* CONFIG_SMP */
3535

‎arch/s390/kernel/head64.S‎

Lines changed: 1 addition & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -16,71 +16,9 @@ startup_continue:
1616
basr %r13,0 # get base
1717
.LPG1: sll %r13,1 # remove high order bit
1818
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 */
8219
mvi __LC_AR_MODE_ID,1 # set esame flag
8320
slr %r0,%r0 # set cpuid to zero
21+
lhi %r1,2 # mode 2 = esame (dump)
8422
sigp %r1,%r0,0x12 # switch to esame mode
8523
sam64 # switch to 64 bit mode
8624
llgfr %r13,%r13 # clear high-order half of base reg
@@ -130,12 +68,6 @@ startup_continue:
13068
.Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8
13169
.Lnop: .long 0x07000700
13270
.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 */
13971
.Lparmaddr:
14072
.quad PARMAREA
14173
.align 64

‎arch/s390/kernel/smp.c‎

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,6 @@ EXPORT_SYMBOL(smp_ctl_clear_bit);
248248

249249
#ifdef CONFIG_ZFCPDUMP
250250

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-
260251
static void __init smp_get_save_area(unsigned int cpu, unsigned int phy_cpu)
261252
{
262253
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)
266257
"the dump\n", cpu, NR_CPUS - 1);
267258
return;
268259
}
269-
zfcpdump_save_areas[cpu] = kmalloc(sizeof(union save_area), GFP_KERNEL);
260+
zfcpdump_save_areas[cpu] = kmalloc(sizeof(struct save_area), GFP_KERNEL);
270261
__cpu_logical_map[CPU_INIT_NO] = (__u16) phy_cpu;
271262
while (signal_processor(CPU_INIT_NO, sigp_stop_and_store_status) ==
272263
sigp_busy)
273264
cpu_relax();
274265
memcpy(zfcpdump_save_areas[cpu],
275266
(void *)(unsigned long) store_prefix() + SAVE_AREA_BASE,
276-
SAVE_AREA_SIZE);
277-
#ifdef CONFIG_64BIT
278-
/* copy original prefix register */
279-
zfcpdump_save_areas[cpu]->s390x.pref_reg = zfcpdump_prefix_array[cpu];
280-
#endif
267+
sizeof(struct save_area));
281268
}
282269

283-
union save_area *zfcpdump_save_areas[NR_CPUS + 1];
270+
struct save_area *zfcpdump_save_areas[NR_CPUS + 1];
284271
EXPORT_SYMBOL_GPL(zfcpdump_save_areas);
285272

286273
#else

‎arch/s390/kvm/kvm-s390.c‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -603,45 +603,45 @@ int __kvm_s390_vcpu_store_status(struct kvm_vcpu *vcpu, unsigned long addr)
603603
} else
604604
prefix = 0;
605605

606-
if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, fp_regs),
606+
if (__guestcopy(vcpu, addr + offsetof(struct save_area, fp_regs),
607607
vcpu->arch.guest_fpregs.fprs, 128, prefix))
608608
return -EFAULT;
609609

610-
if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, gp_regs),
610+
if (__guestcopy(vcpu, addr + offsetof(struct save_area, gp_regs),
611611
vcpu->arch.guest_gprs, 128, prefix))
612612
return -EFAULT;
613613

614-
if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, psw),
614+
if (__guestcopy(vcpu, addr + offsetof(struct save_area, psw),
615615
&vcpu->arch.sie_block->gpsw, 16, prefix))
616616
return -EFAULT;
617617

618-
if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, pref_reg),
618+
if (__guestcopy(vcpu, addr + offsetof(struct save_area, pref_reg),
619619
&vcpu->arch.sie_block->prefix, 4, prefix))
620620
return -EFAULT;
621621

622622
if (__guestcopy(vcpu,
623-
addr + offsetof(struct save_area_s390x, fp_ctrl_reg),
623+
addr + offsetof(struct save_area, fp_ctrl_reg),
624624
&vcpu->arch.guest_fpregs.fpc, 4, prefix))
625625
return -EFAULT;
626626

627-
if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, tod_reg),
627+
if (__guestcopy(vcpu, addr + offsetof(struct save_area, tod_reg),
628628
&vcpu->arch.sie_block->todpr, 4, prefix))
629629
return -EFAULT;
630630

631-
if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, timer),
631+
if (__guestcopy(vcpu, addr + offsetof(struct save_area, timer),
632632
&vcpu->arch.sie_block->cputm, 8, prefix))
633633
return -EFAULT;
634634

635-
if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, clk_cmp),
635+
if (__guestcopy(vcpu, addr + offsetof(struct save_area, clk_cmp),
636636
&vcpu->arch.sie_block->ckc, 8, prefix))
637637
return -EFAULT;
638638

639-
if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, acc_regs),
639+
if (__guestcopy(vcpu, addr + offsetof(struct save_area, acc_regs),
640640
&vcpu->arch.guest_acrs, 64, prefix))
641641
return -EFAULT;
642642

643643
if (__guestcopy(vcpu,
644-
addr + offsetof(struct save_area_s390x, ctrl_regs),
644+
addr + offsetof(struct save_area, ctrl_regs),
645645
&vcpu->arch.sie_block->gcr, 128, prefix))
646646
return -EFAULT;
647647
return 0;

0 commit comments

Comments
 (0)