diff options
Diffstat (limited to 'arch/s390/kvm/kvm-s390.c')
-rw-r--r-- | arch/s390/kvm/kvm-s390.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 0ac36a649eba..6558b09ff579 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -423,6 +423,8 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu, | |||
423 | return -EINVAL; /* not implemented yet */ | 423 | return -EINVAL; /* not implemented yet */ |
424 | } | 424 | } |
425 | 425 | ||
426 | extern void s390_handle_mcck(void); | ||
427 | |||
426 | static void __vcpu_run(struct kvm_vcpu *vcpu) | 428 | static void __vcpu_run(struct kvm_vcpu *vcpu) |
427 | { | 429 | { |
428 | memcpy(&vcpu->arch.sie_block->gg14, &vcpu->arch.guest_gprs[14], 16); | 430 | memcpy(&vcpu->arch.sie_block->gg14, &vcpu->arch.guest_gprs[14], 16); |
@@ -430,13 +432,21 @@ static void __vcpu_run(struct kvm_vcpu *vcpu) | |||
430 | if (need_resched()) | 432 | if (need_resched()) |
431 | schedule(); | 433 | schedule(); |
432 | 434 | ||
435 | if (test_thread_flag(TIF_MCCK_PENDING)) | ||
436 | s390_handle_mcck(); | ||
437 | |||
438 | kvm_s390_deliver_pending_interrupts(vcpu); | ||
439 | |||
433 | vcpu->arch.sie_block->icptcode = 0; | 440 | vcpu->arch.sie_block->icptcode = 0; |
434 | local_irq_disable(); | 441 | local_irq_disable(); |
435 | kvm_guest_enter(); | 442 | kvm_guest_enter(); |
436 | local_irq_enable(); | 443 | local_irq_enable(); |
437 | VCPU_EVENT(vcpu, 6, "entering sie flags %x", | 444 | VCPU_EVENT(vcpu, 6, "entering sie flags %x", |
438 | atomic_read(&vcpu->arch.sie_block->cpuflags)); | 445 | atomic_read(&vcpu->arch.sie_block->cpuflags)); |
439 | sie64a(vcpu->arch.sie_block, vcpu->arch.guest_gprs); | 446 | if (sie64a(vcpu->arch.sie_block, vcpu->arch.guest_gprs)) { |
447 | VCPU_EVENT(vcpu, 3, "%s", "fault in sie instruction"); | ||
448 | kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING); | ||
449 | } | ||
440 | VCPU_EVENT(vcpu, 6, "exit sie icptcode %d", | 450 | VCPU_EVENT(vcpu, 6, "exit sie icptcode %d", |
441 | vcpu->arch.sie_block->icptcode); | 451 | vcpu->arch.sie_block->icptcode); |
442 | local_irq_disable(); | 452 | local_irq_disable(); |
@@ -475,7 +485,6 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
475 | might_sleep(); | 485 | might_sleep(); |
476 | 486 | ||
477 | do { | 487 | do { |
478 | kvm_s390_deliver_pending_interrupts(vcpu); | ||
479 | __vcpu_run(vcpu); | 488 | __vcpu_run(vcpu); |
480 | rc = kvm_handle_sie_intercept(vcpu); | 489 | rc = kvm_handle_sie_intercept(vcpu); |
481 | } while (!signal_pending(current) && !rc); | 490 | } while (!signal_pending(current) && !rc); |