]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/s390/kvm/kvm-s390.c
KVM: s390: vsie: simulate VCPU SIE entry/exit
[linux.git] / arch / s390 / kvm / kvm-s390.c
index f69333fd2fa3818c5eeb8bff9240f67e29f37ef0..0b5aff0e3984218c51ff2398a2004f74c7533633 100644 (file)
@@ -2768,18 +2768,25 @@ static void kvm_s390_vcpu_request(struct kvm_vcpu *vcpu)
        exit_sie(vcpu);
 }
 
+bool kvm_s390_vcpu_sie_inhibited(struct kvm_vcpu *vcpu)
+{
+       return atomic_read(&vcpu->arch.sie_block->prog20) &
+              (PROG_BLOCK_SIE | PROG_REQUEST);
+}
+
 static void kvm_s390_vcpu_request_handled(struct kvm_vcpu *vcpu)
 {
        atomic_andnot(PROG_REQUEST, &vcpu->arch.sie_block->prog20);
 }
 
 /*
- * Kick a guest cpu out of SIE and wait until SIE is not running.
+ * Kick a guest cpu out of (v)SIE and wait until (v)SIE is not running.
  * If the CPU is not running (e.g. waiting as idle) the function will
  * return immediately. */
 void exit_sie(struct kvm_vcpu *vcpu)
 {
        kvm_s390_set_cpuflags(vcpu, CPUSTAT_STOP_INT);
+       kvm_s390_vsie_kick(vcpu);
        while (vcpu->arch.sie_block->prog0c & PROG_IN_SIE)
                cpu_relax();
 }