KVM: s390: Removed SIE_INTERCEPT_UCONTROL
authorThomas Huth <thuth@linux.vnet.ibm.com>
Thu, 19 Sep 2013 14:26:18 +0000 (16:26 +0200)
committerCornelia Huck <cornelia.huck@de.ibm.com>
Thu, 28 Nov 2013 10:08:10 +0000 (11:08 +0100)
The SIE_INTERCEPT_UCONTROL can be removed by moving the related code
from kvm_arch_vcpu_ioctl_run() to vcpu_post_run().

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
arch/s390/kvm/kvm-s390.c
arch/s390/kvm/kvm-s390.h

index 569494e01ec658e1d7bfacac103727979fc7643d..7f4783525144667113eef29eb412d400d602a1d3 100644 (file)
@@ -732,14 +732,12 @@ static int vcpu_post_run(struct kvm_vcpu *vcpu, int exit_reason)
 
        if (exit_reason >= 0) {
                rc = 0;
-       } else {
-               if (kvm_is_ucontrol(vcpu->kvm)) {
-                       rc = SIE_INTERCEPT_UCONTROL;
-               } else {
-                       VCPU_EVENT(vcpu, 3, "%s", "fault in sie instruction");
-                       trace_kvm_s390_sie_fault(vcpu);
-                       rc = kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
-               }
+       } else if (kvm_is_ucontrol(vcpu->kvm)) {
+               vcpu->run->exit_reason = KVM_EXIT_S390_UCONTROL;
+               vcpu->run->s390_ucontrol.trans_exc_code =
+                                               current->thread.gmap_addr;
+               vcpu->run->s390_ucontrol.pgm_code = 0x10;
+               rc = -EREMOTE;
        }
 
        memcpy(&vcpu->run->s.regs.gprs[14], &vcpu->arch.sie_block->gg14, 16);
@@ -833,16 +831,6 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
                rc = -EINTR;
        }
 
-#ifdef CONFIG_KVM_S390_UCONTROL
-       if (rc == SIE_INTERCEPT_UCONTROL) {
-               kvm_run->exit_reason = KVM_EXIT_S390_UCONTROL;
-               kvm_run->s390_ucontrol.trans_exc_code =
-                       current->thread.gmap_addr;
-               kvm_run->s390_ucontrol.pgm_code = 0x10;
-               rc = 0;
-       }
-#endif
-
        if (rc == -EOPNOTSUPP) {
                /* intercept cannot be handled in-kernel, prepare kvm-run */
                kvm_run->exit_reason         = KVM_EXIT_S390_SIEIC;
index b44912a3294941b8df9e9ca27d140ce52149408d..aad541fc9098990430e919cfe88a830526be09fe 100644 (file)
@@ -27,8 +27,6 @@ typedef int (*intercept_handler_t)(struct kvm_vcpu *vcpu);
 /* declare vfacilities extern */
 extern unsigned long *vfacilities;
 
-/* negativ values are error codes, positive values for internal conditions */
-#define SIE_INTERCEPT_UCONTROL         (1<<0)
 int kvm_handle_sie_intercept(struct kvm_vcpu *vcpu);
 
 #define VM_EVENT(d_kvm, d_loglevel, d_string, d_args...)\