Merge tag 'kvm-s390-master-4.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 26 Jan 2016 15:28:36 +0000 (16:28 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 26 Jan 2016 15:28:36 +0000 (16:28 +0100)
KVM: s390: Fixes for kvm/master (targeting 4.5)

1. Fallout of some bigger floating point/vector rework in s390
- memory leak -> stable 4.3+
- memory overwrite -> stable 4.4+

2. enable KVM-VFIO for s390

1  2 
arch/powerpc/kvm/book3s_hv.c

@@@ -224,6 -224,12 +224,12 @@@ static void kvmppc_core_vcpu_put_hv(str
  
  static void kvmppc_set_msr_hv(struct kvm_vcpu *vcpu, u64 msr)
  {
+       /*
+        * Check for illegal transactional state bit combination
+        * and if we find it, force the TS field to a safe state.
+        */
+       if ((msr & MSR_TS_MASK) == MSR_TS_MASK)
+               msr &= ~MSR_TS_MASK;
        vcpu->arch.shregs.msr = msr;
        kvmppc_end_cede(vcpu);
  }
@@@ -827,24 -833,6 +833,24 @@@ static int kvmppc_handle_exit_hv(struc
  
        vcpu->stat.sum_exits++;
  
 +      /*
 +       * This can happen if an interrupt occurs in the last stages
 +       * of guest entry or the first stages of guest exit (i.e. after
 +       * setting paca->kvm_hstate.in_guest to KVM_GUEST_MODE_GUEST_HV
 +       * and before setting it to KVM_GUEST_MODE_HOST_HV).
 +       * That can happen due to a bug, or due to a machine check
 +       * occurring at just the wrong time.
 +       */
 +      if (vcpu->arch.shregs.msr & MSR_HV) {
 +              printk(KERN_EMERG "KVM trap in HV mode!\n");
 +              printk(KERN_EMERG "trap=0x%x | pc=0x%lx | msr=0x%llx\n",
 +                      vcpu->arch.trap, kvmppc_get_pc(vcpu),
 +                      vcpu->arch.shregs.msr);
 +              kvmppc_dump_regs(vcpu);
 +              run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
 +              run->hw.hardware_exit_reason = vcpu->arch.trap;
 +              return RESUME_HOST;
 +      }
        run->exit_reason = KVM_EXIT_UNKNOWN;
        run->ready_for_interrupt_injection = 1;
        switch (vcpu->arch.trap) {