aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm/interrupt.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/kvm/interrupt.c')
-rw-r--r--arch/s390/kvm/interrupt.c52
1 files changed, 28 insertions, 24 deletions
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 5afa931aed11..d78824b18e9d 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -188,8 +188,9 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu,
188 vcpu->stat.deliver_emergency_signal++; 188 vcpu->stat.deliver_emergency_signal++;
189 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, 189 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type,
190 inti->emerg.code, 0); 190 inti->emerg.code, 0);
191 rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x1201); 191 rc = put_guest(vcpu, 0x1201, (u16 *)__LC_EXT_INT_CODE);
192 rc |= put_guest_u16(vcpu, __LC_EXT_CPU_ADDR, inti->emerg.code); 192 rc |= put_guest(vcpu, inti->emerg.code,
193 (u16 *)__LC_EXT_CPU_ADDR);
193 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW, 194 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW,
194 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 195 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
195 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw, 196 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw,
@@ -200,8 +201,9 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu,
200 vcpu->stat.deliver_external_call++; 201 vcpu->stat.deliver_external_call++;
201 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, 202 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type,
202 inti->extcall.code, 0); 203 inti->extcall.code, 0);
203 rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x1202); 204 rc = put_guest(vcpu, 0x1202, (u16 *)__LC_EXT_INT_CODE);
204 rc |= put_guest_u16(vcpu, __LC_EXT_CPU_ADDR, inti->extcall.code); 205 rc |= put_guest(vcpu, inti->extcall.code,
206 (u16 *)__LC_EXT_CPU_ADDR);
205 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW, 207 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW,
206 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 208 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
207 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw, 209 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw,
@@ -213,12 +215,13 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu,
213 vcpu->stat.deliver_service_signal++; 215 vcpu->stat.deliver_service_signal++;
214 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, 216 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type,
215 inti->ext.ext_params, 0); 217 inti->ext.ext_params, 0);
216 rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x2401); 218 rc = put_guest(vcpu, 0x2401, (u16 *)__LC_EXT_INT_CODE);
217 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW, 219 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW,
218 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 220 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
219 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw, 221 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw,
220 __LC_EXT_NEW_PSW, sizeof(psw_t)); 222 __LC_EXT_NEW_PSW, sizeof(psw_t));
221 rc |= put_guest_u32(vcpu, __LC_EXT_PARAMS, inti->ext.ext_params); 223 rc |= put_guest(vcpu, inti->ext.ext_params,
224 (u32 *)__LC_EXT_PARAMS);
222 break; 225 break;
223 case KVM_S390_INT_VIRTIO: 226 case KVM_S390_INT_VIRTIO:
224 VCPU_EVENT(vcpu, 4, "interrupt: virtio parm:%x,parm64:%llx", 227 VCPU_EVENT(vcpu, 4, "interrupt: virtio parm:%x,parm64:%llx",
@@ -227,15 +230,16 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu,
227 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, 230 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type,
228 inti->ext.ext_params, 231 inti->ext.ext_params,
229 inti->ext.ext_params2); 232 inti->ext.ext_params2);
230 rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x2603); 233 rc = put_guest(vcpu, 0x2603, (u16 *)__LC_EXT_INT_CODE);
231 rc |= put_guest_u16(vcpu, __LC_EXT_CPU_ADDR, 0x0d00); 234 rc |= put_guest(vcpu, 0x0d00, (u16 *)__LC_EXT_CPU_ADDR);
232 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW, 235 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW,
233 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 236 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
234 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw, 237 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw,
235 __LC_EXT_NEW_PSW, sizeof(psw_t)); 238 __LC_EXT_NEW_PSW, sizeof(psw_t));
236 rc |= put_guest_u32(vcpu, __LC_EXT_PARAMS, inti->ext.ext_params); 239 rc |= put_guest(vcpu, inti->ext.ext_params,
237 rc |= put_guest_u64(vcpu, __LC_EXT_PARAMS2, 240 (u32 *)__LC_EXT_PARAMS);
238 inti->ext.ext_params2); 241 rc |= put_guest(vcpu, inti->ext.ext_params2,
242 (u64 *)__LC_EXT_PARAMS2);
239 break; 243 break;
240 case KVM_S390_SIGP_STOP: 244 case KVM_S390_SIGP_STOP:
241 VCPU_EVENT(vcpu, 4, "%s", "interrupt: cpu stop"); 245 VCPU_EVENT(vcpu, 4, "%s", "interrupt: cpu stop");
@@ -274,9 +278,9 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu,
274 vcpu->stat.deliver_program_int++; 278 vcpu->stat.deliver_program_int++;
275 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, 279 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type,
276 inti->pgm.code, 0); 280 inti->pgm.code, 0);
277 rc = put_guest_u16(vcpu, __LC_PGM_INT_CODE, inti->pgm.code); 281 rc = put_guest(vcpu, inti->pgm.code, (u16 *)__LC_PGM_INT_CODE);
278 rc |= put_guest_u16(vcpu, __LC_PGM_ILC, 282 rc |= put_guest(vcpu, table[vcpu->arch.sie_block->ipa >> 14],
279 table[vcpu->arch.sie_block->ipa >> 14]); 283 (u16 *)__LC_PGM_ILC);
280 rc |= copy_to_guest(vcpu, __LC_PGM_OLD_PSW, 284 rc |= copy_to_guest(vcpu, __LC_PGM_OLD_PSW,
281 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 285 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
282 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw, 286 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw,
@@ -291,7 +295,7 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu,
291 inti->mchk.mcic); 295 inti->mchk.mcic);
292 rc = kvm_s390_vcpu_store_status(vcpu, 296 rc = kvm_s390_vcpu_store_status(vcpu,
293 KVM_S390_STORE_STATUS_PREFIXED); 297 KVM_S390_STORE_STATUS_PREFIXED);
294 rc |= put_guest_u64(vcpu, __LC_MCCK_CODE, inti->mchk.mcic); 298 rc |= put_guest(vcpu, inti->mchk.mcic, (u64 *) __LC_MCCK_CODE);
295 rc |= copy_to_guest(vcpu, __LC_MCK_OLD_PSW, 299 rc |= copy_to_guest(vcpu, __LC_MCK_OLD_PSW,
296 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 300 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
297 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw, 301 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw,
@@ -308,14 +312,14 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu,
308 vcpu->stat.deliver_io_int++; 312 vcpu->stat.deliver_io_int++;
309 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, 313 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type,
310 param0, param1); 314 param0, param1);
311 rc = put_guest_u16(vcpu, __LC_SUBCHANNEL_ID, 315 rc = put_guest(vcpu, inti->io.subchannel_id,
312 inti->io.subchannel_id); 316 (u16 *) __LC_SUBCHANNEL_ID);
313 rc |= put_guest_u16(vcpu, __LC_SUBCHANNEL_NR, 317 rc |= put_guest(vcpu, inti->io.subchannel_nr,
314 inti->io.subchannel_nr); 318 (u16 *) __LC_SUBCHANNEL_NR);
315 rc |= put_guest_u32(vcpu, __LC_IO_INT_PARM, 319 rc |= put_guest(vcpu, inti->io.io_int_parm,
316 inti->io.io_int_parm); 320 (u32 *) __LC_IO_INT_PARM);
317 rc |= put_guest_u32(vcpu, __LC_IO_INT_WORD, 321 rc |= put_guest(vcpu, inti->io.io_int_word,
318 inti->io.io_int_word); 322 (u32 *) __LC_IO_INT_WORD);
319 rc |= copy_to_guest(vcpu, __LC_IO_OLD_PSW, 323 rc |= copy_to_guest(vcpu, __LC_IO_OLD_PSW,
320 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 324 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
321 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw, 325 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw,
@@ -340,7 +344,7 @@ static int __try_deliver_ckc_interrupt(struct kvm_vcpu *vcpu)
340 return 0; 344 return 0;
341 if (!(vcpu->arch.sie_block->gcr[0] & 0x800ul)) 345 if (!(vcpu->arch.sie_block->gcr[0] & 0x800ul))
342 return 0; 346 return 0;
343 rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x1004); 347 rc = put_guest(vcpu, 0x1004, (u16 *)__LC_EXT_INT_CODE);
344 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW, 348 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW,
345 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 349 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
346 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw, 350 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw,