diff options
Diffstat (limited to 'arch/s390/kvm')
-rw-r--r-- | arch/s390/kvm/diag.c | 4 | ||||
-rw-r--r-- | arch/s390/kvm/gaccess.h | 4 | ||||
-rw-r--r-- | arch/s390/kvm/intercept.c | 4 | ||||
-rw-r--r-- | arch/s390/kvm/interrupt.c | 2 | ||||
-rw-r--r-- | arch/s390/kvm/kvm-s390.c | 5 | ||||
-rw-r--r-- | arch/s390/kvm/kvm-s390.h | 4 | ||||
-rw-r--r-- | arch/s390/kvm/priv.c | 2 | ||||
-rw-r--r-- | arch/s390/kvm/sigp.c | 121 |
8 files changed, 63 insertions, 83 deletions
diff --git a/arch/s390/kvm/diag.c b/arch/s390/kvm/diag.c index b23d9ac77dfc..c88bb7793390 100644 --- a/arch/s390/kvm/diag.c +++ b/arch/s390/kvm/diag.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * diag.c - handling diagnose instructions | 2 | * handling diagnose instructions |
3 | * | 3 | * |
4 | * Copyright IBM Corp. 2008,2011 | 4 | * Copyright IBM Corp. 2008, 2011 |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License (version 2 only) | 7 | * it under the terms of the GNU General Public License (version 2 only) |
diff --git a/arch/s390/kvm/gaccess.h b/arch/s390/kvm/gaccess.h index c86f6ae43f76..4703f129e95e 100644 --- a/arch/s390/kvm/gaccess.h +++ b/arch/s390/kvm/gaccess.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * access.h - access guest memory | 2 | * access guest memory |
3 | * | 3 | * |
4 | * Copyright IBM Corp. 2008,2009 | 4 | * Copyright IBM Corp. 2008, 2009 |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License (version 2 only) | 7 | * it under the terms of the GNU General Public License (version 2 only) |
diff --git a/arch/s390/kvm/intercept.c b/arch/s390/kvm/intercept.c index 979cbe55bf5e..adae539f12e2 100644 --- a/arch/s390/kvm/intercept.c +++ b/arch/s390/kvm/intercept.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * intercept.c - in-kernel handling for sie intercepts | 2 | * in-kernel handling for sie intercepts |
3 | * | 3 | * |
4 | * Copyright IBM Corp. 2008,2009 | 4 | * Copyright IBM Corp. 2008, 2009 |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License (version 2 only) | 7 | * it under the terms of the GNU General Public License (version 2 only) |
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c index 2d9f9a72bb81..b7bc1aac8ed2 100644 --- a/arch/s390/kvm/interrupt.c +++ b/arch/s390/kvm/interrupt.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * interrupt.c - handling kvm guest interrupts | 2 | * handling kvm guest interrupts |
3 | * | 3 | * |
4 | * Copyright IBM Corp. 2008 | 4 | * Copyright IBM Corp. 2008 |
5 | * | 5 | * |
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 664766d0c83c..d470ccbfabae 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * s390host.c -- hosting zSeries kernel virtual machines | 2 | * hosting zSeries kernel virtual machines |
3 | * | 3 | * |
4 | * Copyright IBM Corp. 2008,2009 | 4 | * Copyright IBM Corp. 2008, 2009 |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License (version 2 only) | 7 | * it under the terms of the GNU General Public License (version 2 only) |
@@ -347,6 +347,7 @@ static void kvm_s390_vcpu_initial_reset(struct kvm_vcpu *vcpu) | |||
347 | vcpu->arch.guest_fpregs.fpc = 0; | 347 | vcpu->arch.guest_fpregs.fpc = 0; |
348 | asm volatile("lfpc %0" : : "Q" (vcpu->arch.guest_fpregs.fpc)); | 348 | asm volatile("lfpc %0" : : "Q" (vcpu->arch.guest_fpregs.fpc)); |
349 | vcpu->arch.sie_block->gbea = 1; | 349 | vcpu->arch.sie_block->gbea = 1; |
350 | atomic_set_mask(CPUSTAT_STOPPED, &vcpu->arch.sie_block->cpuflags); | ||
350 | } | 351 | } |
351 | 352 | ||
352 | int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu) | 353 | int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu) |
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h index 2294377975e8..d75bc5e92c5b 100644 --- a/arch/s390/kvm/kvm-s390.h +++ b/arch/s390/kvm/kvm-s390.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * kvm_s390.h - definition for kvm on s390 | 2 | * definition for kvm on s390 |
3 | * | 3 | * |
4 | * Copyright IBM Corp. 2008,2009 | 4 | * Copyright IBM Corp. 2008, 2009 |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License (version 2 only) | 7 | * it under the terms of the GNU General Public License (version 2 only) |
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c index 68a6b2ed16bf..60da903d6f3e 100644 --- a/arch/s390/kvm/priv.c +++ b/arch/s390/kvm/priv.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * priv.c - handling privileged instructions | 2 | * handling privileged instructions |
3 | * | 3 | * |
4 | * Copyright IBM Corp. 2008 | 4 | * Copyright IBM Corp. 2008 |
5 | * | 5 | * |
diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c index 0ad4cf238391..56f80e1f98f7 100644 --- a/arch/s390/kvm/sigp.c +++ b/arch/s390/kvm/sigp.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * sigp.c - handlinge interprocessor communication | 2 | * handling interprocessor communication |
3 | * | 3 | * |
4 | * Copyright IBM Corp. 2008,2009 | 4 | * Copyright IBM Corp. 2008, 2009 |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License (version 2 only) | 7 | * it under the terms of the GNU General Public License (version 2 only) |
@@ -15,38 +15,10 @@ | |||
15 | #include <linux/kvm.h> | 15 | #include <linux/kvm.h> |
16 | #include <linux/kvm_host.h> | 16 | #include <linux/kvm_host.h> |
17 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
18 | #include <asm/sigp.h> | ||
18 | #include "gaccess.h" | 19 | #include "gaccess.h" |
19 | #include "kvm-s390.h" | 20 | #include "kvm-s390.h" |
20 | 21 | ||
21 | /* sigp order codes */ | ||
22 | #define SIGP_SENSE 0x01 | ||
23 | #define SIGP_EXTERNAL_CALL 0x02 | ||
24 | #define SIGP_EMERGENCY 0x03 | ||
25 | #define SIGP_START 0x04 | ||
26 | #define SIGP_STOP 0x05 | ||
27 | #define SIGP_RESTART 0x06 | ||
28 | #define SIGP_STOP_STORE_STATUS 0x09 | ||
29 | #define SIGP_INITIAL_CPU_RESET 0x0b | ||
30 | #define SIGP_CPU_RESET 0x0c | ||
31 | #define SIGP_SET_PREFIX 0x0d | ||
32 | #define SIGP_STORE_STATUS_ADDR 0x0e | ||
33 | #define SIGP_SET_ARCH 0x12 | ||
34 | #define SIGP_SENSE_RUNNING 0x15 | ||
35 | |||
36 | /* cpu status bits */ | ||
37 | #define SIGP_STAT_EQUIPMENT_CHECK 0x80000000UL | ||
38 | #define SIGP_STAT_NOT_RUNNING 0x00000400UL | ||
39 | #define SIGP_STAT_INCORRECT_STATE 0x00000200UL | ||
40 | #define SIGP_STAT_INVALID_PARAMETER 0x00000100UL | ||
41 | #define SIGP_STAT_EXT_CALL_PENDING 0x00000080UL | ||
42 | #define SIGP_STAT_STOPPED 0x00000040UL | ||
43 | #define SIGP_STAT_OPERATOR_INTERV 0x00000020UL | ||
44 | #define SIGP_STAT_CHECK_STOP 0x00000010UL | ||
45 | #define SIGP_STAT_INOPERATIVE 0x00000004UL | ||
46 | #define SIGP_STAT_INVALID_ORDER 0x00000002UL | ||
47 | #define SIGP_STAT_RECEIVER_CHECK 0x00000001UL | ||
48 | |||
49 | |||
50 | static int __sigp_sense(struct kvm_vcpu *vcpu, u16 cpu_addr, | 22 | static int __sigp_sense(struct kvm_vcpu *vcpu, u16 cpu_addr, |
51 | u64 *reg) | 23 | u64 *reg) |
52 | { | 24 | { |
@@ -54,19 +26,23 @@ static int __sigp_sense(struct kvm_vcpu *vcpu, u16 cpu_addr, | |||
54 | int rc; | 26 | int rc; |
55 | 27 | ||
56 | if (cpu_addr >= KVM_MAX_VCPUS) | 28 | if (cpu_addr >= KVM_MAX_VCPUS) |
57 | return 3; /* not operational */ | 29 | return SIGP_CC_NOT_OPERATIONAL; |
58 | 30 | ||
59 | spin_lock(&fi->lock); | 31 | spin_lock(&fi->lock); |
60 | if (fi->local_int[cpu_addr] == NULL) | 32 | if (fi->local_int[cpu_addr] == NULL) |
61 | rc = 3; /* not operational */ | 33 | rc = SIGP_CC_NOT_OPERATIONAL; |
62 | else if (!(atomic_read(fi->local_int[cpu_addr]->cpuflags) | 34 | else if (!(atomic_read(fi->local_int[cpu_addr]->cpuflags) |
63 | & CPUSTAT_STOPPED)) { | 35 | & (CPUSTAT_ECALL_PEND | CPUSTAT_STOPPED))) |
64 | *reg &= 0xffffffff00000000UL; | 36 | rc = SIGP_CC_ORDER_CODE_ACCEPTED; |
65 | rc = 1; /* status stored */ | 37 | else { |
66 | } else { | ||
67 | *reg &= 0xffffffff00000000UL; | 38 | *reg &= 0xffffffff00000000UL; |
68 | *reg |= SIGP_STAT_STOPPED; | 39 | if (atomic_read(fi->local_int[cpu_addr]->cpuflags) |
69 | rc = 1; /* status stored */ | 40 | & CPUSTAT_ECALL_PEND) |
41 | *reg |= SIGP_STATUS_EXT_CALL_PENDING; | ||
42 | if (atomic_read(fi->local_int[cpu_addr]->cpuflags) | ||
43 | & CPUSTAT_STOPPED) | ||
44 | *reg |= SIGP_STATUS_STOPPED; | ||
45 | rc = SIGP_CC_STATUS_STORED; | ||
70 | } | 46 | } |
71 | spin_unlock(&fi->lock); | 47 | spin_unlock(&fi->lock); |
72 | 48 | ||
@@ -82,7 +58,7 @@ static int __sigp_emergency(struct kvm_vcpu *vcpu, u16 cpu_addr) | |||
82 | int rc; | 58 | int rc; |
83 | 59 | ||
84 | if (cpu_addr >= KVM_MAX_VCPUS) | 60 | if (cpu_addr >= KVM_MAX_VCPUS) |
85 | return 3; /* not operational */ | 61 | return SIGP_CC_NOT_OPERATIONAL; |
86 | 62 | ||
87 | inti = kzalloc(sizeof(*inti), GFP_KERNEL); | 63 | inti = kzalloc(sizeof(*inti), GFP_KERNEL); |
88 | if (!inti) | 64 | if (!inti) |
@@ -94,7 +70,7 @@ static int __sigp_emergency(struct kvm_vcpu *vcpu, u16 cpu_addr) | |||
94 | spin_lock(&fi->lock); | 70 | spin_lock(&fi->lock); |
95 | li = fi->local_int[cpu_addr]; | 71 | li = fi->local_int[cpu_addr]; |
96 | if (li == NULL) { | 72 | if (li == NULL) { |
97 | rc = 3; /* not operational */ | 73 | rc = SIGP_CC_NOT_OPERATIONAL; |
98 | kfree(inti); | 74 | kfree(inti); |
99 | goto unlock; | 75 | goto unlock; |
100 | } | 76 | } |
@@ -105,7 +81,7 @@ static int __sigp_emergency(struct kvm_vcpu *vcpu, u16 cpu_addr) | |||
105 | if (waitqueue_active(&li->wq)) | 81 | if (waitqueue_active(&li->wq)) |
106 | wake_up_interruptible(&li->wq); | 82 | wake_up_interruptible(&li->wq); |
107 | spin_unlock_bh(&li->lock); | 83 | spin_unlock_bh(&li->lock); |
108 | rc = 0; /* order accepted */ | 84 | rc = SIGP_CC_ORDER_CODE_ACCEPTED; |
109 | VCPU_EVENT(vcpu, 4, "sent sigp emerg to cpu %x", cpu_addr); | 85 | VCPU_EVENT(vcpu, 4, "sent sigp emerg to cpu %x", cpu_addr); |
110 | unlock: | 86 | unlock: |
111 | spin_unlock(&fi->lock); | 87 | spin_unlock(&fi->lock); |
@@ -120,7 +96,7 @@ static int __sigp_external_call(struct kvm_vcpu *vcpu, u16 cpu_addr) | |||
120 | int rc; | 96 | int rc; |
121 | 97 | ||
122 | if (cpu_addr >= KVM_MAX_VCPUS) | 98 | if (cpu_addr >= KVM_MAX_VCPUS) |
123 | return 3; /* not operational */ | 99 | return SIGP_CC_NOT_OPERATIONAL; |
124 | 100 | ||
125 | inti = kzalloc(sizeof(*inti), GFP_KERNEL); | 101 | inti = kzalloc(sizeof(*inti), GFP_KERNEL); |
126 | if (!inti) | 102 | if (!inti) |
@@ -132,7 +108,7 @@ static int __sigp_external_call(struct kvm_vcpu *vcpu, u16 cpu_addr) | |||
132 | spin_lock(&fi->lock); | 108 | spin_lock(&fi->lock); |
133 | li = fi->local_int[cpu_addr]; | 109 | li = fi->local_int[cpu_addr]; |
134 | if (li == NULL) { | 110 | if (li == NULL) { |
135 | rc = 3; /* not operational */ | 111 | rc = SIGP_CC_NOT_OPERATIONAL; |
136 | kfree(inti); | 112 | kfree(inti); |
137 | goto unlock; | 113 | goto unlock; |
138 | } | 114 | } |
@@ -143,7 +119,7 @@ static int __sigp_external_call(struct kvm_vcpu *vcpu, u16 cpu_addr) | |||
143 | if (waitqueue_active(&li->wq)) | 119 | if (waitqueue_active(&li->wq)) |
144 | wake_up_interruptible(&li->wq); | 120 | wake_up_interruptible(&li->wq); |
145 | spin_unlock_bh(&li->lock); | 121 | spin_unlock_bh(&li->lock); |
146 | rc = 0; /* order accepted */ | 122 | rc = SIGP_CC_ORDER_CODE_ACCEPTED; |
147 | VCPU_EVENT(vcpu, 4, "sent sigp ext call to cpu %x", cpu_addr); | 123 | VCPU_EVENT(vcpu, 4, "sent sigp ext call to cpu %x", cpu_addr); |
148 | unlock: | 124 | unlock: |
149 | spin_unlock(&fi->lock); | 125 | spin_unlock(&fi->lock); |
@@ -171,7 +147,7 @@ static int __inject_sigp_stop(struct kvm_s390_local_interrupt *li, int action) | |||
171 | out: | 147 | out: |
172 | spin_unlock_bh(&li->lock); | 148 | spin_unlock_bh(&li->lock); |
173 | 149 | ||
174 | return 0; /* order accepted */ | 150 | return SIGP_CC_ORDER_CODE_ACCEPTED; |
175 | } | 151 | } |
176 | 152 | ||
177 | static int __sigp_stop(struct kvm_vcpu *vcpu, u16 cpu_addr, int action) | 153 | static int __sigp_stop(struct kvm_vcpu *vcpu, u16 cpu_addr, int action) |
@@ -181,12 +157,12 @@ static int __sigp_stop(struct kvm_vcpu *vcpu, u16 cpu_addr, int action) | |||
181 | int rc; | 157 | int rc; |
182 | 158 | ||
183 | if (cpu_addr >= KVM_MAX_VCPUS) | 159 | if (cpu_addr >= KVM_MAX_VCPUS) |
184 | return 3; /* not operational */ | 160 | return SIGP_CC_NOT_OPERATIONAL; |
185 | 161 | ||
186 | spin_lock(&fi->lock); | 162 | spin_lock(&fi->lock); |
187 | li = fi->local_int[cpu_addr]; | 163 | li = fi->local_int[cpu_addr]; |
188 | if (li == NULL) { | 164 | if (li == NULL) { |
189 | rc = 3; /* not operational */ | 165 | rc = SIGP_CC_NOT_OPERATIONAL; |
190 | goto unlock; | 166 | goto unlock; |
191 | } | 167 | } |
192 | 168 | ||
@@ -210,11 +186,11 @@ static int __sigp_set_arch(struct kvm_vcpu *vcpu, u32 parameter) | |||
210 | 186 | ||
211 | switch (parameter & 0xff) { | 187 | switch (parameter & 0xff) { |
212 | case 0: | 188 | case 0: |
213 | rc = 3; /* not operational */ | 189 | rc = SIGP_CC_NOT_OPERATIONAL; |
214 | break; | 190 | break; |
215 | case 1: | 191 | case 1: |
216 | case 2: | 192 | case 2: |
217 | rc = 0; /* order accepted */ | 193 | rc = SIGP_CC_ORDER_CODE_ACCEPTED; |
218 | break; | 194 | break; |
219 | default: | 195 | default: |
220 | rc = -EOPNOTSUPP; | 196 | rc = -EOPNOTSUPP; |
@@ -235,21 +211,23 @@ static int __sigp_set_prefix(struct kvm_vcpu *vcpu, u16 cpu_addr, u32 address, | |||
235 | address = address & 0x7fffe000u; | 211 | address = address & 0x7fffe000u; |
236 | if (copy_from_guest_absolute(vcpu, &tmp, address, 1) || | 212 | if (copy_from_guest_absolute(vcpu, &tmp, address, 1) || |
237 | copy_from_guest_absolute(vcpu, &tmp, address + PAGE_SIZE, 1)) { | 213 | copy_from_guest_absolute(vcpu, &tmp, address + PAGE_SIZE, 1)) { |
238 | *reg |= SIGP_STAT_INVALID_PARAMETER; | 214 | *reg &= 0xffffffff00000000UL; |
239 | return 1; /* invalid parameter */ | 215 | *reg |= SIGP_STATUS_INVALID_PARAMETER; |
216 | return SIGP_CC_STATUS_STORED; | ||
240 | } | 217 | } |
241 | 218 | ||
242 | inti = kzalloc(sizeof(*inti), GFP_KERNEL); | 219 | inti = kzalloc(sizeof(*inti), GFP_KERNEL); |
243 | if (!inti) | 220 | if (!inti) |
244 | return 2; /* busy */ | 221 | return SIGP_CC_BUSY; |
245 | 222 | ||
246 | spin_lock(&fi->lock); | 223 | spin_lock(&fi->lock); |
247 | if (cpu_addr < KVM_MAX_VCPUS) | 224 | if (cpu_addr < KVM_MAX_VCPUS) |
248 | li = fi->local_int[cpu_addr]; | 225 | li = fi->local_int[cpu_addr]; |
249 | 226 | ||
250 | if (li == NULL) { | 227 | if (li == NULL) { |
251 | rc = 1; /* incorrect state */ | 228 | *reg &= 0xffffffff00000000UL; |
252 | *reg &= SIGP_STAT_INCORRECT_STATE; | 229 | *reg |= SIGP_STATUS_INCORRECT_STATE; |
230 | rc = SIGP_CC_STATUS_STORED; | ||
253 | kfree(inti); | 231 | kfree(inti); |
254 | goto out_fi; | 232 | goto out_fi; |
255 | } | 233 | } |
@@ -257,8 +235,9 @@ static int __sigp_set_prefix(struct kvm_vcpu *vcpu, u16 cpu_addr, u32 address, | |||
257 | spin_lock_bh(&li->lock); | 235 | spin_lock_bh(&li->lock); |
258 | /* cpu must be in stopped state */ | 236 | /* cpu must be in stopped state */ |
259 | if (!(atomic_read(li->cpuflags) & CPUSTAT_STOPPED)) { | 237 | if (!(atomic_read(li->cpuflags) & CPUSTAT_STOPPED)) { |
260 | rc = 1; /* incorrect state */ | 238 | *reg &= 0xffffffff00000000UL; |
261 | *reg &= SIGP_STAT_INCORRECT_STATE; | 239 | *reg |= SIGP_STATUS_INCORRECT_STATE; |
240 | rc = SIGP_CC_STATUS_STORED; | ||
262 | kfree(inti); | 241 | kfree(inti); |
263 | goto out_li; | 242 | goto out_li; |
264 | } | 243 | } |
@@ -270,7 +249,7 @@ static int __sigp_set_prefix(struct kvm_vcpu *vcpu, u16 cpu_addr, u32 address, | |||
270 | atomic_set(&li->active, 1); | 249 | atomic_set(&li->active, 1); |
271 | if (waitqueue_active(&li->wq)) | 250 | if (waitqueue_active(&li->wq)) |
272 | wake_up_interruptible(&li->wq); | 251 | wake_up_interruptible(&li->wq); |
273 | rc = 0; /* order accepted */ | 252 | rc = SIGP_CC_ORDER_CODE_ACCEPTED; |
274 | 253 | ||
275 | VCPU_EVENT(vcpu, 4, "set prefix of cpu %02x to %x", cpu_addr, address); | 254 | VCPU_EVENT(vcpu, 4, "set prefix of cpu %02x to %x", cpu_addr, address); |
276 | out_li: | 255 | out_li: |
@@ -287,21 +266,21 @@ static int __sigp_sense_running(struct kvm_vcpu *vcpu, u16 cpu_addr, | |||
287 | struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int; | 266 | struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int; |
288 | 267 | ||
289 | if (cpu_addr >= KVM_MAX_VCPUS) | 268 | if (cpu_addr >= KVM_MAX_VCPUS) |
290 | return 3; /* not operational */ | 269 | return SIGP_CC_NOT_OPERATIONAL; |
291 | 270 | ||
292 | spin_lock(&fi->lock); | 271 | spin_lock(&fi->lock); |
293 | if (fi->local_int[cpu_addr] == NULL) | 272 | if (fi->local_int[cpu_addr] == NULL) |
294 | rc = 3; /* not operational */ | 273 | rc = SIGP_CC_NOT_OPERATIONAL; |
295 | else { | 274 | else { |
296 | if (atomic_read(fi->local_int[cpu_addr]->cpuflags) | 275 | if (atomic_read(fi->local_int[cpu_addr]->cpuflags) |
297 | & CPUSTAT_RUNNING) { | 276 | & CPUSTAT_RUNNING) { |
298 | /* running */ | 277 | /* running */ |
299 | rc = 1; | 278 | rc = SIGP_CC_ORDER_CODE_ACCEPTED; |
300 | } else { | 279 | } else { |
301 | /* not running */ | 280 | /* not running */ |
302 | *reg &= 0xffffffff00000000UL; | 281 | *reg &= 0xffffffff00000000UL; |
303 | *reg |= SIGP_STAT_NOT_RUNNING; | 282 | *reg |= SIGP_STATUS_NOT_RUNNING; |
304 | rc = 0; | 283 | rc = SIGP_CC_STATUS_STORED; |
305 | } | 284 | } |
306 | } | 285 | } |
307 | spin_unlock(&fi->lock); | 286 | spin_unlock(&fi->lock); |
@@ -314,23 +293,23 @@ static int __sigp_sense_running(struct kvm_vcpu *vcpu, u16 cpu_addr, | |||
314 | 293 | ||
315 | static int __sigp_restart(struct kvm_vcpu *vcpu, u16 cpu_addr) | 294 | static int __sigp_restart(struct kvm_vcpu *vcpu, u16 cpu_addr) |
316 | { | 295 | { |
317 | int rc = 0; | ||
318 | struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int; | 296 | struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int; |
319 | struct kvm_s390_local_interrupt *li; | 297 | struct kvm_s390_local_interrupt *li; |
298 | int rc = SIGP_CC_ORDER_CODE_ACCEPTED; | ||
320 | 299 | ||
321 | if (cpu_addr >= KVM_MAX_VCPUS) | 300 | if (cpu_addr >= KVM_MAX_VCPUS) |
322 | return 3; /* not operational */ | 301 | return SIGP_CC_NOT_OPERATIONAL; |
323 | 302 | ||
324 | spin_lock(&fi->lock); | 303 | spin_lock(&fi->lock); |
325 | li = fi->local_int[cpu_addr]; | 304 | li = fi->local_int[cpu_addr]; |
326 | if (li == NULL) { | 305 | if (li == NULL) { |
327 | rc = 3; /* not operational */ | 306 | rc = SIGP_CC_NOT_OPERATIONAL; |
328 | goto out; | 307 | goto out; |
329 | } | 308 | } |
330 | 309 | ||
331 | spin_lock_bh(&li->lock); | 310 | spin_lock_bh(&li->lock); |
332 | if (li->action_bits & ACTION_STOP_ON_STOP) | 311 | if (li->action_bits & ACTION_STOP_ON_STOP) |
333 | rc = 2; /* busy */ | 312 | rc = SIGP_CC_BUSY; |
334 | else | 313 | else |
335 | VCPU_EVENT(vcpu, 4, "sigp restart %x to handle userspace", | 314 | VCPU_EVENT(vcpu, 4, "sigp restart %x to handle userspace", |
336 | cpu_addr); | 315 | cpu_addr); |
@@ -375,7 +354,7 @@ int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu) | |||
375 | vcpu->stat.instruction_sigp_external_call++; | 354 | vcpu->stat.instruction_sigp_external_call++; |
376 | rc = __sigp_external_call(vcpu, cpu_addr); | 355 | rc = __sigp_external_call(vcpu, cpu_addr); |
377 | break; | 356 | break; |
378 | case SIGP_EMERGENCY: | 357 | case SIGP_EMERGENCY_SIGNAL: |
379 | vcpu->stat.instruction_sigp_emergency++; | 358 | vcpu->stat.instruction_sigp_emergency++; |
380 | rc = __sigp_emergency(vcpu, cpu_addr); | 359 | rc = __sigp_emergency(vcpu, cpu_addr); |
381 | break; | 360 | break; |
@@ -383,12 +362,12 @@ int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu) | |||
383 | vcpu->stat.instruction_sigp_stop++; | 362 | vcpu->stat.instruction_sigp_stop++; |
384 | rc = __sigp_stop(vcpu, cpu_addr, ACTION_STOP_ON_STOP); | 363 | rc = __sigp_stop(vcpu, cpu_addr, ACTION_STOP_ON_STOP); |
385 | break; | 364 | break; |
386 | case SIGP_STOP_STORE_STATUS: | 365 | case SIGP_STOP_AND_STORE_STATUS: |
387 | vcpu->stat.instruction_sigp_stop++; | 366 | vcpu->stat.instruction_sigp_stop++; |
388 | rc = __sigp_stop(vcpu, cpu_addr, ACTION_STORE_ON_STOP | | 367 | rc = __sigp_stop(vcpu, cpu_addr, ACTION_STORE_ON_STOP | |
389 | ACTION_STOP_ON_STOP); | 368 | ACTION_STOP_ON_STOP); |
390 | break; | 369 | break; |
391 | case SIGP_SET_ARCH: | 370 | case SIGP_SET_ARCHITECTURE: |
392 | vcpu->stat.instruction_sigp_arch++; | 371 | vcpu->stat.instruction_sigp_arch++; |
393 | rc = __sigp_set_arch(vcpu, parameter); | 372 | rc = __sigp_set_arch(vcpu, parameter); |
394 | break; | 373 | break; |
@@ -405,7 +384,7 @@ int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu) | |||
405 | case SIGP_RESTART: | 384 | case SIGP_RESTART: |
406 | vcpu->stat.instruction_sigp_restart++; | 385 | vcpu->stat.instruction_sigp_restart++; |
407 | rc = __sigp_restart(vcpu, cpu_addr); | 386 | rc = __sigp_restart(vcpu, cpu_addr); |
408 | if (rc == 2) /* busy */ | 387 | if (rc == SIGP_CC_BUSY) |
409 | break; | 388 | break; |
410 | /* user space must know about restart */ | 389 | /* user space must know about restart */ |
411 | default: | 390 | default: |