Merge tag 'kvm-s390-master-4.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorRadim Krčmář <rkrcmar@redhat.com>
Wed, 6 Dec 2017 14:55:44 +0000 (15:55 +0100)
committerRadim Krčmář <rkrcmar@redhat.com>
Wed, 6 Dec 2017 14:55:44 +0000 (15:55 +0100)
KVM: s390: Fixes for 4.15

- SPDX tags
- Fence storage key accesses from problem state
- Make sure that irq_state.flags is not used in the future

1  2 
arch/s390/kvm/kvm-s390.c

diff --combined arch/s390/kvm/kvm-s390.c
@@@ -1,11 -1,8 +1,8 @@@
+ // SPDX-License-Identifier: GPL-2.0
  /*
-  * hosting zSeries kernel virtual machines
+  * hosting IBM Z kernel virtual machines (s390x)
   *
-  * Copyright IBM Corp. 2008, 2009
-  *
-  * This program is free software; you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License (version 2 only)
-  * as published by the Free Software Foundation.
+  * Copyright IBM Corp. 2008, 2017
   *
   *    Author(s): Carsten Otte <cotte@de.ibm.com>
   *               Christian Borntraeger <borntraeger@de.ibm.com>
@@@ -3372,6 -3369,7 +3369,6 @@@ static void store_regs(struct kvm_vcpu 
  int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
  {
        int rc;
 -      sigset_t sigsaved;
  
        if (kvm_run->immediate_exit)
                return -EINTR;
                return 0;
        }
  
 -      if (vcpu->sigset_active)
 -              sigprocmask(SIG_SETMASK, &vcpu->sigset, &sigsaved);
 +      kvm_sigset_activate(vcpu);
  
        if (!kvm_s390_user_cpu_state_ctrl(vcpu->kvm)) {
                kvm_s390_vcpu_start(vcpu);
        disable_cpu_timer_accounting(vcpu);
        store_regs(vcpu, kvm_run);
  
 -      if (vcpu->sigset_active)
 -              sigprocmask(SIG_SETMASK, &sigsaved, NULL);
 +      kvm_sigset_deactivate(vcpu);
  
        vcpu->stat.exit_userspace++;
        return rc;
@@@ -3808,6 -3808,7 +3805,7 @@@ long kvm_arch_vcpu_ioctl(struct file *f
                        r = -EINVAL;
                        break;
                }
+               /* do not use irq_state.flags, it will break old QEMUs */
                r = kvm_s390_set_irq_state(vcpu,
                                           (void __user *) irq_state.buf,
                                           irq_state.len);
                        r = -EINVAL;
                        break;
                }
+               /* do not use irq_state.flags, it will break old QEMUs */
                r = kvm_s390_get_irq_state(vcpu,
                                           (__u8 __user *)  irq_state.buf,
                                           irq_state.len);