]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/s390/kvm/kvm-s390.c
Merge tag 'kvm-s390-master-4.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / arch / s390 / kvm / kvm-s390.c
index 6484a250021e2717c448eb8f4f0b987169c264f1..4078ba6306890a956c4e9b92d7e2a895a67a0d59 100644 (file)
@@ -217,7 +217,7 @@ static void allow_cpu_feat(unsigned long nr)
 static inline int plo_test_bit(unsigned char nr)
 {
        register unsigned long r0 asm("0") = (unsigned long) nr | 0x100;
-       int cc = 3; /* subfunction not available */
+       int cc;
 
        asm volatile(
                /* Parameter registers are ignored for "test bit" */
@@ -505,6 +505,14 @@ static int kvm_vm_ioctl_enable_cap(struct kvm *kvm, struct kvm_enable_cap *cap)
                } else if (MACHINE_HAS_VX) {
                        set_kvm_facility(kvm->arch.model.fac_mask, 129);
                        set_kvm_facility(kvm->arch.model.fac_list, 129);
+                       if (test_facility(134)) {
+                               set_kvm_facility(kvm->arch.model.fac_mask, 134);
+                               set_kvm_facility(kvm->arch.model.fac_list, 134);
+                       }
+                       if (test_facility(135)) {
+                               set_kvm_facility(kvm->arch.model.fac_mask, 135);
+                               set_kvm_facility(kvm->arch.model.fac_list, 135);
+                       }
                        r = 0;
                } else
                        r = -EINVAL;
@@ -1938,6 +1946,8 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
 
        if (test_kvm_facility(vcpu->kvm, 8) && sclp.has_pfmfi)
                vcpu->arch.sie_block->ecb2 |= 0x08;
+       if (test_kvm_facility(vcpu->kvm, 130))
+               vcpu->arch.sie_block->ecb2 |= 0x20;
        vcpu->arch.sie_block->eca = 0x1002000U;
        if (sclp.has_cei)
                vcpu->arch.sie_block->eca |= 0x80000000U;
@@ -2578,7 +2588,7 @@ static int vcpu_post_run_fault_in_sie(struct kvm_vcpu *vcpu)
         * to look up the current opcode to get the length of the instruction
         * to be able to forward the PSW.
         */
-       rc = read_guest_instr(vcpu, &opcode, 1);
+       rc = read_guest_instr(vcpu, vcpu->arch.sie_block->gpsw.addr, &opcode, 1);
        ilen = insn_length(opcode);
        if (rc < 0) {
                return rc;