diff options
Diffstat (limited to 'arch/s390/kvm/interrupt.c')
-rw-r--r-- | arch/s390/kvm/interrupt.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c index b7bc1aac8ed2..ff1e2f8ef94a 100644 --- a/arch/s390/kvm/interrupt.c +++ b/arch/s390/kvm/interrupt.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <asm/uaccess.h> | 19 | #include <asm/uaccess.h> |
20 | #include "kvm-s390.h" | 20 | #include "kvm-s390.h" |
21 | #include "gaccess.h" | 21 | #include "gaccess.h" |
22 | #include "trace-s390.h" | ||
22 | 23 | ||
23 | static int psw_extint_disabled(struct kvm_vcpu *vcpu) | 24 | static int psw_extint_disabled(struct kvm_vcpu *vcpu) |
24 | { | 25 | { |
@@ -130,6 +131,8 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu, | |||
130 | case KVM_S390_INT_EMERGENCY: | 131 | case KVM_S390_INT_EMERGENCY: |
131 | VCPU_EVENT(vcpu, 4, "%s", "interrupt: sigp emerg"); | 132 | VCPU_EVENT(vcpu, 4, "%s", "interrupt: sigp emerg"); |
132 | vcpu->stat.deliver_emergency_signal++; | 133 | vcpu->stat.deliver_emergency_signal++; |
134 | trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, | ||
135 | inti->emerg.code, 0); | ||
133 | rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x1201); | 136 | rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x1201); |
134 | if (rc == -EFAULT) | 137 | if (rc == -EFAULT) |
135 | exception = 1; | 138 | exception = 1; |
@@ -152,6 +155,8 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu, | |||
152 | case KVM_S390_INT_EXTERNAL_CALL: | 155 | case KVM_S390_INT_EXTERNAL_CALL: |
153 | VCPU_EVENT(vcpu, 4, "%s", "interrupt: sigp ext call"); | 156 | VCPU_EVENT(vcpu, 4, "%s", "interrupt: sigp ext call"); |
154 | vcpu->stat.deliver_external_call++; | 157 | vcpu->stat.deliver_external_call++; |
158 | trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, | ||
159 | inti->extcall.code, 0); | ||
155 | rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x1202); | 160 | rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x1202); |
156 | if (rc == -EFAULT) | 161 | if (rc == -EFAULT) |
157 | exception = 1; | 162 | exception = 1; |
@@ -175,6 +180,8 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu, | |||
175 | VCPU_EVENT(vcpu, 4, "interrupt: sclp parm:%x", | 180 | VCPU_EVENT(vcpu, 4, "interrupt: sclp parm:%x", |
176 | inti->ext.ext_params); | 181 | inti->ext.ext_params); |
177 | vcpu->stat.deliver_service_signal++; | 182 | vcpu->stat.deliver_service_signal++; |
183 | trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, | ||
184 | inti->ext.ext_params, 0); | ||
178 | rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x2401); | 185 | rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x2401); |
179 | if (rc == -EFAULT) | 186 | if (rc == -EFAULT) |
180 | exception = 1; | 187 | exception = 1; |
@@ -198,6 +205,9 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu, | |||
198 | VCPU_EVENT(vcpu, 4, "interrupt: virtio parm:%x,parm64:%llx", | 205 | VCPU_EVENT(vcpu, 4, "interrupt: virtio parm:%x,parm64:%llx", |
199 | inti->ext.ext_params, inti->ext.ext_params2); | 206 | inti->ext.ext_params, inti->ext.ext_params2); |
200 | vcpu->stat.deliver_virtio_interrupt++; | 207 | vcpu->stat.deliver_virtio_interrupt++; |
208 | trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, | ||
209 | inti->ext.ext_params, | ||
210 | inti->ext.ext_params2); | ||
201 | rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x2603); | 211 | rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x2603); |
202 | if (rc == -EFAULT) | 212 | if (rc == -EFAULT) |
203 | exception = 1; | 213 | exception = 1; |
@@ -229,6 +239,8 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu, | |||
229 | case KVM_S390_SIGP_STOP: | 239 | case KVM_S390_SIGP_STOP: |
230 | VCPU_EVENT(vcpu, 4, "%s", "interrupt: cpu stop"); | 240 | VCPU_EVENT(vcpu, 4, "%s", "interrupt: cpu stop"); |
231 | vcpu->stat.deliver_stop_signal++; | 241 | vcpu->stat.deliver_stop_signal++; |
242 | trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, | ||
243 | 0, 0); | ||
232 | __set_intercept_indicator(vcpu, inti); | 244 | __set_intercept_indicator(vcpu, inti); |
233 | break; | 245 | break; |
234 | 246 | ||
@@ -236,12 +248,16 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu, | |||
236 | VCPU_EVENT(vcpu, 4, "interrupt: set prefix to %x", | 248 | VCPU_EVENT(vcpu, 4, "interrupt: set prefix to %x", |
237 | inti->prefix.address); | 249 | inti->prefix.address); |
238 | vcpu->stat.deliver_prefix_signal++; | 250 | vcpu->stat.deliver_prefix_signal++; |
251 | trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, | ||
252 | inti->prefix.address, 0); | ||
239 | kvm_s390_set_prefix(vcpu, inti->prefix.address); | 253 | kvm_s390_set_prefix(vcpu, inti->prefix.address); |
240 | break; | 254 | break; |
241 | 255 | ||
242 | case KVM_S390_RESTART: | 256 | case KVM_S390_RESTART: |
243 | VCPU_EVENT(vcpu, 4, "%s", "interrupt: cpu restart"); | 257 | VCPU_EVENT(vcpu, 4, "%s", "interrupt: cpu restart"); |
244 | vcpu->stat.deliver_restart_signal++; | 258 | vcpu->stat.deliver_restart_signal++; |
259 | trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, | ||
260 | 0, 0); | ||
245 | rc = copy_to_guest(vcpu, offsetof(struct _lowcore, | 261 | rc = copy_to_guest(vcpu, offsetof(struct _lowcore, |
246 | restart_old_psw), &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); | 262 | restart_old_psw), &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); |
247 | if (rc == -EFAULT) | 263 | if (rc == -EFAULT) |
@@ -259,6 +275,8 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu, | |||
259 | inti->pgm.code, | 275 | inti->pgm.code, |
260 | table[vcpu->arch.sie_block->ipa >> 14]); | 276 | table[vcpu->arch.sie_block->ipa >> 14]); |
261 | vcpu->stat.deliver_program_int++; | 277 | vcpu->stat.deliver_program_int++; |
278 | trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, | ||
279 | inti->pgm.code, 0); | ||
262 | rc = put_guest_u16(vcpu, __LC_PGM_INT_CODE, inti->pgm.code); | 280 | rc = put_guest_u16(vcpu, __LC_PGM_INT_CODE, inti->pgm.code); |
263 | if (rc == -EFAULT) | 281 | if (rc == -EFAULT) |
264 | exception = 1; | 282 | exception = 1; |
@@ -405,9 +423,7 @@ no_timer: | |||
405 | set_current_state(TASK_INTERRUPTIBLE); | 423 | set_current_state(TASK_INTERRUPTIBLE); |
406 | spin_unlock_bh(&vcpu->arch.local_int.lock); | 424 | spin_unlock_bh(&vcpu->arch.local_int.lock); |
407 | spin_unlock(&vcpu->arch.local_int.float_int->lock); | 425 | spin_unlock(&vcpu->arch.local_int.float_int->lock); |
408 | vcpu_put(vcpu); | ||
409 | schedule(); | 426 | schedule(); |
410 | vcpu_load(vcpu); | ||
411 | spin_lock(&vcpu->arch.local_int.float_int->lock); | 427 | spin_lock(&vcpu->arch.local_int.float_int->lock); |
412 | spin_lock_bh(&vcpu->arch.local_int.lock); | 428 | spin_lock_bh(&vcpu->arch.local_int.lock); |
413 | } | 429 | } |
@@ -515,6 +531,7 @@ int kvm_s390_inject_program_int(struct kvm_vcpu *vcpu, u16 code) | |||
515 | inti->pgm.code = code; | 531 | inti->pgm.code = code; |
516 | 532 | ||
517 | VCPU_EVENT(vcpu, 3, "inject: program check %d (from kernel)", code); | 533 | VCPU_EVENT(vcpu, 3, "inject: program check %d (from kernel)", code); |
534 | trace_kvm_s390_inject_vcpu(vcpu->vcpu_id, inti->type, code, 0, 1); | ||
518 | spin_lock_bh(&li->lock); | 535 | spin_lock_bh(&li->lock); |
519 | list_add(&inti->list, &li->list); | 536 | list_add(&inti->list, &li->list); |
520 | atomic_set(&li->active, 1); | 537 | atomic_set(&li->active, 1); |
@@ -556,6 +573,8 @@ int kvm_s390_inject_vm(struct kvm *kvm, | |||
556 | kfree(inti); | 573 | kfree(inti); |
557 | return -EINVAL; | 574 | return -EINVAL; |
558 | } | 575 | } |
576 | trace_kvm_s390_inject_vm(s390int->type, s390int->parm, s390int->parm64, | ||
577 | 2); | ||
559 | 578 | ||
560 | mutex_lock(&kvm->lock); | 579 | mutex_lock(&kvm->lock); |
561 | fi = &kvm->arch.float_int; | 580 | fi = &kvm->arch.float_int; |
@@ -621,6 +640,8 @@ int kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu, | |||
621 | kfree(inti); | 640 | kfree(inti); |
622 | return -EINVAL; | 641 | return -EINVAL; |
623 | } | 642 | } |
643 | trace_kvm_s390_inject_vcpu(vcpu->vcpu_id, s390int->type, s390int->parm, | ||
644 | s390int->parm64, 2); | ||
624 | 645 | ||
625 | mutex_lock(&vcpu->kvm->lock); | 646 | mutex_lock(&vcpu->kvm->lock); |
626 | li = &vcpu->arch.local_int; | 647 | li = &vcpu->arch.local_int; |