diff options
author | Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com> | 2009-05-20 09:34:55 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-09-10 01:32:42 -0400 |
commit | 9ace903d171db7dc2fed96e44ac62b6f4c3ccb3d (patch) | |
tree | 50668cde71950831339d601a3bfeabe49657770e /arch/s390/kvm/kvm-s390.c | |
parent | 3032b925f00ba2653f7695d356d6f8284c82038d (diff) |
KVM: s390: infrastructure to kick vcpus out of guest state
To ensure vcpu's come out of guest context in certain cases this patch adds a
s390 specific way to kick them out of guest context. Currently it kicks them
out to rerun the vcpu_run path in the s390 code, but the mechanism itself is
expandable and with a new flag we could also add e.g. kicks to userspace etc.
Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/s390/kvm/kvm-s390.c')
-rw-r--r-- | arch/s390/kvm/kvm-s390.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 90d9d1ba258b..1d65f6277166 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -490,6 +490,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
490 | 490 | ||
491 | vcpu_load(vcpu); | 491 | vcpu_load(vcpu); |
492 | 492 | ||
493 | rerun_vcpu: | ||
493 | /* verify, that memory has been registered */ | 494 | /* verify, that memory has been registered */ |
494 | if (!vcpu->kvm->arch.guest_memsize) { | 495 | if (!vcpu->kvm->arch.guest_memsize) { |
495 | vcpu_put(vcpu); | 496 | vcpu_put(vcpu); |
@@ -509,6 +510,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
509 | vcpu->arch.sie_block->gpsw.addr = kvm_run->s390_sieic.addr; | 510 | vcpu->arch.sie_block->gpsw.addr = kvm_run->s390_sieic.addr; |
510 | break; | 511 | break; |
511 | case KVM_EXIT_UNKNOWN: | 512 | case KVM_EXIT_UNKNOWN: |
513 | case KVM_EXIT_INTR: | ||
512 | case KVM_EXIT_S390_RESET: | 514 | case KVM_EXIT_S390_RESET: |
513 | break; | 515 | break; |
514 | default: | 516 | default: |
@@ -522,6 +524,9 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
522 | rc = kvm_handle_sie_intercept(vcpu); | 524 | rc = kvm_handle_sie_intercept(vcpu); |
523 | } while (!signal_pending(current) && !rc); | 525 | } while (!signal_pending(current) && !rc); |
524 | 526 | ||
527 | if (rc == SIE_INTERCEPT_RERUNVCPU) | ||
528 | goto rerun_vcpu; | ||
529 | |||
525 | if (signal_pending(current) && !rc) | 530 | if (signal_pending(current) && !rc) |
526 | rc = -EINTR; | 531 | rc = -EINTR; |
527 | 532 | ||